diff --git a/assets/CardDetailDialog-0JP7S-1I.js b/assets/CardDetailDialog-0JP7S-1I.js new file mode 100644 index 0000000000000000000000000000000000000000..2693b8c4237fb90dddadc890b76cc5095c178d54 --- /dev/null +++ b/assets/CardDetailDialog-0JP7S-1I.js @@ -0,0 +1 @@ +import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-DwW72nHQ.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C1JwBLjv.js";import"./index-CL4rmUJ-.js";import"./index-CDeQ6Zfm.js";import"./live2d-zip-loader-DFrBymqv.js";import"./airi-card-CWMQJScT.js";import"./consciousness-nHboP4iV.js";import"./providers-BHCrT0RZ.js";import"./speech-Ae5ywnpY.js";export{o as default}; diff --git a/assets/CardDetailDialog-CTkvDi54.js b/assets/CardDetailDialog-CTkvDi54.js deleted file mode 100644 index 0784777f898ea3dd1640c14add22bb8bc2d3ee9a..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-CTkvDi54.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-CGAEfOuB.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-_ktQBMkP.js";import"./index-BYewP6KR.js";import"./index-C4TaASqf.js";import"./live2d-zip-loader-CvpgOHsT.js";import"./airi-card-BM-9G8yH.js";import"./consciousness-MUz60a06.js";import"./providers-CFIOZO6n.js";import"./speech-CLmksxkl.js";export{o as default}; diff --git a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-CGAEfOuB.js b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DwW72nHQ.js similarity index 96% rename from assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-CGAEfOuB.js rename to assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DwW72nHQ.js index 99964eccf60148f8571156992c09d421ce61d984..5c51fddbc14c584f2080e694b85ff0548975dad4 100644 --- a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-CGAEfOuB.js +++ b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DwW72nHQ.js @@ -1 +1 @@ -import{a as O,_ as q}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-_ktQBMkP.js";import"./live2d-zip-loader-CvpgOHsT.js";import{d as E,q as U,s as F,h as x,g as L,c as n,o,bx as f,b as m,e as l,y as k,a as e,C as v,bH as u,D as i,z as $,by as j}from"./index-BYewP6KR.js";import{u as R}from"./airi-card-BM-9G8yH.js";import{n as G,I as J,$ as K,P as Q,B as W}from"./index-C4TaASqf.js";const X={key:0,class:"w-full flex flex-col gap-5"},Y={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={key:0,class:"bg-primary-100 text-primary-600 dark:bg-primary-900/40 dark:text-primary-400 flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},le={class:"mt-4"},ne={class:"border-b border-neutral-200 dark:border-neutral-700"},oe={class:"flex justify-center -mb-px sm:justify-start space-x-1"},ie=["onClick"],de={class:"flex items-center gap-1"},ue={key:0},ce=["innerHTML"],me={key:1},ve=["innerHTML"],pe={key:2},ge={flex:"~ col","max-h-60":"","gap-4":"","overflow-auto":"","pr-1":"","sm:max-h-80":""},xe={key:0,flex:"~ col","gap-2":""},be={"text-lg":"","text-neutral-500":"","font-medium":"","dark:text-neutral-400":""},fe=["innerHTML"],he={key:3},_e={grid:"~ cols-1 sm:cols-3","gap-4":""},ke={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"},we={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ye={truncate:"","font-medium":""},Ce={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"},Ie={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Te={truncate:"","font-medium":""},Ve={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"},He={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Le={truncate:"","font-medium":""},$e={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"},ze=E({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(B,{emit:z}){const b=B,D=z,{t:d}=U(),w=R(),{removeCard:A}=w,{activeCardId:M}=F(w),a=x(()=>{if(b.cardId)return w.getCard(b.cardId)}),y=x(()=>{var t,c,r,g,S;if(!a.value||!((c=(t=a.value.extensions)==null?void 0:t.airi)!=null&&c.modules))return{consciousness:"",speech:"",voice:""};const s=a.value.extensions.airi.modules;return{consciousness:((r=s.consciousness)==null?void 0:r.model)||"",speech:((g=s.speech)==null?void 0:g.model)||"",voice:((S=s.speech)==null?void 0:S.voice_id)||""}}),C=x(()=>a.value?{personality:a.value.personality,scenario:a.value.scenario,systemPrompt:a.value.systemPrompt,postHistoryInstructions:a.value.postHistoryInstructions}:{}),h=x(()=>b.cardId===M.value),I=L(!1);function N(){I.value=!0,setTimeout(()=>{M.value=b.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=L(!1);function P(){a.value&&(A(b.cardId),D("update:modelValue",!1)),_.value=!1}const V=L(""),H=x(()=>{var t,c;const s=[];return(t=a.value)!=null&&t.description&&s.push({id:"description",label:d("settings.pages.card.description_label"),icon:"i-solar:document-text-linear"}),(c=a.value)!=null&&c.notes&&s.push({id:"notes",label:d("settings.pages.card.creator_notes"),icon:"i-solar:notes-linear"}),Object.values(C.value).some(r=>!!r)&&s.push({id:"character",label:d("settings.pages.card.character"),icon:"i-solar:user-rounded-linear"}),s.push({id:"modules",label:d("settings.pages.card.modules"),icon:"i-solar:tuning-square-linear"}),s}),p=x({get:()=>{var s;return H.value.find(t=>t.id===V.value)?V.value:((s=H.value[0])==null?void 0:s.id)||""},set:s=>{V.value=s}});return(s,t)=>{var c;return o(),n(f,null,[m(l(G),{open:B.modelValue,"onUpdate:open":t[0]||(t[0]=r=>D("update:modelValue",r))},{default:k(()=>[m(l(J),null,{default:k(()=>[m(l(K),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),m(l(Q),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 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:k(()=>[a.value?(o(),n("div",X,[e("div",Y,[e("div",Z,[e("div",null,[e("div",ee,[m(l(W),{"text-2xl":"","font-bold":"",class:"from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent"},{default:k(()=>[u(i(a.value.name),1)]),_:1}),h.value?(o(),n("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(l(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(o(),n(f,{key:0},[u(" · "+i(l(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(l(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?l(d)("settings.pages.card.active"):l(d)("settings.pages.card.activate"),disabled:h.value,class:$({"animate-pulse":I.value}),onClick:N},null,8,["icon","label","disabled","class"])])]),e("div",le,[e("div",ne,[e("div",oe,[(o(!0),n(f,null,j(H.value,r=>(o(),n("button",{key:r.id,class:$(["px-4 py-2 text-sm font-medium",[p.value===r.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:g=>p.value=r.id},[e("div",de,[e("div",{class:$(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(o(),n("div",ue,[e("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:T(a.value.notes)},null,8,ce)])):v("",!0),p.value==="description"&&a.value.description?(o(),n("div",me,[e("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:T(a.value.description)},null,8,ve)])):v("",!0),p.value==="character"&&Object.values(C.value).some(r=>!!r)?(o(),n("div",pe,[e("div",ge,[(o(!0),n(f,null,j(C.value,(r,g)=>(o(),n(f,{key:g},[r?(o(),n("div",xe,[e("h2",be,i(l(d)(`settings.pages.card.${g.toLowerCase()}`)),1),e("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:T(r)},null,8,fe)])):v("",!0)],64))),128))])])):v("",!0),p.value==="modules"?(o(),n("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(l(d)("settings.pages.card.consciousness.model")),1)]),e("div",ye,i(y.value.consciousness??"default"),1)]),e("div",Ce,[e("span",Ie,[t[5]||(t[5]=e("div",{"i-lucide:mic":""},null,-1)),u(" "+i(l(d)("settings.pages.card.speech.model")),1)]),e("div",Te,i(y.value.speech??"default"),1)]),e("div",Ve,[e("span",He,[t[6]||(t[6]=e("div",{"i-lucide:music":""},null,-1)),u(" "+i(l(d)("settings.pages.card.speech.voice")),1)]),e("div",Le,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(o(),n("div",$e,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(l(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(q,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:P,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{ze as _}; +import{a as O,_ as q}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C1JwBLjv.js";import"./live2d-zip-loader-DFrBymqv.js";import{d as E,q as U,s as F,h as x,g as L,c as n,o,bx as f,b as m,e as l,y as k,a as e,C as v,bH as u,D as i,z as $,by as j}from"./index-CL4rmUJ-.js";import{u as R}from"./airi-card-CWMQJScT.js";import{n as G,I as J,$ as K,P as Q,B as W}from"./index-CDeQ6Zfm.js";const X={key:0,class:"w-full flex flex-col gap-5"},Y={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={key:0,class:"bg-primary-100 text-primary-600 dark:bg-primary-900/40 dark:text-primary-400 flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},le={class:"mt-4"},ne={class:"border-b border-neutral-200 dark:border-neutral-700"},oe={class:"flex justify-center -mb-px sm:justify-start space-x-1"},ie=["onClick"],de={class:"flex items-center gap-1"},ue={key:0},ce=["innerHTML"],me={key:1},ve=["innerHTML"],pe={key:2},ge={flex:"~ col","max-h-60":"","gap-4":"","overflow-auto":"","pr-1":"","sm:max-h-80":""},xe={key:0,flex:"~ col","gap-2":""},be={"text-lg":"","text-neutral-500":"","font-medium":"","dark:text-neutral-400":""},fe=["innerHTML"],he={key:3},_e={grid:"~ cols-1 sm:cols-3","gap-4":""},ke={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"},we={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ye={truncate:"","font-medium":""},Ce={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"},Ie={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Te={truncate:"","font-medium":""},Ve={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"},He={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Le={truncate:"","font-medium":""},$e={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"},ze=E({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(B,{emit:z}){const b=B,D=z,{t:d}=U(),w=R(),{removeCard:A}=w,{activeCardId:M}=F(w),a=x(()=>{if(b.cardId)return w.getCard(b.cardId)}),y=x(()=>{var t,c,r,g,S;if(!a.value||!((c=(t=a.value.extensions)==null?void 0:t.airi)!=null&&c.modules))return{consciousness:"",speech:"",voice:""};const s=a.value.extensions.airi.modules;return{consciousness:((r=s.consciousness)==null?void 0:r.model)||"",speech:((g=s.speech)==null?void 0:g.model)||"",voice:((S=s.speech)==null?void 0:S.voice_id)||""}}),C=x(()=>a.value?{personality:a.value.personality,scenario:a.value.scenario,systemPrompt:a.value.systemPrompt,postHistoryInstructions:a.value.postHistoryInstructions}:{}),h=x(()=>b.cardId===M.value),I=L(!1);function N(){I.value=!0,setTimeout(()=>{M.value=b.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=L(!1);function P(){a.value&&(A(b.cardId),D("update:modelValue",!1)),_.value=!1}const V=L(""),H=x(()=>{var t,c;const s=[];return(t=a.value)!=null&&t.description&&s.push({id:"description",label:d("settings.pages.card.description_label"),icon:"i-solar:document-text-linear"}),(c=a.value)!=null&&c.notes&&s.push({id:"notes",label:d("settings.pages.card.creator_notes"),icon:"i-solar:notes-linear"}),Object.values(C.value).some(r=>!!r)&&s.push({id:"character",label:d("settings.pages.card.character"),icon:"i-solar:user-rounded-linear"}),s.push({id:"modules",label:d("settings.pages.card.modules"),icon:"i-solar:tuning-square-linear"}),s}),p=x({get:()=>{var s;return H.value.find(t=>t.id===V.value)?V.value:((s=H.value[0])==null?void 0:s.id)||""},set:s=>{V.value=s}});return(s,t)=>{var c;return o(),n(f,null,[m(l(G),{open:B.modelValue,"onUpdate:open":t[0]||(t[0]=r=>D("update:modelValue",r))},{default:k(()=>[m(l(J),null,{default:k(()=>[m(l(K),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),m(l(Q),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 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:k(()=>[a.value?(o(),n("div",X,[e("div",Y,[e("div",Z,[e("div",null,[e("div",ee,[m(l(W),{"text-2xl":"","font-bold":"",class:"from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent"},{default:k(()=>[u(i(a.value.name),1)]),_:1}),h.value?(o(),n("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(l(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(o(),n(f,{key:0},[u(" · "+i(l(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(l(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?l(d)("settings.pages.card.active"):l(d)("settings.pages.card.activate"),disabled:h.value,class:$({"animate-pulse":I.value}),onClick:N},null,8,["icon","label","disabled","class"])])]),e("div",le,[e("div",ne,[e("div",oe,[(o(!0),n(f,null,j(H.value,r=>(o(),n("button",{key:r.id,class:$(["px-4 py-2 text-sm font-medium",[p.value===r.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:g=>p.value=r.id},[e("div",de,[e("div",{class:$(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(o(),n("div",ue,[e("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:T(a.value.notes)},null,8,ce)])):v("",!0),p.value==="description"&&a.value.description?(o(),n("div",me,[e("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:T(a.value.description)},null,8,ve)])):v("",!0),p.value==="character"&&Object.values(C.value).some(r=>!!r)?(o(),n("div",pe,[e("div",ge,[(o(!0),n(f,null,j(C.value,(r,g)=>(o(),n(f,{key:g},[r?(o(),n("div",xe,[e("h2",be,i(l(d)(`settings.pages.card.${g.toLowerCase()}`)),1),e("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:T(r)},null,8,fe)])):v("",!0)],64))),128))])])):v("",!0),p.value==="modules"?(o(),n("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(l(d)("settings.pages.card.consciousness.model")),1)]),e("div",ye,i(y.value.consciousness??"default"),1)]),e("div",Ce,[e("span",Ie,[t[5]||(t[5]=e("div",{"i-lucide:mic":""},null,-1)),u(" "+i(l(d)("settings.pages.card.speech.model")),1)]),e("div",Te,i(y.value.speech??"default"),1)]),e("div",Ve,[e("span",He,[t[6]||(t[6]=e("div",{"i-lucide:music":""},null,-1)),u(" "+i(l(d)("settings.pages.card.speech.voice")),1)]),e("div",Le,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(o(),n("div",$e,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(l(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(q,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:P,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{ze as _}; diff --git a/assets/CardListItem-Yj5o7xqu.js b/assets/CardListItem-DjCvxPQ0.js similarity index 51% rename from assets/CardListItem-Yj5o7xqu.js rename to assets/CardListItem-DjCvxPQ0.js index b8731c0e486e9617762b068262d1af606c8eead8..20cf2796776244c84d40ba14f2ef42d60d7fb3a2 100644 --- a/assets/CardListItem-Yj5o7xqu.js +++ b/assets/CardListItem-DjCvxPQ0.js @@ -1 +1 @@ -import{_ as m}from"./CardListItem.vue_vue_type_script_setup_true_lang-BD31oKXO.js";import"./index-BYewP6KR.js";export{m as default}; +import{_ as m}from"./CardListItem.vue_vue_type_script_setup_true_lang-D1pbLBEG.js";import"./index-CL4rmUJ-.js";export{m as default}; diff --git a/assets/CardListItem.vue_vue_type_script_setup_true_lang-BD31oKXO.js b/assets/CardListItem.vue_vue_type_script_setup_true_lang-D1pbLBEG.js similarity index 98% rename from assets/CardListItem.vue_vue_type_script_setup_true_lang-BD31oKXO.js rename to assets/CardListItem.vue_vue_type_script_setup_true_lang-D1pbLBEG.js index 90b1bd8ddd1c1b7c60bf30b727c28c8cc8a3e870..6429b673bc9bcfcb7ccca207ea2dabd58e81b6a5 100644 --- a/assets/CardListItem.vue_vue_type_script_setup_true_lang-BD31oKXO.js +++ b/assets/CardListItem.vue_vue_type_script_setup_true_lang-D1pbLBEG.js @@ -1 +1 @@ -import{d as p,c as n,o as a,a as e,C as l,D as i,bJ as s,z as u}from"./index-BYewP6KR.js";const c={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]"},b={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},v={"flex-1":"",truncate:"","text-lg":"","font-bold":"",hover:"text-primary-600 dark:text-primary-300"},x={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},f={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400",hover:"text-primary-600/80 dark:text-primary-300/80"},y={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},k={flex:"","items-center":"","gap-1.5":""},g={flex:"","items-center":"","gap-0.5":""},h={flex:"","items-center":"","gap-0.5":""},w={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},C=["disabled"],M=p({__name:"CardListItem",props:{id:null,name:null,description:null,isActive:{type:Boolean},isSelected:{type:Boolean},version:null,consciousnessModel:null,voiceModel:null},emits:["select","activate","delete"],setup(r,{emit:m}){const o=m;return(z,t)=>(a(),n("div",{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:u([r.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:w-50% 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:t[2]||(t[2]=d=>o("select"))},[e("div",c,[e("div",b,[e("h3",v,i(r.name),1),r.isActive?(a(),n("div",x,t[3]||(t[3]=[e("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):l("",!0)]),r.description?(a(),n("p",f,i(r.description),1)):l("",!0),e("div",y,[e("div",null,"v"+i(r.version),1),e("div",k,[e("div",g,[t[4]||(t[4]=e("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),e("span",null,i(r.consciousnessModel),1)]),e("div",h,[t[5]||(t[5]=e("div",{"i-lucide:mic":"","text-xs":""},null,-1)),e("span",null,i(r.voiceModel),1)])])])]),e("div",w,[e("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:t[0]||(t[0]=s(d=>o("activate"),["stop"]))},[e("div",{class:u([r.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,C),r.id!=="default"?(a(),n("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:t[1]||(t[1]=s(d=>o("delete"),["stop"]))},t[6]||(t[6]=[e("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):l("",!0)])],2))}});export{M as _}; +import{d as p,c as n,o as a,a as e,C as l,D as i,bJ as s,z as u}from"./index-CL4rmUJ-.js";const c={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]"},b={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},v={"flex-1":"",truncate:"","text-lg":"","font-bold":"",hover:"text-primary-600 dark:text-primary-300"},x={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},f={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400",hover:"text-primary-600/80 dark:text-primary-300/80"},y={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},k={flex:"","items-center":"","gap-1.5":""},g={flex:"","items-center":"","gap-0.5":""},h={flex:"","items-center":"","gap-0.5":""},w={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},C=["disabled"],M=p({__name:"CardListItem",props:{id:null,name:null,description:null,isActive:{type:Boolean},isSelected:{type:Boolean},version:null,consciousnessModel:null,voiceModel:null},emits:["select","activate","delete"],setup(r,{emit:m}){const o=m;return(z,t)=>(a(),n("div",{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:u([r.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:w-50% 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:t[2]||(t[2]=d=>o("select"))},[e("div",c,[e("div",b,[e("h3",v,i(r.name),1),r.isActive?(a(),n("div",x,t[3]||(t[3]=[e("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):l("",!0)]),r.description?(a(),n("p",f,i(r.description),1)):l("",!0),e("div",y,[e("div",null,"v"+i(r.version),1),e("div",k,[e("div",g,[t[4]||(t[4]=e("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),e("span",null,i(r.consciousnessModel),1)]),e("div",h,[t[5]||(t[5]=e("div",{"i-lucide:mic":"","text-xs":""},null,-1)),e("span",null,i(r.voiceModel),1)])])])]),e("div",w,[e("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:t[0]||(t[0]=s(d=>o("activate"),["stop"]))},[e("div",{class:u([r.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,C),r.id!=="default"?(a(),n("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:t[1]||(t[1]=s(d=>o("delete"),["stop"]))},t[6]||(t[6]=[e("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):l("",!0)])],2))}});export{M as _}; diff --git a/assets/Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js b/assets/Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js similarity index 87% rename from assets/Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js rename to assets/Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js index 7789e325820b502f53299691a1e047cb0cbc3852..4f74c6f1a3ec07dfb30b57099ed221a3a6d81b85 100644 --- a/assets/Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js +++ b/assets/Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js @@ -1 +1 @@ -import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import{d as p,bK as m,bL as f,af as b,c,o as v,m as r,b as V,bT as u,bU as y,y as C,C as g,bV as k,a as s,bH as x,D as i}from"./index-BYewP6KR.js";const B={op50:""},w=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=f(o,"modelValue");b(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),c("div",null,[r(l.$slots,"trigger",u(y({visible:e.value,setVisible:n})),()=>[s("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:a[0]||(a[0]=_=>e.value=!e.value)},[s("span",null,i(t.label??"Collapsable"),1),a[1]||(a[1]=x()),s("span",B,i(e.value?"▲":"▼"),1)])]),V(d,null,{default:C(()=>[e.value?r(l.$slots,"default",u(k({key:0},{visible:e.value,setVisible:n}))):g("",!0)]),_:3})]))}});export{w as _}; +import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import{d as p,bK as m,bL as f,af as b,c,o as v,m as r,b as V,bT as u,bU as y,y as C,C as g,bV as k,a as s,bH as x,D as i}from"./index-CL4rmUJ-.js";const B={op50:""},w=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=f(o,"modelValue");b(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),c("div",null,[r(l.$slots,"trigger",u(y({visible:e.value,setVisible:n})),()=>[s("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:a[0]||(a[0]=_=>e.value=!e.value)},[s("span",null,i(t.label??"Collapsable"),1),a[1]||(a[1]=x()),s("span",B,i(e.value?"▲":"▼"),1)])]),V(d,null,{default:C(()=>[e.value?r(l.$slots,"default",u(k({key:0},{visible:e.value,setVisible:n}))):g("",!0)]),_:3})]))}});export{w as _}; diff --git a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-EIEI_2Ix.js b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-CzX7Yr-T.js similarity index 87% rename from assets/ColorPalette.vue_vue_type_script_setup_true_lang-EIEI_2Ix.js rename to assets/ColorPalette.vue_vue_type_script_setup_true_lang-CzX7Yr-T.js index fbac1ff466272903b80bb5f2ce49564dbcba0d4e..4e547d6d2138223dd50342d1e1c826fcf9549f9f 100644 --- a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-EIEI_2Ix.js +++ b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-CzX7Yr-T.js @@ -1 +1 @@ -import{_ as b}from"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import{d,x as m,o as i,y as l,a as n,z as c,m as y,bH as f,D as g,v as C,c as u,C as k,bx as v,by as x,b as s,e,n as h,bR as z}from"./index-BYewP6KR.js";import"./live2d-zip-loader-CvpgOHsT.js";import{W as w,j as S,q as $,U as B,G as E,H}from"./index-C4TaASqf.js";const V=["onClick"],F={flex:"","gap-1.5":""},q=d({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(o,_)=>(i(),m(b,{default:t.expand},{trigger:l(r=>[n("button",{class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",onClick:a=>r.setVisible(!r.visible)},[n("div",F,[n("div",{class:c(t.icon),"size-6":""},null,2),f(" "+g(t.title),1)]),n("div",{"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-250",class:c({"rotate-180":r.visible})},null,2)],8,V)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:c(t.innerClass)},[y(o.$slots,"default")],2)]),_:3},8,["default"]))}}),N={key:0,flex:"","gap-2":""},G=d({__name:"ColorPalette",props:{colors:null},setup(t){const o=C();return(_,r)=>t.colors.length?(i(),u("div",N,[(i(!0),u(v,null,x(t.colors,({hex:a,name:p})=>(i(),m(e(H),{key:a||"default"},{default:l(()=>[s(e(w),null,{default:l(()=>[s(e(S),{transition:"all ease-in-out duration-250","bg-primary-500":"","size-6":"","cursor-pointer":"","rounded-full":"",style:h(a?{background:a}:{"--theme-colors-hue":e(z)}),class:c(e(o).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:U=>e(o).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e($),null,{default:l(()=>[s(e(B),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(E),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):k("",!0)}});export{q as _,G as a}; +import{_ as b}from"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import{d,x as m,o as i,y as l,a as n,z as c,m as y,bH as f,D as g,v as C,c as u,C as k,bx as v,by as x,b as s,e,n as h,bR as z}from"./index-CL4rmUJ-.js";import"./live2d-zip-loader-DFrBymqv.js";import{W as w,j as S,q as $,U as B,G as E,H}from"./index-CDeQ6Zfm.js";const V=["onClick"],F={flex:"","gap-1.5":""},q=d({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(o,_)=>(i(),m(b,{default:t.expand},{trigger:l(r=>[n("button",{class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",onClick:a=>r.setVisible(!r.visible)},[n("div",F,[n("div",{class:c(t.icon),"size-6":""},null,2),f(" "+g(t.title),1)]),n("div",{"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-250",class:c({"rotate-180":r.visible})},null,2)],8,V)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:c(t.innerClass)},[y(o.$slots,"default")],2)]),_:3},8,["default"]))}}),N={key:0,flex:"","gap-2":""},G=d({__name:"ColorPalette",props:{colors:null},setup(t){const o=C();return(_,r)=>t.colors.length?(i(),u("div",N,[(i(!0),u(v,null,x(t.colors,({hex:a,name:p})=>(i(),m(e(H),{key:a||"default"},{default:l(()=>[s(e(w),null,{default:l(()=>[s(e(S),{transition:"all ease-in-out duration-250","bg-primary-500":"","size-6":"","cursor-pointer":"","rounded-full":"",style:h(a?{background:a}:{"--theme-colors-hue":e(z)}),class:c(e(o).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:U=>e(o).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e($),null,{default:l(()=>[s(e(B),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(E),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):k("",!0)}});export{q as _,G as a}; diff --git a/assets/DeleteCardDialog-B93IlDSL.js b/assets/DeleteCardDialog-B93IlDSL.js new file mode 100644 index 0000000000000000000000000000000000000000..5f6ff921ff892e5ca8e9c83804acd1ddceb8c177 --- /dev/null +++ b/assets/DeleteCardDialog-B93IlDSL.js @@ -0,0 +1 @@ +import{_ as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C1JwBLjv.js";import"./index-CL4rmUJ-.js";import"./index-CDeQ6Zfm.js";export{o as default}; diff --git a/assets/DeleteCardDialog-CzJ6iFuT.js b/assets/DeleteCardDialog-CzJ6iFuT.js deleted file mode 100644 index c306f986531d3225d2c39405db19e8d9310dea68..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-CzJ6iFuT.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-_ktQBMkP.js";import"./index-BYewP6KR.js";import"./index-C4TaASqf.js";export{o as default}; diff --git a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-_ktQBMkP.js b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C1JwBLjv.js similarity index 93% rename from assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-_ktQBMkP.js rename to assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C1JwBLjv.js index bf49436f64179db2238858f74ca4554b98df2895..796c3ccda669c991d76dce65f51966a6d256be7c 100644 --- a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-_ktQBMkP.js +++ b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C1JwBLjv.js @@ -1 +1 @@ -import{d as v,h as p,c as r,o as d,z as g,a as m,C as h,m as _,D as i,q as w,x as C,y as n,b as t,e,bH as x}from"./index-BYewP6KR.js";import{A as V,k as B,O as N,V as z,F as D,M as O,N as S,T}from"./index-C4TaASqf.js";const $=["disabled"],j={class:"flex flex-row items-center justify-center gap-2"},A={key:0,class:"i-lucide:loader-circle animate-spin"},F={key:2},y=v({__name:"Button",props:{icon:null,label:null,disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},variant:{default:"primary"},size:{default:"md"},block:{type:Boolean,default:!1}},setup(a){const s=a,l=p(()=>s.disabled||s.loading),o={primary:"bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 text-white",secondary:"bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 text-neutral-900 dark:text-neutral-100",danger:"bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 text-white"},c={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u=p(()=>["rounded-lg font-medium outline-none transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50",s.block?"w-full":"",c[s.size],o[s.variant],{"opacity-50 cursor-not-allowed":l.value},"focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900","focus:ring-primary-500/50 dark:focus:ring-primary-400/50"]);return(b,f)=>(d(),r("button",{disabled:l.value,class:g(u.value)},[m("div",j,[a.loading?(d(),r("div",A)):a.icon?(d(),r("div",{key:1,class:g(a.icon)},null,2)):h("",!0),a.label?(d(),r("span",F,i(a.label),1)):_(b.$slots,"default",{key:3})])],10,$))}}),H={class:"flex flex-row justify-end gap-3"},q=v({__name:"DeleteCardDialog",props:{modelValue:{type:Boolean},cardName:null},emits:["update:modelValue","confirm","cancel"],setup(a,{emit:s}){const l=s,{t:o}=w();function c(){l("update:modelValue",!1),l("cancel")}function u(){l("update:modelValue",!1),l("confirm")}return(b,f)=>(d(),C(e(T),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=k=>l("update:modelValue",k))},{default:n(()=>[t(e(V),null,{default:n(()=>[t(e(B),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50"}),t(e(N),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 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:n(()=>[t(e(z),{class:"mb-4 text-xl font-bold"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_card")),1)]),_:1}),t(e(D),{class:"mb-6"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_confirmation"))+" ",1),m("b",null,'"'+i(a.cardName||"")+'"',1)]),_:1}),m("div",H,[t(e(O),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(S),{"as-child":""},{default:n(()=>[t(e(y),{variant:"danger",label:e(o)("settings.pages.card.delete"),onClick:u},null,8,["label"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"]))}});export{q as _,y as a}; +import{d as v,h as p,c as r,o as d,z as g,a as m,C as h,m as _,D as i,q as w,x as C,y as n,b as t,e,bH as x}from"./index-CL4rmUJ-.js";import{A as V,k as B,O as N,V as z,F as D,M as O,N as S,T}from"./index-CDeQ6Zfm.js";const $=["disabled"],j={class:"flex flex-row items-center justify-center gap-2"},A={key:0,class:"i-lucide:loader-circle animate-spin"},F={key:2},y=v({__name:"Button",props:{icon:null,label:null,disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},variant:{default:"primary"},size:{default:"md"},block:{type:Boolean,default:!1}},setup(a){const s=a,l=p(()=>s.disabled||s.loading),o={primary:"bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 text-white",secondary:"bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 text-neutral-900 dark:text-neutral-100",danger:"bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 text-white"},c={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u=p(()=>["rounded-lg font-medium outline-none transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50",s.block?"w-full":"",c[s.size],o[s.variant],{"opacity-50 cursor-not-allowed":l.value},"focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900","focus:ring-primary-500/50 dark:focus:ring-primary-400/50"]);return(b,f)=>(d(),r("button",{disabled:l.value,class:g(u.value)},[m("div",j,[a.loading?(d(),r("div",A)):a.icon?(d(),r("div",{key:1,class:g(a.icon)},null,2)):h("",!0),a.label?(d(),r("span",F,i(a.label),1)):_(b.$slots,"default",{key:3})])],10,$))}}),H={class:"flex flex-row justify-end gap-3"},q=v({__name:"DeleteCardDialog",props:{modelValue:{type:Boolean},cardName:null},emits:["update:modelValue","confirm","cancel"],setup(a,{emit:s}){const l=s,{t:o}=w();function c(){l("update:modelValue",!1),l("cancel")}function u(){l("update:modelValue",!1),l("confirm")}return(b,f)=>(d(),C(e(T),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=k=>l("update:modelValue",k))},{default:n(()=>[t(e(V),null,{default:n(()=>[t(e(B),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50"}),t(e(N),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 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:n(()=>[t(e(z),{class:"mb-4 text-xl font-bold"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_card")),1)]),_:1}),t(e(D),{class:"mb-6"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_confirmation"))+" ",1),m("b",null,'"'+i(a.cardName||"")+'"',1)]),_:1}),m("div",H,[t(e(O),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(S),{"as-child":""},{default:n(()=>[t(e(y),{variant:"danger",label:e(o)("settings.pages.card.delete"),onClick:u},null,8,["label"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"]))}});export{q as _,y as a}; diff --git a/assets/FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js b/assets/FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js similarity index 81% rename from assets/FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js rename to assets/FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js index 0d91f492d973eecf3e9f3eb95d6354c5e1daebae..32bfd5d3fe13b999ab0a9a0711d560001184c8ec 100644 --- a/assets/FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js +++ b/assets/FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js @@ -1 +1 @@ -import{_ as m}from"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";import{d as p,h as x,c as o,o as n,a as l,b as V,bH as f,C as h,D as d,z as v}from"./index-BYewP6KR.js";const y={"max-w-full":""},C={flex:"~ col gap-4"},_={class:"flex items-center gap-1 text-sm font-medium"},b={key:0,class:"text-red-500"},g={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},N=p({__name:"FieldInput",props:{modelValue:null,label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},emits:["update:modelValue"],setup(e,{emit:u}){const c=e,i=u,t=x({get:()=>c.modelValue,set:a=>i("update:modelValue",a)});return(a,s)=>(n(),o("div",y,[l("label",C,[l("div",null,[l("div",_,[f(d(e.label)+" ",1),e.required!==!1?(n(),o("span",b,"*")):h("",!0)]),l("div",g,d(e.description),1)]),V(m,{modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),type:e.type,placeholder:e.placeholder,class:v(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}});export{N as _}; +import{_ as m}from"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";import{d as p,h as x,c as o,o as n,a as l,b as V,bH as f,C as h,D as d,z as v}from"./index-CL4rmUJ-.js";const y={"max-w-full":""},C={flex:"~ col gap-4"},_={class:"flex items-center gap-1 text-sm font-medium"},b={key:0,class:"text-red-500"},g={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},N=p({__name:"FieldInput",props:{modelValue:null,label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},emits:["update:modelValue"],setup(e,{emit:u}){const c=e,i=u,t=x({get:()=>c.modelValue,set:a=>i("update:modelValue",a)});return(a,s)=>(n(),o("div",y,[l("label",C,[l("div",null,[l("div",_,[f(d(e.label)+" ",1),e.required!==!1?(n(),o("span",b,"*")):h("",!0)]),l("div",g,d(e.description),1)]),V(m,{modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),type:e.type,placeholder:e.placeholder,class:v(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}});export{N as _}; diff --git a/assets/HeaderLink-7ZfdE9hW.js b/assets/HeaderLink-ByYQsQjF.js similarity index 90% rename from assets/HeaderLink-7ZfdE9hW.js rename to assets/HeaderLink-ByYQsQjF.js index 37b4d8ea5849091a656c7c3bfd8995e63343a727..2644134fab4caee00f0de319d350ac28fdf6c984 100644 --- a/assets/HeaderLink-7ZfdE9hW.js +++ b/assets/HeaderLink-ByYQsQjF.js @@ -1 +1 @@ -import{d as r,bC as c,x as l,e,bo as d,o as s,y as _,c as t,a,bn as i}from"./index-BYewP6KR.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],x=r({__name:"HeaderLink",setup(g){const n=c();return(f,o)=>(s(),l(e(d),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:_(()=>[e(n)?(s(),t("img",{key:0,src:e(k),"h-8":"","w-8":"",class:"theme-colored"},null,8,u)):(s(),t("img",{key:1,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1}))}}),w=i(x,[["__scopeId","data-v-496b6cde"]]);export{w as H}; +import{d as r,bC as c,x as l,e,bo as d,o as s,y as _,c as t,a,bn as i}from"./index-CL4rmUJ-.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],x=r({__name:"HeaderLink",setup(g){const n=c();return(f,o)=>(s(),l(e(d),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:_(()=>[e(n)?(s(),t("img",{key:0,src:e(k),"h-8":"","w-8":"",class:"theme-colored"},null,8,u)):(s(),t("img",{key:1,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1}))}}),w=i(x,[["__scopeId","data-v-496b6cde"]]);export{w as H}; diff --git a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js similarity index 95% rename from assets/IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js rename to assets/IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js index b54d9c416c8ec1927c7d067bf9b2a47ffcb40344..2339f07df7bea52dd217032446b747085d2e0a0b 100644 --- a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js +++ b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js @@ -1 +1 @@ -import{d as m,g as s,w as p,h,c as f,o as x,n as l,a as u,z as y}from"./index-BYewP6KR.js";const C=m({__name:"IconAnimation",props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:["animationEnded"],setup(a,{emit:d}){const e=a,c=d,n=s(!1);p(()=>e.started,o=>{o&&requestAnimationFrame(()=>{n.value=!0})});const t=h(()=>({opacity:n.value!==e.isReverse?1:0,size:n.value!==e.isReverse?25:e.iconSize,position:n.value!==e.isReverse?"calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)":e.position,textColor:n.value!==e.isReverse?"text-white":e.textColor})),i=s([]),r=s(!1);function v(o){i.value.push(o.propertyName),i.value.includes("color")&&i.value.includes("width")&&i.value.includes("height")&&i.value.includes("transform")&&(r.value=!0,c("animationEnded"))}return(o,z)=>(x(),f("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{"bg-primary-500":"",fixed:"","inset-0":"","transition-opacity":"","ease-linear":"",style:l({opacity:t.value.opacity,transitionDuration:`${a.duration}ms`})},null,4),u("div",{fixed:"","inset-0":"","ease-in-out":"",style:l({width:`${t.value.size}rem`,height:`${t.value.size}rem`,transform:`translate(${t.value.position})`,transitionDuration:`${a.duration}ms`}),class:y([t.value.textColor,e.icon,{"transition-all":n.value}]),onTransitionend:v},null,38)],4))}});export{C as _}; +import{d as m,g as s,w as p,h,c as f,o as x,n as l,a as u,z as y}from"./index-CL4rmUJ-.js";const C=m({__name:"IconAnimation",props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:["animationEnded"],setup(a,{emit:d}){const e=a,c=d,n=s(!1);p(()=>e.started,o=>{o&&requestAnimationFrame(()=>{n.value=!0})});const t=h(()=>({opacity:n.value!==e.isReverse?1:0,size:n.value!==e.isReverse?25:e.iconSize,position:n.value!==e.isReverse?"calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)":e.position,textColor:n.value!==e.isReverse?"text-white":e.textColor})),i=s([]),r=s(!1);function v(o){i.value.push(o.propertyName),i.value.includes("color")&&i.value.includes("width")&&i.value.includes("height")&&i.value.includes("transform")&&(r.value=!0,c("animationEnded"))}return(o,z)=>(x(),f("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{"bg-primary-500":"",fixed:"","inset-0":"","transition-opacity":"","ease-linear":"",style:l({opacity:t.value.opacity,transitionDuration:`${a.duration}ms`})},null,4),u("div",{fixed:"","inset-0":"","ease-in-out":"",style:l({width:`${t.value.size}rem`,height:`${t.value.size}rem`,transform:`translate(${t.value.position})`,transitionDuration:`${a.duration}ms`}),class:y([t.value.textColor,e.icon,{"transition-all":n.value}]),onTransitionend:v},null,38)],4))}});export{C as _}; diff --git a/assets/IconStatusItem-DXrpg97R.js b/assets/IconStatusItem-CKiy6LHl.js similarity index 97% rename from assets/IconStatusItem-DXrpg97R.js rename to assets/IconStatusItem-CKiy6LHl.js index 628f2fe28201c38ee1e153a91cd3ee7819416cf6..12537ba69136a774dacc37604ee29dd7f6923496 100644 --- a/assets/IconStatusItem-DXrpg97R.js +++ b/assets/IconStatusItem-CKiy6LHl.js @@ -1 +1 @@ -import{d as u,r as c,c as e,o as n,b as d,a as o,y as m,C as a,D as i,z as s,bn as _}from"./index-BYewP6KR.js";const p={flex:"~ col",bg:"neutral-200/50 dark:neutral-800/50",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","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",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-bold":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},k={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},f=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},y={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},b=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(C,I)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"white dark:neutral-900",transition:"all ease-in-out duration-400",relative:"","h-full":"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",to:t.to},{default:m(()=>[o("div",g,[o("div",h,i(t.title),1),o("div",k,[o("span",null,i(t.description),1)])]),t.icon?(n(),e("div",{key:0,class:s(["menu-icon-status-item-icon",[t.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconColor?(n(),e("div",{key:1,class:s(["menu-icon-status-item-icon-color",[t.iconColor]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconImage?(n(),e("img",{key:2,src:t.iconImage,class:"menu-icon-status-item-icon-image",transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"","grayscale-100":""},null,8,f)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",y))])])}}}),w=_(b,[["__scopeId","data-v-7ea16194"]]);export{w as I}; +import{d as u,r as c,c as e,o as n,b as d,a as o,y as m,C as a,D as i,z as s,bn as _}from"./index-CL4rmUJ-.js";const p={flex:"~ col",bg:"neutral-200/50 dark:neutral-800/50",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","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",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-bold":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},k={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},f=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},y={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},b=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(C,I)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"white dark:neutral-900",transition:"all ease-in-out duration-400",relative:"","h-full":"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",to:t.to},{default:m(()=>[o("div",g,[o("div",h,i(t.title),1),o("div",k,[o("span",null,i(t.description),1)])]),t.icon?(n(),e("div",{key:0,class:s(["menu-icon-status-item-icon",[t.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconColor?(n(),e("div",{key:1,class:s(["menu-icon-status-item-icon-color",[t.iconColor]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconImage?(n(),e("img",{key:2,src:t.iconImage,class:"menu-icon-status-item-icon-image",transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"","grayscale-100":""},null,8,f)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",y))])])}}}),w=_(b,[["__scopeId","data-v-7ea16194"]]);export{w as I}; diff --git a/assets/Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js b/assets/Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js similarity index 91% rename from assets/Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js rename to assets/Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js index 974ee01ebb0fbf7ca3dd8a15bdeab07be34b5a7f..20452a0f1446a8e8cb6ac7aa2b8788048359e70e 100644 --- a/assets/Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js +++ b/assets/Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js @@ -1 +1 @@ -import{d as r,bK as n,bL as u,A as s,cr as d,o as i,c as p}from"./index-BYewP6KR.js";const m=["type"],y=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=u(e,"modelValue");return(c,a)=>s((i(),p("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.type||"text",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,8,m)),[[d,t.value]])}});export{y as _}; +import{d as r,bK as n,bL as u,A as s,cr as d,o as i,c as p}from"./index-CL4rmUJ-.js";const m=["type"],y=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=u(e,"modelValue");return(c,a)=>s((i(),p("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.type||"text",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,8,m)),[[d,t.value]])}});export{y as _}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-CvOp1AJu.js b/assets/Model.vue_vue_type_script_setup_true_lang-CuI1gVrl.js similarity index 97% rename from assets/Model.vue_vue_type_script_setup_true_lang-CvOp1AJu.js rename to assets/Model.vue_vue_type_script_setup_true_lang-CuI1gVrl.js index d5229d683b743f6de28541eb1bc7b39a7fa3b921..6b1a659851335ead73b53d14d36c2b9d962cab43 100644 --- a/assets/Model.vue_vue_type_script_setup_true_lang-CvOp1AJu.js +++ b/assets/Model.vue_vue_type_script_setup_true_lang-CuI1gVrl.js @@ -1 +1 @@ -import{n as C,T as Y,A as re,L as F,o as $,r as ue,D as se,I as de,m as O,M as ce,p as R}from"./live2d-zip-loader-CvpgOHsT.js";import{bO as ve,d as G,g as h,w as p,l as N,H as X,c as j,o as q,m as Q,br as T,h as z,bC as pe,i as he,G as fe,s as me,v as ge,bP as Me,bQ as we,bx as ye,a as be,p as Se}from"./index-BYewP6KR.js";const xe=o=>Math.max(0,Math.min(1,o||0)),B=o=>Math.round(xe(o)*255),Pe=ve("rgb"),Be=o=>{if(o===void 0)return;let l=B(o.r),t=B(o.g),d=B(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Ce=o=>Be(Pe(o)),ke=G({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=h(),e=h(),i=h();async function c(n){F.registerTicker($),C.add(Y),e.value=new re({width:t.width,height:t.height,backgroundAlpha:0,preserveDrawingBuffer:!0}),i.value=e.value.view,i.value.style.objectFit="contain",n.appendChild(e.value.view)}function y(){var n;e.value&&e.value.renderer.resize(t.width,t.height),(n=e.value)!=null&&n.view&&(e.value.view.width=t.width,e.value.view.height=t.height)}p([()=>t.width,()=>t.height],()=>y()),N(async()=>d.value&&await c(d.value)),X(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function P(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:P}),(n,g)=>(q(),j("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[Q(n.$slots,"default",{app:e.value})],512))}});function V(o,l,t){return(1-t)*o+t*l}function H(o,l){return o+Math.random()*(l-o)}function Fe(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=T(()=>l.paused),e=h(),i=h(0),c=h(0),y=z(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),P=pe(),n=he(Se),g=z(()=>n.between("sm","md").value||n.smaller("sm").value),U=Fe(),I=fe(new se({alpha:.2,blur:0,distance:20,rotation:45}));function W(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const f=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(f,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:J,availableLive2dMotions:K,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=me(ge()),ee=h({group:"Idle",index:0});async function ae(){var L;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new F;S.value==="file"?await R.setupLive2DModel(a,[b.value]):S.value==="url"&&await R.setupLive2DModel(a,k.value),e.value=a,t.value.stage.addChild(e.value),i.value=e.value.width,c.value=e.value.height,e.value.x=l.width/2,e.value.y=l.height,e.value.rotation=Math.PI,e.value.skew.x=Math.PI,e.value.anchor.set(.5,.5),D(e),e.value.on("hit",v=>{e.value&&v.includes("body")&&e.value.motion("tap_body")});const r=e.value.internalModel,f=r.coreModel,s=r.motionManager;f.setParameterValueById("ParamMouthOpenY",y.value),K.value=Object.entries(s.definitions).flatMap(([v,u])=>u?u.map((ie,ne)=>({motionName:v,motionIndex:ne,fileName:ie.File})):[]).filter(Boolean),s.groups.idle&&((L=s.motionGroups[s.groups.idle])==null||L.forEach(v=>{v._motionData.curves.forEach(u=>{(u.id==="ParamEyeBallX"||u.id==="ParamEyeBallY")&&(u.id=`_${u.id}`)})}));const m=s.update;s.update=function(v,u){return m==null||m.call(this,v,u),s.state.currentGroup===s.groups.idle&&U.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),b.value&&await O.setItem("live2dModel",b.value),M.value=!1}async function te(){if(!t.value)return;F.registerTicker($),C.add(Y),C.add(de);const a=await O.getItem("live2dModel");if(a){b.value=a,S.value="file",M.value=!0;return}if(k.value){S.value="url",M.value=!0;return}M.value=!1}async function le(a,r){await e.value.motion(a,r,ce.FORCE)}const oe=Me(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=h(),w=h(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Ce(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(P,x,{immediate:!0}),p([e,Z],x);function E(){x(),w.value=requestAnimationFrame(E)}return p(_,()=>{_.value?w.value=requestAnimationFrame(E):(cancelAnimationFrame(w.value),w.value=0)},{immediate:!0}),p(y,a=>W().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(J,a=>le(a.group,a.index)),p(d,a=>{var r,f;a?(r=t.value)==null||r.stop():(f=t.value)==null||f.start()}),we(M,a=>{a&&ae()},{debounce:1e3}),N(x),X(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(q(),j(ye,null,[be("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),Q(a.$slots,"default")],64))}});export{_e as _,ke as a,H as r}; +import{n as C,T as Y,A as re,L as F,o as $,r as ue,D as se,I as de,m as O,M as ce,p as R}from"./live2d-zip-loader-DFrBymqv.js";import{bO as ve,d as G,g as h,w as p,l as N,H as X,c as j,o as q,m as Q,br as T,h as z,bC as pe,i as he,G as fe,s as me,v as ge,bP as Me,bQ as we,bx as ye,a as be,p as Se}from"./index-CL4rmUJ-.js";const xe=o=>Math.max(0,Math.min(1,o||0)),B=o=>Math.round(xe(o)*255),Pe=ve("rgb"),Be=o=>{if(o===void 0)return;let l=B(o.r),t=B(o.g),d=B(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Ce=o=>Be(Pe(o)),ke=G({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=h(),e=h(),i=h();async function c(n){F.registerTicker($),C.add(Y),e.value=new re({width:t.width,height:t.height,backgroundAlpha:0,preserveDrawingBuffer:!0}),i.value=e.value.view,i.value.style.objectFit="contain",n.appendChild(e.value.view)}function y(){var n;e.value&&e.value.renderer.resize(t.width,t.height),(n=e.value)!=null&&n.view&&(e.value.view.width=t.width,e.value.view.height=t.height)}p([()=>t.width,()=>t.height],()=>y()),N(async()=>d.value&&await c(d.value)),X(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function P(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:P}),(n,g)=>(q(),j("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[Q(n.$slots,"default",{app:e.value})],512))}});function V(o,l,t){return(1-t)*o+t*l}function H(o,l){return o+Math.random()*(l-o)}function Fe(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=T(()=>l.paused),e=h(),i=h(0),c=h(0),y=z(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),P=pe(),n=he(Se),g=z(()=>n.between("sm","md").value||n.smaller("sm").value),U=Fe(),I=fe(new se({alpha:.2,blur:0,distance:20,rotation:45}));function W(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const f=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(f,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:J,availableLive2dMotions:K,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=me(ge()),ee=h({group:"Idle",index:0});async function ae(){var L;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new F;S.value==="file"?await R.setupLive2DModel(a,[b.value]):S.value==="url"&&await R.setupLive2DModel(a,k.value),e.value=a,t.value.stage.addChild(e.value),i.value=e.value.width,c.value=e.value.height,e.value.x=l.width/2,e.value.y=l.height,e.value.rotation=Math.PI,e.value.skew.x=Math.PI,e.value.anchor.set(.5,.5),D(e),e.value.on("hit",v=>{e.value&&v.includes("body")&&e.value.motion("tap_body")});const r=e.value.internalModel,f=r.coreModel,s=r.motionManager;f.setParameterValueById("ParamMouthOpenY",y.value),K.value=Object.entries(s.definitions).flatMap(([v,u])=>u?u.map((ie,ne)=>({motionName:v,motionIndex:ne,fileName:ie.File})):[]).filter(Boolean),s.groups.idle&&((L=s.motionGroups[s.groups.idle])==null||L.forEach(v=>{v._motionData.curves.forEach(u=>{(u.id==="ParamEyeBallX"||u.id==="ParamEyeBallY")&&(u.id=`_${u.id}`)})}));const m=s.update;s.update=function(v,u){return m==null||m.call(this,v,u),s.state.currentGroup===s.groups.idle&&U.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),b.value&&await O.setItem("live2dModel",b.value),M.value=!1}async function te(){if(!t.value)return;F.registerTicker($),C.add(Y),C.add(de);const a=await O.getItem("live2dModel");if(a){b.value=a,S.value="file",M.value=!0;return}if(k.value){S.value="url",M.value=!0;return}M.value=!1}async function le(a,r){await e.value.motion(a,r,ce.FORCE)}const oe=Me(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=h(),w=h(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Ce(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(P,x,{immediate:!0}),p([e,Z],x);function E(){x(),w.value=requestAnimationFrame(E)}return p(_,()=>{_.value?w.value=requestAnimationFrame(E):(cancelAnimationFrame(w.value),w.value=0)},{immediate:!0}),p(y,a=>W().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(J,a=>le(a.group,a.index)),p(d,a=>{var r,f;a?(r=t.value)==null||r.stop():(f=t.value)==null||f.start()}),we(M,a=>{a&&ae()},{debounce:1e3}),N(x),X(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(q(),j(ye,null,[be("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),Q(a.$slots,"default")],64))}});export{_e as _,ke as a,H as r}; diff --git a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js similarity index 84% rename from assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js rename to assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js index 27b32eae6182b94472ce009c911b41ac1e6c0748..b81a5e40c502e2a25d6ad2fb4f4cc3bb1467add1 100644 --- a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js +++ b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js @@ -1 +1 @@ -import{_ as i}from"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import{d as n,bK as t,q as u,bL as p,h as m,x as c,o as f,e as b}from"./index-BYewP6KR.js";const y=n({__name:"ProviderApiKeyInput",props:t({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:a}=u(),o=p(e,"modelValue"),d=m(()=>l.description||`API Key for ${l.providerName}`);return(v,r)=>(f(),c(i,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||b(a)("settings.pages.providers.common.fields.field.api-key.label"),description:d.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{y as _}; +import{_ as i}from"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import{d as n,bK as t,q as u,bL as p,h as m,x as c,o as f,e as b}from"./index-CL4rmUJ-.js";const y=n({__name:"ProviderApiKeyInput",props:t({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:a}=u(),o=p(e,"modelValue"),d=m(()=>l.description||`API Key for ${l.providerName}`);return(v,r)=>(f(),c(i,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||b(a)("settings.pages.providers.common.fields.field.api-key.label"),description:d.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{y as _}; diff --git a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js similarity index 88% rename from assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js rename to assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js index 81d5b217d842c7ea7fe2f6a2cbc8e457a60922ff..957e34d783ad0cb22cda935ed9e2fe6116733f21 100644 --- a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js +++ b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js @@ -1 +1 @@ -import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import{d,g as m,x as u,o as c,y as n,a as e,m as f,D as _,z as v,bK as b,bL as g}from"./index-BYewP6KR.js";import{_ as V}from"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";const x=["onClick"],h={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},y={"mt-4":""},q=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function r(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(s=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>s.setVisible(!s.visible)&&r()},[e("h2",h,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":s.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,x)]),default:n(()=>[e("div",y,[f(o.$slots,"default")])]),_:3}))}}),w=d({__name:"ProviderBaseUrlInput",props:b({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=g(l,"modelValue");return(r,o)=>(c(),u(V,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),label:t.label||"Base URL",description:t.description||"Custom base URL (optional)",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{q as _,w as a}; +import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import{d,g as m,x as u,o as c,y as n,a as e,m as f,D as _,z as v,bK as b,bL as g}from"./index-CL4rmUJ-.js";import{_ as V}from"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";const x=["onClick"],h={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},y={"mt-4":""},q=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function r(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(s=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>s.setVisible(!s.visible)&&r()},[e("h2",h,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":s.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,x)]),default:n(()=>[e("div",y,[f(o.$slots,"default")])]),_:3}))}}),w=d({__name:"ProviderBaseUrlInput",props:b({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=g(l,"modelValue");return(r,o)=>(c(),u(V,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),label:t.label||"Base URL",description:t.description||"Custom base URL (optional)",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{q as _,w as a}; diff --git a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js similarity index 94% rename from assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js rename to assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js index 9ea750d064bbb02b929bb72fb7d3faf34f405a38..c4e88b235d49d640e83f51525c8403974536c63e 100644 --- a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js +++ b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js @@ -1 +1 @@ -import{d as o,c as s,o as a,a as e,m as i,C as u,D as l}from"./index-BYewP6KR.js";const c={flex:"~ col gap-6"},x={flex:"~ row","items-center":"","justify-between":""},f={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},m={text:"neutral-400 dark:neutral-500"},g=o({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(t){return(r,n)=>(a(),s("div",c,[e("div",x,[e("div",null,[e("h2",f,l(t.title||"Basic"),1),e("div",m,[e("span",null,l(t.description||"Essential settings"),1)])]),t.onReset?(a(),s("button",{key:0,title:"Reset settings",flex:"","items-center":"","justify-center":"","rounded-full":"","p-2":"",transition:"all duration-250 ease-in-out",text:"neutral-500 dark:neutral-400",bg:"transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700",onClick:n[0]||(n[0]=(...d)=>t.onReset&&t.onReset(...d))},n[1]||(n[1]=[e("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):u("",!0)]),i(r.$slots,"default")]))}}),p={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},k=o({__name:"ProviderSettingsContainer",setup(t){return(r,n)=>(a(),s("div",p,[i(r.$slots,"default")]))}});export{k as _,g as a}; +import{d as o,c as s,o as a,a as e,m as i,C as u,D as l}from"./index-CL4rmUJ-.js";const c={flex:"~ col gap-6"},x={flex:"~ row","items-center":"","justify-between":""},f={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},m={text:"neutral-400 dark:neutral-500"},g=o({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(t){return(r,n)=>(a(),s("div",c,[e("div",x,[e("div",null,[e("h2",f,l(t.title||"Basic"),1),e("div",m,[e("span",null,l(t.description||"Essential settings"),1)])]),t.onReset?(a(),s("button",{key:0,title:"Reset settings",flex:"","items-center":"","justify-center":"","rounded-full":"","p-2":"",transition:"all duration-250 ease-in-out",text:"neutral-500 dark:neutral-400",bg:"transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700",onClick:n[0]||(n[0]=(...d)=>t.onReset&&t.onReset(...d))},n[1]||(n[1]=[e("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):u("",!0)]),i(r.$slots,"default")]))}}),p={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},k=o({__name:"ProviderSettingsContainer",setup(t){return(r,n)=>(a(),s("div",p,[i(r.$slots,"default")]))}});export{k as _,g as a}; diff --git a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js similarity index 94% rename from assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js rename to assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js index 3e65764f96c0f028df661e8dca73886dcf4c7e69..14079184d4b2cf0ff32193cb7808b390bd1874fa 100644 --- a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js +++ b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js @@ -1 +1 @@ -import{d as s,bw as d,c as n,o as r,A as v,m as u,a as t,D as c,z as x,bx as m}from"./index-BYewP6KR.js";const p={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},f={relative:""},k={"text-nowrap":"","text-3xl":"","font-semibold":""},y={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},w=s({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(o){return(a,e)=>{const i=d("motion");return r(),n(m,null,[v((r(),n("div",p,[t("button",{onClick:e[0]||(e[0]=(...l)=>o.onBack&&o.onBack(...l))},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",f,[e[2]||(e[2]=t("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[t("span",{text:"neutral-300 dark:neutral-500","text-nowrap":""},"Provider")],-1)),t("div",k,c(o.providerName),1)])])),[[i]]),u(a.$slots,"default"),t("div",y,[t("div",{text:"40",class:x(o.providerIcon||o.providerIconColor)},null,2)])],64)}}});export{w as _}; +import{d as s,bw as d,c as n,o as r,A as v,m as u,a as t,D as c,z as x,bx as m}from"./index-CL4rmUJ-.js";const p={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},f={relative:""},k={"text-nowrap":"","text-3xl":"","font-semibold":""},y={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},w=s({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(o){return(a,e)=>{const i=d("motion");return r(),n(m,null,[v((r(),n("div",p,[t("button",{onClick:e[0]||(e[0]=(...l)=>o.onBack&&o.onBack(...l))},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",f,[e[2]||(e[2]=t("div",{absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},[t("span",{text:"neutral-300 dark:neutral-500","text-nowrap":""},"Provider")],-1)),t("div",k,c(o.providerName),1)])])),[[i]]),u(a.$slots,"default"),t("div",y,[t("div",{text:"40",class:x(o.providerIcon||o.providerIconColor)},null,2)])],64)}}});export{w as _}; diff --git a/assets/RadioCardDetailManySelect-ConUGerY.js b/assets/RadioCardDetailManySelect-Cc_QkuwQ.js similarity index 98% rename from assets/RadioCardDetailManySelect-ConUGerY.js rename to assets/RadioCardDetailManySelect-Cc_QkuwQ.js index 2b2e3712bad77e0c5bdc2ccd64e7e17f6b98c339..7749be3c73289b695cfa5d87b2bd203ca2fd46a7 100644 --- a/assets/RadioCardDetailManySelect-ConUGerY.js +++ b/assets/RadioCardDetailManySelect-Cc_QkuwQ.js @@ -1 +1 @@ -import{d as g,bK as f,bL as w,g as b,c as n,o as d,z as o,A as V,a as t,bA as B,C as v,D as c,b as $,y as M,bJ as k,bn as C,h as S,bF as T,bx as z,by as D,x as E}from"./index-BYewP6KR.js";import{_ as N}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import{_ as L}from"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const P=["checked","name","value"],U={class:"relative mr-3 mt-0.5 flex-shrink-0"},q={class:"w-full flex flex-col gap-2"},j={class:"flex items-center"},A={key:0,class:"relative"},F=["title"],J={key:1,class:"mt-2"},K=g({__name:"RadioCardDetail",props:f({id:null,name:null,value:null,title:null,description:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue"),m=b(!1);function s(){m.value=!m.value}return(x,r)=>(d(),n("label",{key:e.id,class:o(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[V(t("input",{"onUpdate:modelValue":r[0]||(r[0]=i=>a.value=i),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,P),[[B,a.value]]),t("div",U,[t("div",{class:o(["size-5 border-2 rounded-full transition-colors duration-200",[a.value===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:o(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[a.value===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",q,[t("div",j,[t("span",{class:o(["line-clamp-1 font-medium",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},c(e.title),3)]),e.description?(d(),n("div",A,[$(N,null,{default:M(()=>[!m.value||!e.showExpandCollapse?(d(),n("div",{key:0,class:o(["line-clamp-2 cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:k(s,["prevent"])},c(e.description),11,F)):(d(),n("div",{key:1,class:o(["cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:k(s,["prevent"])},c(e.description),3))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(d(),n("button",{key:0,class:"text-primary-500 dark:text-primary-600 mt-0.5 inline-flex items-center text-xs",onClick:k(s,["prevent"])},[t("span",null,c(m.value?"Show less":"Show more"),1),t("div",{class:o([{"rotate-180":m.value},"transition-transform duration-200"])},r[2]||(r[2]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&a.value===e.value?(d(),n("div",J,[$(L,{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=i=>a.value=i),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:e.customInputPlaceholder},null,8,["modelValue","placeholder"])])):v("",!0)])],2))}}),Q=C(K,[["__scopeId","data-v-c9195151"]]),G=["checked","name","value"],H={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},O=g({__name:"RadioCardSimple",props:f({id:null,name:null,value:null,title:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue");return(m,s)=>(d(),n("label",{key:e.id,border:"2px solid",class:o(["form_radio-card-simple relative",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-simple-active":""]]),transition:"all duration-200 ease-in-out",flex:"~ col",block:"","min-w-50":"","w-fit":"","cursor-pointer":"","items-start":"","rounded-xl":"","p-4":"","text-left":""},[V(t("input",{"onUpdate:modelValue":s[0]||(s[0]=x=>a.value=x),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"[&:checked+div]:border-primary-500 dark:[&:checked+div]:border-primary-400 absolute opacity-0 [&:checked+div_.radio-dot]:opacity-100"},null,8,G),[[B,a.value]]),s[1]||(s[1]=t("div",{class:"radio-circle absolute left-2 top-2 size-5 rounded-full",border:"2 solid neutral-300 dark:neutral-600",transition:"all duration-200 ease-in-out"},[t("div",{class:"radio-dot absolute left-1/2 top-1/2 size-3 rounded-full opacity-0 -translate-x-1/2 -translate-y-1/2",transition:"all duration-200 ease-in-out",bg:"primary-500 dark:primary-400"})],-1)),t("div",H,[t("span",{class:o(["radio-item-name font-bold",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-500 dark:text-neutral-500"]]),text:"md",transition:"all duration-200 ease-in-out"},c(e.title),3),e.description?(d(),n("span",{key:0,class:o(["radio-item-description",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},c(e.description),3)):v("",!0)]),s[2]||(s[2]=t("div",{class:"bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50 [input:checked~&]:bg-dotted-primary-300/50 dark:[input:checked~&]:bg-dotted-primary-200/20",absolute:"","inset-0":"","z--1":"",style:{"background-size":"10px 10px","mask-image":"linear-gradient(165deg, white 30%, transparent 50%)"}},null,-1))],2))}}),ie=C(O,[["__scopeId","data-v-dd41bc0b"]]),W={class:"radio-card-detail-many-select"},X={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Y=["placeholder"],Z={class:"mt-4 space-y-2"},_={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},ee={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},te={class:"flex flex-col"},ae={class:"font-medium"},le={class:"text-sm text-amber-600 dark:text-amber-400"},re={class:"relative"},oe=g({__name:"RadioCardDetailManySelect",props:f({items:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search..."},searchNoResultsTitle:{default:"No results found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} results"},customInputPlaceholder:{default:"Enter custom value"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},showMore:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:f(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=b(""),i=b(!1),R=b(""),h=S(()=>{if(!r.value)return m.items;const p=r.value.toLowerCase();return m.items.filter(l=>l.name.toLowerCase().includes(p)||l.description&&l.description.toLowerCase().includes(p))});function I(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",W,[e.searchable?(d(),n("div",X,[l[4]||(l[4]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),V(t("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>r.value=u),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:e.searchPlaceholder},null,8,Y),[[T,r.value]])])):v("",!0),t("div",Z,[r.value?(d(),n("div",_,c(e.searchResultsText.replace("{count}",h.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),r.value&&h.value.length===0?(d(),n("div",ee,[l[5]||(l[5]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",te,[t("span",ae,c(e.searchNoResultsTitle),1),t("span",le,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",re,[t("div",{class:o(["scrollbar-hide grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4",[i.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(d(!0),n(z,null,D(h.value,u=>(d(),E(Q,{id:u.id,key:u.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:u.id,title:u.name,description:u.description,deprecated:u.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":u.customizable,"custom-input-value":R.value,"custom-input-placeholder":e.customInputPlaceholder,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:customInputValue":l[2]||(l[2]=y=>I(y))},null,8,["id","modelValue","value","title","description","deprecated","show-expand-collapse","show-custom-input","custom-input-value","custom-input-placeholder"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:o([i.value?"w-full":"mt-4 w-full rounded-lg"])},[t("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:o([i.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:l[3]||(l[3]=u=>i.value=!i.value)},[t("span",null,c(i.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([i.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),ue=C(oe,[["__scopeId","data-v-0c2329bf"]]);export{ue as R,ie as a}; +import{d as g,bK as f,bL as w,g as b,c as n,o as d,z as o,A as V,a as t,bA as B,C as v,D as c,b as $,y as M,bJ as k,bn as C,h as S,bF as T,bx as z,by as D,x as E}from"./index-CL4rmUJ-.js";import{_ as N}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import{_ as L}from"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const P=["checked","name","value"],U={class:"relative mr-3 mt-0.5 flex-shrink-0"},q={class:"w-full flex flex-col gap-2"},j={class:"flex items-center"},A={key:0,class:"relative"},F=["title"],J={key:1,class:"mt-2"},K=g({__name:"RadioCardDetail",props:f({id:null,name:null,value:null,title:null,description:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue"),m=b(!1);function s(){m.value=!m.value}return(x,r)=>(d(),n("label",{key:e.id,class:o(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[V(t("input",{"onUpdate:modelValue":r[0]||(r[0]=i=>a.value=i),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,P),[[B,a.value]]),t("div",U,[t("div",{class:o(["size-5 border-2 rounded-full transition-colors duration-200",[a.value===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:o(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[a.value===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",q,[t("div",j,[t("span",{class:o(["line-clamp-1 font-medium",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},c(e.title),3)]),e.description?(d(),n("div",A,[$(N,null,{default:M(()=>[!m.value||!e.showExpandCollapse?(d(),n("div",{key:0,class:o(["line-clamp-2 cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:k(s,["prevent"])},c(e.description),11,F)):(d(),n("div",{key:1,class:o(["cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:k(s,["prevent"])},c(e.description),3))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(d(),n("button",{key:0,class:"text-primary-500 dark:text-primary-600 mt-0.5 inline-flex items-center text-xs",onClick:k(s,["prevent"])},[t("span",null,c(m.value?"Show less":"Show more"),1),t("div",{class:o([{"rotate-180":m.value},"transition-transform duration-200"])},r[2]||(r[2]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&a.value===e.value?(d(),n("div",J,[$(L,{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=i=>a.value=i),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:e.customInputPlaceholder},null,8,["modelValue","placeholder"])])):v("",!0)])],2))}}),Q=C(K,[["__scopeId","data-v-c9195151"]]),G=["checked","name","value"],H={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},O=g({__name:"RadioCardSimple",props:f({id:null,name:null,value:null,title:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue");return(m,s)=>(d(),n("label",{key:e.id,border:"2px solid",class:o(["form_radio-card-simple relative",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-simple-active":""]]),transition:"all duration-200 ease-in-out",flex:"~ col",block:"","min-w-50":"","w-fit":"","cursor-pointer":"","items-start":"","rounded-xl":"","p-4":"","text-left":""},[V(t("input",{"onUpdate:modelValue":s[0]||(s[0]=x=>a.value=x),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"[&:checked+div]:border-primary-500 dark:[&:checked+div]:border-primary-400 absolute opacity-0 [&:checked+div_.radio-dot]:opacity-100"},null,8,G),[[B,a.value]]),s[1]||(s[1]=t("div",{class:"radio-circle absolute left-2 top-2 size-5 rounded-full",border:"2 solid neutral-300 dark:neutral-600",transition:"all duration-200 ease-in-out"},[t("div",{class:"radio-dot absolute left-1/2 top-1/2 size-3 rounded-full opacity-0 -translate-x-1/2 -translate-y-1/2",transition:"all duration-200 ease-in-out",bg:"primary-500 dark:primary-400"})],-1)),t("div",H,[t("span",{class:o(["radio-item-name font-bold",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-500 dark:text-neutral-500"]]),text:"md",transition:"all duration-200 ease-in-out"},c(e.title),3),e.description?(d(),n("span",{key:0,class:o(["radio-item-description",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},c(e.description),3)):v("",!0)]),s[2]||(s[2]=t("div",{class:"bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50 [input:checked~&]:bg-dotted-primary-300/50 dark:[input:checked~&]:bg-dotted-primary-200/20",absolute:"","inset-0":"","z--1":"",style:{"background-size":"10px 10px","mask-image":"linear-gradient(165deg, white 30%, transparent 50%)"}},null,-1))],2))}}),ie=C(O,[["__scopeId","data-v-dd41bc0b"]]),W={class:"radio-card-detail-many-select"},X={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Y=["placeholder"],Z={class:"mt-4 space-y-2"},_={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},ee={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},te={class:"flex flex-col"},ae={class:"font-medium"},le={class:"text-sm text-amber-600 dark:text-amber-400"},re={class:"relative"},oe=g({__name:"RadioCardDetailManySelect",props:f({items:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search..."},searchNoResultsTitle:{default:"No results found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} results"},customInputPlaceholder:{default:"Enter custom value"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},showMore:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:f(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=b(""),i=b(!1),R=b(""),h=S(()=>{if(!r.value)return m.items;const p=r.value.toLowerCase();return m.items.filter(l=>l.name.toLowerCase().includes(p)||l.description&&l.description.toLowerCase().includes(p))});function I(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",W,[e.searchable?(d(),n("div",X,[l[4]||(l[4]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),V(t("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>r.value=u),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:e.searchPlaceholder},null,8,Y),[[T,r.value]])])):v("",!0),t("div",Z,[r.value?(d(),n("div",_,c(e.searchResultsText.replace("{count}",h.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),r.value&&h.value.length===0?(d(),n("div",ee,[l[5]||(l[5]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",te,[t("span",ae,c(e.searchNoResultsTitle),1),t("span",le,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",re,[t("div",{class:o(["scrollbar-hide grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4",[i.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(d(!0),n(z,null,D(h.value,u=>(d(),E(Q,{id:u.id,key:u.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:u.id,title:u.name,description:u.description,deprecated:u.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":u.customizable,"custom-input-value":R.value,"custom-input-placeholder":e.customInputPlaceholder,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:customInputValue":l[2]||(l[2]=y=>I(y))},null,8,["id","modelValue","value","title","description","deprecated","show-expand-collapse","show-custom-input","custom-input-value","custom-input-placeholder"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:o([i.value?"w-full":"mt-4 w-full rounded-lg"])},[t("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:o([i.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:l[3]||(l[3]=u=>i.value=!i.value)},[t("span",null,c(i.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([i.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),ue=C(oe,[["__scopeId","data-v-0c2329bf"]]);export{ue as R,ie as a}; diff --git a/assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-lVYyoUny.js b/assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-8IXQG3Jk.js similarity index 96% rename from assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-lVYyoUny.js rename to assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-8IXQG3Jk.js index 14d3521b66a6994d6492e6c948d0bb7560e7ee5f..435fd814d602381791639aadbeb18ce128df3eb1 100644 --- a/assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-lVYyoUny.js +++ b/assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-8IXQG3Jk.js @@ -1 +1 @@ -import{d as N,q as E,h as R,bw as ie,c as h,o as d,m as U,a as t,z as Y,A as q,C as V,D as k,g as x,w as j,H as Z,b as M,e,bF as G,bG as H,bx as J,by as Q,bE as re,s as ne,l as de,x as I,y as z,bT as W,bU as X,bP as ue,bK as ve,bL as T}from"./index-BYewP6KR.js";import{b as pe,a as ee,_ as C}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-CGhOEjXF.js";import"./live2d-zip-loader-CvpgOHsT.js";import{u as ce,g as me}from"./speech-CLmksxkl.js";import{u as fe}from"./providers-CFIOZO6n.js";import{_ as ge,a as be}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as ye}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as xe,a as he}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";const ke={flex:"~ row",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250,"mb-6":"","items-center":"","gap-3":""},Se={relative:""},Ve={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},we={text:"neutral-300 dark:neutral-500","text-nowrap":""},Ue={"text-nowrap":"","text-3xl":"","font-semibold":""},$e={key:0,"text-sm":"",text:"neutral-500 dark:neutral-400"},_e={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},Be=N({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function},title:null,subtitle:null,categoryLabel:null},emits:["back"],setup(a,{emit:i}){const b=a,c=i,{t:y}=E(),w=R(()=>b.title||b.providerName||""),s=R(()=>b.categoryLabel||y("settings.pages.providers.title"));function f(){b.onBack&&b.onBack(),c("back")}return(l,v)=>{const r=ie("motion");return d(),h("div",null,[U(l.$slots,"header",{},()=>[q((d(),h("div",ke,[U(l.$slots,"backButton",{},()=>[t("button",{onClick:f},v[0]||(v[0]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)]))]),t("div",null,[U(l.$slots,"title",{},()=>[t("h1",Se,[s.value?(d(),h("div",Ve,[t("span",we,k(s.value),1)])):V("",!0),t("div",Ue,k(w.value),1)])]),U(l.$slots,"subtitle",{},()=>[a.subtitle?(d(),h("div",$e,k(a.subtitle),1)):V("",!0)])]),U(l.$slots,"headerExtra")])),[[r]])]),U(l.$slots,"default"),t("div",_e,[t("div",{text:"40",class:Y(a.providerIcon||a.providerIconColor)},null,2)])])}}}),Ie={"w-full":"","rounded-xl":""},Le={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Te={class:"inline-flex items-center gap-4"},Me={flex:"~ col gap-4"},Pe=["placeholder"],Ce=["placeholder"],Re={flex:"~ col gap-6"},Oe={grid:"~ cols-2 gap-4"},qe={class:"flex items-center gap-1 text-sm font-medium"},Ke={class:"text-xs text-neutral-500 dark:text-neutral-400"},ze=["value"],Ne={grid:"~ cols-2 gap-4"},Ee={class:"flex items-center gap-1 text-sm font-medium"},Fe={class:"text-xs text-neutral-500 dark:text-neutral-400"},je=["value"],De={flex:"~ row","gap-4":""},Ae=["disabled"],Ge={flex:"~ row","items-center":"","gap-2":""},He={flex:"~ row","items-center":"","gap-2":""},Je={key:2,class:"mt-2 text-sm text-red-500"},Qe={key:3,class:"mt-2 text-sm text-red-500"},We={key:4,class:"mt-2 text-sm text-red-500"},Xe=["src"],ct=N({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,availableLanguages:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(a,{expose:i}){const b=a,{t:c}=E(),y=x(b.defaultText||"Hello! This is a test of the voice synthesis."),w=x(!1),s=x(""),f=x(""),l=x(null),v=x(!1),r=x(""),n=x(b.availableLanguages[0]||"en-US"),g=x("");j(()=>b.availableVoices,S=>{var p;S.length>0&&!g.value&&(g.value=((p=S[0])==null?void 0:p.id)||"")},{immediate:!0});async function P(){if(!(!y.value.trim()&&!v.value||v.value&&!r.value.trim()||!g.value)){w.value=!0,f.value="";try{s.value&&$();const S=v.value?r.value:y.value,p=await b.generateSpeech(S,g.value,v.value);s.value=URL.createObjectURL(new Blob([p])),setTimeout(()=>{l.value&&l.value.play()},100)}catch(S){console.error("Error generating speech:",S),f.value=S instanceof Error?S.message:"An unknown error occurred"}finally{w.value=!1}}}function $(){l.value&&(l.value.pause(),l.value.currentTime=0),s.value&&(URL.revokeObjectURL(s.value),s.value="")}return Z(()=>{s.value&&URL.revokeObjectURL(s.value)}),i({testText:y,ssmlText:r,useSSML:v,selectedLanguage:n,selectedVoice:g,isGenerating:w,audioUrl:s,errorMessage:f,audioPlayer:l,generateTestSpeech:P,stopTestAudio:$}),(S,p)=>(d(),h("div",Ie,[t("h2",Le,[t("div",Te,[M(e(pe)),t("div",null,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),t("div",Me,[M(e(ee),{modelValue:v.value,"onUpdate:modelValue":p[0]||(p[0]=m=>v.value=m),label:e(c)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:e(c)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),v.value?q((d(),h("textarea",{key:1,"onUpdate:modelValue":p[2]||(p[2]=m=>r.value=m),placeholder:e(c)("settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-48":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","font-mono":"","outline-none":""},null,8,Ce)),[[G,r.value]]):q((d(),h("textarea",{key:0,"onUpdate:modelValue":p[1]||(p[1]=m=>y.value=m),placeholder:e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,Pe)),[[G,y.value]]),t("div",Re,[t("label",Oe,[t("div",null,[t("div",qe,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.language.label")),1),t("div",Ke,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.language.description")),1)]),q(t("select",{"onUpdate:modelValue":p[3]||(p[3]=m=>n.value=m),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(d(!0),h(J,null,Q(a.availableLanguages,m=>(d(),h("option",{key:m,value:m},k(m),9,ze))),128))],512),[[H,n.value]])]),t("label",Ne,[t("div",null,[t("div",Ee,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),t("div",Fe,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),q(t("select",{"onUpdate:modelValue":p[4]||(p[4]=m=>g.value=m),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(d(!0),h(J,null,Q(a.availableVoices,m=>(d(),h("option",{key:m.id,value:m.id},k(m.name),9,je))),128))],512),[[H,g.value]])])]),t("div",De,[t("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:w.value||!y.value.trim()&&!v.value||v.value&&!r.value.trim()||!g.value||!a.apiKeyConfigured,class:Y({"opacity-50 cursor-not-allowed":w.value||!y.value.trim()&&!v.value||v.value&&!r.value.trim()||!g.value||!a.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:P},[t("div",Ge,[p[5]||(p[5]=t("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),t("span",null,k(w.value?e(c)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):e(c)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Ae),s.value?(d(),h("button",{key:0,border:"primary-300 dark:primary-800 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"","py-2":"","text-sm":"",onClick:$},[t("div",He,[p[6]||(p[6]=t("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),t("span",null,k(e(c)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):V("",!0)]),a.apiKeyConfigured?V("",!0):(d(),h("div",Je,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),g.value?V("",!0):(d(),h("div",Qe,k(e(c)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),f.value?(d(),h("div",We,k(f.value),1)):V("",!0),s.value?(d(),h("audio",{key:5,ref_key:"audioPlayer",ref:l,src:s.value,controls:"",class:"mt-2 w-full"},null,8,Xe)):V("",!0)]),U(S.$slots,"default")]))}}),Ye={flex:"~ col md:row gap-6"},Ze={flex:"~ col gap-6"},et={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},tt={flex:"~ col gap-4"},lt={flex:"~ col gap-6",class:"w-full md:w-[60%]"},st={"w-full":"","rounded-xl":""},mt=N({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(a){const i=a,{t:b}=E(),c=re(),y=fe(),w=ce(),{providers:s}=ne(y),f=R(()=>y.getProviderMetadata(i.providerId)),l=R({get:()=>{var o;return((o=s.value[i.providerId])==null?void 0:o.apiKey)||""},set:o=>{s.value[i.providerId]||(s.value[i.providerId]={}),s.value[i.providerId].apiKey=o}}),v=R({get:()=>{var o,u,_;return((o=s.value[i.providerId])==null?void 0:o.baseUrl)||((_=(u=f.value)==null?void 0:u.defaultOptions)==null?void 0:_.baseUrl)||""},set:o=>{s.value[i.providerId]||(s.value[i.providerId]={}),s.value[i.providerId].baseUrl=o}}),r=x("Hello! This is a test of voice synthesis."),n=x(!1),g=x(""),P=x(""),$=x(null),S=x(!1),p=x(""),m=x(""),B=x({});function te(){var o;(o=s.value[i.providerId])!=null&&o.voiceSettings?B.value={...s.value[i.providerId].voiceSettings}:B.value={pitch:0,speed:1,volume:0,...i.additionalSettings}}de(()=>{var o,u,_,L;y.initializeProvider(i.providerId),l.value=((o=s.value[i.providerId])==null?void 0:o.apiKey)||"",v.value=((u=s.value[i.providerId])==null?void 0:u.baseUrl)||((L=(_=f.value)==null?void 0:_.defaultOptions)==null?void 0:L.baseUrl)||"",te(),y.configuredProviders[i.providerId]&&w.loadVoicesForProvider(i.providerId)});const F=ue(()=>{var o,u;s.value[i.providerId]={...s.value[i.providerId],apiKey:l.value,baseUrl:v.value||((u=(o=f.value)==null?void 0:o.defaultOptions)==null?void 0:u.baseUrl)||"",voiceSettings:{...B.value}}},1e3);j([l,v],F),j(B,F,{deep:!0});async function le(){if(!r.value.trim()&&!S.value||S.value&&!p.value.trim())return;const o=y.getProviderInstance(i.providerId);if(!o){console.error("Failed to initialize speech provider");return}if(!m.value){console.error("No active speech voice selected");return}n.value=!0,P.value="";try{g.value&&D();const u=i.defaultModel||"default",_=S.value?p.value:r.value,L=await me({...o.speech(u,{voiceSettings:B.value}),input:_,voice:m.value});g.value=URL.createObjectURL(new Blob([L])),setTimeout(()=>{$.value&&$.value.play()},100)}catch(u){console.error("Error generating speech:",u),P.value=u instanceof Error?u.message:"An unknown error occurred"}finally{n.value=!1}}function D(){$.value&&($.value.pause(),$.value.currentTime=0),g.value&&(URL.revokeObjectURL(g.value),g.value="")}Z(()=>{g.value&&URL.revokeObjectURL(g.value)});function se(){var o,u;B.value={...((u=(o=f.value)==null?void 0:o.defaultOptions)==null?void 0:u.voiceSettings)||{}},F()}function oe(o,u){B.value[o]=u}const A=R(()=>({voiceSettings:B.value,updateVoiceSettings:oe,isGenerating:n.value,testText:r.value,useSSML:S.value,ssmlText:p.value,generateTestSpeech:le,stopTestAudio:D,audioUrl:g.value,audioPlayer:$.value,errorMessage:P.value}));return(o,u)=>{var _,L;return d(),I(Be,{"provider-name":(_=f.value)==null?void 0:_.localizedName,"provider-icon":(L=f.value)==null?void 0:L.icon,"on-back":()=>e(c).back()},{default:z(()=>[t("div",Ye,[M(e(xe),{class:"w-full md:w-[40%]"},{default:z(()=>[M(e(he),{title:e(b)("settings.pages.providers.common.section.basic.title"),description:e(b)("settings.pages.providers.common.section.basic.description"),"on-reset":se},{default:z(()=>{var O;return[M(e(ye),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=K=>l.value=K),"provider-name":(O=f.value)==null?void 0:O.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),U(o.$slots,"basic-settings")]}),_:3},8,["title","description"]),t("div",Ze,[t("h2",et,k(e(b)("settings.pages.providers.common.section.voice.title")),1),t("div",tt,[U(o.$slots,"voice-settings",W(X(A.value)))])]),M(e(ge),{title:e(b)("settings.pages.providers.common.section.advanced.title")},{default:z(()=>{var O,K;return[M(e(be),{modelValue:v.value,"onUpdate:modelValue":u[1]||(u[1]=ae=>v.value=ae),placeholder:((K=(O=f.value)==null?void 0:O.defaultOptions)==null?void 0:K.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),U(o.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),t("div",lt,[t("div",st,[U(o.$slots,"playground",W(X(A.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}}),ot={flex:"~ col gap-4"},ft=N({__name:"SpeechVoiceSettings",props:ve({settings:null,showPitch:{type:Boolean},showSpeed:{type:Boolean},showStyle:{type:Boolean},showStability:{type:Boolean},showSimilarityBoost:{type:Boolean},showVolume:{type:Boolean},showSpeakerBoost:{type:Boolean}},{pitch:{required:!1,default:0},pitchModifiers:{},speed:{required:!1,default:1},speedModifiers:{},volume:{required:!1,default:0},volumeModifiers:{},style:{required:!1,default:0},styleModifiers:{},stability:{required:!1,default:.5},stabilityModifiers:{},similarityBoost:{required:!1,default:.75},similarityBoostModifiers:{},useSpeakerBoost:{type:Boolean,required:!1,default:!1},useSpeakerBoostModifiers:{}}),emits:["update:pitch","update:speed","update:volume","update:style","update:stability","update:similarityBoost","update:useSpeakerBoost"],setup(a){const i=T(a,"pitch"),b=T(a,"speed"),c=T(a,"volume"),y=T(a,"style"),w=T(a,"stability"),s=T(a,"similarityBoost"),f=T(a,"useSpeakerBoost"),{t:l}=E();return(v,r)=>(d(),h("div",ot,[a.showPitch?(d(),I(e(C),{key:0,modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=n=>i.value=n),label:e(l)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:e(l)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":n=>`${n}%`},null,8,["modelValue","label","description","format-value"])):V("",!0),a.showSpeed?(d(),I(e(C),{key:1,modelValue:b.value,"onUpdate:modelValue":r[1]||(r[1]=n=>b.value=n),label:e(l)("settings.pages.providers.provider.common.fields.field.speed.label"),description:e(l)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])):V("",!0),a.showVolume?(d(),I(e(C),{key:2,modelValue:c.value,"onUpdate:modelValue":r[2]||(r[2]=n=>c.value=n),label:e(l)("settings.pages.providers.provider.common.fields.field.volume.label"),description:e(l)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":n=>`${n}%`},null,8,["modelValue","label","description","format-value"])):V("",!0),a.showStyle?(d(),I(e(C),{key:3,modelValue:y.value,"onUpdate:modelValue":r[3]||(r[3]=n=>y.value=n),label:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"])):V("",!0),a.showStability?(d(),I(e(C),{key:4,modelValue:w.value,"onUpdate:modelValue":r[4]||(r[4]=n=>w.value=n),label:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"])):V("",!0),a.showSimilarityBoost?(d(),I(e(C),{key:5,modelValue:s.value,"onUpdate:modelValue":r[5]||(r[5]=n=>s.value=n),label:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"])):V("",!0),a.showSpeakerBoost?(d(),I(e(ee),{key:6,modelValue:f.value,"onUpdate:modelValue":r[6]||(r[6]=n=>f.value=n),label:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])):V("",!0),U(v.$slots,"default")]))}});export{ct as _,ft as a,mt as b}; +import{d as N,q as E,h as R,bw as ie,c as h,o as d,m as U,a as t,z as Y,A as q,C as V,D as k,g as x,w as j,H as Z,b as M,e,bF as G,bG as H,bx as J,by as Q,bE as re,s as ne,l as de,x as I,y as z,bT as W,bU as X,bP as ue,bK as ve,bL as T}from"./index-CL4rmUJ-.js";import{b as pe,a as ee,_ as C}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-D5aCIkT4.js";import"./live2d-zip-loader-DFrBymqv.js";import{u as ce,g as me}from"./speech-Ae5ywnpY.js";import{u as fe}from"./providers-BHCrT0RZ.js";import{_ as ge,a as be}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as ye}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as xe,a as he}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";const ke={flex:"~ row",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250,"mb-6":"","items-center":"","gap-3":""},Se={relative:""},Ve={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},we={text:"neutral-300 dark:neutral-500","text-nowrap":""},Ue={"text-nowrap":"","text-3xl":"","font-semibold":""},$e={key:0,"text-sm":"",text:"neutral-500 dark:neutral-400"},_e={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},Be=N({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function},title:null,subtitle:null,categoryLabel:null},emits:["back"],setup(a,{emit:i}){const b=a,c=i,{t:y}=E(),w=R(()=>b.title||b.providerName||""),s=R(()=>b.categoryLabel||y("settings.pages.providers.title"));function f(){b.onBack&&b.onBack(),c("back")}return(l,v)=>{const r=ie("motion");return d(),h("div",null,[U(l.$slots,"header",{},()=>[q((d(),h("div",ke,[U(l.$slots,"backButton",{},()=>[t("button",{onClick:f},v[0]||(v[0]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)]))]),t("div",null,[U(l.$slots,"title",{},()=>[t("h1",Se,[s.value?(d(),h("div",Ve,[t("span",we,k(s.value),1)])):V("",!0),t("div",Ue,k(w.value),1)])]),U(l.$slots,"subtitle",{},()=>[a.subtitle?(d(),h("div",$e,k(a.subtitle),1)):V("",!0)])]),U(l.$slots,"headerExtra")])),[[r]])]),U(l.$slots,"default"),t("div",_e,[t("div",{text:"40",class:Y(a.providerIcon||a.providerIconColor)},null,2)])])}}}),Ie={"w-full":"","rounded-xl":""},Le={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Te={class:"inline-flex items-center gap-4"},Me={flex:"~ col gap-4"},Pe=["placeholder"],Ce=["placeholder"],Re={flex:"~ col gap-6"},Oe={grid:"~ cols-2 gap-4"},qe={class:"flex items-center gap-1 text-sm font-medium"},Ke={class:"text-xs text-neutral-500 dark:text-neutral-400"},ze=["value"],Ne={grid:"~ cols-2 gap-4"},Ee={class:"flex items-center gap-1 text-sm font-medium"},Fe={class:"text-xs text-neutral-500 dark:text-neutral-400"},je=["value"],De={flex:"~ row","gap-4":""},Ae=["disabled"],Ge={flex:"~ row","items-center":"","gap-2":""},He={flex:"~ row","items-center":"","gap-2":""},Je={key:2,class:"mt-2 text-sm text-red-500"},Qe={key:3,class:"mt-2 text-sm text-red-500"},We={key:4,class:"mt-2 text-sm text-red-500"},Xe=["src"],ct=N({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,availableLanguages:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(a,{expose:i}){const b=a,{t:c}=E(),y=x(b.defaultText||"Hello! This is a test of the voice synthesis."),w=x(!1),s=x(""),f=x(""),l=x(null),v=x(!1),r=x(""),n=x(b.availableLanguages[0]||"en-US"),g=x("");j(()=>b.availableVoices,S=>{var p;S.length>0&&!g.value&&(g.value=((p=S[0])==null?void 0:p.id)||"")},{immediate:!0});async function P(){if(!(!y.value.trim()&&!v.value||v.value&&!r.value.trim()||!g.value)){w.value=!0,f.value="";try{s.value&&$();const S=v.value?r.value:y.value,p=await b.generateSpeech(S,g.value,v.value);s.value=URL.createObjectURL(new Blob([p])),setTimeout(()=>{l.value&&l.value.play()},100)}catch(S){console.error("Error generating speech:",S),f.value=S instanceof Error?S.message:"An unknown error occurred"}finally{w.value=!1}}}function $(){l.value&&(l.value.pause(),l.value.currentTime=0),s.value&&(URL.revokeObjectURL(s.value),s.value="")}return Z(()=>{s.value&&URL.revokeObjectURL(s.value)}),i({testText:y,ssmlText:r,useSSML:v,selectedLanguage:n,selectedVoice:g,isGenerating:w,audioUrl:s,errorMessage:f,audioPlayer:l,generateTestSpeech:P,stopTestAudio:$}),(S,p)=>(d(),h("div",Ie,[t("h2",Le,[t("div",Te,[M(e(pe)),t("div",null,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),t("div",Me,[M(e(ee),{modelValue:v.value,"onUpdate:modelValue":p[0]||(p[0]=m=>v.value=m),label:e(c)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:e(c)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),v.value?q((d(),h("textarea",{key:1,"onUpdate:modelValue":p[2]||(p[2]=m=>r.value=m),placeholder:e(c)("settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-48":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","font-mono":"","outline-none":""},null,8,Ce)),[[G,r.value]]):q((d(),h("textarea",{key:0,"onUpdate:modelValue":p[1]||(p[1]=m=>y.value=m),placeholder:e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,Pe)),[[G,y.value]]),t("div",Re,[t("label",Oe,[t("div",null,[t("div",qe,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.language.label")),1),t("div",Ke,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.language.description")),1)]),q(t("select",{"onUpdate:modelValue":p[3]||(p[3]=m=>n.value=m),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(d(!0),h(J,null,Q(a.availableLanguages,m=>(d(),h("option",{key:m,value:m},k(m),9,ze))),128))],512),[[H,n.value]])]),t("label",Ne,[t("div",null,[t("div",Ee,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),t("div",Fe,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),q(t("select",{"onUpdate:modelValue":p[4]||(p[4]=m=>g.value=m),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(d(!0),h(J,null,Q(a.availableVoices,m=>(d(),h("option",{key:m.id,value:m.id},k(m.name),9,je))),128))],512),[[H,g.value]])])]),t("div",De,[t("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:w.value||!y.value.trim()&&!v.value||v.value&&!r.value.trim()||!g.value||!a.apiKeyConfigured,class:Y({"opacity-50 cursor-not-allowed":w.value||!y.value.trim()&&!v.value||v.value&&!r.value.trim()||!g.value||!a.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:P},[t("div",Ge,[p[5]||(p[5]=t("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),t("span",null,k(w.value?e(c)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):e(c)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Ae),s.value?(d(),h("button",{key:0,border:"primary-300 dark:primary-800 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"","py-2":"","text-sm":"",onClick:$},[t("div",He,[p[6]||(p[6]=t("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),t("span",null,k(e(c)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):V("",!0)]),a.apiKeyConfigured?V("",!0):(d(),h("div",Je,k(e(c)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),g.value?V("",!0):(d(),h("div",Qe,k(e(c)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),f.value?(d(),h("div",We,k(f.value),1)):V("",!0),s.value?(d(),h("audio",{key:5,ref_key:"audioPlayer",ref:l,src:s.value,controls:"",class:"mt-2 w-full"},null,8,Xe)):V("",!0)]),U(S.$slots,"default")]))}}),Ye={flex:"~ col md:row gap-6"},Ze={flex:"~ col gap-6"},et={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},tt={flex:"~ col gap-4"},lt={flex:"~ col gap-6",class:"w-full md:w-[60%]"},st={"w-full":"","rounded-xl":""},mt=N({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(a){const i=a,{t:b}=E(),c=re(),y=fe(),w=ce(),{providers:s}=ne(y),f=R(()=>y.getProviderMetadata(i.providerId)),l=R({get:()=>{var o;return((o=s.value[i.providerId])==null?void 0:o.apiKey)||""},set:o=>{s.value[i.providerId]||(s.value[i.providerId]={}),s.value[i.providerId].apiKey=o}}),v=R({get:()=>{var o,u,_;return((o=s.value[i.providerId])==null?void 0:o.baseUrl)||((_=(u=f.value)==null?void 0:u.defaultOptions)==null?void 0:_.baseUrl)||""},set:o=>{s.value[i.providerId]||(s.value[i.providerId]={}),s.value[i.providerId].baseUrl=o}}),r=x("Hello! This is a test of voice synthesis."),n=x(!1),g=x(""),P=x(""),$=x(null),S=x(!1),p=x(""),m=x(""),B=x({});function te(){var o;(o=s.value[i.providerId])!=null&&o.voiceSettings?B.value={...s.value[i.providerId].voiceSettings}:B.value={pitch:0,speed:1,volume:0,...i.additionalSettings}}de(()=>{var o,u,_,L;y.initializeProvider(i.providerId),l.value=((o=s.value[i.providerId])==null?void 0:o.apiKey)||"",v.value=((u=s.value[i.providerId])==null?void 0:u.baseUrl)||((L=(_=f.value)==null?void 0:_.defaultOptions)==null?void 0:L.baseUrl)||"",te(),y.configuredProviders[i.providerId]&&w.loadVoicesForProvider(i.providerId)});const F=ue(()=>{var o,u;s.value[i.providerId]={...s.value[i.providerId],apiKey:l.value,baseUrl:v.value||((u=(o=f.value)==null?void 0:o.defaultOptions)==null?void 0:u.baseUrl)||"",voiceSettings:{...B.value}}},1e3);j([l,v],F),j(B,F,{deep:!0});async function le(){if(!r.value.trim()&&!S.value||S.value&&!p.value.trim())return;const o=y.getProviderInstance(i.providerId);if(!o){console.error("Failed to initialize speech provider");return}if(!m.value){console.error("No active speech voice selected");return}n.value=!0,P.value="";try{g.value&&D();const u=i.defaultModel||"default",_=S.value?p.value:r.value,L=await me({...o.speech(u,{voiceSettings:B.value}),input:_,voice:m.value});g.value=URL.createObjectURL(new Blob([L])),setTimeout(()=>{$.value&&$.value.play()},100)}catch(u){console.error("Error generating speech:",u),P.value=u instanceof Error?u.message:"An unknown error occurred"}finally{n.value=!1}}function D(){$.value&&($.value.pause(),$.value.currentTime=0),g.value&&(URL.revokeObjectURL(g.value),g.value="")}Z(()=>{g.value&&URL.revokeObjectURL(g.value)});function se(){var o,u;B.value={...((u=(o=f.value)==null?void 0:o.defaultOptions)==null?void 0:u.voiceSettings)||{}},F()}function oe(o,u){B.value[o]=u}const A=R(()=>({voiceSettings:B.value,updateVoiceSettings:oe,isGenerating:n.value,testText:r.value,useSSML:S.value,ssmlText:p.value,generateTestSpeech:le,stopTestAudio:D,audioUrl:g.value,audioPlayer:$.value,errorMessage:P.value}));return(o,u)=>{var _,L;return d(),I(Be,{"provider-name":(_=f.value)==null?void 0:_.localizedName,"provider-icon":(L=f.value)==null?void 0:L.icon,"on-back":()=>e(c).back()},{default:z(()=>[t("div",Ye,[M(e(xe),{class:"w-full md:w-[40%]"},{default:z(()=>[M(e(he),{title:e(b)("settings.pages.providers.common.section.basic.title"),description:e(b)("settings.pages.providers.common.section.basic.description"),"on-reset":se},{default:z(()=>{var O;return[M(e(ye),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=K=>l.value=K),"provider-name":(O=f.value)==null?void 0:O.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),U(o.$slots,"basic-settings")]}),_:3},8,["title","description"]),t("div",Ze,[t("h2",et,k(e(b)("settings.pages.providers.common.section.voice.title")),1),t("div",tt,[U(o.$slots,"voice-settings",W(X(A.value)))])]),M(e(ge),{title:e(b)("settings.pages.providers.common.section.advanced.title")},{default:z(()=>{var O,K;return[M(e(be),{modelValue:v.value,"onUpdate:modelValue":u[1]||(u[1]=ae=>v.value=ae),placeholder:((K=(O=f.value)==null?void 0:O.defaultOptions)==null?void 0:K.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),U(o.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),t("div",lt,[t("div",st,[U(o.$slots,"playground",W(X(A.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}}),ot={flex:"~ col gap-4"},ft=N({__name:"SpeechVoiceSettings",props:ve({settings:null,showPitch:{type:Boolean},showSpeed:{type:Boolean},showStyle:{type:Boolean},showStability:{type:Boolean},showSimilarityBoost:{type:Boolean},showVolume:{type:Boolean},showSpeakerBoost:{type:Boolean}},{pitch:{required:!1,default:0},pitchModifiers:{},speed:{required:!1,default:1},speedModifiers:{},volume:{required:!1,default:0},volumeModifiers:{},style:{required:!1,default:0},styleModifiers:{},stability:{required:!1,default:.5},stabilityModifiers:{},similarityBoost:{required:!1,default:.75},similarityBoostModifiers:{},useSpeakerBoost:{type:Boolean,required:!1,default:!1},useSpeakerBoostModifiers:{}}),emits:["update:pitch","update:speed","update:volume","update:style","update:stability","update:similarityBoost","update:useSpeakerBoost"],setup(a){const i=T(a,"pitch"),b=T(a,"speed"),c=T(a,"volume"),y=T(a,"style"),w=T(a,"stability"),s=T(a,"similarityBoost"),f=T(a,"useSpeakerBoost"),{t:l}=E();return(v,r)=>(d(),h("div",ot,[a.showPitch?(d(),I(e(C),{key:0,modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=n=>i.value=n),label:e(l)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:e(l)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":n=>`${n}%`},null,8,["modelValue","label","description","format-value"])):V("",!0),a.showSpeed?(d(),I(e(C),{key:1,modelValue:b.value,"onUpdate:modelValue":r[1]||(r[1]=n=>b.value=n),label:e(l)("settings.pages.providers.provider.common.fields.field.speed.label"),description:e(l)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])):V("",!0),a.showVolume?(d(),I(e(C),{key:2,modelValue:c.value,"onUpdate:modelValue":r[2]||(r[2]=n=>c.value=n),label:e(l)("settings.pages.providers.provider.common.fields.field.volume.label"),description:e(l)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":n=>`${n}%`},null,8,["modelValue","label","description","format-value"])):V("",!0),a.showStyle?(d(),I(e(C),{key:3,modelValue:y.value,"onUpdate:modelValue":r[3]||(r[3]=n=>y.value=n),label:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"])):V("",!0),a.showStability?(d(),I(e(C),{key:4,modelValue:w.value,"onUpdate:modelValue":r[4]||(r[4]=n=>w.value=n),label:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"])):V("",!0),a.showSimilarityBoost?(d(),I(e(C),{key:5,modelValue:s.value,"onUpdate:modelValue":r[5]||(r[5]=n=>s.value=n),label:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"])):V("",!0),a.showSpeakerBoost?(d(),I(e(ee),{key:6,modelValue:f.value,"onUpdate:modelValue":r[6]||(r[6]=n=>f.value=n),label:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:e(l)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])):V("",!0),U(v.$slots,"default")]))}});export{ct as _,ft as a,mt as b}; diff --git a/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-CGhOEjXF.js b/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-CGhOEjXF.js deleted file mode 100644 index 9193266455b19a68269402727c44ecff34005cd6..0000000000000000000000000000000000000000 --- a/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-CGhOEjXF.js +++ /dev/null @@ -1 +0,0 @@ -import{bx as q,d as c,c2 as T,bV as k,c3 as I,b$ as E,x as b,o as m,y as _,m as w,e as d,b_ as L,cc as N,g as V,h,cd as M,bX as D,ce as z,w as U,c as x,by as H,E as K,cf as G,C as X,cg as W,bJ as Y,bL as C,b as $,bK as B,a as v,D as g,l as A,A as J,bF as Q,bn as j,n as F,br as S,H as Z}from"./index-BYewP6KR.js";function O(t){return t?t.flatMap(e=>e.type===q?O(e.children):[e]):[]}const ee=c({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var f,p;if(!n.default)return null;const a=O(n.default()),o=a.findIndex(i=>i.type!==T);if(o===-1)return a;const r=a[o];(f=r.props)==null||delete f.ref;const l=r.props?k(e,r.props):e;e.class&&((p=r.props)!=null&&p.class)&&delete r.props.class;const u=I(r,l);for(const i in l)i.startsWith("on")&&(u.props||(u.props={}),u.props[i]=l[i]);return a.length===1?u:(a[o]=u,a)}}}),P=c({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const a=t.asChild?"template":t.as;return typeof a=="string"&&["area","img","input"].includes(a)?()=>E(a,e):a!=="template"?()=>E(t.as,e,{default:n.default}):()=>E(ee,e,{default:n.default})}}),te=c({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,n)=>(m(),b(d(P),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:_(()=>[w(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function ae(t,e){const n=`${t}Context`,a=Symbol(n);return[l=>{const u=L(a,l);if(u||u===null)return u;throw new Error(`Injection \`${a.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},l=>(N(a,l),l)]}function R(){const t=D(),e=V(),n=h(()=>{var l,u;return["#text","#comment"].includes((l=e.value)==null?void 0:l.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:M(e)}),a=Object.assign({},t.exposed),o={};for(const l in t.props)Object.defineProperty(o,l,{enumerable:!0,configurable:!0,get:()=>t.props[l]});if(Object.keys(a).length>0)for(const l in a)Object.defineProperty(o,l,{enumerable:!0,configurable:!0,get:()=>a[l]});Object.defineProperty(o,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=o;function r(l){e.value=l,l&&(Object.defineProperty(o,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),t.exposed=o)}return{forwardRef:r,currentRef:e,currentElement:n}}function ne(){const t=V(),e=h(()=>{var n,a;return["#text","#comment"].includes((n=t.value)==null?void 0:n.$el.nodeName)?(a=t.value)==null?void 0:a.$el.nextElementSibling:M(t)});return{primitiveElement:t,currentElement:e}}function le(t){return h(()=>{var e;return z(t)?!!((e=M(t))!=null&&e.closest("form")):!0})}const oe=c({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:n,currentElement:a}=ne(),o=h(()=>e.checked??e.value);return U(o,(r,l)=>{if(!a.value)return;const u=a.value,f=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(f,"value").set;if(i&&r!==l){const s=new Event("input",{bubbles:!0}),y=new Event("change",{bubbles:!0});i.call(u,r),u.dispatchEvent(s),u.dispatchEvent(y)}}),(r,l)=>(m(),b(te,k({ref_key:"primitiveElement",ref:n},{...e,...r.$attrs},{as:"input"}),null,16))}}),re=c({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,n=h(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((a,o)=>typeof a=="object"?Object.entries(a).map(([r,l])=>({name:`[${e.name}][${o}][${r}]`,value:l})):{name:`[${e.name}][${o}]`,value:a}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([a,o])=>({name:`[${e.name}][${a}]`,value:o})):[]);return(a,o)=>(m(!0),x(q,null,H(n.value,r=>(m(),b(oe,k({key:r.name,ref_for:!0},{...e,...a.$attrs},{name:r.name,value:r.value}),null,16,["name","value"]))),128))}}),[se,ue]=ae("SwitchRoot"),ie=c({__name:"SwitchRoot",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null],default:void 0},disabled:{type:Boolean},id:{},value:{default:"on"},asChild:{type:Boolean},as:{default:"button"},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,{disabled:o}=K(n),r=G(n,"modelValue",a,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function l(){o.value||(r.value=!r.value)}const{forwardRef:u,currentElement:f}=R(),p=le(f),i=h(()=>{var s;return n.id&&f.value?(s=document.querySelector(`[for="${n.id}"]`))==null?void 0:s.innerText:void 0});return ue({modelValue:r,toggleCheck:l,disabled:o}),(s,y)=>(m(),b(d(P),k(s.$attrs,{id:s.id,ref:d(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||i.value,"aria-checked":d(r),"aria-required":s.required,"data-state":d(r)?"checked":"unchecked","data-disabled":d(o)?"":void 0,"as-child":s.asChild,as:s.as,disabled:d(o),onClick:l,onKeydown:W(Y(l,["prevent"]),["enter"])}),{default:_(()=>[w(s.$slots,"default",{modelValue:d(r)}),d(p)&&s.name?(m(),b(d(re),{key:0,type:"checkbox",name:s.name,disabled:d(o),required:s.required,value:s.value,checked:!!d(r)},null,8,["name","disabled","required","value","checked"])):X("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),de=c({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=se();return R(),(n,a)=>{var o;return m(),b(d(P),{"data-state":(o=d(e).modelValue)!=null&&o.value?"checked":"unchecked","data-disabled":d(e).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},{default:_(()=>[w(n.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),ce=c({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=C(t,"modelValue");return(n,a)=>(m(),b(d(ie),{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),transition:"background duration-250 ease-in-out",outline:"focus-within:none",flex:"~",border:"neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800",bg:"data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800",relative:"","h-7":"",w:"12.5","rounded-full":"",shadow:"sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] "},{default:_(()=>[$(d(de),{"my-auto":"","size-6":"",flex:"","items-center":"","justify-center":"","translate-x":"0.5 data-[state=checked]:full","rounded-full":"","bg-white":"","text-xs":"","shadow-xl":"",transition:"transform duration-250 ease-in-out","will-change-transform":""})]),_:1},8,["modelValue"]))}}),me={flex:"~ col gap-4"},fe={flex:"~ row","items-center":"","gap-2":""},pe={flex:"1"},ve={class:"flex items-center gap-1 text-sm font-medium"},he={class:"text-xs text-neutral-500 dark:text-neutral-400"},Pe=c({__name:"FieldCheckbox",props:B({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(a,o)=>(m(),x("label",me,[v("div",fe,[v("div",pe,[v("div",ve,g(e.label),1),v("div",he,g(e.description),1)]),$(ce,{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=r=>n.value=r)},null,8,["modelValue"])])]))}}),be=["min","max","step"],ye=c({__name:"Range",props:B({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue"),a=h(()=>e.min*1e4),o=h(()=>e.max*1e4),r=h(()=>e.step*1e4),l=V(),u=h({get:()=>n.value*1e4,set:p=>{n.value=p/1e4,f()}});A(()=>{f()});function f(){l.value&&(l.value.style.setProperty("--value",l.value.value),l.value.style.setProperty("--min",l.value.min?l.value.min:e.min.toString()),l.value.style.setProperty("--max",l.value.max?l.value.max:e.max.toString()))}return(p,i)=>J((m(),x("input",{ref_key:"sliderRef",ref:l,"onUpdate:modelValue":i[0]||(i[0]=s=>u.value=s),type:"range",min:a.value,max:o.value,step:r.value,class:"slider-progress form_input-range",onInput:i[1]||(i[1]=s=>{s.target.style.setProperty("--value",s.target.value)})},null,40,be)),[[Q,u.value,void 0,{number:!0}]])}}),_e=j(ye,[["__scopeId","data-v-6ca6d31c"]]),xe={flex:"~ col gap-4"},ge={flex:"~ row","items-center":"","gap-2":""},Ve={flex:"1"},$e={class:"flex items-center gap-1 text-sm font-medium"},we={class:"text-xs text-neutral-500 dark:text-neutral-400"},ke={"font-mono":""},Ce={flex:"~ row","items-center":"","gap-2":""},qe=c({__name:"FieldRange",props:B({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(a,o)=>{var r;return m(),x("label",xe,[v("div",ge,[v("div",Ve,[v("div",$e,g(t.label),1),v("div",we,g(t.description),1)]),v("span",ke,g(((r=e.formatValue)==null?void 0:r.call(e,n.value))||n.value),1)]),v("div",Ce,[$(_e,{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}}),Ee=c({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,n)=>(m(),x("div",{class:"volumed",style:F({perspective:`${t.perspective}px`,transform:t.transform})},[w(e.$slots,"default",{},void 0,!0)],4))}}),Se=j(Ee,[["__scopeId","data-v-568551bc"]]),Me=c({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const n=t,a=V(1),o=V(0);let r=0;const l=S(()=>n.friction),u=S(()=>n.baseSpeed),f=S(()=>n.momentumFactor);function p(s){r||(r=s);const y=s-r;r=s,a.value=u.value+(a.value-u.value)*l.value,o.value+=a.value*y,requestAnimationFrame(p)}function i(s){const y=Math.sqrt(s.movementX**2+s.movementY**2);a.value+=y*f.value}return A(()=>{window.addEventListener("mousemove",i),requestAnimationFrame(p)}),Z(()=>{window.removeEventListener("mousemove",i)}),e({momentum:a,currentValue:o}),(s,y)=>w(s.$slots,"default",{momentum:a.value,currentValue:o.value})}}),Be=c({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,n)=>(m(),x("div",{class:"test-dummy-flat",style:F({width:`${t.size}px`,height:`${t.size}px`})},n[0]||(n[0]=[v("div",{class:"marker"},null,-1)]),4))}}),je=j(Be,[["__scopeId","data-v-b4ef37ac"]]),Ae=c({__name:"TestDummyMarker",setup(t){return(e,n)=>(m(),b(Me,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:a})=>[$(Se,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[$(je,{size:24,style:F({transform:`rotate(${a}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});export{qe as _,Pe as a,Ae as b}; diff --git a/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-D5aCIkT4.js b/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-D5aCIkT4.js new file mode 100644 index 0000000000000000000000000000000000000000..7b059ed39709c5572b2c582422eed812c219644b --- /dev/null +++ b/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-D5aCIkT4.js @@ -0,0 +1 @@ +import{bx as P,d as m,c2 as I,bV as V,c3 as D,b$ as E,x as y,o as c,y as _,m as k,e as d,b_ as N,cc as L,g as $,h,cd as M,bX as z,ce as U,w as H,c as g,by as K,E as X,cf as G,C as W,cg as Y,bJ as J,bL as C,b as w,bK as B,a as v,D as x,l as R,A as Q,bF as Z,bn as j,n as A,br as S,H as ee}from"./index-CL4rmUJ-.js";function O(t){return t?t.flatMap(e=>e.type===P?O(e.children):[e]):[]}const te=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var p,f;if(!n.default)return null;const o=O(n.default()),l=o.findIndex(i=>i.type!==I);if(l===-1)return o;const r=o[l];(p=r.props)==null||delete p.ref;const a=r.props?V(e,r.props):e;e.class&&((f=r.props)!=null&&f.class)&&delete r.props.class;const u=D(r,a);for(const i in a)i.startsWith("on")&&(u.props||(u.props={}),u.props[i]=a[i]);return o.length===1?u:(o[l]=u,o)}}}),ae=["area","img","input"],q=m({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const o=t.asChild?"template":t.as;return typeof o=="string"&&ae.includes(o)?()=>E(o,e):o!=="template"?()=>E(t.as,e,{default:n.default}):()=>E(te,e,{default:n.default})}}),ne=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,n)=>(c(),y(d(q),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:_(()=>[k(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function le(t,e){const n=`${t}Context`,o=Symbol(n);return[a=>{const u=N(o,a);if(u||u===null)return u;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},a=>(L(o,a),a)]}function T(){const t=z(),e=$(),n=h(()=>{var a,u;return["#text","#comment"].includes((a=e.value)==null?void 0:a.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:M(e)}),o=Object.assign({},t.exposed),l={};for(const a in t.props)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(o).length>0)for(const a in o)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>o[a]});Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=l;function r(a){e.value=a,a&&(Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),t.exposed=l)}return{forwardRef:r,currentRef:e,currentElement:n}}function oe(){const t=$(),e=h(()=>{var n,o;return["#text","#comment"].includes((n=t.value)==null?void 0:n.$el.nodeName)?(o=t.value)==null?void 0:o.$el.nextElementSibling:M(t)});return{primitiveElement:t,currentElement:e}}function re(t){return h(()=>{var e;return U(t)?!!((e=M(t))!=null&&e.closest("form")):!0})}const F=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:n,currentElement:o}=oe(),l=h(()=>e.checked??e.value);return H(l,(r,a)=>{if(!o.value)return;const u=o.value,p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"value").set;if(i&&r!==a){const s=new Event("input",{bubbles:!0}),b=new Event("change",{bubbles:!0});i.call(u,r),u.dispatchEvent(s),u.dispatchEvent(b)}}),(r,a)=>(c(),y(ne,V({ref_key:"primitiveElement",ref:n},{...e,...r.$attrs},{as:"input"}),null,16))}}),se=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,n=h(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),o=h(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((l,r)=>typeof l=="object"?Object.entries(l).map(([a,u])=>({name:`[${e.name}][${r}][${a}]`,value:u})):{name:`[${e.name}][${r}]`,value:l}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([l,r])=>({name:`[${e.name}][${l}]`,value:r})):[]);return(l,r)=>n.value?(c(),y(F,V({key:l.name},{...e,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(c(!0),g(P,{key:1},K(o.value,a=>(c(),y(F,V({key:a.name,ref_for:!0},{...e,...l.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))}}),[ue,ie]=le("SwitchRoot"),de=m({__name:"SwitchRoot",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null],default:void 0},disabled:{type:Boolean},id:{},value:{default:"on"},asChild:{type:Boolean},as:{default:"button"},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,{disabled:l}=X(n),r=G(n,"modelValue",o,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function a(){l.value||(r.value=!r.value)}const{forwardRef:u,currentElement:p}=T(),f=re(p),i=h(()=>{var s;return n.id&&p.value?(s=document.querySelector(`[for="${n.id}"]`))==null?void 0:s.innerText:void 0});return ie({modelValue:r,toggleCheck:a,disabled:l}),(s,b)=>(c(),y(d(q),V(s.$attrs,{id:s.id,ref:d(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||i.value,"aria-checked":d(r),"aria-required":s.required,"data-state":d(r)?"checked":"unchecked","data-disabled":d(l)?"":void 0,"as-child":s.asChild,as:s.as,disabled:d(l),onClick:a,onKeydown:Y(J(a,["prevent"]),["enter"])}),{default:_(()=>[k(s.$slots,"default",{modelValue:d(r)}),d(f)&&s.name?(c(),y(d(se),{key:0,type:"checkbox",name:s.name,disabled:d(l),required:s.required,value:s.value,checked:!!d(r)},null,8,["name","disabled","required","value","checked"])):W("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),ce=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=ue();return T(),(n,o)=>{var l;return c(),y(d(q),{"data-state":(l=d(e).modelValue)!=null&&l.value?"checked":"unchecked","data-disabled":d(e).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},{default:_(()=>[k(n.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),me=m({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=C(t,"modelValue");return(n,o)=>(c(),y(d(de),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),transition:"background duration-250 ease-in-out",outline:"focus-within:none",flex:"~",border:"neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800",bg:"data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800",relative:"","h-7":"",w:"12.5","rounded-full":"",shadow:"sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] "},{default:_(()=>[w(d(ce),{"my-auto":"","size-6":"",flex:"","items-center":"","justify-center":"","translate-x":"0.5 data-[state=checked]:full","rounded-full":"","bg-white":"","text-xs":"","shadow-xl":"",transition:"transform duration-250 ease-in-out","will-change-transform":""})]),_:1},8,["modelValue"]))}}),pe={flex:"~ col gap-4"},fe={flex:"~ row","items-center":"","gap-2":""},ve={flex:"1"},he={class:"flex items-center gap-1 text-sm font-medium"},ye={class:"text-xs text-neutral-500 dark:text-neutral-400"},Fe=m({__name:"FieldCheckbox",props:B({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>(c(),g("label",pe,[v("div",fe,[v("div",ve,[v("div",he,x(e.label),1),v("div",ye,x(e.description),1)]),w(me,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r)},null,8,["modelValue"])])]))}}),be=["min","max","step"],_e=m({__name:"Range",props:B({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue"),o=h(()=>e.min*1e4),l=h(()=>e.max*1e4),r=h(()=>e.step*1e4),a=$(),u=h({get:()=>n.value*1e4,set:f=>{n.value=f/1e4,p()}});R(()=>{p()});function p(){a.value&&(a.value.style.setProperty("--value",a.value.value),a.value.style.setProperty("--min",a.value.min?a.value.min:e.min.toString()),a.value.style.setProperty("--max",a.value.max?a.value.max:e.max.toString()))}return(f,i)=>Q((c(),g("input",{ref_key:"sliderRef",ref:a,"onUpdate:modelValue":i[0]||(i[0]=s=>u.value=s),type:"range",min:o.value,max:l.value,step:r.value,class:"slider-progress form_input-range",onInput:i[1]||(i[1]=s=>{s.target.style.setProperty("--value",s.target.value)})},null,40,be)),[[Z,u.value,void 0,{number:!0}]])}}),ge=j(_e,[["__scopeId","data-v-6ca6d31c"]]),xe={flex:"~ col gap-4"},Ve={flex:"~ row","items-center":"","gap-2":""},$e={flex:"1"},we={class:"flex items-center gap-1 text-sm font-medium"},ke={class:"text-xs text-neutral-500 dark:text-neutral-400"},Ce={"font-mono":""},Ee={flex:"~ row","items-center":"","gap-2":""},Pe=m({__name:"FieldRange",props:B({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>{var r;return c(),g("label",xe,[v("div",Ve,[v("div",$e,[v("div",we,x(t.label),1),v("div",ke,x(t.description),1)]),v("span",Ce,x(((r=e.formatValue)==null?void 0:r.call(e,n.value))||n.value),1)]),v("div",Ee,[w(ge,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}}),Se=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,n)=>(c(),g("div",{class:"volumed",style:A({perspective:`${t.perspective}px`,transform:t.transform})},[k(e.$slots,"default",{},void 0,!0)],4))}}),Me=j(Se,[["__scopeId","data-v-568551bc"]]),Be=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const n=t,o=$(1),l=$(0);let r=0;const a=S(()=>n.friction),u=S(()=>n.baseSpeed),p=S(()=>n.momentumFactor);function f(s){r||(r=s);const b=s-r;r=s,o.value=u.value+(o.value-u.value)*a.value,l.value+=o.value*b,requestAnimationFrame(f)}function i(s){const b=Math.sqrt(s.movementX**2+s.movementY**2);o.value+=b*p.value}return R(()=>{window.addEventListener("mousemove",i),requestAnimationFrame(f)}),ee(()=>{window.removeEventListener("mousemove",i)}),e({momentum:o,currentValue:l}),(s,b)=>k(s.$slots,"default",{momentum:o.value,currentValue:l.value})}}),je=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,n)=>(c(),g("div",{class:"test-dummy-flat",style:A({width:`${t.size}px`,height:`${t.size}px`})},n[0]||(n[0]=[v("div",{class:"marker"},null,-1)]),4))}}),Ae=j(je,[["__scopeId","data-v-b4ef37ac"]]),Re=m({__name:"TestDummyMarker",setup(t){return(e,n)=>(c(),y(Be,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:o})=>[w(Me,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[w(Ae,{size:24,style:A({transform:`rotate(${o}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});export{Pe as _,Fe as a,Re as b}; diff --git a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js similarity index 93% rename from assets/TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js rename to assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js index f8b790b96e90fc6c1062c81457eb30887c2a4b19..4a7fda2aa40a4299cb0d4d983c87f48628901cc5 100644 --- a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js +++ b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js @@ -1 +1 @@ -import{d as m,x as T,o as l,bB as B,y as b,m as v}from"./index-BYewP6KR.js";const n="0px",W=m({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(c){const r=c;function p(o){return{height:o.style.height,width:o.style.width,position:o.style.position,visibility:o.style.visibility,overflow:o.style.overflow,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,borderTopWidth:o.style.borderTopWidth,borderBottomWidth:o.style.borderBottomWidth,marginTop:o.style.marginTop,marginBottom:o.style.marginBottom}}function y(o,t){const{width:i}=getComputedStyle(o);o.style.width=i,o.style.position="absolute",o.style.visibility="hidden",o.style.height="";const{height:s}=getComputedStyle(o);return o.style.width=t.width,o.style.position=t.position,o.style.visibility=t.visibility,o.style.height=n,o.style.overflow="hidden",t.height&&t.height!==n?t.height:s}function h(o,t,i,s,d){const e=o.animate(s,d);o.style.height=t.height,e.onfinish=()=>{o.style.overflow=t.overflow,i()}}function g(o,t){return[{height:n,opacity:r.opacityClosed,paddingTop:n,paddingBottom:n,borderTopWidth:n,borderBottomWidth:n,marginTop:n,marginBottom:n},{height:o,opacity:r.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function u(o,t){const i=o,s=p(i),d=y(i,s),e=g(d,s),a={duration:r.duration,easing:r.easingEnter};h(i,s,t,e,a)}function f(o,t){const i=o,s=p(i),{height:d}=getComputedStyle(i);i.style.height=d,i.style.overflow="hidden";const e=g(d,s).reverse(),a={duration:r.duration,easing:r.easingLeave};h(i,s,t,e,a)}return(o,t)=>(l(),T(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; +import{d as m,x as T,o as l,bB as B,y as b,m as v}from"./index-CL4rmUJ-.js";const n="0px",W=m({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(c){const r=c;function p(o){return{height:o.style.height,width:o.style.width,position:o.style.position,visibility:o.style.visibility,overflow:o.style.overflow,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,borderTopWidth:o.style.borderTopWidth,borderBottomWidth:o.style.borderBottomWidth,marginTop:o.style.marginTop,marginBottom:o.style.marginBottom}}function y(o,t){const{width:i}=getComputedStyle(o);o.style.width=i,o.style.position="absolute",o.style.visibility="hidden",o.style.height="";const{height:s}=getComputedStyle(o);return o.style.width=t.width,o.style.position=t.position,o.style.visibility=t.visibility,o.style.height=n,o.style.overflow="hidden",t.height&&t.height!==n?t.height:s}function h(o,t,i,s,d){const e=o.animate(s,d);o.style.height=t.height,e.onfinish=()=>{o.style.overflow=t.overflow,i()}}function g(o,t){return[{height:n,opacity:r.opacityClosed,paddingTop:n,paddingBottom:n,borderTopWidth:n,borderBottomWidth:n,marginTop:n,marginBottom:n},{height:o,opacity:r.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function u(o,t){const i=o,s=p(i),d=y(i,s),e=g(d,s),a={duration:r.duration,easing:r.easingEnter};h(i,s,t,e,a)}function f(o,t){const i=o,s=p(i),{height:d}=getComputedStyle(i);i.style.height=d,i.style.overflow="hidden";const e=g(d,s).reverse(),a={duration:r.duration,easing:r.easingLeave};h(i,s,t,e,a)}return(o,t)=>(l(),T(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; diff --git a/assets/_...all_-8bDQaOJn.js b/assets/_...all_-CSvu3bhX.js similarity index 64% rename from assets/_...all_-8bDQaOJn.js rename to assets/_...all_-CSvu3bhX.js index 914e3a92e0252ef637b71b3ee764a8b527042186..d8fa9ef8b7fd80c94d37e36a4cd26d1de08ece3e 100644 --- a/assets/_...all_-8bDQaOJn.js +++ b/assets/_...all_-CSvu3bhX.js @@ -1 +1 @@ -import{bn as e,c as n,o as c}from"./index-BYewP6KR.js";const o={};function _(t,r){return c(),n("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; +import{bn as e,c as n,o as c}from"./index-CL4rmUJ-.js";const o={};function _(t,r){return c(),n("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; diff --git a/assets/airi-card-BM-9G8yH.js b/assets/airi-card-CWMQJScT.js similarity index 94% rename from assets/airi-card-BM-9G8yH.js rename to assets/airi-card-CWMQJScT.js index 950c1bdf8147a0e899726e702e1259b17522460f..0e659311096fa0fbee170e90cec778de48de212a 100644 --- a/assets/airi-card-BM-9G8yH.js +++ b/assets/airi-card-CWMQJScT.js @@ -1,4 +1,4 @@ -import{f as $,bI as L,h as g,s as O,l as b,q,w as D}from"./index-BYewP6KR.js";import{j as G}from"./live2d-zip-loader-CvpgOHsT.js";import{u as H}from"./consciousness-MUz60a06.js";import{u as N}from"./speech-CLmksxkl.js";function k(a,u){return{role:"system",content:[a,G.map(n=>`- ${n}`).join(` +import{f as $,bI as L,h as g,s as O,l as b,q,w as D}from"./index-CL4rmUJ-.js";import{j as G}from"./live2d-zip-loader-DFrBymqv.js";import{u as H}from"./consciousness-nHboP4iV.js";import{u as N}from"./speech-Ae5ywnpY.js";function k(a,u){return{role:"system",content:[a,G.map(n=>`- ${n}`).join(` `),u].join(` `)}}const Q=$("airi-card",()=>{const a=L("airi-cards",new Map),u=L("airi-card-active-id","default"),n=g(()=>a.value.get(u.value)),P=H(),R=N(),{activeModel:l}=O(P),{activeSpeechVoiceId:m,activeSpeechModel:p}=O(R),B=s=>{const e=crypto.randomUUID();return a.value.set(e,h(s)),e},V=s=>{a.value.delete(s)},W=s=>a.value.get(s);function v(s){var t,r,i,c,d,f,_,y,S,x,C,I,M,w,E,A,j,T,U;const e="data"in s?(r=(t=s.data)==null?void 0:t.extensions)==null?void 0:r.airi:(i=s.extensions)==null?void 0:i.airi,o={consciousness:{model:l.value},speech:{model:p.value,voice_id:m.value}};return e?{modules:{consciousness:{model:((d=(c=e.modules)==null?void 0:c.consciousness)==null?void 0:d.model)??o.consciousness.model},speech:{model:((_=(f=e.modules)==null?void 0:f.speech)==null?void 0:_.model)??o.speech.model,voice_id:((S=(y=e.modules)==null?void 0:y.speech)==null?void 0:S.voice_id)??o.speech.voice_id,pitch:(C=(x=e.modules)==null?void 0:x.speech)==null?void 0:C.pitch,rate:(M=(I=e.modules)==null?void 0:I.speech)==null?void 0:M.rate,ssml:(E=(w=e.modules)==null?void 0:w.speech)==null?void 0:E.ssml,language:(j=(A=e.modules)==null?void 0:A.speech)==null?void 0:j.language},vrm:(T=e.modules)==null?void 0:T.vrm,live2d:(U=e.modules)==null?void 0:U.live2d},agents:e.agents??{}}:{modules:o,agents:{}}}function h(s){if("data"in s){const e=s;return{name:e.data.name,version:e.data.character_version??"1.0.0",description:e.data.description??"",creator:e.data.creator??"",notes:e.data.creator_notes??"",notesMultilingual:e.data.creator_notes_multilingual,personality:e.data.personality??"",scenario:e.data.scenario??"",greetings:[e.data.first_mes,...e.data.alternate_greetings??[]],greetingsGroupOnly:e.data.group_only_greetings??[],systemPrompt:e.data.system_prompt??"",postHistoryInstructions:e.data.post_history_instructions??"",messageExample:e.data.mes_example?e.data.mes_example.split(` diff --git a/assets/anthropic-xuZL6YhP.js b/assets/anthropic-Dr4rn0dD.js similarity index 81% rename from assets/anthropic-xuZL6YhP.js rename to assets/anthropic-Dr4rn0dD.js index e1758a66f97d77b8990455a3a350b67da94c6619..4a2e54592fa907e1f234aa20f8e498083daa9b8f 100644 --- a/assets/anthropic-xuZL6YhP.js +++ b/assets/anthropic-Dr4rn0dD.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as k,q as x,bE as S,s as U,h as v,l as w,w as V,x as C,o as K,y as u,a as i,b as l,bH as p,e as t}from"./index-BYewP6KR.js";import{u as R}from"./providers-CFIOZO6n.js";import{_ as O,a as $}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as I,a as N}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const e="anthropic",J=k({__name:"anthropic",setup(T){const{t:c}=x(),_=S(),h=R(),{providers:a}=U(h),m=v(()=>h.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),n=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.anthropic.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});w(()=>{var o,r;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",n.value=((r=a.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),V([s,n],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(o,r)=>{var f,b;return K(),C(t(B),{"provider-name":((f=m.value)==null?void 0:f.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>t(_).back()},{default:u(()=>[r[2]||(r[2]=i("div",{bg:"orange-50 dark:orange-900/20","rounded-xl":"","p-4":"",flex:"~ col gap-3"},[i("h2",{"text-xl":"","font-bold":"",text:"orange-700 dark:orange-500"}," Before you start "),i("p",null,[p(" While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility "),i("a",{underline:"",href:"https://docs.anthropic.com/en/api/openai-sdk"},"(you can read more here)"),p(", but due to the implementation details comes with "),i("a",{underline:"",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS"},"CORS"),p(" restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. ")]),i("p",null,[p(" If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on "),i("a",{underline:"",href:"https://workers.cloudflare.com/"},"Cloudflare Workers"),p(" or some CORS bypassing services to bypass the CORS restrictions. ")])],-1)),l(t(I),null,{default:u(()=>[l(t(N),{title:t(c)("settings.pages.providers.common.section.basic.title"),description:t(c)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var d;return[l(t(A),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=y=>s.value=y),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(O),{title:t(c)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t($),{modelValue:n.value,"onUpdate:modelValue":r[1]||(r[1]=d=>n.value=d),placeholder:"https://api.anthropic.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{J as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as k,q as x,bE as S,s as U,h as v,l as w,w as V,x as C,o as K,y as u,a as i,b as l,bH as p,e as t}from"./index-CL4rmUJ-.js";import{u as R}from"./providers-BHCrT0RZ.js";import{_ as O,a as $}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as I,a as N}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const e="anthropic",J=k({__name:"anthropic",setup(T){const{t:c}=x(),_=S(),h=R(),{providers:a}=U(h),m=v(()=>h.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),n=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.anthropic.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});w(()=>{var o,r;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",n.value=((r=a.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),V([s,n],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(o,r)=>{var f,b;return K(),C(t(B),{"provider-name":((f=m.value)==null?void 0:f.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>t(_).back()},{default:u(()=>[r[2]||(r[2]=i("div",{bg:"orange-50 dark:orange-900/20","rounded-xl":"","p-4":"",flex:"~ col gap-3"},[i("h2",{"text-xl":"","font-bold":"",text:"orange-700 dark:orange-500"}," Before you start "),i("p",null,[p(" While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility "),i("a",{underline:"",href:"https://docs.anthropic.com/en/api/openai-sdk"},"(you can read more here)"),p(", but due to the implementation details comes with "),i("a",{underline:"",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS"},"CORS"),p(" restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. ")]),i("p",null,[p(" If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on "),i("a",{underline:"",href:"https://workers.cloudflare.com/"},"Cloudflare Workers"),p(" or some CORS bypassing services to bypass the CORS restrictions. ")])],-1)),l(t(I),null,{default:u(()=>[l(t(N),{title:t(c)("settings.pages.providers.common.section.basic.title"),description:t(c)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var d;return[l(t(A),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=y=>s.value=y),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(O),{title:t(c)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t($),{modelValue:n.value,"onUpdate:modelValue":r[1]||(r[1]=d=>n.value=d),placeholder:"https://api.anthropic.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{J as default}; diff --git a/assets/audio-Bp2_lULR.js b/assets/audio-C8wXhwK7.js similarity index 88% rename from assets/audio-Bp2_lULR.js rename to assets/audio-C8wXhwK7.js index a24a2bc064b6952679d1d61ab7d56c99a3496ef3..bdca5a7420c96b617d4e96631ad45bfb6dc03717 100644 --- a/assets/audio-Bp2_lULR.js +++ b/assets/audio-C8wXhwK7.js @@ -1 +1 @@ -import{d as s,g as f,c as d,o as p,a as t}from"./index-BYewP6KR.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; +import{d as s,g as f,c as d,o as p,a as t}from"./index-CL4rmUJ-.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; diff --git a/assets/cloudflare-workers-ai-CtD2Pa0I.js b/assets/cloudflare-workers-ai-BYCqyq2S.js similarity index 83% rename from assets/cloudflare-workers-ai-CtD2Pa0I.js rename to assets/cloudflare-workers-ai-BYCqyq2S.js index 7b422f03b76d6b2e1ccbe05a2e895044149e7930..97f45bb3b33249e9eaa96015359cf9bb36418781 100644 --- a/assets/cloudflare-workers-ai-CtD2Pa0I.js +++ b/assets/cloudflare-workers-ai-BYCqyq2S.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as V,bK as w,bL as y,x as k,o as I,q,bE as x,s as K,h as v,l as M,w as $,y as f,b as c,e as l}from"./index-BYewP6KR.js";import{u as P}from"./providers-CFIOZO6n.js";import{_ as z}from"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as B,a as C}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const R=V({__name:"ProviderAccountIdInput",props:w({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=y(p,"modelValue");return(n,e)=>(I(),k(z,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),label:r.label||"Account ID",description:r.description||"Account ID",placeholder:r.placeholder,required:r.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}}),a="cloudflare-workers-ai",F=V({__name:"cloudflare-workers-ai",setup(p){const{t:r}=q(),u=x(),n=P(),{providers:e}=K(n),t=v(()=>n.getProviderMetadata(a)),s=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.apiKey)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].apiKey=o}}),d=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.accountId)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].accountId=o}});M(()=>{var o,i;n.initializeProvider(a),s.value=((o=e.value[a])==null?void 0:o.apiKey)||"",d.value=((i=e.value[a])==null?void 0:i.accountId)||""}),$([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function h(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return I(),k(l(N),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(g=t.value)==null?void 0:g.iconColor,"on-back":()=>l(u).back()},{default:f(()=>[c(l(B),null,{default:f(()=>[c(l(C),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":h},{default:f(()=>{var b;return[c(l(A),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=m=>s.value=m),"provider-name":(b=t.value)==null?void 0:b.localizedName,placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(l(R),{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=m=>d.value=m),label:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label"),description:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description"),placeholder:l(r)("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"])}}});export{F as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as V,bK as w,bL as y,x as k,o as I,q,bE as x,s as K,h as v,l as M,w as $,y as f,b as c,e as l}from"./index-CL4rmUJ-.js";import{u as P}from"./providers-BHCrT0RZ.js";import{_ as z}from"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as B,a as C}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const R=V({__name:"ProviderAccountIdInput",props:w({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=y(p,"modelValue");return(n,e)=>(I(),k(z,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),label:r.label||"Account ID",description:r.description||"Account ID",placeholder:r.placeholder,required:r.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}}),a="cloudflare-workers-ai",F=V({__name:"cloudflare-workers-ai",setup(p){const{t:r}=q(),u=x(),n=P(),{providers:e}=K(n),t=v(()=>n.getProviderMetadata(a)),s=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.apiKey)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].apiKey=o}}),d=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.accountId)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].accountId=o}});M(()=>{var o,i;n.initializeProvider(a),s.value=((o=e.value[a])==null?void 0:o.apiKey)||"",d.value=((i=e.value[a])==null?void 0:i.accountId)||""}),$([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function h(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return I(),k(l(N),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(g=t.value)==null?void 0:g.iconColor,"on-back":()=>l(u).back()},{default:f(()=>[c(l(B),null,{default:f(()=>[c(l(C),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":h},{default:f(()=>{var b;return[c(l(A),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=m=>s.value=m),"provider-name":(b=t.value)==null?void 0:b.localizedName,placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(l(R),{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=m=>d.value=m),label:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label"),description:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description"),placeholder:l(r)("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"])}}});export{F as default}; diff --git a/assets/consciousness-DZJpow8n.js b/assets/consciousness-CJCDq3tD.js similarity index 95% rename from assets/consciousness-DZJpow8n.js rename to assets/consciousness-CJCDq3tD.js index 10acca9276713721dc3c826cf2e6e2b0660d17a2..26a7d229357db1376d5cda1857624bf703695629 100644 --- a/assets/consciousness-DZJpow8n.js +++ b/assets/consciousness-CJCDq3tD.js @@ -1 +1 @@ -import{d as L,s as b,q as U,bE as q,l as B,bw as z,c as r,o as i,A as h,a as e,e as s,D as n,C as f,bx as k,by as E,b as F,y as T,bo as A,x as y,ad as u,bF as Q}from"./index-BYewP6KR.js";import{R as j,a as G}from"./RadioCardDetailManySelect-ConUGerY.js";import"./live2d-zip-loader-CvpgOHsT.js";import{u as I}from"./consciousness-MUz60a06.js";import{u as $}from"./providers-CFIOZO6n.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const H={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},J={relative:""},K={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},O={text:"neutral-300 dark:neutral-500","text-nowrap":""},W={"text-nowrap":"","text-3xl":"","font-semibold":""},X={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},Y={flex:"~ col gap-4"},Z={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},ee={text:"neutral-400 dark:neutral-400"},se={"max-w-full":""},te={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},oe={key:1},ne={key:0},le={flex:"~ col gap-4"},ie={class:"text-lg md:text-2xl"},re={text:"neutral-400 dark:neutral-400"},de={key:0,class:"flex items-center justify-center py-4"},ae={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},ce={class:"flex flex-col"},ue={class:"font-medium"},pe={class:"text-sm text-red-600 dark:text-red-400"},me={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},xe={class:"flex flex-col"},ve={class:"font-medium"},ge={class:"text-sm text-amber-600 dark:text-amber-400"},_e={key:1},be={flex:"~ col gap-4"},he={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},fe={text:"neutral-400 dark:neutral-500"},ke={class:"bg-primary-50 border-primary-200 dark:bg-primary-900/20 dark:border-primary-800 flex items-center gap-3 border rounded-lg p-4"},ye={class:"flex flex-col"},we={class:"font-medium"},Me={class:"dark:text-primary-400 text-primary-600 text-sm"},Ce={class:"mt-2"},Ve={class:"mb-1 block text-sm font-medium"},Pe=["placeholder"],Se=L({__name:"consciousness",setup(Ne){const M=$(),m=I(),{availableProviders:C,availableTextGenerationsProvidersMetadata:V}=b(M),{activeProvider:d,activeModel:a,customModelName:P,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=b(m),{t:o}=U(),S=q();B(async()=>{await m.loadModelsForProvider(d.value)});function N(_){P.value=_}return(_,t)=>{const R=z("motion");return i(),r(k,null,[h((i(),r("div",H,[e("button",{onClick:t[0]||(t[0]=l=>s(S).back())},t[5]||(t[5]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-xl":""},null,-1)])),e("h1",J,[e("div",K,[e("span",O,n(s(o)("settings.pages.modules.title")),1)]),e("div",W,n(s(o)("settings.pages.modules.consciousness.title")),1)])])),[[R]]),e("div",X,[e("div",null,[e("div",Y,[e("div",null,[e("h2",Z,n(s(o)("settings.pages.providers.title")),1),e("div",ee,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",se,[s(C).length>0?(i(),r("fieldset",te,[(i(!0),r(k,null,E(s(V),l=>(i(),y(s(G),{id:l.id,key:l.id,modelValue:s(d),"onUpdate:modelValue":t[1]||(t[1]=D=>u(d)?d.value=D:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),r("div",oe,[F(s(A),{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:T(()=>t[6]||(t[6]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your LLM providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])])]),s(d)&&s(x)?(i(),r("div",ne,[e("div",le,[e("div",null,[e("h2",ie,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",re,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(i(),r("div",de,[t[7]||(t[7]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(g)?(i(),r("div",ae,[t[8]||(t[8]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",ce,[e("span",ue,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",pe,n(s(g)),1)])])):s(p).length===0&&!s(v)?(i(),r("div",me,[t[9]||(t[9]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",xe,[e("span",ve,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ge,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(i(),y(s(j),{key:3,modelValue:s(a),"onUpdate:modelValue":t[2]||(t[2]=l=>u(a)?a.value=l:null),"search-query":s(c),"onUpdate:searchQuery":t[3]||(t[3]=l=>u(c)?c.value=l:null),items:s(p),searchable:!0,"search-placeholder":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":N},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):f("",!0)])])):s(d)&&!s(x)?(i(),r("div",_e,[e("div",be,[e("div",null,[e("h2",he,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",fe,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",ke,[t[10]||(t[10]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-primary-500 dark:text-primary-400 text-2xl"},null,-1)),e("div",ye,[e("span",we,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",Me,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",Ce,[e("label",Ve,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),h(e("input",{"onUpdate:modelValue":t[4]||(t[4]=l=>u(a)?a.value=l: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:s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,Pe),[[Q,s(a)]])])])])):f("",!0)]),t[11]||(t[11]=e("div",{text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:ghost":""})],-1))],64)}}});typeof w=="function"&&w(Se);export{Se as default}; +import{d as L,s as b,q as U,bE as q,l as B,bw as z,c as r,o as i,A as h,a as e,e as s,D as n,C as f,bx as k,by as E,b as F,y as T,bo as A,x as y,ad as u,bF as Q}from"./index-CL4rmUJ-.js";import{R as j,a as G}from"./RadioCardDetailManySelect-Cc_QkuwQ.js";import"./live2d-zip-loader-DFrBymqv.js";import{u as I}from"./consciousness-nHboP4iV.js";import{u as $}from"./providers-BHCrT0RZ.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const H={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},J={relative:""},K={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},O={text:"neutral-300 dark:neutral-500","text-nowrap":""},W={"text-nowrap":"","text-3xl":"","font-semibold":""},X={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},Y={flex:"~ col gap-4"},Z={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},ee={text:"neutral-400 dark:neutral-400"},se={"max-w-full":""},te={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},oe={key:1},ne={key:0},le={flex:"~ col gap-4"},ie={class:"text-lg md:text-2xl"},re={text:"neutral-400 dark:neutral-400"},de={key:0,class:"flex items-center justify-center py-4"},ae={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},ce={class:"flex flex-col"},ue={class:"font-medium"},pe={class:"text-sm text-red-600 dark:text-red-400"},me={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},xe={class:"flex flex-col"},ve={class:"font-medium"},ge={class:"text-sm text-amber-600 dark:text-amber-400"},_e={key:1},be={flex:"~ col gap-4"},he={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},fe={text:"neutral-400 dark:neutral-500"},ke={class:"bg-primary-50 border-primary-200 dark:bg-primary-900/20 dark:border-primary-800 flex items-center gap-3 border rounded-lg p-4"},ye={class:"flex flex-col"},we={class:"font-medium"},Me={class:"dark:text-primary-400 text-primary-600 text-sm"},Ce={class:"mt-2"},Ve={class:"mb-1 block text-sm font-medium"},Pe=["placeholder"],Se=L({__name:"consciousness",setup(Ne){const M=$(),m=I(),{availableProviders:C,availableTextGenerationsProvidersMetadata:V}=b(M),{activeProvider:d,activeModel:a,customModelName:P,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=b(m),{t:o}=U(),S=q();B(async()=>{await m.loadModelsForProvider(d.value)});function N(_){P.value=_}return(_,t)=>{const R=z("motion");return i(),r(k,null,[h((i(),r("div",H,[e("button",{onClick:t[0]||(t[0]=l=>s(S).back())},t[5]||(t[5]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-xl":""},null,-1)])),e("h1",J,[e("div",K,[e("span",O,n(s(o)("settings.pages.modules.title")),1)]),e("div",W,n(s(o)("settings.pages.modules.consciousness.title")),1)])])),[[R]]),e("div",X,[e("div",null,[e("div",Y,[e("div",null,[e("h2",Z,n(s(o)("settings.pages.providers.title")),1),e("div",ee,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",se,[s(C).length>0?(i(),r("fieldset",te,[(i(!0),r(k,null,E(s(V),l=>(i(),y(s(G),{id:l.id,key:l.id,modelValue:s(d),"onUpdate:modelValue":t[1]||(t[1]=D=>u(d)?d.value=D:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),r("div",oe,[F(s(A),{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:T(()=>t[6]||(t[6]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your LLM providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])])]),s(d)&&s(x)?(i(),r("div",ne,[e("div",le,[e("div",null,[e("h2",ie,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",re,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(i(),r("div",de,[t[7]||(t[7]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(g)?(i(),r("div",ae,[t[8]||(t[8]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",ce,[e("span",ue,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",pe,n(s(g)),1)])])):s(p).length===0&&!s(v)?(i(),r("div",me,[t[9]||(t[9]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",xe,[e("span",ve,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ge,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(i(),y(s(j),{key:3,modelValue:s(a),"onUpdate:modelValue":t[2]||(t[2]=l=>u(a)?a.value=l:null),"search-query":s(c),"onUpdate:searchQuery":t[3]||(t[3]=l=>u(c)?c.value=l:null),items:s(p),searchable:!0,"search-placeholder":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":N},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):f("",!0)])])):s(d)&&!s(x)?(i(),r("div",_e,[e("div",be,[e("div",null,[e("h2",he,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",fe,[e("span",null,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",ke,[t[10]||(t[10]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-primary-500 dark:text-primary-400 text-2xl"},null,-1)),e("div",ye,[e("span",we,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",Me,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",Ce,[e("label",Ve,n(s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),h(e("input",{"onUpdate:modelValue":t[4]||(t[4]=l=>u(a)?a.value=l: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:s(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,Pe),[[Q,s(a)]])])])])):f("",!0)]),t[11]||(t[11]=e("div",{text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:ghost":""})],-1))],64)}}});typeof w=="function"&&w(Se);export{Se as default}; diff --git a/assets/consciousness-MUz60a06.js b/assets/consciousness-nHboP4iV.js similarity index 90% rename from assets/consciousness-MUz60a06.js rename to assets/consciousness-nHboP4iV.js index a2a9dfebda4dd621b0bd0297c4a759a698f8f73c..83ba1e4e2a0b12fafa9afade568e6ab1fa61979c 100644 --- a/assets/consciousness-MUz60a06.js +++ b/assets/consciousness-nHboP4iV.js @@ -1 +1 @@ -import{f as P,bI as n,g as M,h as r,w as L}from"./index-BYewP6KR.js";import{u as w}from"./providers-CFIOZO6n.js";const h=P("consciousness",()=>{const o=w(),s=n("settings/consciousness/active-provider",""),c=n("settings/consciousness/active-model",""),d=n("settings/consciousness/active-custom-model",""),l=M({}),i=M(""),m=r(()=>{var e;return((e=o.getProviderMetadata(s.value))==null?void 0:e.capabilities.listModels)!==void 0}),a=r(()=>o.getModelsForProvider(s.value)),f=r(()=>o.isLoadingModels[s.value]||!1),g=r(()=>o.modelLoadError[s.value]||null),p=r(()=>{if(!i.value.trim())return a.value;const e=i.value.toLowerCase().trim();return a.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function u(){c.value="",d.value="",l.value={},i.value=""}async function v(e){var t;e&&((t=o.getProviderMetadata(s.value))==null?void 0:t.capabilities.listModels)!==void 0&&o.getModelsForProvider(e).length===0&&await o.fetchModelsForProvider(e)}return L(s,async e=>{await v(e),u()}),{activeProvider:s,activeModel:c,customModelName:d,expandedDescriptions:l,modelSearchQuery:i,supportsModelListing:m,providerModels:a,isLoadingActiveProviderModels:f,activeProviderModelError:g,filteredModels:p,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; +import{f as P,bI as n,g as M,h as r,w as L}from"./index-CL4rmUJ-.js";import{u as w}from"./providers-BHCrT0RZ.js";const h=P("consciousness",()=>{const o=w(),s=n("settings/consciousness/active-provider",""),c=n("settings/consciousness/active-model",""),d=n("settings/consciousness/active-custom-model",""),l=M({}),i=M(""),m=r(()=>{var e;return((e=o.getProviderMetadata(s.value))==null?void 0:e.capabilities.listModels)!==void 0}),a=r(()=>o.getModelsForProvider(s.value)),f=r(()=>o.isLoadingModels[s.value]||!1),g=r(()=>o.modelLoadError[s.value]||null),p=r(()=>{if(!i.value.trim())return a.value;const e=i.value.toLowerCase().trim();return a.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function u(){c.value="",d.value="",l.value={},i.value=""}async function v(e){var t;e&&((t=o.getProviderMetadata(s.value))==null?void 0:t.capabilities.listModels)!==void 0&&o.getModelsForProvider(e).length===0&&await o.fetchModelsForProvider(e)}return L(s,async e=>{await v(e),u()}),{activeProvider:s,activeModel:c,customModelName:d,expandedDescriptions:l,modelSearchQuery:i,supportsModelListing:m,providerModels:a,isLoadingActiveProviderModels:f,activeProviderModelError:g,filteredModels:p,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; diff --git a/assets/deepseek-CWb6iLhX.js b/assets/deepseek-CROYIRyB.js similarity index 67% rename from assets/deepseek-CWb6iLhX.js rename to assets/deepseek-CROYIRyB.js index efe3739e2e9c061f29c132b3d9cdb95a90896b60..7abe49b7b4045656c9613a24def2f7270fed5e49 100644 --- a/assets/deepseek-CWb6iLhX.js +++ b/assets/deepseek-CROYIRyB.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as k,q as U,bE as V,s as y,h as c,l as $,w as K,x as h,o as x,y as p,b as l,e as t}from"./index-BYewP6KR.js";import{u as w}from"./providers-CFIOZO6n.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const a="deepseek",H=k({__name:"deepseek",setup(S){const{t:d}=U(),_=V(),m=w(),{providers:o}=y(m),n=c(()=>m.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),i=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),K([r,i],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:i.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var v,f;return x(),h(t(R),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=u=>i.value=u),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as k,q as U,bE as V,s as y,h as c,l as $,w as K,x as h,o as x,y as p,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as w}from"./providers-BHCrT0RZ.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="deepseek",H=k({__name:"deepseek",setup(S){const{t:d}=U(),_=V(),m=w(),{providers:o}=y(m),n=c(()=>m.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),i=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),K([r,i],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:i.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var v,f;return x(),h(t(R),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=u=>i.value=u),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; diff --git a/assets/default-uUrVtnYd.js b/assets/default-BPwzNWfB.js similarity index 89% rename from assets/default-uUrVtnYd.js rename to assets/default-BPwzNWfB.js index 1b704d21db975e8cbb4376b0a1a3ebb589eef095..9cc026be2cc36bff5bd471294a4b316ae38efe76 100644 --- a/assets/default-uUrVtnYd.js +++ b/assets/default-BPwzNWfB.js @@ -1 +1 @@ -import{d as n,u as r,c,a,b as t,e,n as i,R as m,o as l}from"./index-BYewP6KR.js";import{H as x}from"./HeaderLink-7ZfdE9hW.js";const f={"mb-4":"","w-full":"","gap-2":"",class:"px-0 py-1 md:px-3 md:py-3"},_={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col gap-4","mx-auto":"","max-w-screen-xl":""},$=n({__name:"default",setup(u){const{top:o,right:p,bottom:s,left:d}=r();return(g,y)=>(l(),c("div",{"p-2":"",style:i({paddingTop:`${e(o)}px`,paddingRight:`${e(p)}px`,paddingBottom:`${e(s)}px`,paddingLeft:`${e(d)}px`})},[a("div",f,[t(x)]),a("div",_,[t(e(m))])],4))}});export{$ as default}; +import{d as n,u as r,c,a,b as t,e,n as i,R as m,o as l}from"./index-CL4rmUJ-.js";import{H as x}from"./HeaderLink-ByYQsQjF.js";const f={"mb-4":"","w-full":"","gap-2":"",class:"px-0 py-1 md:px-3 md:py-3"},_={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col gap-4","mx-auto":"","max-w-screen-xl":""},$=n({__name:"default",setup(u){const{top:o,right:p,bottom:s,left:d}=r();return(g,y)=>(l(),c("div",{"p-2":"",style:i({paddingTop:`${e(o)}px`,paddingRight:`${e(p)}px`,paddingBottom:`${e(s)}px`,paddingLeft:`${e(d)}px`})},[a("div",f,[t(x)]),a("div",_,[t(e(m))])],4))}});export{$ as default}; diff --git a/assets/default-node-BIObRWrk.js b/assets/default-node-BIhx9KIo.js similarity index 89% rename from assets/default-node-BIObRWrk.js rename to assets/default-node-BIhx9KIo.js index 7606fe5ce5778c80609689fbcc3ecb5322546c13..f8c2514e85e37ecdc2785a222e245538fe28459d 100644 --- a/assets/default-node-BIObRWrk.js +++ b/assets/default-node-BIhx9KIo.js @@ -1 +1 @@ -import{cp as t}from"./index-BYewP6KR.js";async function s(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:c}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:c}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{s as getBundles}; +import{cp as t}from"./index-CL4rmUJ-.js";async function s(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:c}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:c}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{s as getBundles}; diff --git a/assets/delays-Bgq_JgIR.js b/assets/delays-DYQGGjQG.js similarity index 82% rename from assets/delays-Bgq_JgIR.js rename to assets/delays-DYQGGjQG.js index 412409527326605b72349ef1b9c36cfa966a47d1..25110a0a7238af2e8ad42fcee12300ebf67c3499 100644 --- a/assets/delays-Bgq_JgIR.js +++ b/assets/delays-DYQGGjQG.js @@ -1 +1 @@ -import{b as v,_,l as b}from"./queues-Cj51JWdx.js";import"./live2d-zip-loader-CvpgOHsT.js";import{d as k,g as d,c as s,o as l,a as e,b as y,e as x,D as i,bx as f,by as p}from"./index-BYewP6KR.js";import"./index-CBPLaxd6.js";import"./queue-DRKK1rL_.js";const z={flex:"","flex-col":"","gap-2":"","p-2":""},w={flex:"","flex-row":"","gap-2":""},h={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},V={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},D={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},N=k({__name:"delays",setup(E){const t=d(""),m=d([]),c=d([]),r=d(!1),u=v();u.onHandlerEvent("delay",a=>{c.value.push(a)});function g(){r.value=!0;const a=t.value.split("");for(const n of a)u.add(n);u.add(b),t.value="",r.value=!1}return(a,n)=>(l(),s("div",z,[e("div",w,[y(x(_),{modelValue:t.value,"onUpdate:modelValue":n[0]||(n[0]=o=>t.value=o),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:g},null,8,["modelValue"]),e("button",h,i(r.value?"Processing...":"Send"),1)]),e("div",M,[e("div",V,[n[1]||(n[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(l(!0),s(f,null,p(m.value,o=>(l(),s("div",{key:o},[e("div",null,i(o),1)]))),128))]),e("div",D,[n[2]||(n[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(l(!0),s(f,null,p(c.value,o=>(l(),s("div",{key:o},[e("div",null,i(o)+"s",1)]))),128))])])]))}});export{N as default}; +import{b as v,_,l as b}from"./queues-D3Ic2N1b.js";import"./live2d-zip-loader-DFrBymqv.js";import{d as k,g as d,c as s,o as l,a as e,b as y,e as x,D as i,bx as f,by as p}from"./index-CL4rmUJ-.js";import"./index-D7ZJqxUE.js";import"./queue-DCQeV-U1.js";const z={flex:"","flex-col":"","gap-2":"","p-2":""},w={flex:"","flex-row":"","gap-2":""},h={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},V={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},D={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},N=k({__name:"delays",setup(E){const t=d(""),m=d([]),c=d([]),r=d(!1),u=v();u.onHandlerEvent("delay",a=>{c.value.push(a)});function g(){r.value=!0;const a=t.value.split("");for(const n of a)u.add(n);u.add(b),t.value="",r.value=!1}return(a,n)=>(l(),s("div",z,[e("div",w,[y(x(_),{modelValue:t.value,"onUpdate:modelValue":n[0]||(n[0]=o=>t.value=o),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:g},null,8,["modelValue"]),e("button",h,i(r.value?"Processing...":"Send"),1)]),e("div",M,[e("div",V,[n[1]||(n[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(l(!0),s(f,null,p(m.value,o=>(l(),s("div",{key:o},[e("div",null,i(o),1)]))),128))]),e("div",D,[n[2]||(n[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(l(!0),s(f,null,p(c.value,o=>(l(),s("div",{key:o},[e("div",null,i(o)+"s",1)]))),128))])])]))}});export{N as default}; diff --git a/assets/elevenlabs-DaDbxr9N.js b/assets/elevenlabs-BKBDCaFN.js similarity index 56% rename from assets/elevenlabs-DaDbxr9N.js rename to assets/elevenlabs-BKBDCaFN.js index ec6e24da2e7413b688d1eb6c73ab7cfe3331ffb4..f3a2b7a0539e4444974b161c9a008380e4c60474 100644 --- a/assets/elevenlabs-DaDbxr9N.js +++ b/assets/elevenlabs-BKBDCaFN.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as y,s as S,h as i,x as w,o as k,y as u,b as d,e as r}from"./index-BYewP6KR.js";import{u as x}from"./providers-CFIOZO6n.js";import{u as C}from"./speech-CLmksxkl.js";import{_ as B,a as L,b as V}from"./SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-lVYyoUny.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-CGhOEjXF.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";const t="elevenlabs",v="eleven_multilingual_v2",j=y({__name:"elevenlabs",setup(P){const n={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},a=C(),s=x(),{providers:m}=S(s),f=i(()=>{var e;return!!((e=m.value[t])!=null&&e.apiKey)}),g=i(()=>a.availableVoices[t]||[]),h=i(()=>a.availableLanguages);async function _(e,l,p){const o=s.getProviderInstance(t);if(!o)throw new Error("Failed to initialize speech provider");const c=s.getProviderConfig(t),b=c.model||v;return await a.speech(o,b,e,l,{...c,...n})}return(e,l)=>(k(),w(r(V),{"provider-id":t,"default-model":v,"additional-settings":n},{"voice-settings":u(({voiceSettings:p,updateVoiceSettings:o})=>[d(r(L),{settings:p,"show-similarity-boost":!0,"show-stability":!0,"show-speed":!0,"show-style":!0,"show-speaker-boost":!0,onUpdate:o},null,8,["settings","onUpdate"])]),playground:u(()=>[d(r(B),{"available-voices":g.value,"available-languages":h.value,"generate-speech":_,"api-key-configured":f.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","available-languages","api-key-configured"])]),_:1}))}});export{j as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as y,s as S,h as i,x as w,o as k,y as u,b as d,e as r}from"./index-CL4rmUJ-.js";import{u as x}from"./providers-BHCrT0RZ.js";import{u as C}from"./speech-Ae5ywnpY.js";import{_ as B,a as L,b as V}from"./SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-8IXQG3Jk.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-D5aCIkT4.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";const t="elevenlabs",v="eleven_multilingual_v2",j=y({__name:"elevenlabs",setup(P){const n={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},a=C(),s=x(),{providers:m}=S(s),f=i(()=>{var e;return!!((e=m.value[t])!=null&&e.apiKey)}),g=i(()=>a.availableVoices[t]||[]),h=i(()=>a.availableLanguages);async function _(e,l,p){const o=s.getProviderInstance(t);if(!o)throw new Error("Failed to initialize speech provider");const c=s.getProviderConfig(t),b=c.model||v;return await a.speech(o,b,e,l,{...c,...n})}return(e,l)=>(k(),w(r(V),{"provider-id":t,"default-model":v,"additional-settings":n},{"voice-settings":u(({voiceSettings:p,updateVoiceSettings:o})=>[d(r(L),{settings:p,"show-similarity-boost":!0,"show-stability":!0,"show-speed":!0,"show-style":!0,"show-speaker-boost":!0,onUpdate:o},null,8,["settings","onUpdate"])]),playground:u(()=>[d(r(B),{"available-voices":g.value,"available-languages":h.value,"generate-speech":_,"api-key-configured":f.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","available-languages","api-key-configured"])]),_:1}))}});export{j as default}; diff --git a/assets/emotions-BY0bSGBW.js b/assets/emotions-Bk2T6ViW.js similarity index 82% rename from assets/emotions-BY0bSGBW.js rename to assets/emotions-Bk2T6ViW.js index 5cbc5a416c693d4b22627daab5ec44e8e33a3572..57467bbe0a92e15a06049b0095886a0783232c48 100644 --- a/assets/emotions-BY0bSGBW.js +++ b/assets/emotions-Bk2T6ViW.js @@ -1 +1 @@ -import{a as _,_ as b,l as k}from"./queues-Cj51JWdx.js";import"./live2d-zip-loader-CvpgOHsT.js";import{d as x,g as u,c as s,o as t,a as e,b as z,e as h,D as i,bx as f,by as m}from"./index-BYewP6KR.js";import{u as w}from"./queue-DRKK1rL_.js";const y={flex:"","flex-col":"","gap-2":"","p-2":""},M={flex:"","flex-row":"","gap-2":""},V={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},E={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},N=x({__name:"emotions",setup(B){const l=u(""),p=u([]),r=u([]),d=u(!1),g=w({handlers:[async a=>{r.value.push(a.data)}]}),c=_(g);function v(){d.value=!0;const a=l.value.split("");for(const o of a)c.add(o);c.add(k),l.value="",d.value=!1}return(a,o)=>(t(),s("div",y,[e("div",M,[z(h(b),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",V,i(d.value?"Processing...":"Send"),1)]),e("div",E,[e("div",Q,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,m(p.value,n=>(t(),s("div",{key:n},[e("div",null,i(n),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,m(r.value,n=>(t(),s("div",{key:n},[e("div",null,i(n),1)]))),128))])])]))}});export{N as default}; +import{a as _,_ as b,l as k}from"./queues-D3Ic2N1b.js";import"./live2d-zip-loader-DFrBymqv.js";import{d as x,g as u,c as s,o as t,a as e,b as z,e as h,D as i,bx as f,by as m}from"./index-CL4rmUJ-.js";import{u as w}from"./queue-DCQeV-U1.js";const y={flex:"","flex-col":"","gap-2":"","p-2":""},M={flex:"","flex-row":"","gap-2":""},V={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},E={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},N=x({__name:"emotions",setup(B){const l=u(""),p=u([]),r=u([]),d=u(!1),g=w({handlers:[async a=>{r.value.push(a.data)}]}),c=_(g);function v(){d.value=!0;const a=l.value.split("");for(const o of a)c.add(o);c.add(k),l.value="",d.value=!1}return(a,o)=>(t(),s("div",y,[e("div",M,[z(h(b),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",V,i(d.value?"Processing...":"Send"),1)]),e("div",E,[e("div",Q,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,m(p.value,n=>(t(),s("div",{key:n},[e("div",null,i(n),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,m(r.value,n=>(t(),s("div",{key:n},[e("div",null,i(n),1)]))),128))])])]))}});export{N as default}; diff --git a/assets/featherless-ai-PxI_AzkK.js b/assets/featherless-ai-PxI_AzkK.js new file mode 100644 index 0000000000000000000000000000000000000000..02a105969bd03ae61ce9c8482d04ce7741cba33c --- /dev/null +++ b/assets/featherless-ai-PxI_AzkK.js @@ -0,0 +1 @@ +import"./live2d-zip-loader-DFrBymqv.js";import{d as h,q as U,bE as V,s as y,h as v,l as $,w as k,x as K,o as w,y as p,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as x}from"./providers-BHCrT0RZ.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="featherless-ai",H=h({__name:"featherless-ai",setup(B){const{t:d}=U(),_=V(),m=x(),{providers:o}=y(m),n=v(()=>m.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;m.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,r],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return w(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=u=>r.value=u),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; diff --git a/assets/filter-message-BT9_oUVT.js b/assets/filter-message-CX1l3MTd.js similarity index 95% rename from assets/filter-message-BT9_oUVT.js rename to assets/filter-message-CX1l3MTd.js index b4cfb8a5a45ab6ad522789a0256e4d33fca1f2c1..18315b76a0bf1780e9b8809d9a76b0fd4528cc6b 100644 --- a/assets/filter-message-BT9_oUVT.js +++ b/assets/filter-message-CX1l3MTd.js @@ -1 +1 @@ -import{d as g,g as u,r as m,c as v,o as _,a as s,b as x,D as d}from"./index-BYewP6KR.js";const b={flex:"","flex-col":"","gap-2":"","p-2":""},S={flex:"","flex-row":"","gap-2":""},k={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},w={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},V=g({__name:"filter-message",setup(z){const o=u(""),c=u(!1),i=u({content:""});async function f(r){return new Promise(e=>setTimeout(e,r))}async function p(){c.value=!0;const r=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let l="literal",t="";for(const a of r){await f(50);let n=l;a==="<"?n="special":a===">"&&(n="literal"),l==="literal"&&n==="special"&&(i.value.content+=t,t=""),l==="special"&&n==="literal"&&(t=""),l==="literal"&&n==="literal"&&(i.value.content+=a,t=""),l=n}t&&(i.value.content+=t),o.value="",c.value=!1}return(r,e)=>{const l=m("BasicTextarea");return _(),v("div",b,[s("div",S,[x(l,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",k,d(c.value?"Processing...":"Send"),1)]),s("div",w,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(i.value.content),1)])])}}});export{V as default}; +import{d as g,g as u,r as m,c as v,o as _,a as s,b as x,D as d}from"./index-CL4rmUJ-.js";const b={flex:"","flex-col":"","gap-2":"","p-2":""},S={flex:"","flex-row":"","gap-2":""},k={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},w={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},V=g({__name:"filter-message",setup(z){const o=u(""),c=u(!1),i=u({content:""});async function f(r){return new Promise(e=>setTimeout(e,r))}async function p(){c.value=!0;const r=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let l="literal",t="";for(const a of r){await f(50);let n=l;a==="<"?n="special":a===">"&&(n="literal"),l==="literal"&&n==="special"&&(i.value.content+=t,t=""),l==="special"&&n==="literal"&&(t=""),l==="literal"&&n==="literal"&&(i.value.content+=a,t=""),l=n}t&&(i.value.content+=t),o.value="",c.value=!1}return(r,e)=>{const l=m("BasicTextarea");return _(),v("div",b,[s("div",S,[x(l,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",k,d(c.value?"Processing...":"Send"),1)]),s("div",w,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(i.value.content),1)])])}}});export{V as default}; diff --git a/assets/fireworks-ai-CiD4t3hx.js b/assets/fireworks-ai-CmtwbW1h.js similarity index 67% rename from assets/fireworks-ai-CiD4t3hx.js rename to assets/fireworks-ai-CmtwbW1h.js index 868585fc283bdcce9b9abd1265ba7e635828e61d..c61512828109c8bc29a6bcd617715f585350fdd3 100644 --- a/assets/fireworks-ai-CiD4t3hx.js +++ b/assets/fireworks-ai-CmtwbW1h.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as k,q as w,bE as U,s as V,h as v,l as y,w as $,x as K,o as h,y as p,b as l,e as t}from"./index-BYewP6KR.js";import{u as x}from"./providers-CFIOZO6n.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const a="fireworks-ai",H=k({__name:"fireworks-ai",setup(B){const{t:d}=w(),_=U(),m=x(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,i;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),$([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=u=>s.value=u),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as k,q as w,bE as U,s as V,h as v,l as y,w as $,x as K,o as h,y as p,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as x}from"./providers-BHCrT0RZ.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="fireworks-ai",H=k({__name:"fireworks-ai",setup(B){const{t:d}=w(),_=U(),m=x(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,i;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),$([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=u=>s.value=u),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; diff --git a/assets/image-CEksY4YG.js b/assets/image-CcWmIr03.js similarity index 95% rename from assets/image-CEksY4YG.js rename to assets/image-CcWmIr03.js index 9dc291c306cda05d8be84066cf5f519ae191fe7e..fabf221c9e91173d907a0c4892712df4079d34b8 100644 --- a/assets/image-CEksY4YG.js +++ b/assets/image-CcWmIr03.js @@ -1,2 +1,2 @@ -import{d as _,g as c,bD as y,c as d,o as u,a,C as x,D as b,e as v,bn as w}from"./index-BYewP6KR.js";const C={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},h={key:0},D=["src"],U={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},R=_({__name:"image",setup(k){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(r){return new Promise((e,o)=>{const t=new FileReader;t.onload=s=>{var l,i;e(((i=(l=s.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=s=>{o(s)},t.readAsDataURL(r)})}async function f(r){var t;const o=(t=r.target.files)==null?void 0:t[0];if(o){p.value=o;const s=await m(o);n.value=s}}return(r,e)=>(u(),d("div",null,[a("label",C,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",h,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,D),a("pre",U," "+b(n.value)+` +import{d as _,g as c,bD as y,c as d,o as u,a,C as x,D as b,e as v,bn as w}from"./index-CL4rmUJ-.js";const C={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},h={key:0},D=["src"],U={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},R=_({__name:"image",setup(k){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(r){return new Promise((e,o)=>{const t=new FileReader;t.onload=s=>{var l,i;e(((i=(l=s.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=s=>{o(s)},t.readAsDataURL(r)})}async function f(r){var t;const o=(t=r.target.files)==null?void 0:t[0];if(o){p.value=o;const s=await m(o);n.value=s}}return(r,e)=>(u(),d("div",null,[a("label",C,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",h,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,D),a("pre",U," "+b(n.value)+` `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>v(g)())}," Copy Data URL ")])):x("",!0)]))}}),B=w(R,[["__scopeId","data-v-7edd53e6"]]);export{B as default}; diff --git a/assets/index-DSfRQH3b.css b/assets/index-BXUWdGb6.css similarity index 50% rename from assets/index-DSfRQH3b.css rename to assets/index-BXUWdGb6.css index af8ded7905820ac7ff31aef55e78171089beb30a..99333ce8e725da7d8414a5d5a366608d574f8735 100644 --- a/assets/index-DSfRQH3b.css +++ b/assets/index-BXUWdGb6.css @@ -1 +1 @@ -.stage-transition-3[data-v-df576df0]{--delay: 0s;--sharpness: 40%;position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.stage-transition-3[data-v-df576df0]:before,.stage-transition-3[data-v-df576df0]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;animation:arrowIn-df576df0 1s cubic-bezier(.87,.05,.02,.97) both,arrowOut-df576df0 1s cubic-bezier(.87,.05,.02,.97) forwards}.stage-transition-3[data-v-df576df0]: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-df576df0]: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-df576df0{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-df576df0{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-0c29056c]{position:fixed;top:calc(50% - 75vmax);left:calc(50% - 75vmax);width:150vmax;height:150vmax;pointer-events:none}.circle-expansion-transition div[data-v-0c29056c]{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;transform:scale(0)}.circle-expansion-transition div[data-v-0c29056c]:nth-child(1){background-color:var(--circle-expansion-color-1);animation:circleExpand-0c29056c var(--circle-expansion-duration) ease-in calc(var(--circle-expansion-delay) + 0s) forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(2){background-color:var(--circle-expansion-color-2);animation:circleExpand-0c29056c var(--circle-expansion-duration) ease-in calc(var(--circle-expansion-delay) + .15s) forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(3){background-color:var(--circle-expansion-color-3);animation:circleExpand-0c29056c var(--circle-expansion-duration) ease-in calc(var(--circle-expansion-delay) + .3s) forwards}.circle-expansion-transition div[data-v-0c29056c]:nth-child(4){background-color:var(--circle-expansion-color-4);animation:circleExpand-0c29056c var(--circle-expansion-duration) ease-in calc(var(--circle-expansion-delay) + .45s) forwards}@keyframes circleExpand-0c29056c{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes fantasy-fall-up{0%{transform:translateY(-100%)}50%{transform:translateY(0)}to{transform:translateY(0);border-bottom-right-radius:0%;border-bottom-left-radius:0%}}@keyframes fantasy-fall-down{0%{transform:translateY(100%)}50%{transform:translateY(0)}to{transform:translateY(0);border-top-right-radius:0%;border-top-left-radius:0%}}@keyframes fantasy-fall-left{0%{transform:translate(-100%)}50%{transform:translate(0)}to{transform:translate(0);border-top-right-radius:0%;border-bottom-right-radius:0%}}@keyframes fantasy-fall-right{0%{transform:translate(100%)}50%{transform:translate(0)}to{transform:translate(0);border-top-left-radius:0%;border-bottom-left-radius:0%}}.fantasy-fall-transition[data-v-e62bf496]{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.fantasy-fall-up[data-v-e62bf496]:before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--fantasy-fall-color);transform:translateY(-100%);border-bottom-left-radius:var(--fantasy-fall-radius-sm);border-bottom-right-radius:var(--fantasy-fall-radius-sm);animation:fantasy-fall-up var(--fantasy-fall-duration) ease-out var(--fantasy-fall-delay) forwards}.fantasy-fall-down[data-v-e62bf496]:before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--fantasy-fall-color);transform:translateY(100%);border-top-left-radius:var(--fantasy-fall-radius-sm);border-top-right-radius:var(--fantasy-fall-radius-sm);animation:fantasy-fall-down var(--fantasy-fall-duration) ease-out var(--fantasy-fall-delay) forwards}.fantasy-fall-left[data-v-e62bf496]:before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--fantasy-fall-color);transform:translate(-100%);border-top-right-radius:var(--fantasy-fall-radius-sm);border-bottom-right-radius:var(--fantasy-fall-radius-sm);animation:fantasy-fall-left var(--fantasy-fall-duration) ease-out var(--fantasy-fall-delay) forwards}.fantasy-fall-right[data-v-e62bf496]:before{content:"";display:block;position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--fantasy-fall-color);transform:translate(100%);border-top-left-radius:var(--fantasy-fall-radius-sm);border-bottom-left-radius:var(--fantasy-fall-radius-sm);animation:fantasy-fall-right var(--fantasy-fall-duration) ease-out var(--fantasy-fall-delay) forwards}@media (min-width: 768px){.fantasy-fall-up[data-v-e62bf496]:before{border-bottom-left-radius:var(--fantasy-fall-radius-md);border-bottom-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-down[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-md);border-top-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-left[data-v-e62bf496]:before{border-top-right-radius:var(--fantasy-fall-radius-md);border-bottom-right-radius:var(--fantasy-fall-radius-md)}.fantasy-fall-right[data-v-e62bf496]: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-e62bf496]:before{border-bottom-left-radius:var(--fantasy-fall-radius-lg);border-bottom-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-down[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-lg);border-top-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-left[data-v-e62bf496]:before{border-top-right-radius:var(--fantasy-fall-radius-lg);border-bottom-right-radius:var(--fantasy-fall-radius-lg)}.fantasy-fall-right[data-v-e62bf496]:before{border-top-left-radius:var(--fantasy-fall-radius-lg);border-bottom-left-radius:var(--fantasy-fall-radius-lg)}}.stage-transition-4[data-v-6d1179fc]{--delay: 0s;position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden;display:grid;grid-template-rows:repeat(5,1fr)}.stage-transition-4__block[data-v-6d1179fc]{position:relative;width:100%;height:100%}.stage-transition-4__block[data-v-6d1179fc]:before,.stage-transition-4__block[data-v-6d1179fc]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;animation:slideIn-6d1179fc .8s cubic-bezier(.87,.05,.02,.97) both,slideOut-6d1179fc .8s cubic-bezier(.87,.05,.02,.97) forwards}.stage-transition-4__block[data-v-6d1179fc]: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-6d1179fc]: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-6d1179fc]:nth-child(1){--d: .1s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(2){--d: .3s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(3){--d: 0s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(4){--d: .4s}.stage-transition-4__block[data-v-6d1179fc]:nth-child(5){--d: .2s}@keyframes slideIn-6d1179fc{0%{transform:translate(-101%)}to{transform:translate(0)}}@keyframes slideOut-6d1179fc{0%{transform:translate(0)}to{transform:translate(101%)}}.stage-transition-1[data-v-bf1d1566]{--delay: 0s;position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.stage-transition-1[data-v-bf1d1566]:before,.stage-transition-1[data-v-bf1d1566]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;animation:slideIn-bf1d1566 1s cubic-bezier(.87,.05,.02,.97) both,slideOut-bf1d1566 1s cubic-bezier(.87,.05,.02,.97) forwards}.stage-transition-1[data-v-bf1d1566]: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-bf1d1566]: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-bf1d1566{0%{transform:translate(-101%)}to{transform:translate(0)}}@keyframes slideOut-bf1d1566{0%{transform:translate(0)}to{transform:translate(101%)}}.stage-transition-2[data-v-8ff7120f]{--delay: 0s;--skew-x: 100%;position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.stage-transition-2[data-v-8ff7120f]:before,.stage-transition-2[data-v-8ff7120f]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;animation:maskIn-8ff7120f 1s cubic-bezier(.87,.05,.02,.97) both,maskOut-8ff7120f 1s cubic-bezier(.87,.05,.02,.97) forwards}.stage-transition-2[data-v-8ff7120f]: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-8ff7120f]: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-8ff7120f{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-8ff7120f{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-f4b1dc64]{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.rectangle[data-v-f4b1dc64]{position:absolute;width:100%;height:100%}.rectangle div[data-v-f4b1dc64]{position:absolute;width:100vmax;height:100vmax;transform:scale(0)}.rectangle-rotate-1 div[data-v-f4b1dc64]{top:-50vmax;left:-50vmax;background-color:var(--rectangle-rotate-1-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration) ease calc(var(--rectangle-rotate-delay) + 0s) forwards}.rectangle-rotate-2 div[data-v-f4b1dc64]{bottom:-50vmax;right:-50vmax;background-color:var(--rectangle-rotate-2-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration) ease calc(var(--rectangle-rotate-delay) + var(--rectangle-rotate-stagger)) forwards}.rectangle-rotate-3 div[data-v-f4b1dc64]{top:calc(50% - 50vmax);left:calc(50% - 50vmax);background-color:var(--rectangle-rotate-3-color);animation:expand-rotate-f4b1dc64 var(--rectangle-rotate-duration) ease calc(var(--rectangle-rotate-delay) + calc(var(--rectangle-rotate-stagger) * 2)) forwards}@keyframes expand-rotate-f4b1dc64{0%{transform:scale(0) rotate(0)}to{transform:scale(1) rotate(var(--rectangle-rotate-rotation))}}@property --theme-colors-hue{syntax: ""; initial-value: 0; inherits: true;}@keyframes hue-anim{0%{--theme-colors-hue: 0}to{--theme-colors-hue: 360}}.dynamic-hue{animation:hue-anim 10s linear infinite}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings: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:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-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{list-style:none;margin:0;padding:0}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{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--airi-theme-primary-50: #fff0f2;--airi-theme-primary-100: #ffe3e6;--airi-theme-primary-200: #ffcad4;--airi-theme-primary-300: #ff9fb0;--airi-theme-primary-400: #ff6988;--airi-theme-primary-500: #fe456e;--airi-theme-primary-600: #ec124d;--airi-theme-primary-700: #c70941;--airi-theme-primary-800: #a70a3e;--airi-theme-primary-900: #8e0d3b;--airi-theme-primary-950: #50011b;--theme-colors-hue: 354.31;--theme-colors-chroma: calc(.18 + cos(var(--theme-colors-hue) * 3.14159265 / 180)/25) ;--theme-colors-chroma-50: calc(var(--theme-colors-chroma) * .3);--theme-colors-chroma-100: calc(var(--theme-colors-chroma) * .5);--theme-colors-chroma-200: calc(var(--theme-colors-chroma) * .6);--theme-colors-chroma-300: calc(var(--theme-colors-chroma) * .75);--theme-colors-chroma-400: var(--theme-colors-chroma);--theme-colors-chroma-600: calc(var(--theme-colors-chroma) * 1.15);--theme-colors-chroma-700: calc(var(--theme-colors-chroma) * 1.1);--theme-colors-chroma-800: calc(var(--theme-colors-chroma) * .85);--theme-colors-chroma-900: calc(var(--theme-colors-chroma) * .7);--theme-colors-chroma-950: calc(var(--theme-colors-chroma) * .5)}.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{transform:translateY(-10px);opacity:0}.slide-away-enter-from,.slide-away-leave{transform:translateY(10px);opacity:0}html,body,#app{height:100%;margin:0;padding:0;overscroll-behavior:none}html{background:#fff;transition:all .3s ease-in-out}html.dark{background:#121212;color-scheme:dark}#nprogress{pointer-events:none}#nprogress .bar{background:#f472b6;opacity:.75;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}*,:before,:after{--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 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--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: }::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 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--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: }@font-face{font-family:DM Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthSQBK6PYK3EXw.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthqQBK6PYK0.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRR232RmYJp8I5zzw.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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 Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRSW32RmYJp8I5.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v15/-nFnOHM81r4j6k0gjAW3mujVU2B2G_5x0vrx52jJ3Q.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v15/-nFnOHM81r4j6k0gjAW3mujVU2B2G_Bx0vrx52g.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.0.woff2) format("woff2");unicode-range:U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26222,U+2626a,U+26270,U+26286,U+2634c,U+26402,U+2667e,U+266b0,U+2671d,U+268dd,U+268ea,U+26951,U+2696f,U+26999,U+269dd,U+26a1e,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26c29,U+26c73,U+26c9e,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752,U+278b2,U+27985,U+279b4,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27c3c,U+27cb8,U+27d73,U+27da0,U+27e10,U+27eaf,U+27fb7,U+2808a,U+280bb,U+28277,U+28282,U+282f3,U+283cd,U+2840c,U+28455,U+284dc,U+2856b,U+285c8-285c9,U+286d7,U+286fa,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28bc1,U+28bef,U+28cdd,U+28d10,U+28d71,U+28dfb,U+28e0f,U+28e17,U+28e1f,U+28e36,U+28e89,U+28eeb,U+28ef6,U+28f32,U+28ff8,U+292a0,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750,U+29810,U+298c6,U+29a72,U+29d4b,U+29ddb,U+29e15,U+29e3d,U+29e49,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29fce,U+29fd7,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a2b2,U+2a38c,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a9e6,U+2b746,U+2b751,U+2b753,U+2b75a,U+2b75c,U+2b765,U+2b776-2b777,U+2b77c,U+2b782,U+2b789,U+2b78b,U+2b78e,U+2b794,U+2b7ac,U+2b7af,U+2b7bd,U+2b7c9,U+2b7cf,U+2b7d2,U+2b7d8,U+2b7f0,U+2b80d,U+2b817,U+2b81a,U+2d544,U+2e278,U+2e569,U+2e6ea,U+2f804,U+2f80f,U+2f815,U+2f818,U+2f81a,U+2f822,U+2f828,U+2f82c,U+2f833,U+2f83f,U+2f846,U+2f852,U+2f862,U+2f86d,U+2f873,U+2f877,U+2f884,U+2f899-2f89a,U+2f8a6,U+2f8ac,U+2f8b2,U+2f8b6,U+2f8d3,U+2f8db-2f8dc,U+2f8e1,U+2f8e5,U+2f8ea,U+2f8ed,U+2f8fc,U+2f903,U+2f90b,U+2f90f,U+2f91a,U+2f920-2f921,U+2f945,U+2f947,U+2f96c,U+2f995,U+2f9d0,U+2f9de-2f9df,U+2f9f4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.1.woff2) format("woff2");unicode-range:U+1f235-1f23b,U+1f240-1f248,U+1f250-1f251,U+2000b,U+20089-2008a,U+200a2,U+200a4,U+200b0,U+200f5,U+20158,U+201a2,U+20213,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+2053f,U+205b1,U+205d6,U+20611,U+20628,U+206ec,U+2074f,U+207c8,U+20807,U+2083a,U+208b9,U+2090e,U+2097c,U+20984,U+2099d,U+20a64,U+20ad3,U+20b1d,U+20b9f,U+20bb7,U+20d45,U+20d58,U+20de1,U+20e64,U+20e6d,U+20e95,U+20f5f,U+21201,U+2123d,U+21255,U+21274,U+2127b,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+213c4,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3,U+21a1a,U+21c56,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b,U+22218,U+2231e,U+223ad,U+22609,U+226f3,U+2285b,U+228ab,U+2298f,U+22ab8,U+22b46,U+22b4f-22b50,U+22ba6,U+22c1d,U+22c24,U+22de1,U+22e42,U+22feb,U+231b6,U+231c3-231c4,U+231f5,U+23372,U+233cc,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+233fe,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237f1,U+237ff,U+23824,U+2383d,U+23a98,U+23c7f,U+23cbe,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23f7e,U+2404b,U+24096,U+24103,U+241c6,U+241fe,U+242ee,U+243bc,U+243d0,U+24629,U+246a5,U+247f1,U+24896,U+248e9,U+24a4d,U+24b56,U+24b6f,U+24c16,U+24d14,U+24e04,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24ff2,U+2504a,U+25055,U+25122,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+255a7,U+2567f,U+25771,U+257a9,U+257b4,U+25874,U+259c4,U+259cc,U+259d4,U+25ad7,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c4b,U+25c64,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed8}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.2.woff2) format("woff2");unicode-range:U+ffd7,U+ffda-ffdc,U+ffe0-ffe2,U+ffe4,U+ffe6,U+ffe8-ffee,U+1f100-1f10c,U+1f110-1f16c,U+1f170-1f1ac,U+1f200-1f202,U+1f210-1f234}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.3.woff2) format("woff2");unicode-range:U+fa10,U+fa12-fa6d,U+fb00-fb04,U+fe10-fe19,U+fe30-fe42,U+fe44-fe52,U+fe54-fe66,U+fe68-fe6b,U+ff02,U+ff04,U+ff07,U+ff51,U+ff5b,U+ff5d,U+ff5f-ff60,U+ff66,U+ff69,U+ff87,U+ffa1-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd6}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.4.woff2) format("woff2");unicode-range:U+f92d-f959,U+f95b-f9f2,U+f9f4-fa0b,U+fa0e-fa0f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.5.woff2) format("woff2");unicode-range:U+9e8b-9e8c,U+9e8e-9e8f,U+9e91-9e92,U+9e95-9e96,U+9e98,U+9e9b,U+9e9d-9e9e,U+9ea4-9ea5,U+9ea8-9eaa,U+9eac-9eb0,U+9eb3-9eb5,U+9eb8,U+9ebc-9ebf,U+9ec3,U+9ec6,U+9ec8,U+9ecb-9ecd,U+9ecf-9ed1,U+9ed4-9ed5,U+9ed8,U+9edb-9ee0,U+9ee4-9ee5,U+9ee7-9ee8,U+9eec-9ef2,U+9ef4-9ef9,U+9efb-9eff,U+9f02-9f03,U+9f07-9f09,U+9f0e-9f12,U+9f14-9f17,U+9f19-9f1b,U+9f1f-9f22,U+9f26,U+9f2a-9f2c,U+9f2f,U+9f31-9f32,U+9f34,U+9f37,U+9f39-9f3a,U+9f3c-9f3f,U+9f41,U+9f43-9f47,U+9f4a,U+9f4e-9f50,U+9f52-9f58,U+9f5a,U+9f5d-9f61,U+9f63,U+9f66-9f6a,U+9f6c-9f73,U+9f75-9f77,U+9f7a,U+9f7d,U+9f7f,U+9f8f-9f92,U+9f94-9f97,U+9f99,U+9f9c-9fa3,U+9fa5,U+9fb4,U+9fbc-9fc2,U+9fc4,U+9fc6,U+9fcc,U+f900-f92c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.6.woff2) format("woff2");unicode-range:U+9c3e,U+9c41,U+9c43-9c4a,U+9c4e-9c50,U+9c52-9c54,U+9c56,U+9c58,U+9c5a-9c61,U+9c63,U+9c65,U+9c67-9c6b,U+9c6d-9c6e,U+9c70,U+9c72,U+9c75-9c78,U+9c7a-9c7c,U+9ce6-9ce7,U+9ceb-9cec,U+9cf0,U+9cf2,U+9cf6-9cf7,U+9cf9,U+9d02-9d03,U+9d06-9d09,U+9d0b,U+9d0e,U+9d11-9d12,U+9d15,U+9d17-9d18,U+9d1b-9d1f,U+9d23,U+9d26,U+9d2a-9d2c,U+9d2f-9d30,U+9d32-9d34,U+9d3a,U+9d3c-9d3f,U+9d41-9d48,U+9d4a,U+9d50-9d54,U+9d59,U+9d5d-9d65,U+9d69-9d6c,U+9d6f-9d70,U+9d72-9d73,U+9d76-9d77,U+9d7a-9d7c,U+9d7e,U+9d83-9d84,U+9d86-9d87,U+9d89-9d8a,U+9d8d-9d8e,U+9d92-9d93,U+9d95-9d9a,U+9da1,U+9da4,U+9da9-9dac,U+9dae,U+9db1-9db2,U+9db5,U+9db8-9dbd,U+9dbf-9dc4,U+9dc6-9dc7,U+9dc9-9dca,U+9dcf,U+9dd3-9dd7,U+9dd9-9dda,U+9dde-9de0,U+9de3,U+9de5-9de7,U+9de9,U+9deb,U+9ded-9df0,U+9df3-9df4,U+9df8,U+9dfd-9dfe,U+9e02,U+9e07,U+9e0a,U+9e0d-9e0e,U+9e10-9e12,U+9e15-9e16,U+9e19-9e1f,U+9e75,U+9e79-9e7d,U+9e80-9e85,U+9e87-9e88}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.7.woff2) format("woff2");unicode-range:U+9ae5-9ae7,U+9ae9,U+9aeb-9aec,U+9aee-9aef,U+9af1-9af5,U+9af7,U+9af9-9afb,U+9afd,U+9aff-9b06,U+9b08-9b09,U+9b0b-9b0e,U+9b10,U+9b12,U+9b16,U+9b18-9b1d,U+9b1f-9b20,U+9b22-9b23,U+9b25-9b2f,U+9b32-9b35,U+9b37,U+9b39-9b3b,U+9b3d,U+9b43-9b44,U+9b48,U+9b4b-9b4f,U+9b51,U+9b55-9b58,U+9b5b,U+9b5e,U+9b61,U+9b63,U+9b65-9b66,U+9b68,U+9b6a-9b6f,U+9b72-9b79,U+9b7f-9b80,U+9b83-9b87,U+9b89-9b8b,U+9b8d,U+9b8f-9b94,U+9b96-9b97,U+9b9a,U+9b9d-9ba0,U+9ba6-9ba7,U+9ba9-9baa,U+9bac,U+9bb0-9bb2,U+9bb4,U+9bb7-9bb9,U+9bbb-9bbc,U+9bbe-9bc1,U+9bc6-9bc8,U+9bca,U+9bce-9bd2,U+9bd4,U+9bd7-9bd8,U+9bdd,U+9bdf,U+9be1-9be5,U+9be7,U+9bea-9beb,U+9bee-9bf3,U+9bf5,U+9bf7-9bfa,U+9bfd,U+9bff-9c00,U+9c02,U+9c04,U+9c06,U+9c08-9c0d,U+9c0f-9c16,U+9c18-9c1e,U+9c21-9c2a,U+9c2d-9c32,U+9c35-9c37,U+9c39-9c3a,U+9c3d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.8.woff2) format("woff2");unicode-range:U+98eb,U+98ed-98ee,U+98f0-98f1,U+98f3,U+98f6,U+9902,U+9907-9909,U+9911-9912,U+9914-9918,U+991a-9922,U+9924,U+9926-9927,U+992b-992c,U+992e,U+9931-9935,U+9939-993e,U+9940-9942,U+9945-9949,U+994b-994e,U+9950-9952,U+9954-9955,U+9958-9959,U+995b-995c,U+995e-9960,U+9963,U+9997-9998,U+999b,U+999d-999f,U+99a3,U+99a5-99a6,U+99a8,U+99ad-99ae,U+99b0-99b2,U+99b5,U+99b9-99ba,U+99bc-99bd,U+99bf,U+99c1,U+99c3,U+99c8-99c9,U+99d1,U+99d3-99d5,U+99d8-99df,U+99e1-99e2,U+99e7,U+99ea-99ee,U+99f0-99f2,U+99f4-99f5,U+99f8-99f9,U+99fb-99fe,U+9a01-9a05,U+9a08,U+9a0a-9a0c,U+9a0f-9a11,U+9a16,U+9a1a,U+9a1e,U+9a20,U+9a22-9a24,U+9a27,U+9a2b,U+9a2d-9a2e,U+9a31,U+9a33,U+9a35-9a38,U+9a3e,U+9a40-9a45,U+9a47,U+9a4a-9a4e,U+9a51-9a52,U+9a54-9a58,U+9a5b,U+9a5d,U+9a5f,U+9a62,U+9a64-9a65,U+9a69-9a6c,U+9aaa,U+9aac-9ab0,U+9ab2,U+9ab4-9ab7,U+9ab9,U+9abb-9ac1,U+9ac3,U+9ac6,U+9ac8,U+9ace-9ad3,U+9ad5-9ad7,U+9adb-9adc,U+9ade-9ae0,U+9ae2-9ae4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.9.woff2) format("woff2");unicode-range:U+971d,U+9721-9724,U+9728,U+972a,U+9730-9731,U+9733,U+9736,U+9738-9739,U+973b,U+973d-973e,U+9741-9744,U+9746-974a,U+974d-974f,U+9751,U+9755,U+9757-9758,U+975a-975c,U+9760-9761,U+9763-9764,U+9766-9768,U+976a-976b,U+976e,U+9771,U+9773,U+9776-977d,U+977f-9781,U+9785-9786,U+9789,U+978b,U+978f-9790,U+9795-9797,U+9799-979a,U+979c,U+979e-97a0,U+97a2-97a3,U+97a6,U+97a8,U+97ab-97ac,U+97ae,U+97b1-97b6,U+97b8-97ba,U+97bc,U+97be-97bf,U+97c1,U+97c3-97ce,U+97d0-97d1,U+97d4,U+97d7-97d9,U+97db-97de,U+97e0-97e1,U+97e4,U+97e6,U+97ed-97ef,U+97f1-97f2,U+97f4-97f8,U+97fa,U+9804,U+9807,U+980a,U+980c-980f,U+9814,U+9816-9817,U+9819-981a,U+981c,U+981e,U+9820-9821,U+9823-9826,U+982b,U+982e-9830,U+9832-9835,U+9837,U+9839,U+983d-983e,U+9844,U+9846-9847,U+984a-984b,U+984f,U+9851-9853,U+9856-9857,U+9859-985b,U+9862-9863,U+9865-9866,U+986a-986c,U+986f-9871,U+9873-9875,U+98aa-98ab,U+98ad-98ae,U+98b0-98b1,U+98b4,U+98b6-98b8,U+98ba-98bc,U+98bf,U+98c2-98c8,U+98cb-98cc,U+98ce,U+98dc,U+98de,U+98e0-98e1,U+98e3,U+98e5-98e7,U+98e9-98ea}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.10.woff2) format("woff2");unicode-range:U+944a,U+944c,U+9452-9453,U+9455,U+9459-945c,U+945e-9463,U+9468,U+946a-946b,U+946d-9472,U+9475,U+9477,U+947c-947f,U+9481,U+9483-9485,U+9578-9579,U+957e-957f,U+9582,U+9584,U+9586-9588,U+958a,U+958c-958f,U+9592,U+9594,U+9596,U+9598-9599,U+959d-95a1,U+95a4,U+95a6-95a9,U+95ab-95ad,U+95b1,U+95b4,U+95b6,U+95b9-95bf,U+95c3,U+95c6,U+95c8-95cd,U+95d0-95d6,U+95d9-95da,U+95dc-95e2,U+95e4-95e6,U+95e8,U+961d-961e,U+9621-9622,U+9624-9626,U+9628,U+962c,U+962e-962f,U+9631,U+9633-9634,U+9637-963a,U+963c-963d,U+9641-9642,U+964b-964c,U+964f,U+9652,U+9654,U+9656-9658,U+965c-965f,U+9661,U+9666,U+966a,U+966c,U+966e,U+9672,U+9674,U+9677,U+967b-967c,U+967e-967f,U+9681-9684,U+9689,U+968b,U+968d,U+9691,U+9695-9698,U+969a,U+969d,U+969f,U+96a4-96aa,U+96ae-96b4,U+96b6,U+96b8-96bb,U+96bd,U+96c1,U+96c9-96cb,U+96cd-96ce,U+96d2,U+96d5-96d6,U+96d8-96da,U+96dc-96df,U+96e9,U+96ef,U+96f1,U+96f9-96fa,U+9702-9706,U+9708-9709,U+970d-970f,U+9711,U+9713-9714,U+9716,U+9719-971b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.11.woff2) format("woff2");unicode-range:U+92bc-92bd,U+92bf-92c3,U+92c5-92c8,U+92cb-92d0,U+92d2-92d3,U+92d5,U+92d7-92d9,U+92dc-92dd,U+92df-92e1,U+92e3-92e5,U+92e7-92ea,U+92ec,U+92ee,U+92f0,U+92f2,U+92f7-92fb,U+92ff-9300,U+9302,U+9304,U+9308,U+930d,U+930f-9311,U+9314-9315,U+9318-931a,U+931c-931f,U+9321-9325,U+9327-932b,U+932e,U+9333-9337,U+933a-933b,U+9344,U+9347-934a,U+934d,U+9350-9352,U+9354-9358,U+935a,U+935c,U+935e,U+9360,U+9364-9365,U+9367,U+9369-936d,U+936f-9371,U+9373-9374,U+9376,U+937a,U+937d-9382,U+9388,U+938a-938b,U+938d,U+938f,U+9392,U+9394-9395,U+9397-9398,U+939a-939b,U+939e,U+93a1,U+93a3-93a4,U+93a6,U+93a8-93a9,U+93ab-93ad,U+93b0,U+93b4-93b6,U+93b9-93bb,U+93c1,U+93c3-93cd,U+93d0-93d1,U+93d3,U+93d6-93d9,U+93dc-93df,U+93e2,U+93e4-93e8,U+93f1,U+93f5,U+93f7-93fb,U+93fd,U+9401-9404,U+9407-9409,U+940d-9410,U+9413-9417,U+9419-941a,U+941f,U+9421,U+942b,U+942e-942f,U+9431-9434,U+9436,U+9438,U+943a-943b,U+943d,U+943f,U+9441,U+9443-9445,U+9448}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.12.woff2) format("woff2");unicode-range:U+9143,U+9146-914c,U+914f,U+9153,U+9156-915b,U+9161,U+9163-9165,U+9167,U+9169,U+916d,U+9172-9174,U+9179-917b,U+9181-9183,U+9185-9187,U+9189-918b,U+918e,U+9191,U+9193-9195,U+9197-9198,U+919e,U+91a1-91a2,U+91a6,U+91a8,U+91aa-91b6,U+91ba-91bd,U+91bf-91c6,U+91c9,U+91cb,U+91d0,U+91d3-91d4,U+91d6-91d7,U+91d9-91db,U+91de-91df,U+91e1,U+91e4-91e6,U+91e9-91ea,U+91ec-91f1,U+91f5-91f7,U+91f9,U+91fb-91fd,U+91ff-9201,U+9204-9207,U+9209-920a,U+920c,U+920e,U+9210-9218,U+921c-921e,U+9223-9226,U+9228-9229,U+922c,U+922e-9230,U+9233,U+9235-923a,U+923c,U+923e-9240,U+9242-9243,U+9245-924b,U+924d-9251,U+9256-925a,U+925c-925e,U+9260-9261,U+9264-9269,U+926e-9270,U+9275-9279,U+927b-927f,U+9288-928a,U+928d-928e,U+9291-9293,U+9295-9297,U+9299,U+929b-929c,U+929f-92a0,U+92a4-92a5,U+92a7-92a8,U+92ab,U+92af,U+92b2-92b3,U+92b6-92bb}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.13.woff2) format("woff2");unicode-range:U+8f52-8f55,U+8f57-8f58,U+8f5c-8f5e,U+8f61-8f66,U+8f9c-8f9d,U+8f9f-8fa2,U+8fa4-8fa8,U+8fad-8faf,U+8fb4-8fb8,U+8fbe,U+8fc0-8fc2,U+8fc6,U+8fc8,U+8fca-8fcb,U+8fcd,U+8fd0,U+8fd2-8fd3,U+8fd5,U+8fda,U+8fe0,U+8fe2-8fe5,U+8fe8-8fea,U+8fed-8fef,U+8ff1,U+8ff4-8ff6,U+8ff8-8ffb,U+8ffe,U+9002,U+9004-9005,U+9008,U+900b-900e,U+9011,U+9013,U+9015-9016,U+9018,U+901b,U+901e,U+9021,U+9027-902a,U+902c-902d,U+902f,U+9033-9037,U+9039,U+903c,U+903e-903f,U+9041,U+9043-9044,U+9049,U+904c,U+904f-9052,U+9056,U+9058,U+905b-905e,U+9062,U+9066-9068,U+906c,U+906f-9070,U+9072,U+9074,U+9076,U+9079,U+9080-9083,U+9085,U+9087-9088,U+908b-908c,U+908e-9090,U+9095,U+9097-9099,U+909b,U+90a0-90a2,U+90a5,U+90a8,U+90af-90b6,U+90bd-90be,U+90c3-90c5,U+90c7-90c9,U+90cc,U+90d2,U+90d5,U+90d7-90d9,U+90db-90df,U+90e2,U+90e4-90e5,U+90eb,U+90ef-90f0,U+90f2,U+90f4,U+90f6,U+90fe-9100,U+9102,U+9104-9106,U+9108,U+910d,U+9110,U+9112,U+9114-911a,U+911c,U+911e,U+9120,U+9122-9123,U+9125,U+9127,U+9129,U+912d-9132,U+9134,U+9136-9137,U+9139-913a,U+913c-913d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.14.woff2) format("woff2");unicode-range:U+8dc0,U+8dc2,U+8dc5-8dc8,U+8dca-8dcc,U+8dce-8dcf,U+8dd1,U+8dd4-8dd7,U+8dd9-8ddb,U+8ddf,U+8de3-8de5,U+8de7,U+8dea-8dec,U+8df0-8df2,U+8df4,U+8dfc-8dfd,U+8dff,U+8e01,U+8e04-8e06,U+8e08-8e09,U+8e0b-8e0c,U+8e10-8e11,U+8e14,U+8e16,U+8e1d-8e23,U+8e26-8e27,U+8e30-8e31,U+8e33-8e39,U+8e3d,U+8e40-8e42,U+8e44,U+8e47-8e50,U+8e54-8e55,U+8e59,U+8e5b-8e64,U+8e69,U+8e6c-8e6d,U+8e6f-8e72,U+8e75-8e77,U+8e79-8e7c,U+8e81-8e85,U+8e89,U+8e8b,U+8e90-8e95,U+8e98-8e9b,U+8e9d-8e9e,U+8ea1-8ea2,U+8ea7,U+8ea9-8eaa,U+8eac-8eb1,U+8eb3,U+8eb5-8eb6,U+8eba-8ebb,U+8ebe,U+8ec0-8ec1,U+8ec3-8ec8,U+8ecb,U+8ecf,U+8ed1,U+8ed4,U+8edb-8edc,U+8ee3,U+8ee8,U+8eeb,U+8eed-8eee,U+8ef0-8ef1,U+8ef7,U+8ef9-8efc,U+8efe,U+8f00,U+8f02,U+8f05,U+8f07-8f08,U+8f0a,U+8f0f-8f10,U+8f12-8f13,U+8f15-8f19,U+8f1b-8f1c,U+8f1e-8f21,U+8f23,U+8f25-8f28,U+8f2b-8f2f,U+8f33-8f37,U+8f39-8f3b,U+8f3e,U+8f40-8f43,U+8f45-8f47,U+8f49-8f4a,U+8f4c-8f4f,U+8f51}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.15.woff2) format("woff2");unicode-range:U+8b2d,U+8b30,U+8b37,U+8b3c,U+8b3e,U+8b41-8b46,U+8b48-8b49,U+8b4c-8b4f,U+8b51-8b54,U+8b56,U+8b59,U+8b5b,U+8b5e-8b5f,U+8b63,U+8b69,U+8b6b-8b6d,U+8b6f,U+8b71,U+8b74,U+8b76,U+8b78-8b79,U+8b7c-8b81,U+8b84-8b85,U+8b8a-8b8f,U+8b92-8b96,U+8b99-8b9a,U+8b9c-8ba0,U+8c38-8c3a,U+8c3d-8c3f,U+8c41,U+8c45,U+8c47-8c49,U+8c4b-8c4c,U+8c4e-8c51,U+8c53-8c55,U+8c57-8c59,U+8c5b,U+8c5d,U+8c62-8c64,U+8c66,U+8c68-8c69,U+8c6b-8c6d,U+8c73,U+8c75-8c76,U+8c78,U+8c7a-8c7c,U+8c7e,U+8c82,U+8c85-8c87,U+8c89-8c8b,U+8c8d-8c8e,U+8c90,U+8c92-8c94,U+8c98-8c99,U+8c9b-8c9c,U+8c9f,U+8ca4,U+8cad-8cae,U+8cb2-8cb3,U+8cb6,U+8cb9-8cba,U+8cbd,U+8cc1-8cc2,U+8cc4-8cc6,U+8cc8-8cc9,U+8ccb,U+8ccd-8ccf,U+8cd2,U+8cd5-8cd6,U+8cd9-8cda,U+8cdd,U+8ce1,U+8ce3-8ce4,U+8ce6,U+8ce8,U+8cec,U+8cef-8cf2,U+8cf4-8cf5,U+8cf7-8cf8,U+8cfa-8cfb,U+8cfd-8cff,U+8d01,U+8d03-8d04,U+8d07,U+8d09-8d0b,U+8d0d-8d10,U+8d12-8d14,U+8d16-8d17,U+8d1b-8d1d,U+8d65,U+8d67,U+8d69,U+8d6b-8d6e,U+8d71,U+8d73,U+8d76,U+8d7f,U+8d81-8d82,U+8d84,U+8d88,U+8d8d,U+8d90-8d91,U+8d95,U+8d99,U+8d9e-8da0,U+8da6,U+8da8,U+8dab-8dac,U+8daf,U+8db2,U+8db5,U+8db7,U+8db9-8dbc,U+8dbe}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.16.woff2) format("woff2");unicode-range:U+8973-8975,U+8977,U+897a-897e,U+8980,U+8983,U+8988-898a,U+898d,U+8990,U+8993-8995,U+8998,U+899b-899c,U+899f-89a1,U+89a5-89a6,U+89a9,U+89ac,U+89af-89b0,U+89b2,U+89b4-89b7,U+89ba,U+89bc-89bd,U+89bf-89c1,U+89d4-89d8,U+89da,U+89dc-89dd,U+89e5,U+89e7,U+89e9,U+89eb,U+89ed,U+89f1,U+89f3-89f4,U+89f6,U+89f8-89f9,U+89fd,U+89ff,U+8a01,U+8a04-8a05,U+8a07,U+8a0c,U+8a0f-8a12,U+8a14-8a16,U+8a1b,U+8a1d-8a1e,U+8a20-8a22,U+8a24-8a26,U+8a2b-8a2c,U+8a2f,U+8a35-8a37,U+8a3b,U+8a3d-8a3e,U+8a40-8a41,U+8a43,U+8a45-8a49,U+8a4d-8a4e,U+8a51-8a54,U+8a56-8a58,U+8a5b-8a5d,U+8a61-8a62,U+8a65,U+8a67,U+8a6c-8a6d,U+8a75-8a77,U+8a79-8a7c,U+8a7e-8a80,U+8a82-8a86,U+8a8b,U+8a8f-8a92,U+8a96-8a97,U+8a99-8a9a,U+8a9f,U+8aa1,U+8aa3,U+8aa5-8aaa,U+8aae-8aaf,U+8ab3,U+8ab6-8ab7,U+8abb-8abc,U+8abe,U+8ac2-8ac4,U+8ac6,U+8ac8-8aca,U+8acc-8acd,U+8ad0-8ad1,U+8ad3-8ad5,U+8ad7,U+8ada-8ae2,U+8ae4,U+8ae7,U+8aeb-8aec,U+8aee,U+8af0-8af1,U+8af3-8af7,U+8afa,U+8afc,U+8aff,U+8b01-8b02,U+8b04-8b07,U+8b0a-8b0d,U+8b0f-8b11,U+8b14,U+8b16,U+8b1a,U+8b1c,U+8b1e-8b20,U+8b26,U+8b28,U+8b2b-8b2c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.17.woff2) format("woff2");unicode-range:U+87e2-87e6,U+87ea-87ed,U+87ef,U+87f1,U+87f3,U+87f5-87f8,U+87fa-87fb,U+87fe-87ff,U+8801,U+8803,U+8805-8807,U+8809-880b,U+880d-8816,U+8818-881c,U+881e-881f,U+8821-8822,U+8827-8828,U+882d-882e,U+8830-8832,U+8835-8836,U+8839-883c,U+8841-8845,U+8848-884b,U+884d-884e,U+8851-8852,U+8855-8856,U+8858-885a,U+885c,U+885e-8860,U+8862,U+8864,U+8869,U+886b,U+886e-886f,U+8871-8872,U+8875,U+8877,U+8879,U+887b,U+887d-887e,U+8880-8882,U+8888,U+888d,U+8892,U+8897-889c,U+889e-88a0,U+88a2,U+88a4,U+88a8,U+88aa,U+88ae,U+88b0-88b1,U+88b5,U+88b7,U+88ba,U+88bc-88c0,U+88c3-88c4,U+88c6,U+88ca-88ce,U+88d1-88d4,U+88d8-88d9,U+88db,U+88dd-88e1,U+88e7-88e8,U+88ef-88f2,U+88f4-88f5,U+88f7,U+88f9,U+88fc,U+8901-8902,U+8904,U+8906,U+890a,U+890c-890f,U+8913,U+8915-8916,U+8918-891a,U+891c-891e,U+8920,U+8925-8928,U+892a-892b,U+8930-8932,U+8935-893b,U+893e,U+8940-8946,U+8949,U+894c-894d,U+894f,U+8952,U+8956-8957,U+895a-895c,U+895e,U+8960-8964,U+8966,U+896a-896b,U+896d-8970}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.18.woff2) format("woff2");unicode-range:U+8655-8659,U+865b,U+865d-8664,U+8667,U+8669,U+866c,U+866f,U+8671,U+8675-8677,U+867a-867b,U+867d,U+8687-8689,U+868b-868d,U+8691,U+8693,U+8695-8696,U+8698,U+869a,U+869c-869d,U+86a1,U+86a3-86a4,U+86a6-86ab,U+86ad,U+86af-86b1,U+86b3-86b9,U+86bf-86c1,U+86c3-86c6,U+86c9,U+86cb,U+86ce,U+86d1-86d2,U+86d4-86d5,U+86d7,U+86da,U+86dc,U+86de-86e0,U+86e3-86e7,U+86e9,U+86ec-86ed,U+86ef,U+86f8-86fe,U+8700,U+8703-870b,U+870d-8714,U+8719-871a,U+871e-871f,U+8721-8723,U+8725,U+8728-8729,U+872e-872f,U+8731-8732,U+8734,U+8737,U+8739-8740,U+8743,U+8745,U+8749,U+874b-874e,U+8751,U+8753,U+8755,U+8757-8759,U+875d,U+875f-8761,U+8763-8766,U+8768,U+876a,U+876e-876f,U+8771-8772,U+8774,U+8778,U+877b-877c,U+877f,U+8782-8789,U+878b-878c,U+878e,U+8790,U+8793,U+8795,U+8797-8799,U+879e-87a0,U+87a2-87a3,U+87a7,U+87ab-87af,U+87b1,U+87b3,U+87b5,U+87bb,U+87bd-87c1,U+87c4,U+87c6-87cb,U+87ce,U+87d0,U+87d2,U+87d5-87d6,U+87d9-87da,U+87dc,U+87df-87e0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.19.woff2) format("woff2");unicode-range:U+84b4,U+84b9-84bb,U+84bd-84c2,U+84c6-84ca,U+84cc-84d1,U+84d3,U+84d6,U+84d9-84da,U+84dc,U+84e7,U+84ea,U+84ec,U+84ef-84f2,U+84f4,U+84f7,U+84fa-84fd,U+84ff-8500,U+8502-8503,U+8506-8507,U+850c,U+850e,U+8510,U+8514-8515,U+8517-8518,U+851a-851c,U+851e-851f,U+8521-8525,U+8527,U+852a-852c,U+852f,U+8532-8534,U+8536,U+853e-8541,U+8543,U+8546,U+8548,U+854a-854b,U+854f-8553,U+8555-855a,U+855c-8564,U+8569-856b,U+856d,U+856f,U+8577,U+8579-857b,U+857d-8581,U+8585-8586,U+8588-858c,U+858f-8591,U+8593,U+8597-8598,U+859b-859d,U+859f-85a0,U+85a2,U+85a4-85a5,U+85a7-85a8,U+85ad-85b0,U+85b4,U+85b6-85ba,U+85bc-85bf,U+85c1-85c2,U+85c7,U+85c9-85cb,U+85ce-85d0,U+85d5,U+85d8-85da,U+85dc,U+85df-85e1,U+85e5-85e6,U+85e8,U+85ed,U+85f3-85f4,U+85f6-85f7,U+85f9-85fa,U+85fc,U+85fe-8600,U+8602,U+8604-8606,U+860a-860b,U+860d-860e,U+8610-8613,U+8616-861b,U+861e,U+8621-8622,U+8624,U+8627,U+8629,U+862f-8630,U+8636,U+8638-863a,U+863c-863d,U+863f-8642,U+8646,U+864d,U+8652-8654}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.20.woff2) format("woff2");unicode-range:U+82e8,U+82ea,U+82ed,U+82ef,U+82f3-82f4,U+82f6-82f7,U+82f9,U+82fb,U+82fd-82fe,U+8300-8301,U+8303,U+8306-8308,U+830a-830c,U+8316-8318,U+831b,U+831d-831f,U+8321-8323,U+832b-8335,U+8337,U+833a,U+833c-833d,U+8340,U+8342-8347,U+834a,U+834d-8351,U+8353-8357,U+835a,U+8362-8363,U+8370,U+8373,U+8375,U+8378,U+837c-837d,U+837f-8380,U+8382,U+8384-8387,U+838a,U+838d-838e,U+8392-8396,U+8398-83a0,U+83a2,U+83a6-83ad,U+83b1,U+83b5,U+83bd-83c1,U+83c7,U+83c9,U+83ce-83d1,U+83d4,U+83d6,U+83d8,U+83dd,U+83df-83e1,U+83e5,U+83e8,U+83ea-83eb,U+83f0,U+83f2,U+83f4,U+83f6-83f9,U+83fb-83fd,U+8401,U+8403-8404,U+8406-8407,U+840a-840b,U+840d,U+840f,U+8411,U+8413,U+8415,U+8417,U+8419,U+8420,U+8422,U+842a,U+842f,U+8431,U+8435,U+8438-8439,U+843c,U+8445-8448,U+844a,U+844d-844f,U+8451-8452,U+8456,U+8458-845a,U+845c,U+845f-8462,U+8464-8467,U+8469-846b,U+846d-8470,U+8473-8474,U+8476-847a,U+847c-847d,U+8481-8482,U+8484-8485,U+848b,U+8490,U+8492-8493,U+8495,U+8497,U+849c,U+849e-849f,U+84a1,U+84a6,U+84a8-84aa,U+84ad,U+84af,U+84b1}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.21.woff2) format("woff2");unicode-range:U+814a,U+814c,U+8151-8153,U+8157,U+815f-8161,U+8165-8169,U+816d-816f,U+8171,U+8173-8174,U+8177,U+8180-8186,U+8188,U+818a-818b,U+818e,U+8190,U+8193,U+8195-8196,U+8198,U+819b,U+819e,U+81a0,U+81a2,U+81a4,U+81a9,U+81ae,U+81b0,U+81b2,U+81b4-81b5,U+81b8,U+81ba-81bb,U+81bd-81be,U+81c0-81c3,U+81c5-81c6,U+81c8-81cb,U+81cd-81cf,U+81d1,U+81d5-81db,U+81dd-81e1,U+81e4-81e5,U+81e7,U+81eb-81ec,U+81ef-81f2,U+81f5-81f6,U+81f8-81fb,U+81fd-8205,U+8209-820b,U+820d,U+820f,U+8212-8214,U+8216,U+8219-821d,U+8221-8222,U+8228-8229,U+822b,U+822e,U+8232-8235,U+8237-8238,U+823a,U+823c,U+8240,U+8243-8246,U+8249,U+824b,U+824e-824f,U+8251,U+8256-825a,U+825c-825d,U+825f-8260,U+8262-8264,U+8267-8268,U+826a-826b,U+826d-826e,U+8271,U+8274,U+8277,U+8279,U+827b,U+827d-8281,U+8283-8284,U+8287,U+8289-828a,U+828d-828e,U+8291-8294,U+8296,U+8298-829b,U+829f-82a1,U+82a3-82a4,U+82a7-82ac,U+82ae,U+82b0,U+82b2,U+82b4,U+82b7,U+82ba-82bc,U+82be-82bf,U+82c5-82c6,U+82d0,U+82d2-82d3,U+82d5,U+82d9-82da,U+82dc,U+82de-82e4,U+82e7}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.22.woff2) format("woff2");unicode-range:U+7f77-7f79,U+7f7d-7f80,U+7f82-7f83,U+7f86-7f88,U+7f8b-7f8d,U+7f8f-7f91,U+7f94,U+7f96-7f97,U+7f9a,U+7f9c-7f9d,U+7fa1-7fa3,U+7fa6,U+7faa,U+7fad-7faf,U+7fb2,U+7fb4,U+7fb6,U+7fb8-7fb9,U+7fbc,U+7fbf-7fc0,U+7fc3,U+7fc5-7fc6,U+7fc8,U+7fca,U+7fce-7fcf,U+7fd5,U+7fdb,U+7fdf,U+7fe1,U+7fe3,U+7fe5-7fe6,U+7fe8-7fe9,U+7feb-7fec,U+7fee-7ff0,U+7ff2-7ff3,U+7ff9-7ffa,U+7ffd-7fff,U+8002,U+8004,U+8006-8008,U+800a-800f,U+8011-8014,U+8016,U+8018-8019,U+801c-8021,U+8024,U+8026,U+8028,U+802c,U+802e,U+8030,U+8034-8035,U+8037,U+8039-8040,U+8043-8044,U+8046,U+804a,U+8052,U+8058,U+805a,U+805f-8060,U+8062,U+8064,U+8066,U+8068,U+806d,U+806f-8073,U+8075-8076,U+8079,U+807b,U+807d-8081,U+8084-8088,U+808b,U+808e,U+8093,U+8099-809a,U+809c,U+809e,U+80a4,U+80a6-80a7,U+80ab-80ad,U+80b1,U+80b8-80b9,U+80c4-80c5,U+80c8,U+80ca,U+80cd,U+80cf,U+80d2,U+80d4-80db,U+80dd,U+80e0,U+80e4-80e6,U+80ed-80f3,U+80f5-80f7,U+80f9-80fc,U+80fe,U+8101,U+8103,U+8109,U+810b,U+810d,U+8116-8118,U+811b-811c,U+811e,U+8120,U+8123-8124,U+8127,U+8129,U+812b-812c,U+812f-8130,U+8135,U+8139-813a,U+813c-813e,U+8141,U+8145-8147}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.23.woff2) format("woff2");unicode-range:U+7d57,U+7d59-7d5d,U+7d63,U+7d65,U+7d67,U+7d6a,U+7d6e,U+7d70,U+7d72-7d73,U+7d78,U+7d7a-7d7b,U+7d7d,U+7d7f,U+7d81-7d83,U+7d85-7d86,U+7d88-7d89,U+7d8b-7d8d,U+7d8f,U+7d91,U+7d93,U+7d96-7d97,U+7d9b-7da0,U+7da2-7da3,U+7da6-7da7,U+7daa-7dac,U+7dae-7db0,U+7db3,U+7db5-7db9,U+7dbd,U+7dc0,U+7dc2-7dc7,U+7dcc-7dce,U+7dd0,U+7dd5-7dd9,U+7ddc-7dde,U+7de1-7de6,U+7dea-7ded,U+7df1-7df2,U+7df5-7df6,U+7df9-7dfa,U+7e00,U+7e05,U+7e08-7e0b,U+7e10-7e12,U+7e15,U+7e17,U+7e1c-7e1d,U+7e1f-7e23,U+7e27-7e28,U+7e2c-7e2d,U+7e2f,U+7e31-7e33,U+7e35-7e37,U+7e39-7e3b,U+7e3d,U+7e3f,U+7e43-7e48,U+7e4e,U+7e50,U+7e52,U+7e56,U+7e58-7e5a,U+7e5d-7e5f,U+7e61-7e62,U+7e65-7e67,U+7e69-7e6b,U+7e6d-7e6f,U+7e73,U+7e75,U+7e78-7e79,U+7e7b-7e7f,U+7e81-7e83,U+7e86-7e8a,U+7e8c-7e8e,U+7e90-7e96,U+7e98,U+7e9a-7e9f,U+7f38,U+7f3a-7f3f,U+7f43-7f45,U+7f47,U+7f4c-7f50,U+7f52-7f55,U+7f58,U+7f5b-7f5d,U+7f5f,U+7f61,U+7f63-7f69,U+7f6b,U+7f6d,U+7f71}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.24.woff2) format("woff2");unicode-range:U+7bc8,U+7bca-7bcc,U+7bcf,U+7bd4,U+7bd6-7bd7,U+7bd9-7bdb,U+7bdd,U+7be5-7be6,U+7be8-7bea,U+7bf0,U+7bf2-7bfa,U+7bfc,U+7bfe,U+7c00-7c04,U+7c06-7c07,U+7c09,U+7c0b-7c0f,U+7c11-7c14,U+7c17,U+7c19,U+7c1b,U+7c1e-7c20,U+7c23,U+7c25-7c28,U+7c2a-7c2c,U+7c2f,U+7c31,U+7c33-7c34,U+7c36-7c3a,U+7c3d-7c3e,U+7c40,U+7c42-7c43,U+7c45-7c46,U+7c4a,U+7c4c,U+7c4f-7c5f,U+7c61,U+7c63-7c65,U+7c67,U+7c69,U+7c6c-7c70,U+7c72,U+7c75,U+7c79,U+7c7b-7c7e,U+7c81-7c83,U+7c86-7c87,U+7c8d,U+7c8f-7c90,U+7c94,U+7c9e,U+7ca0-7ca2,U+7ca4-7ca6,U+7ca8,U+7cab,U+7cad-7cae,U+7cb0-7cb3,U+7cb6-7cb7,U+7cb9-7cbd,U+7cbf-7cc0,U+7cc2,U+7cc4-7cc5,U+7cc7-7cca,U+7ccd-7ccf,U+7cd2-7cd5,U+7cd7-7cda,U+7cdc-7cdd,U+7cdf-7ce0,U+7ce2,U+7ce6,U+7ce9,U+7ceb,U+7cef,U+7cf2,U+7cf4-7cf6,U+7cf9-7cfa,U+7cfe,U+7d02-7d03,U+7d06-7d0a,U+7d0f,U+7d11-7d13,U+7d15-7d16,U+7d1c-7d1e,U+7d23,U+7d26,U+7d2a,U+7d2c-7d2e,U+7d31-7d32,U+7d35,U+7d3c-7d41,U+7d43,U+7d45,U+7d47-7d48,U+7d4b,U+7d4d-7d4f,U+7d51,U+7d53,U+7d55-7d56}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.25.woff2) format("woff2");unicode-range:U+7a17-7a19,U+7a1b,U+7a1e-7a21,U+7a27,U+7a2b,U+7a2d,U+7a2f-7a31,U+7a34-7a35,U+7a37-7a3b,U+7a3e,U+7a43-7a49,U+7a4c,U+7a4e,U+7a50,U+7a55-7a57,U+7a59,U+7a5c-7a5d,U+7a5f-7a63,U+7a65,U+7a67,U+7a69-7a6a,U+7a6d,U+7a70,U+7a75,U+7a78-7a79,U+7a7d-7a7e,U+7a80,U+7a82,U+7a84-7a86,U+7a88,U+7a8a-7a8b,U+7a90-7a91,U+7a94-7a98,U+7a9e,U+7aa0,U+7aa3,U+7aa9,U+7aac,U+7ab0,U+7ab3,U+7ab5-7ab6,U+7ab9-7abf,U+7ac3,U+7ac5-7aca,U+7acc-7acf,U+7ad1-7ad3,U+7ad5,U+7ada-7adb,U+7add,U+7adf,U+7ae1-7ae2,U+7ae6-7aed,U+7af0-7af1,U+7af4,U+7af8,U+7afa-7afb,U+7afd-7afe,U+7b02,U+7b04,U+7b06-7b08,U+7b0a-7b0b,U+7b0f,U+7b12,U+7b14,U+7b18-7b19,U+7b1e-7b1f,U+7b23,U+7b25,U+7b27-7b2b,U+7b2d-7b31,U+7b33-7b36,U+7b3b,U+7b3d,U+7b3f-7b41,U+7b45,U+7b47,U+7b4c-7b50,U+7b53,U+7b55,U+7b5d,U+7b60,U+7b64-7b66,U+7b69-7b6a,U+7b6c-7b75,U+7b77,U+7b79-7b7a,U+7b7f,U+7b84,U+7b86,U+7b89,U+7b8d-7b92,U+7b96,U+7b98-7ba0,U+7ba5,U+7bac-7bad,U+7baf-7bb0,U+7bb2,U+7bb4-7bb6,U+7bba-7bbd,U+7bc1-7bc2,U+7bc5-7bc6}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.26.woff2) format("woff2");unicode-range:U+7851-7852,U+785c,U+785e,U+7860-7861,U+7863-7864,U+7868,U+786a,U+786e-786f,U+7872,U+7874,U+787a,U+787c,U+787e,U+7886-7887,U+788a,U+788c-788f,U+7893-7895,U+7898,U+789a,U+789d-789f,U+78a1,U+78a3-78a4,U+78a8-78aa,U+78ac-78ad,U+78af-78b3,U+78b5,U+78bb-78bf,U+78c5-78cc,U+78ce,U+78d1-78d6,U+78da-78db,U+78df-78e1,U+78e4,U+78e6-78e7,U+78ea,U+78ec,U+78f2-78f4,U+78f6-78f7,U+78f9-78fb,U+78fd-7901,U+7906-7907,U+790c,U+7910-7912,U+7919-791c,U+791e-7920,U+7925-792e,U+7930-7931,U+7934-7935,U+793b,U+793d,U+793f,U+7941-7942,U+7944-7946,U+794a-794b,U+794f,U+7951,U+7954-7955,U+7957-7958,U+795a-795c,U+795f-7960,U+7962,U+7967,U+7969,U+796b,U+7972,U+7977,U+7979-797c,U+797e-7980,U+798a-798e,U+7991,U+7993-7996,U+7998,U+799b-799d,U+79a1,U+79a6-79ab,U+79ae-79b1,U+79b3-79b4,U+79b8-79bb,U+79bd-79be,U+79c2,U+79c4,U+79c7-79ca,U+79cc-79cd,U+79cf,U+79d4-79d6,U+79da,U+79dd-79e3,U+79e5,U+79e7,U+79ea-79ed,U+79f1,U+79f8,U+79fc,U+7a02-7a03,U+7a05,U+7a07-7a0a,U+7a0c-7a0d,U+7a11,U+7a15}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.27.woff2) format("woff2");unicode-range:U+768c-768e,U+7690,U+7693,U+7695-7696,U+7699-76a8,U+76aa,U+76ad,U+76af-76b0,U+76b4,U+76b6-76ba,U+76bd,U+76c1-76c3,U+76c5,U+76c8-76c9,U+76cb-76ce,U+76d2,U+76d4,U+76d6,U+76d9,U+76dc,U+76de,U+76e0-76e1,U+76e5-76e8,U+76ea-76ec,U+76f0-76f1,U+76f6,U+76f9,U+76fb-76fc,U+7700,U+7704,U+7706-7708,U+770a,U+770e,U+7712,U+7714-7715,U+7717,U+7719-771c,U+7722,U+7724-7726,U+7728,U+772d-772f,U+7734-7739,U+773d-773e,U+7742,U+7745-7747,U+774a,U+774d-774f,U+7752,U+7756-7758,U+775a-775c,U+775e-7760,U+7762,U+7764-7765,U+7767,U+776a-776c,U+7770,U+7772-7774,U+7779-777a,U+777c-7780,U+7784,U+778b-778e,U+7794-7796,U+779a,U+779e-77a0,U+77a2,U+77a4-77a5,U+77a7,U+77a9-77aa,U+77ae-77b1,U+77b5-77b7,U+77b9,U+77bb-77bf,U+77c3,U+77c7,U+77c9,U+77cd,U+77d1-77d2,U+77d5,U+77d7,U+77d9-77da,U+77dc,U+77de-77e0,U+77e3-77e4,U+77e6-77e7,U+77e9-77ea,U+77ec,U+77ee,U+77f0-77f1,U+77f4,U+77f8,U+77fb-77fc,U+7805-7806,U+7809,U+780c-780e,U+7811-7812,U+7819,U+781d,U+7820-7823,U+7826-7827,U+782c-782e,U+7830,U+7835,U+7837,U+783a,U+783f,U+7843-7845,U+7847-7848,U+784c,U+784e-784f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.28.woff2) format("woff2");unicode-range:U+7511-7513,U+7515-7517,U+751c,U+751e,U+7520-7522,U+7524,U+7526-7527,U+7529-752c,U+752f,U+7536,U+7538-7539,U+753c-7540,U+7543-7544,U+7546-754b,U+754d-7550,U+7552,U+7557,U+755a-755b,U+755d-755f,U+7561-7562,U+7564,U+7566-7567,U+7569,U+756b-756d,U+756f,U+7571-7572,U+7574-757e,U+7581-7582,U+7585-7587,U+7589-758c,U+758f-7590,U+7592-7595,U+7599-759a,U+759c-759d,U+75a2-75a5,U+75b0-75b1,U+75b3-75b5,U+75b7-75b8,U+75ba,U+75bd,U+75bf-75c4,U+75c6,U+75ca,U+75cc-75cf,U+75d3-75d4,U+75d7-75d8,U+75dc-75e1,U+75e3-75e4,U+75e7,U+75ec,U+75ee-75f3,U+75f9,U+75fc,U+75fe-7604,U+7607-760c,U+760f,U+7612-7613,U+7615-7616,U+7618-7619,U+761b-7629,U+762d,U+7630,U+7632-7635,U+7638-763c,U+7640-7641,U+7643-764b,U+764e,U+7655,U+7658-7659,U+765c,U+765f,U+7661-7662,U+7664-7665,U+7667-766a,U+766c-7672,U+7674,U+7676,U+7678,U+7680-7683,U+7685,U+7688,U+768b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.29.woff2) format("woff2");unicode-range:U+736c,U+736e-7371,U+7375,U+7377-737c,U+7380-7381,U+7383,U+7385-7386,U+738a,U+738e,U+7390,U+7393-7398,U+739c,U+739e-73a0,U+73a2,U+73a5-73a6,U+73a8,U+73aa-73ab,U+73ad,U+73b3,U+73b5,U+73b7,U+73b9-73bd,U+73bf,U+73c5-73c6,U+73c9-73cc,U+73ce-73cf,U+73d2-73d3,U+73d6,U+73d9,U+73dd-73de,U+73e1,U+73e3-73e7,U+73e9-73ea,U+73ee,U+73f1,U+73f4-73f5,U+73f7-73fb,U+73fd,U+73ff-7401,U+7404-7405,U+7407,U+740a,U+7411,U+7413,U+741a-741b,U+7421,U+7424,U+7426,U+7428-7431,U+7433,U+7439-743a,U+743f-7441,U+7443-7444,U+7446-7447,U+744b,U+744d,U+7451-7453,U+7455,U+7457,U+7459-745a,U+745c-745d,U+745f,U+7462-7464,U+7466-746b,U+746d-7473,U+7476,U+747e,U+7480-7481,U+7485-7489,U+748b,U+748f-7492,U+7497-749a,U+749c,U+749e-74a3,U+74a5-74a6,U+74a8-74ab,U+74ae-74af,U+74b1-74b2,U+74b5,U+74b9-74bb,U+74bd,U+74bf,U+74c8-74ca,U+74cc,U+74cf-74d0,U+74d3-74d4,U+74d6,U+74d8,U+74da-74db,U+74de-74e0,U+74e3-74e4,U+74e7-74eb,U+74ee-74f2,U+74f4,U+74f7-74f8,U+74fa-74fc,U+74ff,U+7501,U+7503-7506,U+750c-750e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.30.woff2) format("woff2");unicode-range:U+7166,U+7168,U+716c,U+7179,U+7180,U+7184-7185,U+7187-7188,U+718c,U+718f,U+7192,U+7194-7196,U+7199-719b,U+71a0,U+71a2,U+71a8,U+71ac,U+71ae-71b0,U+71b2-71b3,U+71b9-71ba,U+71be-71c1,U+71c4,U+71c9,U+71cb-71cc,U+71ce,U+71d0,U+71d2-71d4,U+71d6-71d7,U+71d9-71da,U+71dc,U+71df-71e0,U+71e6-71e7,U+71ec-71ee,U+71f4-71f5,U+71f8-71f9,U+71fc,U+71fe-7200,U+7207-7209,U+720d,U+7210,U+7213,U+7215,U+7217,U+721a,U+721d,U+721f,U+7224,U+7228,U+722b,U+722d,U+722f-7230,U+7232,U+7234,U+7238-7239,U+723b-723c,U+723e-7243,U+7245-7246,U+724b,U+724e-7250,U+7252-7253,U+7255-7258,U+725a,U+725c,U+725e,U+7260,U+7263,U+7268,U+726b,U+726e-726f,U+7271,U+7274,U+7277-7278,U+727b-727c,U+727e-7282,U+7284,U+7287,U+7289,U+728d-728e,U+7292-7293,U+7296,U+729b,U+72a2,U+72a7-72a8,U+72ad-72ae,U+72b0-72b2,U+72b4,U+72b9,U+72be,U+72c0-72c1,U+72c3-72c4,U+72c6-72c7,U+72c9,U+72cc,U+72ce,U+72d2,U+72d5-72d6,U+72d8,U+72df-72e2,U+72e5,U+72f3-72f4,U+72f7,U+72f9-72fb,U+72fd-72fe,U+7302,U+7304-7305,U+7307,U+730a-730b,U+730d,U+7312-7313,U+7316-7319,U+731c-731e,U+7322,U+7324,U+7327-7329,U+732c,U+732f,U+7331-7337,U+7339-733b,U+733d-733e,U+7343,U+734d-7350,U+7352,U+7356-7358,U+735d-7360,U+7366-736b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.31.woff2) format("woff2");unicode-range:U+6f58-6f5b,U+6f5d-6f5e,U+6f60-6f62,U+6f66,U+6f68,U+6f6c-6f6d,U+6f6f,U+6f74,U+6f78,U+6f7a,U+6f7c-6f7e,U+6f80,U+6f82-6f83,U+6f86-6f88,U+6f8b-6f8e,U+6f90-6f94,U+6f96-6f98,U+6f9a,U+6f9d,U+6f9f-6fa1,U+6fa3,U+6fa5-6fa8,U+6fae-6fb1,U+6fb3,U+6fb5-6fb7,U+6fb9,U+6fbc,U+6fbe,U+6fc2,U+6fc5-6fca,U+6fd4-6fd5,U+6fd8,U+6fda-6fdb,U+6fde-6fe0,U+6fe4,U+6fe8-6fe9,U+6feb-6fec,U+6fee,U+6ff0,U+6ff3,U+6ff5-6ff6,U+6ff9-6ffa,U+6ffc-6ffe,U+7000-7001,U+7005-7007,U+7009-700b,U+700d,U+700f,U+7011,U+7015,U+7017-7018,U+701a-701b,U+701d-7020,U+7023,U+7026,U+7028,U+702f-7030,U+7032,U+7034,U+7037,U+7039-703a,U+703c,U+703e,U+7043-7044,U+7047-704c,U+704e,U+7051,U+7054-7055,U+705d-705e,U+7064-7065,U+7069,U+706c,U+706e,U+7075-7076,U+707e,U+7081,U+7085-7086,U+7094-7098,U+709b,U+709f,U+70a4,U+70ab-70ac,U+70ae-70b1,U+70b3-70b4,U+70b7,U+70bb,U+70ca-70cb,U+70d1,U+70d3-70d6,U+70d8-70d9,U+70dc-70dd,U+70df,U+70e4,U+70ec,U+70f1,U+70fa,U+70fd,U+7103-7108,U+710b-710c,U+710f,U+7114,U+7119,U+711c,U+711e,U+7120,U+712b,U+712d-7131,U+7138,U+7141,U+7145-7147,U+7149-714b,U+7150-7153,U+7155-7157,U+715a,U+715c,U+715e,U+7160,U+7162,U+7164-7165}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.32.woff2) format("woff2");unicode-range:U+6d7c,U+6d80-6d82,U+6d85,U+6d87,U+6d89-6d8a,U+6d8c-6d8e,U+6d91-6d98,U+6d9c,U+6daa-6dac,U+6dae,U+6db4-6db5,U+6db7-6db9,U+6dbd,U+6dbf,U+6dc2,U+6dc4-6dc8,U+6dca,U+6dcc,U+6dce-6dd0,U+6dd2,U+6dd5-6dd6,U+6dd8-6ddb,U+6ddd-6de0,U+6de2,U+6de4-6de6,U+6de8-6dea,U+6dec,U+6dee-6df0,U+6df2,U+6df4,U+6df6,U+6df8-6dfa,U+6dfc,U+6e00,U+6e04,U+6e0a,U+6e17,U+6e19,U+6e1d-6e20,U+6e22-6e25,U+6e27,U+6e2b,U+6e2d-6e2e,U+6e32,U+6e34,U+6e36,U+6e38-6e3c,U+6e42-6e45,U+6e48-6e49,U+6e4b-6e4f,U+6e51-6e54,U+6e57,U+6e5b-6e5f,U+6e62-6e63,U+6e68,U+6e6b,U+6e6e,U+6e72-6e73,U+6e76,U+6e7b,U+6e7d,U+6e82,U+6e89,U+6e8c-6e8d,U+6e8f,U+6e93,U+6e98-6e99,U+6e9f-6ea0,U+6ea5,U+6ea7,U+6eaa-6eab,U+6ead-6eaf,U+6eb1-6eb4,U+6eb7,U+6ebb-6ebd,U+6ebf-6ec4,U+6ec7-6eca,U+6ecc-6ecf,U+6ed3-6ed5,U+6ed9-6edb,U+6ee6,U+6eeb-6eef,U+6ef7-6ef9,U+6efb,U+6efd-6eff,U+6f04,U+6f08-6f0a,U+6f0c-6f0d,U+6f10-6f11,U+6f13,U+6f15-6f16,U+6f18,U+6f1a-6f1b,U+6f25-6f26,U+6f29-6f2a,U+6f2d,U+6f2f-6f33,U+6f35-6f36,U+6f38,U+6f3b-6f3c,U+6f3e-6f3f,U+6f41,U+6f45,U+6f4f,U+6f51-6f53,U+6f57}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.33.woff2) format("woff2");unicode-range:U+6b85,U+6b89,U+6b8d,U+6b95,U+6b97-6b98,U+6b9b,U+6b9e-6ba0,U+6ba2-6ba4,U+6ba8-6bb3,U+6bb7-6bb9,U+6bbc-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bc9,U+6bcb-6bcc,U+6bcf,U+6bd3,U+6bd6-6bd8,U+6bda,U+6bdf,U+6be1,U+6be3,U+6be6-6be7,U+6beb-6bec,U+6bee,U+6bf1,U+6bf3,U+6bf7,U+6bf9,U+6bff,U+6c02,U+6c04-6c05,U+6c08-6c0a,U+6c0d-6c0e,U+6c10,U+6c12-6c14,U+6c19,U+6c1b,U+6c1f,U+6c24,U+6c26-6c28,U+6c2c,U+6c2e,U+6c33,U+6c35-6c36,U+6c3a-6c3b,U+6c3e-6c40,U+6c4a-6c4b,U+6c4d,U+6c4f,U+6c52,U+6c54-6c55,U+6c59,U+6c5b-6c5e,U+6c62,U+6c67-6c68,U+6c6a-6c6b,U+6c6d,U+6c6f,U+6c73-6c74,U+6c76,U+6c78-6c79,U+6c7b,U+6c7e,U+6c81-6c87,U+6c89,U+6c8c-6c8d,U+6c90,U+6c92-6c95,U+6c97-6c98,U+6c9a-6c9c,U+6c9f,U+6caa-6cae,U+6cb0-6cb2,U+6cb4,U+6cba,U+6cbd-6cbe,U+6cc2,U+6cc5-6cc6,U+6ccd,U+6ccf-6cd4,U+6cd6-6cd7,U+6cd9-6cdd,U+6ce0,U+6ce7,U+6ce9-6cef,U+6cf1-6cf2,U+6cf4,U+6cfb,U+6d00-6d01,U+6d04,U+6d07,U+6d0a,U+6d0c,U+6d0e-6d0f,U+6d11,U+6d13,U+6d19-6d1a,U+6d1f,U+6d24,U+6d26-6d28,U+6d2b,U+6d2e-6d2f,U+6d31,U+6d33-6d36,U+6d38-6d39,U+6d3c-6d3d,U+6d3f,U+6d57-6d5b,U+6d5e-6d61,U+6d64-6d65,U+6d67,U+6d6c,U+6d6f-6d70,U+6d79}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.34.woff2) format("woff2");unicode-range:U+69dd-69de,U+69e2-69e3,U+69e5,U+69e7-69eb,U+69ed-69ef,U+69f1-69f6,U+69f9,U+69fe-6a01,U+6a03,U+6a05,U+6a0a,U+6a0c,U+6a0f,U+6a11-6a15,U+6a17,U+6a1a-6a1b,U+6a1d-6a20,U+6a22-6a24,U+6a28,U+6a2e,U+6a30,U+6a32-6a38,U+6a3b,U+6a3e-6a3f,U+6a44-6a4a,U+6a4e,U+6a50-6a52,U+6a54-6a56,U+6a5b,U+6a61-6a62,U+6a64,U+6a66-6a67,U+6a6a-6a6b,U+6a71-6a73,U+6a78,U+6a7a,U+6a7e-6a7f,U+6a81,U+6a83-6a84,U+6a86-6a87,U+6a89,U+6a8b,U+6a8d,U+6a90-6a91,U+6a94,U+6a97,U+6a9b,U+6a9d-6aa3,U+6aa5,U+6aaa-6aac,U+6aae-6ab1,U+6ab3-6ab4,U+6ab8,U+6abb,U+6abd-6abf,U+6ac1-6ac3,U+6ac6,U+6ac8-6ac9,U+6acc,U+6ad0-6ad1,U+6ad3-6ad6,U+6ada-6adf,U+6ae2,U+6ae4,U+6ae7-6ae8,U+6aea,U+6aec,U+6af0-6af3,U+6af8,U+6afa,U+6afc-6afd,U+6b02-6b03,U+6b06-6b07,U+6b09-6b0b,U+6b0f-6b12,U+6b16-6b17,U+6b1b,U+6b1d-6b1f,U+6b23-6b24,U+6b28,U+6b2b-6b2c,U+6b2f,U+6b35-6b39,U+6b3b,U+6b3d,U+6b3f,U+6b43,U+6b46-6b47,U+6b49-6b4a,U+6b4d-6b4e,U+6b50,U+6b52,U+6b54,U+6b56,U+6b58-6b59,U+6b5b,U+6b5d,U+6b5f-6b61,U+6b65,U+6b67,U+6b6b-6b6c,U+6b6e,U+6b70,U+6b72,U+6b75,U+6b77-6b7a,U+6b7d-6b84}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.35.woff2) format("woff2");unicode-range:U+6855,U+6857-6859,U+685b,U+685d,U+685f,U+6863,U+6867,U+686b,U+686e-6872,U+6874-6875,U+6877,U+6879-687c,U+687e-687f,U+6882-6884,U+6886,U+6888,U+688d-6890,U+6894,U+6896,U+6898-689c,U+689f-68a3,U+68a5-68a7,U+68a9-68ab,U+68ad-68af,U+68b2-68b5,U+68b9-68bc,U+68c3,U+68c5-68c6,U+68c8-68ca,U+68cc-68cd,U+68cf-68d1,U+68d3-68d9,U+68dc-68dd,U+68e0-68e1,U+68e3-68e5,U+68e7-68e8,U+68ea-68ed,U+68ef-68f1,U+68f5-68f7,U+68f9,U+68fb-68fd,U+6900-6901,U+6903-6904,U+6906-690c,U+690f-6911,U+6913,U+6916-6917,U+6919-691b,U+6921-6923,U+6925-6926,U+6928,U+692a,U+6930-6931,U+6933-6936,U+6938-6939,U+693b,U+693d,U+6942,U+6945-6946,U+6949,U+694e,U+6954,U+6957,U+6959,U+695b-695e,U+6961-6966,U+6968-696c,U+696e-6974,U+6977-697b,U+697e-6981,U+6986,U+698d,U+6991-6992,U+6994-6996,U+6998,U+699c,U+69a0-69a1,U+69a5-69a8,U+69ab,U+69ad,U+69af-69b2,U+69b4,U+69b7-69b8,U+69ba-69bc,U+69be-69c1,U+69c3,U+69c5,U+69c7-69c8,U+69ca,U+69ce-69d1,U+69d3,U+69d6-69d7,U+69d9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.36.woff2) format("woff2");unicode-range:U+667e-6680,U+6683-6684,U+6688,U+668b-668e,U+6690,U+6692,U+6698-669d,U+669f-66a0,U+66a2,U+66a4,U+66ad,U+66b1-66b3,U+66b5,U+66b8-66b9,U+66bb-66bc,U+66be-66c4,U+66c6,U+66c8-66c9,U+66cc,U+66ce-66cf,U+66d4,U+66da-66db,U+66dd,U+66df-66e0,U+66e6,U+66e8-66e9,U+66eb-66ec,U+66ee,U+66f5,U+66f7,U+66fa-66fc,U+6701,U+6705,U+6707,U+670c,U+670e-6710,U+6712-6716,U+6719,U+671c,U+671e,U+6720,U+6722,U+6725-6726,U+672e,U+6733,U+6735-6738,U+673e-673f,U+6741,U+6743,U+6745-6748,U+674c-674d,U+6753-6755,U+6759,U+675d-675e,U+6760,U+6762-6764,U+6766,U+676a,U+676c,U+676e,U+6770,U+6772-6774,U+6776-6777,U+677b-677c,U+6780-6781,U+6784-6785,U+6787,U+6789,U+678b-678c,U+678e-678f,U+6791-6793,U+6796,U+6798-6799,U+679b,U+67a1,U+67a4,U+67a6,U+67a9,U+67b0-67b5,U+67b7-67b9,U+67bb-67be,U+67c0-67c3,U+67c5-67c6,U+67c8-67c9,U+67ce,U+67d2,U+67d7-67d9,U+67db-67de,U+67e1-67e2,U+67e4,U+67e6-67e7,U+67e9,U+67ec,U+67ee-67f0,U+67f2,U+67f6-67f7,U+67f9-67fa,U+67fc,U+67fe,U+6801-6802,U+6805,U+6810,U+6814,U+6818-6819,U+681d,U+681f,U+6822,U+6827-6829,U+682b-682d,U+682f-6834,U+683b,U+683e-6840,U+6844-6846,U+6849-684a,U+684c-684e,U+6852-6854}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.37.woff2) format("woff2");unicode-range:U+64d2,U+64d4-64d5,U+64d7-64d8,U+64da,U+64e0-64e1,U+64e3-64e5,U+64e7,U+64e9-64ea,U+64ed,U+64ef-64f2,U+64f4-64f7,U+64fa-64fb,U+64fd-6501,U+6504-6505,U+6508-650a,U+650f,U+6513-6514,U+6516,U+6518-6519,U+651b-651f,U+6522,U+6524,U+6526,U+6529-652c,U+652e,U+6531-6532,U+6534-6538,U+653a,U+653c-653d,U+6543-6544,U+6547-6549,U+654d-654e,U+6550,U+6552,U+6554-6556,U+6558,U+655d-6560,U+6567,U+656b,U+6572,U+6578,U+657a,U+657d,U+6581-6585,U+6588,U+658a,U+658c,U+6592,U+6595,U+6598,U+659b,U+659d,U+659f-65a1,U+65a3-65a6,U+65ab,U+65ae,U+65b2-65b5,U+65b7-65b8,U+65be-65bf,U+65c1-65c4,U+65c6,U+65c8-65c9,U+65cc,U+65ce,U+65d0,U+65d2,U+65d4,U+65d6,U+65d8-65d9,U+65db,U+65df-65e1,U+65e3,U+65f0-65f2,U+65f4-65f5,U+65f9,U+65fb-65fc,U+65fe-6600,U+6603-6604,U+6608-660a,U+660d,U+6611-6612,U+6615-6616,U+661c-661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630-6631,U+6633-6637,U+6639-663b,U+663f-6641,U+6644-6646,U+6648-664a,U+664c,U+664e-664f,U+6651,U+6657-6665,U+6667-6668,U+666a-666d,U+6670,U+6673,U+6675,U+6677-6679,U+667b-667c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.38.woff2) format("woff2");unicode-range:U+62cf,U+62d1,U+62d4-62d6,U+62da,U+62dc,U+62ea,U+62ee-62ef,U+62f1-62f2,U+62f4-62f5,U+62fc-62fd,U+62ff,U+6302-6304,U+6308-630d,U+6310,U+6313,U+6316,U+6318,U+631b,U+6327,U+6329-632a,U+632d,U+6332,U+6335-6336,U+6339-633c,U+633e,U+6341-6344,U+6346,U+634a-634e,U+6350,U+6352-6354,U+6358-6359,U+635b,U+6365-6366,U+6369,U+636b-636d,U+6371-6372,U+6374-6378,U+637a,U+637c-637d,U+637f-6380,U+6382,U+6384,U+6387,U+6389-638a,U+638e-6390,U+6394-6396,U+6399-639a,U+639e,U+63a0,U+63a3-63a4,U+63a6,U+63a9,U+63ab-63af,U+63b5,U+63bd-63be,U+63c0-63c1,U+63c4-63c6,U+63c8,U+63ce,U+63d1-63d6,U+63dc,U+63e0,U+63e3,U+63e5,U+63e9-63ed,U+63f2-63f3,U+63f5-63f9,U+6406,U+6409-640a,U+640f-6410,U+6412-6414,U+6416-6418,U+641e,U+6420,U+6422,U+6424-6426,U+6428-642a,U+642f-6430,U+6434-6436,U+643d,U+643f,U+644b,U+644e-644f,U+6451-6454,U+645a-645d,U+645f-6461,U+6463,U+6467,U+646d,U+6473-6474,U+6476,U+6478-6479,U+647b,U+647d,U+6485,U+6487-6488,U+648f-6491,U+6493,U+6495,U+6498-649b,U+649d-649f,U+64a1,U+64a3,U+64a6,U+64a8-64a9,U+64ac,U+64b3,U+64bb-64bf,U+64c2,U+64c4-64c5,U+64c7,U+64c9-64cc,U+64ce,U+64d0-64d1}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.39.woff2) format("woff2");unicode-range:U+6117,U+6119,U+611c,U+611e,U+6120-6122,U+6127-6128,U+612a-612c,U+6130-6131,U+6134-6137,U+6139-613a,U+613c-613f,U+6141-6142,U+6144-6147,U+6149-614a,U+614d,U+6153,U+6158-615a,U+615d-6160,U+6164-6165,U+616b-616c,U+616f,U+6171-6175,U+6177-6178,U+617b-6181,U+6183-6184,U+6187,U+618a-618b,U+618d,U+6192-6194,U+6196-619a,U+619c-619d,U+619f-61a0,U+61a5,U+61a8,U+61aa-61ae,U+61b8-61ba,U+61bc,U+61be,U+61c0-61c3,U+61c6,U+61c8,U+61ca-61cf,U+61d5,U+61dc-61df,U+61e1-61e3,U+61e5-61e9,U+61ec-61ed,U+61ef,U+61f4-61f7,U+61fa,U+61fc-6201,U+6203-6204,U+6207-620a,U+620d-620e,U+6213-6215,U+621b-621e,U+6220-6223,U+6227,U+6229-622b,U+622e,U+6230-6233,U+6236,U+6239,U+623d-623e,U+6241-6244,U+6246,U+6248,U+624c,U+624e,U+6250-6252,U+6254,U+6256,U+6258,U+625a-625c,U+625e,U+6260-6261,U+6263-6264,U+6268,U+626d,U+626f,U+6273,U+627a-627e,U+6282-6283,U+6285,U+6289,U+628d-6290,U+6292-6294,U+6296,U+6299,U+629b,U+62a6,U+62a8,U+62ac,U+62b3,U+62b6-62b7,U+62ba-62bb,U+62be-62bf,U+62c2,U+62c4,U+62c6-62c8,U+62ca,U+62ce}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.40.woff2) format("woff2");unicode-range:U+5f6c-5f6d,U+5f6f,U+5f72-5f75,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f82-5f83,U+5f87-5f89,U+5f8d,U+5f8f,U+5f91,U+5f96,U+5f99,U+5f9c-5f9d,U+5fa0,U+5fa2,U+5fa4,U+5fa7-5fa8,U+5fab-5fad,U+5faf-5fb1,U+5fb5,U+5fb7-5fb8,U+5fbc-5fbd,U+5fc4,U+5fc7-5fc9,U+5fcb,U+5fd0-5fd4,U+5fdd-5fde,U+5fe1-5fe2,U+5fe4,U+5fe8-5fea,U+5fec-5ff3,U+5ff6,U+5ff8,U+5ffa-5ffd,U+5fff,U+6007,U+600a,U+600d-6010,U+6013-6015,U+6017-601b,U+601f,U+6021-6022,U+6024,U+6026,U+6029,U+602b,U+602d,U+6031,U+6033,U+6035,U+603a,U+6040-6043,U+6046-604a,U+604c-604d,U+6051,U+6054-6057,U+6059-605a,U+605d,U+605f-6064,U+6067,U+606a-606c,U+6070-6071,U+6077,U+607e-607f,U+6081-6086,U+6088-608e,U+6091-6093,U+6095-6098,U+609a-609b,U+609d-609e,U+60a2,U+60a4-60a5,U+60a7-60a8,U+60b0-60b1,U+60b3-60b5,U+60b7-60b8,U+60bb,U+60bd-60be,U+60c2,U+60c4,U+60c6-60cb,U+60ce-60cf,U+60d3-60d5,U+60d8-60d9,U+60db,U+60dd-60df,U+60e1-60e2,U+60e5,U+60ee,U+60f0-60f2,U+60f4-60f8,U+60fa-60fd,U+6100,U+6102-6103,U+6106-6108,U+610a,U+610c-610e,U+6110-6114,U+6116}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.41.woff2) format("woff2");unicode-range:U+5d9b,U+5d9d,U+5d9f-5da0,U+5da2,U+5da4,U+5da7,U+5dab-5dac,U+5dae,U+5db0,U+5db2,U+5db4,U+5db7-5db9,U+5dbc-5dbd,U+5dc3,U+5dc7,U+5dc9,U+5dcb-5dce,U+5dd0-5dd3,U+5dd6-5dd9,U+5ddb,U+5de0,U+5de2,U+5de4,U+5de9,U+5df2,U+5df5,U+5df8-5df9,U+5dfd,U+5dff-5e00,U+5e07,U+5e0b,U+5e0d,U+5e11-5e12,U+5e14-5e15,U+5e18-5e1b,U+5e1f-5e20,U+5e25,U+5e28,U+5e2e,U+5e32,U+5e35-5e37,U+5e3e,U+5e40,U+5e43-5e44,U+5e47,U+5e49,U+5e4b,U+5e4e,U+5e50-5e51,U+5e54,U+5e56-5e58,U+5e5b-5e5c,U+5e5e-5e5f,U+5e62,U+5e64,U+5e68,U+5e6a-5e6e,U+5e70,U+5e75-5e77,U+5e7a,U+5e7f-5e80,U+5e87,U+5e8b,U+5e8e,U+5e96,U+5e99-5e9a,U+5ea0,U+5ea2,U+5ea4-5ea5,U+5ea8,U+5eaa,U+5eac,U+5eb1,U+5eb3,U+5eb8-5eb9,U+5ebd-5ebf,U+5ec1-5ec2,U+5ec6,U+5ec8,U+5ecb-5ecc,U+5ece-5ed6,U+5ed9-5ee2,U+5ee5,U+5ee8-5ee9,U+5eeb-5eec,U+5ef0-5ef1,U+5ef3-5ef4,U+5ef8-5ef9,U+5efc-5f00,U+5f02-5f03,U+5f06-5f09,U+5f0b-5f0e,U+5f11,U+5f16-5f17,U+5f19,U+5f1b-5f1e,U+5f21-5f24,U+5f27-5f29,U+5f2b-5f30,U+5f34,U+5f36,U+5f38,U+5f3a-5f3d,U+5f3f-5f41,U+5f44-5f45,U+5f47-5f48,U+5f4a,U+5f4c-5f4e,U+5f50-5f51,U+5f54,U+5f56-5f58,U+5f5b-5f5d,U+5f60,U+5f63-5f65,U+5f67,U+5f6a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.42.woff2) format("woff2");unicode-range:U+5bbc,U+5bc0-5bc1,U+5bc3,U+5bc7,U+5bc9,U+5bcd-5bd0,U+5bd3-5bd4,U+5bd6-5bda,U+5bde,U+5be0-5be2,U+5be4-5be6,U+5be8,U+5beb-5bec,U+5bef-5bf1,U+5bf3-5bf6,U+5bfd,U+5c03,U+5c05,U+5c07-5c09,U+5c0c-5c0d,U+5c12-5c14,U+5c17,U+5c19,U+5c1e-5c20,U+5c22-5c24,U+5c26,U+5c28-5c2e,U+5c30,U+5c32,U+5c35-5c36,U+5c38-5c39,U+5c46,U+5c4d-5c50,U+5c53,U+5c59-5c5c,U+5c5f-5c63,U+5c67-5c69,U+5c6c-5c70,U+5c74-5c76,U+5c79-5c7d,U+5c87-5c88,U+5c8a,U+5c8c,U+5c8f,U+5c91-5c92,U+5c94,U+5c9d,U+5c9f-5ca0,U+5ca2-5ca3,U+5ca6-5ca8,U+5caa-5cab,U+5cad,U+5cb1-5cb2,U+5cb4-5cb7,U+5cba-5cbc,U+5cbe,U+5cc5,U+5cc7,U+5cc9,U+5ccb,U+5cd0,U+5cd2,U+5cd7,U+5cd9,U+5cdd,U+5ce6,U+5ce8-5cea,U+5ced-5cee,U+5cf1-5cf2,U+5cf4-5cf5,U+5cfa-5cfb,U+5cfd,U+5d01,U+5d06,U+5d0b,U+5d0d,U+5d10-5d12,U+5d14-5d15,U+5d17-5d1b,U+5d1d,U+5d1f-5d20,U+5d22-5d24,U+5d26-5d27,U+5d2b,U+5d31,U+5d34,U+5d39,U+5d3d,U+5d3f,U+5d42-5d43,U+5d46-5d48,U+5d4a-5d4b,U+5d4e,U+5d51-5d53,U+5d55,U+5d59,U+5d5c,U+5d5f-5d62,U+5d64,U+5d69-5d6a,U+5d6c-5d6d,U+5d6f-5d70,U+5d73,U+5d76,U+5d79-5d7a,U+5d7e-5d7f,U+5d81-5d84,U+5d87-5d88,U+5d8a,U+5d8c,U+5d90,U+5d92-5d95,U+5d97,U+5d99}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.43.woff2) format("woff2");unicode-range:U+598b-598e,U+5992,U+5995,U+5997,U+599b,U+599d,U+599f,U+59a3-59a4,U+59a7,U+59ad-59b0,U+59b2-59b3,U+59b7,U+59ba,U+59bc,U+59be,U+59c1,U+59c3-59c4,U+59c6,U+59c8,U+59ca,U+59cd,U+59d2,U+59d9-59da,U+59dd-59df,U+59e3-59e5,U+59e7-59e8,U+59ec,U+59ee-59ef,U+59f1-59f2,U+59f4,U+59f6-59f8,U+5a00,U+5a03-5a04,U+5a09,U+5a0c-5a0e,U+5a11-5a13,U+5a17,U+5a1a-5a1c,U+5a1e-5a1f,U+5a23-5a25,U+5a27-5a28,U+5a2a,U+5a2d,U+5a30,U+5a35-5a36,U+5a40-5a41,U+5a44-5a45,U+5a47-5a49,U+5a4c,U+5a50,U+5a55,U+5a5e,U+5a62-5a63,U+5a65,U+5a67,U+5a6a,U+5a6c-5a6d,U+5a77,U+5a7a-5a7b,U+5a7e,U+5a84,U+5a8b,U+5a90,U+5a93,U+5a96,U+5a99,U+5a9c,U+5a9e-5aa0,U+5aa2,U+5aa7,U+5aac,U+5ab1-5ab3,U+5ab5,U+5ab8,U+5aba-5abf,U+5ac2,U+5ac4,U+5ac6,U+5ac8,U+5acb,U+5acf-5ad0,U+5ad6-5ad7,U+5ada,U+5adc,U+5ae0-5ae1,U+5ae3,U+5ae5-5ae6,U+5ae9-5aea,U+5aee,U+5af0,U+5af5-5af6,U+5afa-5afb,U+5afd,U+5b00-5b01,U+5b08,U+5b0b,U+5b16-5b17,U+5b19,U+5b1b,U+5b1d,U+5b21,U+5b25,U+5b2a,U+5b2c-5b2d,U+5b30,U+5b32,U+5b34,U+5b36,U+5b38,U+5b3e,U+5b40-5b41,U+5b43,U+5b45,U+5b4b-5b4c,U+5b51-5b52,U+5b56,U+5b5a-5b5c,U+5b5e-5b5f,U+5b65,U+5b68-5b69,U+5b6e-5b71,U+5b73,U+5b75-5b76,U+5b7a,U+5b7c-5b84,U+5b86,U+5b8a-5b8b,U+5b8d-5b8e,U+5b90-5b91,U+5b93-5b94,U+5b96,U+5ba5-5ba6,U+5ba8-5ba9,U+5bac-5bad,U+5baf,U+5bb1-5bb2,U+5bb7-5bb8,U+5bba}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.44.woff2) format("woff2");unicode-range:U+57b3,U+57b8,U+57bd,U+57c0,U+57c3,U+57c6-57c8,U+57cc,U+57cf,U+57d2-57d7,U+57dc-57de,U+57e0-57e1,U+57e3-57e4,U+57e6-57e7,U+57e9,U+57ed,U+57f0,U+57f4-57f6,U+57f8,U+57fb,U+57fd-57ff,U+5803-5804,U+5808-580d,U+5819,U+581b,U+581d-5821,U+5826-5827,U+582d,U+582f-5830,U+5832,U+5835,U+5839,U+583d,U+583f-5840,U+5849,U+584b-584d,U+584f-5852,U+5855,U+5858-5859,U+585f,U+5861-5862,U+5864,U+5867-5868,U+586d,U+5870,U+5872,U+5878-5879,U+587c,U+587f-5881,U+5885,U+5887-588d,U+588f-5890,U+5894,U+5896,U+5898,U+589d-589e,U+58a0-58a2,U+58a6,U+58a9-58ab,U+58ae,U+58b1-58b3,U+58b8-58bc,U+58be,U+58c2-58c5,U+58c8,U+58cd-58ce,U+58d0-58da,U+58dc-58e2,U+58e4-58e5,U+58e9,U+58ec,U+58ef,U+58f3-58f4,U+58f7,U+58f9,U+58fb-58fd,U+5902,U+5905-5906,U+590a-590d,U+5910,U+5912-5914,U+5918-5919,U+591b,U+591d,U+591f,U+5921,U+5923-5925,U+5928,U+592c-592d,U+592f-5930,U+5932-5933,U+5935-5936,U+5938-5939,U+593d-593f,U+5943,U+5946,U+594e,U+5950,U+5952-5953,U+5955,U+5957-595b,U+595d-5961,U+5963,U+5967,U+5969,U+596b-596d,U+596f,U+5972,U+5975-5976,U+5978-5979,U+597b-597c,U+5981}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.45.woff2) format("woff2");unicode-range:U+5616-5617,U+5619,U+561b,U+5620,U+5628,U+562c,U+562f-5639,U+563b-563d,U+563f-5641,U+5643-5644,U+5646-5647,U+5649,U+564b,U+564d-5650,U+5653-5654,U+565e,U+5660-5664,U+5666,U+5669-566d,U+566f,U+5671-5672,U+5675-5676,U+5678,U+567a,U+5680,U+5684-5688,U+568a-568c,U+568f,U+5694-5695,U+5699-569a,U+569d-56a0,U+56a5-56a9,U+56ab-56ae,U+56b1-56b4,U+56b6-56b7,U+56bc,U+56be,U+56c0,U+56c2-56c3,U+56c5,U+56c8-56d1,U+56d3,U+56d7-56d9,U+56dc-56dd,U+56df,U+56e1,U+56e4-56e8,U+56eb,U+56ed-56ee,U+56f1,U+56f6-56f7,U+56f9,U+56ff-5704,U+5707-570a,U+570c-570d,U+5711,U+5713,U+5715-5716,U+5718,U+571a-571d,U+5720-5726,U+5729-572a,U+572c,U+572e-572f,U+5733-5734,U+5737-5738,U+573b,U+573d-573f,U+5745-5746,U+574c-574f,U+5751-5752,U+5759,U+575f,U+5761-5762,U+5764-5765,U+5767-5769,U+576b,U+576d-5771,U+5773-5775,U+5777,U+5779-577c,U+577e-577f,U+5781,U+5783,U+5788-5789,U+578c,U+5793-5795,U+5797,U+5799-579a,U+579c-57a1,U+57a4,U+57a7-57aa,U+57ac,U+57ae,U+57b0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.46.woff2) format("woff2");unicode-range:U+543f-5440,U+5443-5444,U+5447,U+544c-544f,U+5455,U+545e,U+5462,U+5464,U+5466-5467,U+5469,U+546b-546e,U+5470-5471,U+5474-5477,U+547b,U+547f-5481,U+5483-5486,U+5488-548b,U+548d-5492,U+5495-5496,U+549c,U+549f-54a2,U+54a4,U+54a6-54af,U+54b1,U+54b7-54bc,U+54be-54bf,U+54c2-54c4,U+54c6-54c8,U+54ca,U+54cd-54ce,U+54d8,U+54e0,U+54e2,U+54e5-54e6,U+54e8-54ea,U+54ec-54ef,U+54f1,U+54f3,U+54f6,U+54fc-5501,U+5505,U+5508-5509,U+550c-550f,U+5514-5516,U+5527,U+552a-552b,U+552e,U+5532-5533,U+5535-5536,U+5538-5539,U+553b-553d,U+5540-5541,U+5544-5545,U+5547,U+5549-554a,U+554c-554d,U+5550-5551,U+5556-5558,U+555a-555e,U+5560-5561,U+5563-5564,U+5566,U+557b-5583,U+5586-5588,U+558a,U+558e-558f,U+5591-5594,U+5597,U+5599,U+559e-559f,U+55a3-55a4,U+55a8-55a9,U+55ac-55ae,U+55b2,U+55bf,U+55c1,U+55c3-55c4,U+55c6-55c7,U+55c9,U+55cb-55cc,U+55ce,U+55d1-55d4,U+55d7-55d8,U+55da-55db,U+55dd-55df,U+55e2,U+55e4,U+55e9,U+55ec,U+55ee,U+55f1,U+55f6-55f9,U+55fd-55ff,U+5605,U+5607-5608,U+560a,U+560d-5612}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.47.woff2) format("woff2");unicode-range:U+528d,U+5291-5298,U+529a,U+529c,U+52a4-52a7,U+52ab-52ad,U+52af-52b0,U+52b5-52b8,U+52ba-52be,U+52c0-52c1,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cd,U+52cf-52d2,U+52d4,U+52d6-52d7,U+52db-52dc,U+52de,U+52e0-52e1,U+52e3,U+52e5-52e6,U+52e8-52ea,U+52ec,U+52f0-52f1,U+52f3-52fb,U+5300-5301,U+5303,U+5306-5308,U+530a-530d,U+530f-5311,U+5313,U+5315,U+5318-531f,U+5321,U+5323-5325,U+5327-532d,U+532f-5333,U+5335,U+5338,U+533c-533e,U+5340,U+5342,U+5345-5346,U+5349,U+534b-534c,U+5359,U+535b,U+535e,U+5361,U+5363-5367,U+5369,U+536c-536e,U+5372,U+5377,U+5379-537b,U+537d-537f,U+5382-5383,U+5387-5389,U+538e,U+5393-5394,U+5396,U+5398-5399,U+539d,U+53a0-53a1,U+53a4-53a6,U+53a9-53ab,U+53ad-53b0,U+53b2,U+53b4-53b8,U+53ba,U+53bd,U+53c0-53c1,U+53c3-53c5,U+53cf,U+53d2-53d3,U+53d5,U+53da-53db,U+53dd-53e0,U+53e2,U+53e6-53e8,U+53ed-53ee,U+53f4-53f5,U+53fa,U+5401-5403,U+540b,U+540f,U+5412-5413,U+541a,U+541d-541e,U+5421,U+5424,U+5427-542a,U+542c-542f,U+5431,U+5433-5436,U+543c-543d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.48.woff2) format("woff2");unicode-range:U+50dd-50df,U+50e1-50e6,U+50e8-50e9,U+50ed-50f6,U+50f9-50fb,U+50fe,U+5101-5103,U+5106-5109,U+510b-510e,U+5110,U+5112,U+5114-511e,U+5121,U+5123,U+5127-5128,U+512c-512d,U+512f,U+5131,U+5133-5135,U+5137-513c,U+513f-5142,U+5147,U+514a,U+514c,U+514f,U+5152-5155,U+5157-5158,U+515f-5160,U+5162,U+5164,U+5166-5167,U+5169-516a,U+516e,U+5173-5174,U+5179,U+517b,U+517e,U+5180,U+5182-5184,U+5189,U+518b-518c,U+518e-5191,U+5193,U+5195-5196,U+5198,U+519d,U+51a1-51a4,U+51a6,U+51a9-51ab,U+51ad,U+51b0-51b3,U+51b5,U+51b8,U+51ba,U+51bc-51bf,U+51c2-51c3,U+51c5,U+51c8-51cb,U+51cf,U+51d1-51d6,U+51d8,U+51de-51e0,U+51e2,U+51e5,U+51e7,U+51e9,U+51ec-51ee,U+51f2-51f5,U+51f7,U+51fe,U+5201-5202,U+5204-5205,U+520b,U+520e,U+5212-5216,U+5218,U+5222,U+5226-5228,U+522a-522b,U+522e,U+5231-5233,U+5235,U+523c,U+5244-5245,U+5249,U+524b-524c,U+524f,U+5254-5255,U+5257-5258,U+525a,U+525c-5261,U+5266,U+5269,U+526c,U+526e,U+5271,U+5273-5274,U+5277-5279,U+527d,U+527f-5280,U+5282-5285,U+5288-528a,U+528c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.49.woff2) format("woff2");unicode-range:U+4f57-4f58,U+4f5a-4f5b,U+4f5d-4f5f,U+4f63-4f64,U+4f69-4f6a,U+4f6c,U+4f6e-4f71,U+4f76-4f7e,U+4f81-4f85,U+4f88-4f8a,U+4f8c,U+4f8e-4f90,U+4f92-4f94,U+4f96-4f9a,U+4f9e-4fa0,U+4fab,U+4fad,U+4faf,U+4fb2,U+4fb7,U+4fb9,U+4fbb-4fbe,U+4fc0-4fc1,U+4fc4-4fc6,U+4fc8-4fc9,U+4fcb-4fd4,U+4fd8,U+4fda-4fdc,U+4fdf-4fe0,U+4fe2,U+4fe4-4fe6,U+4fef-4ff2,U+4ff6,U+4ffc-5002,U+5004-5007,U+500a,U+500c,U+500e-5011,U+5013-5014,U+5016-5018,U+501a-501e,U+5021-5023,U+5025-502a,U+502c-502e,U+5030,U+5032-5033,U+5035,U+5039,U+503b,U+5040-5043,U+5045-5048,U+504a,U+504c,U+504e,U+5050-5053,U+5055-5057,U+5059-505a,U+505f-5060,U+5062-5063,U+5066-5067,U+506a,U+506c-506d,U+5070-5072,U+5077-5078,U+5080-5081,U+5083-5086,U+5088,U+508a,U+508e-5090,U+5092-5096,U+509a-509c,U+509e-50a3,U+50aa,U+50ad,U+50af-50b4,U+50b9-50bb,U+50bd,U+50c0,U+50c2-50c4,U+50c7,U+50c9-50ca,U+50cc,U+50ce,U+50d0-50d1,U+50d3-50d4,U+50d6,U+50d8-50d9,U+50dc}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.50.woff2) format("woff2");unicode-range:U+4093,U+4103,U+4105,U+4148,U+414f,U+4163,U+41b4,U+41bf,U+41e6,U+41ee,U+41f3,U+4207,U+420e,U+4264,U+4293,U+42c6,U+42d6,U+42dd,U+4302,U+432b,U+4343,U+43ee,U+43f0,U+4408,U+440c,U+4417,U+441c,U+4422,U+4453,U+445b,U+4476,U+447a,U+4491,U+44b3,U+44be,U+44d4,U+4508,U+450d,U+4525,U+4543,U+457a,U+459d,U+45b8,U+45be,U+45e5,U+45ea,U+460f-4610,U+4641,U+4665,U+46a1,U+46ae-46af,U+470c,U+471f,U+4764,U+47e6,U+47fd,U+4816,U+481e,U+4844,U+484e,U+48b5,U+49b0,U+49e7,U+49fa,U+4a04,U+4a29,U+4abc,U+4b38,U+4b3b,U+4b7e,U+4bc2,U+4bca,U+4bd2,U+4be8,U+4c17,U+4c20,U+4c38,U+4cc4,U+4cd1,U+4ce1,U+4d07,U+4d77,U+4e02,U+4e04-4e05,U+4e0c,U+4e0f-4e12,U+4e15,U+4e17,U+4e19,U+4e1e-4e1f,U+4e23-4e24,U+4e28-4e2c,U+4e2e-4e31,U+4e35-4e37,U+4e3f-4e42,U+4e44,U+4e47-4e48,U+4e4d-4e4e,U+4e51,U+4e55-4e56,U+4e58,U+4e5a-4e5c,U+4e62-4e63,U+4e68-4e69,U+4e74-4e75,U+4e79,U+4e7f,U+4e82,U+4e85,U+4e8a,U+4e8d-4e8e,U+4e96-4e99,U+4e9d-4ea0,U+4ea2,U+4ea5-4ea6,U+4ea8,U+4eaf-4eb0,U+4eb3,U+4eb6,U+4eb9,U+4ebb-4ebc,U+4ec2-4ec4,U+4ec6-4ec8,U+4ecd,U+4ed0,U+4ed7,U+4eda-4edb,U+4edd-4ee2,U+4ee8,U+4eeb,U+4eed,U+4eef,U+4ef1,U+4ef3,U+4ef5,U+4ef7,U+4efc-4f00,U+4f02-4f03,U+4f08-4f09,U+4f0b-4f0d,U+4f12,U+4f15-4f17,U+4f19,U+4f1c,U+4f2b,U+4f2e,U+4f30-4f31,U+4f33,U+4f35-4f37,U+4f39,U+4f3b,U+4f3e,U+4f40,U+4f42-4f43,U+4f48-4f49,U+4f4b-4f4c,U+4f52,U+4f54,U+4f56}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.51.woff2) format("woff2");unicode-range:U+3395-339b,U+339e-33a0,U+33a2-33ff,U+3402,U+3405-3406,U+3427,U+342c,U+342e,U+3468,U+346a,U+3488,U+3492,U+34b5,U+34bc,U+34c1,U+34c7,U+34db,U+351f,U+353e,U+355d-355e,U+3563,U+356e,U+35a6,U+35a8,U+35c5,U+35da,U+35de,U+35f4,U+3605,U+3614,U+364a,U+3691,U+3696,U+3699,U+36cf,U+3761-3762,U+376b-376c,U+3775,U+378d,U+37c1,U+37e2,U+37e8,U+37f4,U+37fd,U+3800,U+382f,U+3836,U+3840,U+385c,U+3861,U+38a1,U+38ad,U+38fa,U+3917,U+391a,U+396f,U+39a4,U+39b8,U+3a5c,U+3a6e,U+3a73,U+3a85,U+3ac4,U+3acb,U+3ad6-3ad7,U+3aea,U+3af3,U+3b0e,U+3b1a,U+3b1c,U+3b22,U+3b35,U+3b6d,U+3b77,U+3b87-3b88,U+3b8d,U+3ba4,U+3bb6,U+3bc3,U+3bcd,U+3bf0,U+3bf3,U+3c0f,U+3c26,U+3cc3,U+3cd2,U+3d11,U+3d1e,U+3d31,U+3d4e,U+3d64,U+3d9a,U+3dc0,U+3dcc,U+3dd4,U+3e05,U+3e3f-3e40,U+3e60,U+3e66,U+3e68,U+3e83,U+3e8a,U+3e94,U+3eda,U+3f57,U+3f72,U+3f75,U+3f77,U+3fae,U+3fb1,U+3fc9,U+3fd7,U+3fdc,U+4039,U+4058}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.52.woff2) format("woff2");unicode-range:U+32b5-332b,U+332d-3394}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.53.woff2) format("woff2");unicode-range:U+31c8-31e3,U+31f0-321e,U+3220-3230,U+3232-32b4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.54.woff2) format("woff2");unicode-range:U+3028-303f,U+3094-3096,U+309f-30a0,U+30ee,U+30f7-30fa,U+30ff,U+3105-312f,U+3131-3163,U+3165-318e,U+3190-31bb,U+31c0-31c7}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.55.woff2) format("woff2");unicode-range:U+2f14-2fd5,U+2ff0-2ffb,U+3004,U+3013,U+3016-301b,U+301e,U+3020-3027}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.56.woff2) format("woff2");unicode-range:U+25e4-25e6,U+2601-2603,U+2609,U+260e-260f,U+2616-2617,U+261c-261f,U+262f,U+2641,U+2660,U+2662-2664,U+2666-2668,U+266d-266e,U+2672-267d,U+26bd-26be,U+2702,U+271a,U+273d,U+2740,U+2756,U+2776-2793,U+27a1,U+2934-2935,U+29bf,U+29fa-29fb,U+2b05-2b07,U+2b1a,U+2b95,U+2e3a-2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f13}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.57.woff2) format("woff2");unicode-range:U+24d1-24ff,U+2503-2513,U+2515-2516,U+2518-251b,U+251d-2522,U+2524-259f,U+25a2-25ab,U+25b1,U+25b7,U+25c0-25c1,U+25c9-25ca,U+25cc,U+25d0-25d3,U+25e2-25e3}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.58.woff2) format("woff2");unicode-range:U+2105,U+2109-210a,U+210f,U+2116,U+2121,U+2126-2127,U+212b,U+212e,U+2135,U+213b,U+2194-2199,U+21b8-21b9,U+21c4-21c6,U+21cb-21cc,U+21d0,U+21e6-21e9,U+21f5,U+2202-2203,U+2205-2206,U+2208-220b,U+220f,U+2211,U+2213,U+2215,U+221a,U+221d,U+2220,U+2223,U+2225-2226,U+2228,U+222a-222e,U+2234-2237,U+223d,U+2243,U+2245,U+2248,U+224c,U+2260,U+2262,U+2264-2265,U+226e-226f,U+2272-2273,U+2276-2277,U+2283-2287,U+228a-228b,U+2295-2299,U+22a0,U+22a5,U+22bf,U+22da-22db,U+22ef,U+2305-2307,U+2318,U+2329-232a,U+23b0-23b1,U+23be-23cc,U+23ce,U+23da-23db,U+2423,U+2469-24d0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.59.woff2) format("woff2");unicode-range:U+a1-a4,U+a6-a7,U+aa,U+ac-ad,U+b5-b6,U+b8-ba,U+bc-c8,U+ca-cc,U+ce-d5,U+d9-db,U+dd-df,U+e6,U+ee,U+f0,U+f5,U+f7,U+f9,U+fb,U+fe-102,U+110-113,U+11a-11b,U+128-12b,U+143-144,U+147-148,U+14c,U+14e-14f,U+152-153,U+168-16d,U+192,U+1a0-1a1,U+1af,U+1cd-1dc,U+1f8-1f9,U+251,U+261,U+2bb,U+2c7,U+2c9,U+2ea-2eb,U+304,U+307,U+30c,U+1e3e-1e3f,U+1ea0-1ebe,U+1ec0-1ec6,U+1ec8-1ef9,U+2011-2012,U+2016,U+2018-201a,U+201e,U+2021,U+2030,U+2033,U+2035,U+2042,U+2047,U+2051,U+2074,U+20a9,U+20ab-20ac,U+20dd-20de,U+2100}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.60.woff2) format("woff2");unicode-range:U+2227,U+26a0,U+2713,U+301f,U+4ff8,U+5239,U+526a,U+54fa,U+5740,U+5937,U+5993,U+59fb,U+5a3c,U+5c41,U+6028,U+626e,U+646f,U+647a,U+64b0,U+64e2,U+65a7,U+66fe,U+6727,U+6955,U+6bef,U+6f23,U+724c,U+767c,U+7a83,U+7ac4,U+7b67,U+8000,U+8471,U+8513,U+8599,U+86db,U+8718,U+87f2,U+88f3,U+8ad2,U+8e2a,U+8fa3,U+95a5,U+9798,U+9910,U+9957,U+9bab,U+9c3b,U+9daf,U+ff95}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.61.woff2) format("woff2");unicode-range:U+a8,U+2032,U+2261,U+2282,U+3090,U+30f1,U+339c,U+535c,U+53d9,U+56a2,U+56c1,U+5806,U+589f,U+59d0,U+5a7f,U+60e0,U+639f,U+65af,U+68fa,U+69ae,U+6d1b,U+6ef2,U+71fb,U+725d,U+7262,U+75bc,U+7768,U+7940,U+79bf,U+7bed,U+7d68,U+7dfb,U+814b,U+8207,U+83e9,U+8494,U+8526,U+8568,U+85ea,U+86d9,U+87ba,U+8861,U+887f,U+8fe6,U+9059,U+9061,U+916a,U+976d,U+97ad,U+9ece}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.62.woff2) format("woff2");unicode-range:U+2d9,U+21d4,U+301d,U+515c,U+52fe,U+5420,U+5750,U+5766,U+5954,U+5b95,U+5f8a,U+5f98,U+620c,U+621f,U+641c,U+66d9,U+676d,U+6775,U+67f5,U+694a,U+6a02,U+6a3a,U+6a80,U+6c23,U+6c72,U+6dcb,U+6faa,U+707c,U+71c8,U+7422,U+74e2,U+7791,U+7825,U+7a14,U+7a1c,U+7c95,U+7fc1,U+82a5,U+82db,U+8304,U+853d,U+8cd3,U+8de8,U+8f0c,U+8f3f,U+9091,U+91c7,U+929a,U+98af,U+9913}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.63.woff2) format("woff2");unicode-range:U+2ca-2cb,U+2229,U+2468,U+2669,U+266f,U+273f,U+4ec0,U+4f60,U+4fb6,U+5347,U+540e,U+543b,U+5b0c,U+5d4c,U+5f14,U+5f9e,U+6155,U+62d0,U+6602,U+6666,U+66f3,U+67a2,U+67ca,U+69cc,U+6d29,U+6d9b,U+6e3e,U+6f81,U+7109,U+73c0,U+73c2,U+7425,U+7435-7436,U+7525,U+7554,U+785d,U+786b,U+7ae3,U+7b94,U+7d18,U+81bf,U+8511,U+8549,U+9075,U+9640,U+98e2,U+9e9f,U+ff96}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.64.woff2) format("woff2");unicode-range:U+2467,U+4ece,U+4ed4,U+4f91,U+4fae,U+534d,U+53c9,U+54b3,U+586b,U+5944,U+5b78,U+5df7,U+5f77,U+6101,U+6167-6168,U+61a4,U+62d9,U+698a,U+699b,U+6a59,U+6cc4,U+6e07,U+7099,U+75d2,U+77ad,U+7953,U+7984,U+7a92,U+7baa,U+7dbb,U+817f,U+82ad,U+85e9,U+868a,U+8caa,U+8f44,U+9017,U+907c,U+908a,U+92f3,U+936e,U+9435,U+978d,U+9838,U+9a28,U+9b41,U+9ba8,U+9c57,U+9eb9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.65.woff2) format("woff2");unicode-range:U+b1,U+309b,U+4e5e,U+51f1,U+5506,U+55c5,U+58cc,U+59d1,U+5c51,U+5ef7,U+6284,U+62d7,U+6689,U+673d,U+6a2b,U+6a8e,U+6a9c,U+6d63,U+6dd1,U+70b8,U+7235,U+72db,U+72f8,U+7560,U+7c9b,U+7ce7,U+7e1e,U+80af,U+82eb,U+8463,U+8499,U+85dd,U+86ee,U+8a60,U+8a6e,U+8c79,U+8e87,U+8e8a,U+8f5f,U+9010,U+918d,U+9190,U+965b,U+97fb,U+9ab8,U+9bad,U+9d3b,U+9d5c,U+9dfa,U+9e93}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.66.woff2) format("woff2");unicode-range:U+2020,U+3003,U+3231,U+4e9b,U+4f3d,U+4f47,U+51b6,U+51dc,U+53e1,U+5bc5,U+602f,U+60bc,U+61c9,U+633d,U+637b,U+6492,U+65fa,U+660f,U+66f0,U+6703,U+681e,U+6876,U+6893,U+6912,U+698e,U+6c7d,U+714c,U+7169,U+71d5,U+725f,U+72d7,U+745b,U+74dc,U+75e2,U+7891,U+7897,U+7dcb,U+810a,U+8218,U+8339,U+840e,U+852d,U+8823,U+8a0a,U+9089,U+919c,U+971c,U+9ad9,U+ff4a,U+ff5a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.67.woff2) format("woff2");unicode-range:U+2466,U+2600,U+4eab,U+4fe3,U+4ff5,U+51a5,U+51f0,U+536f,U+53d4,U+53f1,U+54a5,U+559d,U+55e3,U+58fa,U+5962,U+59ea,U+5c16,U+5cef,U+5d16,U+5f10,U+5fd6,U+6190,U+6216,U+634f,U+63bb,U+66d6,U+6756,U+6bc5,U+6e26,U+727d,U+731f,U+76f2,U+7729,U+7a7f,U+7aff,U+7c9f,U+818f,U+8236,U+82b9,U+8338,U+85aa,U+88b4,U+8b33,U+904d,U+93a7,U+96cc,U+96eb,U+9aed,U+9b8e,U+fa11}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.68.woff2) format("woff2");unicode-range:U+251c,U+2523,U+4e14,U+545f,U+54bd,U+553e,U+55dc,U+56da,U+589c,U+5b55,U+5bb5,U+5ce1,U+5df4,U+5eb6,U+5ec9,U+6191,U+62f7,U+6357,U+64a5,U+6591,U+65bc,U+6897,U+6e1a,U+7063,U+711a,U+721b,U+722c,U+75b9,U+75d5,U+75fa,U+7766,U+7aae,U+7b48,U+7b8b,U+7d21,U+7e55,U+7f75,U+842c,U+8910,U+8a63,U+8b39,U+8b5a,U+8cdc,U+8d74,U+907d,U+91e7,U+9306,U+96bc,U+98f4,U+9ac4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.69.woff2) format("woff2");unicode-range:U+2003,U+2312,U+266c,U+4f86,U+51ea,U+5243,U+5256,U+541f,U+5841,U+59dc,U+5df3,U+601c,U+60e7,U+632b,U+638c,U+64ad,U+6881,U+697c,U+69cd,U+6c50,U+6d2a,U+6fc1,U+7027,U+7058,U+70f9,U+714e,U+7345,U+751a,U+760d,U+764c,U+77db,U+7d79,U+7e8f,U+80ce,U+814e,U+81fc,U+8247,U+8278,U+85a9,U+8a03,U+90ed,U+9784,U+9801,U+984e,U+99b3,U+9bc9,U+9bdb,U+9be8,U+9e78,U+ff6b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.70.woff2) format("woff2");unicode-range:U+266b,U+3006,U+5176,U+5197,U+51a8,U+51c6,U+52f2,U+5614,U+5875,U+5a2f,U+5b54,U+5ce0,U+5dba,U+5deb,U+5e63,U+5f59,U+5fcc,U+6068,U+6367,U+68b6,U+6a0b,U+6b64,U+6e15,U+6eba,U+7272,U+72a0,U+7947,U+7985,U+79e6,U+79e9,U+7a3d,U+7a9f,U+7aaf,U+7b95,U+7f60,U+7f9e,U+7fe0,U+8098,U+80ba,U+8106,U+82d4,U+831c,U+87f9,U+8a1f,U+8acf,U+90c1,U+920d,U+9756,U+fe43,U+ff94}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.71.woff2) format("woff2");unicode-range:U+af,U+2465,U+2517,U+33a1,U+4f10,U+50c5,U+51b4,U+5384,U+5606,U+5bb0,U+5cac,U+5ee3,U+618e,U+61f2,U+62c9,U+66ab,U+66f9,U+6816,U+6960,U+6b3e,U+6f20,U+7078,U+72d0,U+73ed,U+7ad9,U+7b1b,U+7be4,U+7d62,U+7f51,U+80b4,U+80f4,U+8154,U+85fb,U+865c,U+8702,U+895f,U+8aed,U+8b90,U+8ced,U+8fbf,U+91d8,U+9418,U+9583,U+9591,U+9813,U+982c,U+9bd6,U+ff46,U+ff7f,U+ff88}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.72.woff2) format("woff2");unicode-range:U+4e91,U+508d,U+50e7,U+514e,U+51f6,U+5446,U+5504,U+584a,U+59a8,U+59d3,U+5a46,U+5ac9,U+6020,U+60a6,U+6148,U+621a,U+6234,U+64c1,U+6523,U+675c,U+67d1,U+6953,U+6ccc,U+6df5,U+6e13,U+6f06,U+723a,U+7325,U+74e6,U+758e,U+75ab,U+75d9,U+7a40,U+8096,U+82fa,U+8587,U+8594,U+8a6b,U+8ab9,U+8b17,U+8b83,U+937c,U+963b,U+9673,U+96db,U+9ce9,U+9f4b,U+ff67,U+ff82,U+ff93}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.73.woff2) format("woff2");unicode-range:U+221e,U+2514,U+51f9,U+5270,U+5449,U+5824,U+59a5,U+5a29,U+5d07,U+5e16,U+60e3,U+614c,U+6276,U+643e,U+64ab,U+6562,U+6681,U+670b,U+6734,U+67af,U+6a3d,U+6b05,U+6dc0,U+6e4a,U+7259,U+732a,U+7409,U+78a7,U+7a6b,U+8015,U+809b,U+817a,U+830e,U+837b,U+85ab,U+8a23,U+8a93,U+8b00,U+8b19,U+8b21,U+8cbf,U+8fb0,U+901d,U+91b8,U+9320,U+932c,U+9688,U+96f6,U+9df2,U+ff6a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.74.woff2) format("woff2");unicode-range:U+2002,U+2025,U+4f8d,U+51e1,U+51f8,U+5507,U+5598,U+58f1,U+5983,U+59ac,U+5c3c,U+5de7,U+5e7d,U+5eca,U+5f61,U+606d,U+60f9,U+636e,U+64ec,U+67da,U+67ff,U+6813,U+68f2,U+693f,U+6b6a,U+6bbb,U+6ef4,U+7092,U+717d,U+7261,U+73c8,U+7432,U+7483,U+76fe,U+7709,U+78d0,U+81a3,U+81b3,U+82af,U+8305,U+8309,U+8870,U+88fe,U+8cd1,U+8d66,U+906e,U+971e,U+9812,U+ff79,U+ff90}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.75.woff2) format("woff2");unicode-range:U+2464,U+2501,U+2640,U+2642,U+339d,U+4f0e,U+5091,U+50b5,U+5132,U+51cc,U+558b,U+55aa,U+585e,U+5bee,U+5dfe,U+60b6,U+62b9,U+6349,U+6566,U+6590,U+6842,U+689d,U+6a58,U+6c70,U+6ff1,U+7815,U+7881,U+7aaa,U+7bc7,U+7def,U+7fa8,U+8017,U+8036,U+8061,U+821f,U+8429,U+8ce0,U+8e74,U+9019,U+90ca,U+9162,U+932f,U+93ae,U+9644,U+990c,U+9cf3,U+ff56,U+ff6e,U+ff7e,U+ff85}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.76.woff2) format("woff2");unicode-range:U+2266-2267,U+4f2f,U+5208,U+5451,U+546a,U+5589,U+576a,U+5815,U+5a9a,U+5b9b,U+5c3a,U+5efb,U+5faa,U+6109,U+6643,U+6652,U+695a,U+69fd,U+6b86,U+6bb4,U+6daf,U+7089,U+70cf,U+7a00,U+7a4f,U+7b39,U+7d33,U+80e1,U+828b,U+82a6,U+86cd,U+8c8c,U+8cca,U+8df3,U+9077,U+9175,U+91dc,U+925b,U+9262,U+9271,U+92ed,U+9855,U+9905,U+9d28,U+ff3f,U+ff58,U+ff68,U+ff6d,U+ff9c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.77.woff2) format("woff2");unicode-range:U+2207,U+25ef,U+309c,U+4e4f,U+5146,U+51dd,U+5351,U+540a,U+5629,U+5eb5,U+5f04,U+5f13,U+60dc,U+6212,U+63b4,U+642c,U+6627,U+66a6,U+66c7,U+66fd,U+674e,U+6b96,U+6c4e,U+6df3,U+6e67,U+6f84,U+72fc,U+733f,U+7c97,U+7db1,U+7e4d,U+816b,U+82d1,U+84cb,U+854e,U+8607,U+86c7,U+871c,U+8776,U+8a89,U+8fc4,U+91a4,U+9285,U+9685,U+9903,U+9b31,U+9f13,U+ff42,U+ff74,U+ff91}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.78.woff2) format("woff2");unicode-range:U+4e32,U+51db,U+53a8,U+53ea,U+5609,U+5674,U+5a92,U+5e7e,U+6115,U+611a,U+62cc,U+62ed,U+63c9,U+64b9,U+64e6,U+65cb,U+6606,U+6731,U+683d,U+6afb,U+7460,U+771e,U+78ef,U+7b26,U+7b51,U+7cde,U+7d10,U+7d2f,U+7d46,U+80de,U+819c,U+84b2,U+85cd,U+865a,U+8ecc,U+9022,U+90b8,U+9192,U+9675,U+96b7,U+99ff,U+ff44,U+ff55,U+ff6c,U+ff73,U+ff75,U+ff86,U+ff8d,U+ff92,U+ffe3}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.79.woff2) format("woff2");unicode-range:U+25b3,U+30f5,U+4eae,U+4f46,U+4f51,U+5203,U+52ff,U+55a7,U+564c,U+565b,U+57f9,U+5805,U+5b64,U+5e06,U+5f70,U+5f90,U+60e8,U+6182,U+62f3,U+62fe,U+63aa,U+64a4,U+65d7,U+673a,U+6851,U+68cb,U+68df,U+6d1e,U+6e58,U+6e9d,U+77b3,U+7832,U+7c3f,U+7db4,U+7f70,U+80aa,U+80c6,U+8105,U+819d,U+8276,U+8679,U+8986,U+8c9d,U+8fc5,U+916c,U+9665,U+9699,U+96c0,U+9a19,U+ff8b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.80.woff2) format("woff2");unicode-range:U+2463,U+25a1,U+4ef0,U+5076,U+5098,U+51fd,U+5302,U+5448,U+54c9,U+570b,U+583a,U+5893,U+58a8,U+58ee,U+5949,U+5bdb,U+5f26,U+5f81,U+6052,U+6170,U+61c7,U+631f,U+635c,U+664b,U+69fb,U+6f01,U+7070,U+722a,U+745e,U+755c,U+76c6,U+78c1,U+79e4,U+7bb8,U+7d0b,U+81a8,U+82d7,U+8b5c,U+8f14,U+8fb1,U+8fbb,U+9283,U+9298,U+9a30,U+ff03,U+ff50,U+ff59,U+ff7b,U+ff8e-ff8f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.81.woff2) format("woff2");unicode-range:U+2010,U+2502,U+25b6,U+4f3a,U+514b,U+5265,U+52c3,U+5339,U+53ec,U+54c0,U+55b0,U+5854,U+5b8f,U+5cb3,U+5e84,U+60da,U+6247,U+6249,U+628a,U+62cd,U+65ac,U+6838,U+690e,U+6cf0,U+6f02,U+6f2c,U+6f70,U+708a,U+7434,U+75be,U+77ef,U+7c60,U+7c98,U+7d1b,U+7e2b,U+80a5,U+81e3,U+820c,U+8210,U+8475,U+862d,U+8650,U+8997,U+906d,U+91c8,U+9700,U+9727,U+9df9,U+ff3a,U+ff9a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.82.woff2) format("woff2");unicode-range:U+2103,U+5049,U+52b1,U+5320,U+5553,U+572d,U+58c7,U+5b5d,U+5bc2,U+5de3,U+5e61,U+5f80,U+61a9,U+67d0,U+67f4,U+6c88,U+6ca1,U+6ce5,U+6d78,U+6e9c,U+6f54,U+731b,U+73b2,U+74a7,U+74f6,U+75e9,U+7b20,U+7c8b,U+7f72,U+809d,U+8108,U+82b3,U+82bd,U+84b8,U+84c4,U+88c2,U+8ae6,U+8ef8,U+902e,U+9065,U+9326,U+935b,U+938c,U+9676,U+9694,U+96f7,U+9ed9,U+ff48,U+ff4c,U+ff81}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.83.woff2) format("woff2");unicode-range:U+2500,U+3008-3009,U+4ead,U+4f0f,U+4fca,U+53eb,U+543e,U+57a2,U+5cf0,U+5e8f,U+5fe0,U+61b2,U+62d8,U+6442,U+64b2,U+6589,U+659c,U+67f1,U+68c4,U+6cb8,U+6d12,U+6de1,U+6fe1,U+70c8,U+723d,U+73e0,U+7656,U+773a,U+7948,U+7b87,U+7c92,U+7d3a,U+7e1b,U+7e4a,U+819a,U+8358,U+83c5,U+84bc,U+864e,U+8912,U+8c9e,U+8d05,U+92fc,U+9396,U+98fd,U+99d2,U+ff64,U+ff7a,U+ff83}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.84.woff2) format("woff2");unicode-range:U+3014-3015,U+4e3c,U+5036,U+5075,U+533f,U+53e9,U+5531,U+5642,U+5984,U+59e6,U+5a01,U+5b6b,U+5c0b,U+5f25,U+6069,U+60a0,U+614e,U+62b5,U+62d2-62d3,U+6597,U+660c,U+674f,U+67cf,U+6841,U+6905,U+6cf3,U+6d32,U+6d69,U+6f64,U+716e,U+7761,U+7b52,U+7be0,U+7dbf,U+7de9,U+7f36,U+81d3,U+8302,U+8389,U+846c,U+84ee,U+8a69,U+9038,U+9d8f,U+ff47,U+ff4b,U+ff76,U+ff9b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.85.woff2) format("woff2");unicode-range:U+25c7,U+3007,U+504f,U+507d,U+51a0,U+52a3,U+5410,U+5510,U+559a,U+5782,U+582a,U+5c0a,U+5c3f,U+5c48,U+5f6b,U+6176,U+622f,U+6279,U+62bd,U+62dd,U+65ed,U+67b6,U+6817,U+6850,U+6d6a,U+6deb,U+6ea2,U+6edd,U+6f5c,U+72e9,U+73a9,U+7573,U+76bf,U+7950,U+7956,U+7f8a,U+7ffc,U+80a2,U+80c3,U+83ca,U+8a02,U+8a13,U+8df5,U+9375,U+983b,U+99b4,U+ff4e,U+ff71,U+ff89,U+ff97}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.86.woff2) format("woff2");unicode-range:U+24,U+2022,U+2212,U+221f,U+2665,U+4ecf,U+5100,U+51cd,U+52d8,U+5378,U+53f6,U+574a,U+5982,U+5996,U+5c1a,U+5e1d,U+5f84,U+609f,U+61a7,U+61f8,U+6398,U+63ee,U+6676,U+6691,U+6eb6,U+7126,U+71e5,U+7687,U+7965,U+7d17,U+80a1,U+8107,U+8266,U+85a6,U+8987,U+8ca2,U+8cab,U+8e0a,U+9042,U+95c7,U+9810,U+9867,U+98fc,U+ff52-ff54,U+ff61,U+ff77,U+ff98-ff99}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.87.woff2) format("woff2");unicode-range:U+b0,U+226a,U+2462,U+4e39,U+4fc3,U+4fd7,U+50be,U+50da,U+5200,U+5211,U+54f2,U+5618,U+596a,U+5b22,U+5bb4,U+5d50,U+60a3,U+63fa,U+658e,U+65e8,U+6669,U+6795,U+679d,U+67a0,U+6b3a,U+6e09,U+757f,U+7cd6,U+7dbe,U+7ffb,U+83cc,U+83f1,U+840c,U+845b,U+8846,U+8972,U+8a34,U+8a50,U+8a87,U+8edf,U+8ff0,U+90a6,U+9154,U+95a3,U+9663,U+9686,U+96c7,U+ff3c,U+ff7c,U+ff8a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.88.woff2) format("woff2");unicode-range:U+25bd,U+4e59,U+4ec1,U+4ff3,U+515a,U+518a,U+525b,U+5375,U+552f,U+57a3,U+5b9c,U+5c3d,U+5e3d,U+5e7b,U+5f0a,U+6094,U+6458,U+654f,U+67f3,U+6b8a,U+6bd2,U+6c37,U+6ce1,U+6e56,U+6e7f,U+6ed1,U+6ede,U+6f0f,U+70ad,U+7267,U+7363,U+786c,U+7a42,U+7db2,U+7f85,U+8178,U+829d,U+8896,U+8c5a,U+8cb0,U+8ce2,U+8ed2,U+9047,U+9177,U+970a,U+9ea6,U+ff1b,U+ff31,U+ff39,U+ff80}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.89.woff2) format("woff2");unicode-range:U+a5,U+4e80,U+4f34,U+4f73,U+4f75,U+511f,U+5192,U+52aa,U+53c8,U+570f,U+57cb,U+596e,U+5d8b,U+5f66,U+5fd9,U+62db,U+62f6,U+6328,U+633f,U+63a7,U+6469,U+6bbf,U+6c41,U+6c57,U+6d44,U+6dbc,U+706f,U+72c2,U+72ed,U+7551,U+75f4,U+7949,U+7e26,U+7fd4,U+8150,U+8af8,U+8b0e,U+8b72,U+8ca7,U+934b,U+9a0e,U+9a12,U+9b42,U+ff41,U+ff43,U+ff45,U+ff49,U+ff4f,U+ff62-ff63}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.90.woff2) format("woff2");unicode-range:U+4e18,U+4fb5,U+5104,U+52c7,U+5353,U+5374,U+53e5,U+587e,U+594f,U+5a20,U+5de1,U+5f18,U+5fcd,U+6291,U+62ab,U+6355,U+6392,U+63da,U+63e1,U+656c,U+6687,U+68b0-68b1,U+68d2,U+68da,U+6b27,U+6cbc,U+7159,U+7344,U+73cd,U+76df,U+790e,U+7cf8,U+8102,U+88c1,U+8aa0,U+8e0f,U+9178,U+92ad,U+9670,U+96c5,U+9cf4,U+9db4,U+ff3e,U+ff6f,U+ff72,U+ff78,U+ff7d,U+ff84,U+ff8c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.91.woff2) format("woff2");unicode-range:U+60,U+2200,U+226b,U+2461,U+517c,U+526f,U+5800,U+5b97,U+5bf8,U+5c01,U+5d29,U+5e4c,U+5e81,U+6065,U+61d0,U+667a,U+6696,U+6843,U+6c99,U+6d99,U+6ec5,U+6f22,U+6f6e,U+6fa4,U+6fef,U+71c3,U+72d9,U+7384,U+78e8,U+7a1a,U+7a32,U+7a3c,U+7adc,U+7ca7,U+7d2b,U+7dad,U+7e4b,U+80a9,U+8170,U+81ed,U+820e,U+8a17,U+8afe,U+90aa,U+914e,U+963f,U+99c4,U+9eba,U+9f3b,U+ff38}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.92.woff2) format("woff2");unicode-range:U+2460,U+4e5f,U+4e7e,U+4ed9,U+501f,U+502b,U+5968,U+5974,U+5ac1,U+5b99,U+5ba3,U+5be7,U+5be9,U+5c64,U+5cb8,U+5ec3,U+5f1f,U+616e,U+6297,U+62e0,U+62ec,U+6368,U+642d,U+65e6,U+6717,U+676f,U+6b04,U+732e,U+7652,U+76ca,U+76d7,U+7802,U+7e70,U+7f6a,U+8133,U+81e8,U+866b,U+878d,U+88f8,U+8a5e,U+8cdb,U+8d08,U+907a,U+90e1,U+96f2,U+9f8d,U+ff35,U+ff37,U+ff40,U+ff9d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.93.woff2) format("woff2");unicode-range:U+21d2,U+25ce,U+300a-300b,U+4e89,U+4e9c,U+4ea1,U+5263,U+53cc,U+5426,U+5869,U+5947,U+598a,U+5999,U+5e55,U+5e72,U+5e79,U+5fae,U+5fb9,U+602a,U+6163,U+624d,U+6749,U+6c5a,U+6cbf,U+6d45,U+6dfb,U+6e7e,U+708e,U+725b,U+7763,U+79c0,U+7bc4,U+7c89,U+7e01,U+7e2e,U+8010,U+8033,U+8c6a,U+8cc3,U+8f1d,U+8f9b,U+8fb2,U+907f,U+90f7,U+9707,U+9818,U+9b3c,U+ff0a,U+ff4d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.94.woff2) format("woff2");unicode-range:U+2015,U+2190,U+4e43,U+5019,U+5247,U+52e7,U+5438,U+54b2,U+55ab,U+57f7,U+5bd2,U+5e8a,U+5ef6,U+6016,U+60b2,U+6162,U+6319,U+6551,U+6607,U+66b4,U+675f,U+67d4,U+6b20,U+6b53,U+6ce3,U+719f,U+75b2,U+770b,U+7720,U+77ac,U+79d2,U+7af9,U+7d05,U+7dca,U+8056,U+80f8,U+81f3,U+8352,U+885d,U+8a70,U+8aa4,U+8cbc,U+900f,U+9084,U+91e3,U+9451,U+96c4,U+99c6,U+9ad4,U+ff70}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.95.woff2) format("woff2");unicode-range:U+2193,U+25b2,U+4e4b,U+516d,U+51c4,U+529f,U+52c9,U+5360,U+5442,U+5857,U+5915,U+59eb,U+5a9b,U+5c3b,U+6012,U+61b6,U+62b1,U+6311,U+6577,U+65e2,U+65ec,U+6613,U+6790,U+6cb9,U+7372,U+76ae,U+7d5e,U+7fcc,U+88ab,U+88d5,U+8caf,U+8ddd,U+8ecd,U+8f38,U+8f9e,U+8feb,U+9063,U+90f5,U+93e1,U+968a,U+968f,U+98fe,U+9ec4,U+ff1d,U+ff27,U+ff2a,U+ff36,U+ff3b,U+ff3d,U+ffe5}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.96.woff2) format("woff2");unicode-range:U+4e03,U+4f38,U+50b7,U+5264,U+5348,U+5371,U+585a,U+58ca,U+5951,U+59b9,U+59d4,U+5b98,U+5f8b,U+6388,U+64cd,U+65e7,U+6803,U+6b6f,U+6d66,U+6e0b,U+6ecb,U+6fc3,U+72ac,U+773c,U+77e2,U+7968,U+7a74,U+7dba,U+7dd1,U+7e3e,U+808c,U+811a,U+8179,U+8239,U+8584,U+8a0e,U+8a72,U+8b66,U+8c46,U+8f29,U+90a3,U+9234,U+96f0,U+9769,U+9774,U+9aa8,U+ff26,U+ff28,U+ff9e-ff9f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.97.woff2) format("woff2");unicode-range:U+7e,U+b4,U+25c6,U+2661,U+4e92,U+4eee,U+4ffa,U+5144,U+5237,U+5287,U+52b4,U+58c1,U+5bff,U+5c04,U+5c06,U+5e95,U+5f31,U+5f93,U+63c3,U+640d,U+6557,U+6614,U+662f,U+67d3,U+690d,U+6bba,U+6e6f,U+72af,U+732b,U+7518,U+7ae0,U+7ae5,U+7af6,U+822a,U+89e6,U+8a3a,U+8a98,U+8cb8,U+8de1,U+8e8d,U+95d8,U+961c,U+96a3,U+96ea,U+9bae,U+ff20,U+ff22,U+ff29,U+ff2b-ff2c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.98.woff2) format("woff2");unicode-range:U+25cb,U+4e71,U+4f59,U+50d5,U+520a,U+5217,U+5230,U+523a-523b,U+541b,U+5439,U+5747,U+59c9,U+5bdf,U+5c31,U+5de8,U+5e7c,U+5f69,U+6050,U+60d1,U+63cf,U+663c,U+67c4,U+6885,U+6c38,U+6d6e,U+6db2,U+6df7,U+6e2c,U+6f5f,U+7532,U+76e3-76e4,U+7701,U+793c,U+79f0,U+7a93,U+7d00,U+7de0,U+7e54,U+8328,U+8840,U+969c,U+96e8,U+9811,U+9aea,U+9b5a,U+ff24,U+ff2e,U+ff57}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.99.woff2) format("woff2");unicode-range:U+2191,U+505c,U+52e4,U+5305,U+535a,U+56e0,U+59bb,U+5acc,U+5b09,U+5b87,U+5c90,U+5df1,U+5e2d,U+5e33,U+5f3e,U+6298,U+6383,U+653b,U+6697,U+6804,U+6a39,U+6cca,U+6e90,U+6f2b,U+702c,U+7206,U+7236,U+7559,U+7565,U+7591,U+75c7,U+75db,U+7b4b,U+7bb1,U+7d99,U+7fbd,U+8131,U+885b,U+8b1d,U+8ff7,U+9003,U+9045,U+96a0,U+9732,U+990a,U+99d0,U+9e97,U+9f62,U+ff25,U+ff2d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.100.woff2) format("woff2");unicode-range:U+4e08,U+4f9d,U+5012,U+514d,U+51b7,U+5275,U+53ca,U+53f8,U+5584,U+57fc,U+5b9d,U+5bfa,U+5c3e,U+5f01,U+5fb4,U+5fd7,U+606f,U+62e1,U+6563,U+6674,U+6cb3,U+6d3e,U+6d74,U+6e1b,U+6e2f,U+718a,U+7247,U+79d8,U+7d14,U+7d66,U+7d71,U+7df4,U+7e41,U+80cc,U+8155,U+83d3,U+8a95,U+8ab2,U+8ad6,U+8ca1,U+9000,U+9006,U+9678,U+97d3,U+9808,U+98ef,U+9a5a,U+9b45,U+ff23,U+ff30}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.101.woff2) format("woff2");unicode-range:U+25bc,U+3012,U+4ef2,U+4f0a,U+516b,U+5373,U+539a,U+53b3,U+559c,U+56f0,U+5727,U+5742,U+5965,U+59ff,U+5bc6,U+5dfb,U+5e45,U+5ead,U+5fb3,U+6211,U+6253,U+639b,U+63a8,U+6545,U+6575,U+6628,U+672d,U+68a8,U+6bdb,U+6d25,U+707d,U+767e,U+7834,U+7b46,U+7bc9,U+8074,U+82e6,U+8349,U+8a2a,U+8d70,U+8da3,U+8fce,U+91cc,U+967d,U+97ff,U+9996,U+ff1c,U+ff2f,U+ff32,U+ff34}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.102.woff2) format("woff2");unicode-range:U+3d,U+5e,U+25cf,U+4e0e,U+4e5d,U+4e73,U+4e94,U+4f3c,U+5009,U+5145,U+51ac,U+5238,U+524a,U+53f3,U+547c,U+5802,U+5922,U+5a66,U+5c0e,U+5de6,U+5fd8,U+5feb,U+6797,U+685c,U+6b7b,U+6c5f-6c60,U+6cc9,U+6ce2,U+6d17,U+6e21,U+7167,U+7642,U+76db,U+8001,U+821e,U+8857,U+89d2,U+8b1b,U+8b70,U+8cb4,U+8cde,U+8f03,U+8f2a,U+968e,U+9b54,U+9e7f,U+9ebb,U+ff05,U+ff33}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.103.woff2) format("woff2");unicode-range:U+500d,U+5074,U+50cd,U+5175,U+52e2,U+5352,U+5354,U+53f2,U+5409,U+56fa,U+5a18,U+5b88,U+5bdd,U+5ca9,U+5f92,U+5fa9,U+60a9,U+623f,U+6483,U+653f,U+666f,U+66ae,U+66f2,U+6a21,U+6b66,U+6bcd,U+6d5c,U+796d,U+7a4d,U+7aef,U+7b56,U+7b97,U+7c4d,U+7e04,U+7fa9,U+8377,U+83dc,U+83ef,U+8535,U+8863,U+88cf,U+88dc,U+8907,U+8acb,U+90ce,U+91dd,U+ff0b,U+ff0d,U+ff19,U+ff65}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.104.woff2) format("woff2");unicode-range:U+4e01,U+4e21,U+4e38,U+52a9,U+547d,U+592e,U+5931,U+5b63,U+5c40,U+5dde,U+5e78,U+5efa,U+5fa1,U+604b,U+6075,U+62c5,U+632f,U+6a19,U+6c0f,U+6c11,U+6c96,U+6e05,U+70ba,U+71b1,U+7387,U+7403,U+75c5,U+77ed,U+795d,U+7b54,U+7cbe,U+7d19,U+7fa4,U+8089,U+81f4,U+8208,U+8336,U+8457,U+8a33,U+8c4a,U+8ca0,U+8ca8,U+8cc0,U+9014,U+964d,U+9803,U+983c,U+98db,U+ff17,U+ff21}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.105.woff2) format("woff2");unicode-range:U+25,U+25a0,U+4e26,U+4f4e,U+5341,U+56f2,U+5bbf,U+5c45,U+5c55,U+5c5e,U+5dee,U+5e9c,U+5f7c,U+6255,U+627f,U+62bc,U+65cf,U+661f,U+666e,U+66dc,U+67fb,U+6975,U+6a4b,U+6b32,U+6df1,U+6e29,U+6fc0,U+738b,U+7686,U+7a76,U+7a81,U+7c73,U+7d75,U+7dd2,U+82e5,U+82f1,U+85ac,U+888b,U+899a,U+8a31,U+8a8c,U+8ab0,U+8b58,U+904a,U+9060,U+9280,U+95b2,U+984d,U+9ce5,U+ff18}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.106.woff2) format("woff2");unicode-range:U+30f6,U+50ac,U+5178,U+51e6,U+5224,U+52dd,U+5883,U+5897,U+590f,U+5a5a,U+5bb3,U+5c65,U+5e03,U+5e2b,U+5e30,U+5eb7,U+6271,U+63f4,U+64ae,U+6574,U+672b,U+679a,U+6a29-6a2a,U+6ca2,U+6cc1,U+6d0b,U+713c,U+74b0,U+7981,U+7a0b,U+7bc0,U+7d1a,U+7d61,U+7fd2,U+822c,U+8996,U+89aa,U+8cac,U+8cbb,U+8d77,U+8def,U+9020,U+9152,U+9244,U+9662,U+967a,U+96e3,U+9759,U+ff16}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.107.woff2) format("woff2");unicode-range:U+23,U+3c,U+2192,U+4e45,U+4efb,U+4f50,U+4f8b,U+4fc2,U+5024,U+5150,U+5272,U+5370,U+53bb,U+542b,U+56db,U+56e3,U+57ce,U+5bc4,U+5bcc,U+5f71,U+60aa,U+6238,U+6280,U+629c,U+6539,U+66ff,U+670d,U+677e-677f,U+6839,U+69cb,U+6b4c,U+6bb5,U+6e96,U+6f14,U+72ec,U+7389,U+7814,U+79cb,U+79d1,U+79fb,U+7a0e,U+7d0d,U+85e4,U+8d64,U+9632,U+96e2,U+9805,U+99ac,U+ff1e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.108.woff2) format("woff2");unicode-range:U+2605-2606,U+301c,U+4e57,U+4fee,U+5065,U+52df,U+533b,U+5357,U+57df,U+58eb,U+58f0,U+591c,U+592a-592b,U+5948,U+5b85,U+5d0e,U+5ea7,U+5ff5,U+6025,U+63a1,U+63a5,U+63db,U+643a,U+65bd,U+671d,U+68ee,U+6982,U+6b73,U+6bd4,U+6d88,U+7570,U+7b11,U+7d76,U+8077,U+8217,U+8c37,U+8c61,U+8cc7,U+8d85,U+901f,U+962a,U+9802,U+9806,U+9854,U+98f2,U+9928,U+99c5,U+9ed2}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.109.woff2) format("woff2");unicode-range:U+266a,U+4f11,U+533a,U+5343,U+534a,U+53cd,U+5404,U+56f3,U+5b57-5b58,U+5bae,U+5c4a,U+5e0c,U+5e2f,U+5eab,U+5f35,U+5f79,U+614b,U+6226,U+629e,U+65c5,U+6625,U+6751,U+6821,U+6b69,U+6b8b,U+6bce,U+6c42,U+706b,U+7c21,U+7cfb,U+805e,U+80b2,U+82b8,U+843d,U+8853,U+88c5,U+8a3c,U+8a66,U+8d8a,U+8fba,U+9069,U+91cf,U+9752,U+975e,U+9999,U+ff0f-ff10,U+ff14-ff15}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.110.woff2) format("woff2");unicode-range:U+40,U+4e86,U+4e95,U+4f01,U+4f1d,U+4fbf,U+5099,U+5171,U+5177,U+53cb,U+53ce,U+53f0,U+5668,U+5712,U+5ba4,U+5ca1,U+5f85,U+60f3,U+653e,U+65ad,U+65e9,U+6620,U+6750,U+6761,U+6b62,U+6b74,U+6e08,U+6e80,U+7248,U+7531,U+7533,U+753a,U+77f3,U+798f,U+7f6e,U+8449,U+88fd,U+89b3,U+8a55,U+8ac7,U+8b77,U+8db3,U+8efd,U+8fd4,U+9031-9032,U+9580,U+9589,U+96d1,U+985e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.111.woff2) format("woff2");unicode-range:U+2b,U+d7,U+300e-300f,U+4e07,U+4e8c,U+512a,U+5149,U+518d,U+5236,U+52b9,U+52d9,U+5468,U+578b,U+57fa,U+5b8c,U+5ba2,U+5c02,U+5de5,U+5f37,U+5f62,U+623b,U+63d0,U+652f,U+672a,U+6848,U+6d41,U+7136,U+7537,U+754c,U+76f4,U+79c1,U+7ba1,U+7d44,U+7d4c,U+7dcf,U+7dda,U+7de8,U+82b1,U+897f,U+8ca9,U+8cfc,U+904e,U+9664,U+982d,U+9858,U+98a8,U+9a13,U+ff13,U+ff5c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.112.woff2) format("woff2");unicode-range:U+4e16,U+4e3b,U+4ea4,U+4ee4,U+4f4d,U+4f4f,U+4f55,U+4f9b,U+5317,U+5358,U+53c2,U+53e4,U+548c,U+571f,U+59cb,U+5cf6,U+5e38,U+63a2,U+63b2,U+6559,U+662d,U+679c,U+6c7a,U+72b6,U+7523,U+767d,U+770c,U+7a2e,U+7a3f,U+7a7a,U+7b2c,U+7b49,U+7d20,U+7d42,U+8003,U+8272,U+8a08,U+8aac,U+8cb7,U+8eab,U+8ee2,U+9054-9055,U+90fd,U+914d,U+91cd,U+969b,U+97f3,U+984c,U+ff06}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.113.woff2) format("woff2");unicode-range:U+26,U+5f,U+2026,U+203b,U+4e09,U+4eac,U+4ed5,U+4fa1,U+5143,U+5199,U+5207,U+539f,U+53e3,U+53f7,U+5411,U+5473,U+5546,U+55b6,U+5929,U+597d,U+5bb9,U+5c11,U+5c4b,U+5ddd,U+5f97,U+5fc5,U+6295,U+6301,U+6307,U+671b,U+76f8,U+78ba,U+795e,U+7d30,U+7d39,U+7d9a,U+89e3,U+8a00,U+8a73,U+8a8d,U+8a9e,U+8aad,U+8abf,U+8cea,U+8eca,U+8ffd,U+904b,U+9650,U+ff11-ff12}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.114.woff2) format("woff2");unicode-range:U+3e,U+3005,U+4e0d,U+4e88,U+4ecb,U+4ee3,U+4ef6,U+4fdd,U+4fe1,U+500b,U+50cf,U+5186,U+5316,U+53d7,U+540c,U+544a,U+54e1,U+5728,U+58f2,U+5973,U+5b89,U+5c71,U+5e02,U+5e97,U+5f15,U+5fc3,U+5fdc,U+601d,U+611b,U+611f,U+671f,U+6728,U+6765,U+683c,U+6b21,U+6ce8,U+6d3b,U+6d77,U+7530,U+7740,U+7acb,U+7d50,U+826f,U+8f09,U+8fbc,U+9001,U+9053,U+91ce,U+9762,U+98df}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.115.woff2) format("woff2");unicode-range:U+7c,U+3080,U+4ee5,U+5148,U+516c,U+521d,U+5225,U+529b,U+52a0,U+53ef,U+56de,U+56fd,U+5909,U+591a,U+5b66,U+5b9f,U+5bb6,U+5bfe,U+5e73,U+5e83,U+5ea6,U+5f53,U+6027,U+610f,U+6210,U+6240,U+660e,U+66f4,U+66f8,U+6709,U+6771,U+697d,U+69d8,U+6a5f,U+6c34,U+6cbb,U+73fe,U+756a,U+7684,U+771f,U+793a,U+7f8e,U+898f,U+8a2d,U+8a71,U+8fd1,U+9078,U+9577,U+96fb,U+ff5e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.116.woff2) format("woff2");unicode-range:U+a9,U+3010-3011,U+30e2,U+4e0b,U+4eca,U+4ed6,U+4ed8,U+4f53,U+4f5c,U+4f7f,U+53d6,U+540d,U+54c1,U+5730,U+5916,U+5b50,U+5c0f,U+5f8c,U+624b,U+6570,U+6587,U+6599,U+691c,U+696d,U+6cd5,U+7269,U+7279,U+7406,U+767a-767b,U+77e5,U+7d04,U+7d22,U+8005,U+80fd,U+81ea,U+8868,U+8981,U+89a7,U+901a,U+9023,U+90e8,U+91d1,U+9332,U+958b,U+96c6,U+9ad8,U+ff1a,U+ff1f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.117.woff2) format("woff2");unicode-range:U+4e,U+a0,U+3000,U+300c-300d,U+4e00,U+4e0a,U+4e2d,U+4e8b,U+4eba,U+4f1a,U+5165,U+5168,U+5185,U+51fa,U+5206,U+5229,U+524d,U+52d5,U+5408,U+554f,U+5831,U+5834,U+5927,U+5b9a,U+5e74,U+5f0f,U+60c5,U+65b0,U+65b9,U+6642,U+6700,U+672c,U+682a,U+6b63,U+6c17,U+7121,U+751f,U+7528,U+753b,U+76ee,U+793e,U+884c,U+898b,U+8a18,U+9593,U+95a2,U+ff01,U+ff08-ff09}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.118.woff2) format("woff2");unicode-range:U+21-22,U+27-2a,U+2c-3b,U+3f,U+41-4d,U+4f-5d,U+61-7b,U+7d,U+ab,U+ae,U+b2-b3,U+b7,U+bb,U+c9,U+cd,U+d6,U+d8,U+dc,U+e0-e5,U+e7-ed,U+ef,U+f1-f4,U+f6,U+f8,U+fa,U+fc-fd,U+103,U+14d,U+1b0,U+300-301,U+1ebf,U+1ec7,U+2013-2014,U+201c-201d,U+2039-203a,U+203c,U+2048-2049,U+2113,U+2122,U+65e5,U+6708,U+70b9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.119.woff2) format("woff2");unicode-range:U+20,U+2027,U+3001-3002,U+3041-307f,U+3081-308f,U+3091-3093,U+3099-309a,U+309d-309e,U+30a1-30e1,U+30e3-30ed,U+30ef-30f0,U+30f2-30f4,U+30fb-30fe,U+ff0c,U+ff0e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6omwqRfTHxT624.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6okQqRfTHxT624.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6onwqRfTHxTw.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sniglet/v17/cIf9MaFLtkE3UjaJ9CChYUsEkIpdQQ.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sniglet/v17/cIf9MaFLtkE3UjaJ9C6hYUsEkIo.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:cloudflare-color{background: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='none' fill-rule='evenodd'%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' fill='%23F38020'/%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' fill='%23FCAD32'/%3E%3C/g%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.i-lobe-icons\:deepseek-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %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' fill='%234D6BFE'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:microsoft-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cpath d='M11.49 2H2v9.492h9.492V2h-.002z' fill='%23F25022'/%3E%3Cpath d='M22 2h-9.492v9.492H22V2z' fill='%237FBA00'/%3E%3Cpath d='M11.49 12.508H2V22h9.492v-9.492h-.002z' fill='%2300A4EF'/%3E%3Cpath d='M22 12.508h-9.492V22H22v-9.492z' fill='%23FFB900'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.i-lobe-icons\:mistral-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cpath d='M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z' fill='gold'/%3E%3Cpath d='M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z' fill='%23FFAF00'/%3E%3Cpath d='M3.428 10.258h17.144v3.428H3.428v-3.428z' fill='%23FF8205'/%3E%3Cpath d='M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z' fill='%23FA500F'/%3E%3Cpath d='M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z' fill='%23E10500'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:novita-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cpath clip-rule='evenodd' d='M9.167 4.17v5.665L0 19.003h9.167v-5.666l5.666 5.666H24L9.167 4.17z' fill='%2323D57C' fill-rule='evenodd'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:together-color{--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' fill='%230F6FFF' r='4.615'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:vllm-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cpath d='M0 4.973h9.324V23L0 4.973z' fill='%23FDB515'/%3E%3Cpath d='M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z' fill='%2330A2FF'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:blocks,[i-lucide\:blocks=""]{--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%3Crect width='7' height='7' x='14' y='3' rx='1'/%3E%3Cpath d='M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:book{--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='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:book-copy{--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='M2 16V4a2 2 0 0 1 2-2h11'/%3E%3Cpath d='M22 18H11a2 2 0 1 0 0 4h10.5a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5H11a2 2 0 0 0-2 2v12m-4-6H4a2 2 0 1 0 0 4h1'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:brain,[i-lucide\:brain=""]{--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 5a3 3 0 1 0-5.997.125a4 4 0 0 0-2.526 5.77a4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z'/%3E%3Cpath d='M12 5a3 3 0 1 1 5.997.125a4 4 0 0 1 2.526 5.77a4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z'/%3E%3Cpath d='M15 13a4.5 4.5 0 0 1-3-4a4.5 4.5 0 0 1-3 4m8.599-6.5a3 3 0 0 0 .399-1.375m-11.995 0A3 3 0 0 0 6.401 6.5m-2.924 4.396a4 4 0 0 1 .585-.396m15.876 0a4 4 0 0 1 .585.396M6 18a4 4 0 0 1-1.967-.516m15.934 0A4 4 0 0 1 18 18'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:check,[i-lucide\:check=""]{--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='M20 6L9 17l-5-5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:cog,[i-lucide\:cog=""]{--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 20a8 8 0 1 0 0-16a8 8 0 0 0 0 16'/%3E%3Cpath d='M12 14a2 2 0 1 0 0-4a2 2 0 0 0 0 4m0-12v2m0 18v-2m5 .66l-1-1.73m-5-8.66L7 3.34M20.66 17l-1.73-1M3.34 7l1.73 1M14 12h8M2 12h2m16.66-5l-1.73 1M3.34 17l1.73-1M17 3.34l-1 1.73m-5 8.66l-4 6.93'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:ear{--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='M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0'/%3E%3Cpath d='M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:eye{--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='M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:id-card,[i-lucide\:id-card=""]{--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='M16 10h2m-2 4h2M6.17 15a3 3 0 0 1 5.66 0'/%3E%3Ccircle cx='9' cy='11' r='2'/%3E%3Crect width='20' height='14' x='2' y='5' rx='2'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:loader-circle{--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='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2m7 9v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:paintbrush,[i-lucide\:paintbrush=""]{--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='m14.622 17.897l-10.68-2.913M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0zM9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:person-standing,[i-lucide\:person-standing=""]{--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%3Ccircle cx='12' cy='5' r='1'/%3E%3Cpath d='m9 20l3-6l3 6M6 8l6 2l6-2m-6 2v4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:sprout{--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='M7 20h10m-7 0c5.5-2.5.8-6.4 3-10'/%3E%3Cpath d='M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7c-2 .4-3.5.4-4.8-.3c-1.2-.6-2.3-1.9-3-4.2c2.8-.5 4.4 0 5.5.8M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4c1-1 1.6-2.3 1.7-4.6c-2.7.1-4 1-4.9 2'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:volume-2,[i-lucide\:volume-2=""]{--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='M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298zM16 9a5 5 0 0 1 0 6m3.364 3.364a9 9 0 0 0 0-12.728'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:alt-arrow-down-bold-duotone,[i-solar\:alt-arrow-down-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.303 12.404l3.327 3.431c.213.22.527.22.74 0l6.43-6.63C19.201 8.79 18.958 8 18.43 8h-5.723z'/%3E%3Cpath fill='currentColor' d='M11.293 8H5.57c-.528 0-.771.79-.37 1.205l2.406 2.481z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:bug-bold-duotone,[i-solar\:bug-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='M19 11.938V15a7 7 0 0 1-6.25 6.96V15a.75.75 0 0 0-1.5 0v6.96A7 7 0 0 1 5 15v-3.062A3.94 3.94 0 0 1 8.938 8h6.124A3.94 3.94 0 0 1 19 11.938' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M19 14.75v-1.5h3a.75.75 0 0 1 0 1.5zm-1.504 4.586c.31-.393.58-.82.801-1.276l2.538 1.27a.75.75 0 1 1-.67 1.34zM5.703 18.06q.333.684.801 1.276l-2.669 1.335a.75.75 0 0 1-.67-1.342zM5 13.25H2a.75.75 0 0 0 0 1.5h3zm12.354-4.515l2.81-1.406a.75.75 0 1 1 .671 1.341L18.42 9.88a4 4 0 0 0-1.065-1.144M6.647 8.735c-.427.306-.79.695-1.067 1.144L3.165 8.67a.75.75 0 0 1 .67-1.341zM16.5 8.27V7.5a4.5 4.5 0 1 0-9 0v.77A3.9 3.9 0 0 1 8.938 8h6.124c.508 0 .993.096 1.438.27'/%3E%3Cpath fill='currentColor' d='M6.376 1.584a.75.75 0 0 0 .208 1.04l2.36 1.573a4.5 4.5 0 0 1 1.387-.877L7.416 1.376a.75.75 0 0 0-1.04.208m8.68 2.613a4.5 4.5 0 0 0-1.387-.877l2.915-1.944a.75.75 0 1 1 .832 1.248z' opacity='.5'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 14.25a.75.75 0 0 1 .75.75v7h-1.5v-7a.75.75 0 0 1 .75-.75' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:magic-stick-3-bold-duotone,[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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:microphone-2-bold-duotone,[i-solar\:microphone-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='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' d='M9.75 7.75A.75.75 0 0 0 9 7H6.298a5.751 5.751 0 0 1 11.404 0H13.5a.75.75 0 0 0 0 1.5h4.25V10H13.5a.75.75 0 0 0 0 1.5h4.201a5.751 5.751 0 0 1-11.403 0H9A.75.75 0 0 0 9 10H6.25V8.5H9a.75.75 0 0 0 .75-.75' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12.75 10.75c0 .414.336.75.75.75h4.201l.049-1.5H13.5a.75.75 0 0 0-.75.75m0-3c0 .414.336.75.75.75h4.25L17.701 7H13.5a.75.75 0 0 0-.75.75m-3 0A.75.75 0 0 0 9 7H6.298L6.25 8.5H9a.75.75 0 0 0 .75-.75m0 3A.75.75 0 0 0 9 10H6.25l.048 1.5H9a.75.75 0 0 0 .75-.75'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:moon-stars-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.9 2.307a.483.483 0 0 0-.9 0l-.43 1.095a.48.48 0 0 1-.272.274l-1.091.432a.486.486 0 0 0 0 .903l1.091.432a.48.48 0 0 1 .272.273L19 6.81c.162.41.74.41.9 0l.43-1.095a.48.48 0 0 1 .273-.273l1.091-.432a.486.486 0 0 0 0-.903l-1.091-.432a.48.48 0 0 1-.273-.274zM16.033 8.13a.483.483 0 0 0-.9 0l-.157.399a.48.48 0 0 1-.272.273l-.398.158a.486.486 0 0 0 0 .903l.398.157c.125.05.223.148.272.274l.157.399c.161.41.739.41.9 0l.157-.4a.48.48 0 0 1 .272-.273l.398-.157a.486.486 0 0 0 0-.903l-.398-.158a.48.48 0 0 1-.272-.273z'/%3E%3Cpath fill='currentColor' d='M12 22c5.523 0 10-4.477 10-10c0-.463-.694-.54-.933-.143a6.5 6.5 0 1 1-8.924-8.924C12.54 2.693 12.463 2 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:star-fall-2-bold-duotone,[i-solar\:star-fall-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='M11.58 4.776c.695-1.77 1.043-2.656 1.769-2.765c.726-.11 1.35.63 2.6 2.109l.323.382c.355.42.532.63.774.75c.24.12.518.137 1.074.17l.506.029c1.955.114 2.932.172 3.271.81c.34.64-.184 1.438-1.231 3.033l-.271.413c-.298.453-.447.68-.487.939s.033.52.179 1.043l.133.477c.513 1.842.77 2.762.253 3.266c-.517.505-1.465.258-3.361-.235l-.49-.127c-.54-.14-.809-.21-1.075-.17s-.499.185-.964.476l-.424.265c-1.638 1.024-2.456 1.536-3.115 1.208c-.659-.327-.72-1.277-.845-3.177l-.033-.492c-.035-.54-.053-.81-.177-1.044s-.34-.406-.774-.75l-.395-.312C7.294 9.865 6.53 9.26 6.64 8.554s1.02-1.047 2.839-1.729l.47-.176c.518-.194.776-.29.965-.475c.19-.185.288-.437.486-.94z'/%3E%3Cpath fill='currentColor' d='M5.31 9.593C2.873 11.92 1.275 15.806 2.331 22c.943-2.603 3.526-4.76 6.581-6.047c-.106-.593-.154-1.317-.204-2.08l-.039-.595a22 22 0 0 0-.032-.43l-.086-.071l-.268-.215l-.475-.376c-.694-.55-1.34-1.06-1.783-1.532c-.253-.269-.536-.624-.715-1.061m5.037 5.83l-.015-.114l.056.101z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:sun-fog-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.25 22a.75.75 0 0 1 .75-.75h8a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75M12 1.25a.75.75 0 0 1 .75.75v1a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75M1.25 12a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5H2a.75.75 0 0 1-.75-.75m19 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75M6.083 15.25H2a.75.75 0 0 0 0 1.5h20a.75.75 0 0 0 0-1.5z' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M4.25 19a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75m.148-14.602a.75.75 0 0 1 1.061 0l.393.393a.75.75 0 0 1-1.06 1.06l-.394-.392a.75.75 0 0 1 0-1.06m15.202 0a.75.75 0 0 1 0 1.06l-.392.393a.75.75 0 0 1-1.06-1.06l.392-.393a.75.75 0 0 1 1.06 0M5.25 12c0 1.178.302 2.286.833 3.25h11.834A6.75 6.75 0 1 0 5.25 12' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-svg-spinners\:bouncing-ball,[i-svg-spinners\:bouncing-ball=""]{--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%3Cellipse cx='12' cy='5' fill='currentColor' rx='4' ry='4'%3E%3Canimate id='svgSpinnersBouncingBall0' fill='freeze' attributeName='cy' begin='0;svgSpinnersBouncingBall2.end' calcMode='spline' dur='0.375s' keySplines='.33,0,.66,.33' values='5;20'/%3E%3Canimate attributeName='rx' begin='svgSpinnersBouncingBall0.end' calcMode='spline' dur='0.05s' keySplines='.33,0,.66,.33;.33,.66,.66,1' values='4;4.8;4'/%3E%3Canimate attributeName='ry' begin='svgSpinnersBouncingBall0.end' calcMode='spline' dur='0.05s' keySplines='.33,0,.66,.33;.33,.66,.66,1' values='4;3;4'/%3E%3Canimate id='svgSpinnersBouncingBall1' attributeName='cy' begin='svgSpinnersBouncingBall0.end' calcMode='spline' dur='0.025s' keySplines='.33,0,.66,.33' values='20;20.5'/%3E%3Canimate id='svgSpinnersBouncingBall2' attributeName='cy' begin='svgSpinnersBouncingBall1.end' calcMode='spline' dur='0.4s' keySplines='.33,.66,.66,1' values='20.5;5'/%3E%3C/ellipse%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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") no-repeat;background-size:100% 100%;background-color:transparent;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);text-decoration:underline;font-weight:500}.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 *)){margin:1em 0;padding-left:1em;font-style:italic;border-left:.25em solid var(--un-prose-borders)}.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-size:.875em;font-weight:600;font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.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 *)){padding:1.25rem 1.5rem;overflow-x:auto;border-radius:.375rem}.prose :where(pre,code):not(:where(.not-prose,.not-prose *)){white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;hyphens:none;background:transparent}.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,.prose :where(ul>li):not(:where(.not-prose,.not-prose *))::marker,.prose :where(summary):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(hr):not(:where(.not-prose,.not-prose *)){margin:2em 0;border:1px solid var(--un-prose-hr)}.prose :where(table):not(:where(.not-prose,.not-prose *)){display:block;margin:1em 0;border-collapse:collapse;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;padding:.25rem .5rem;font-size:.875em;border-radius:.25rem}.prose :where(details):not(:where(.not-prose,.not-prose *)){margin:1em 0;padding:1.25rem 1.5rem;background:var(--un-prose-bg-soft)}.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%}@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{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none,[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~=absolute]:before{position:absolute}.after\:absolute:after{position:absolute}[after~=absolute]:after{position:absolute}.inset-0,[inset-0=""]{top:0;right:0;bottom:0;left:0}[before~=inset-0]:before{top:0;right:0;bottom:0;left:0}[after~=inset-0]:after{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-0,[bottom-0=""]{bottom:0}.bottom-11,[bottom-11=""]{bottom:2.75rem}.left-0,[left-0=""]{left:0}.left-1\/2,[left~="1/2"]{left:50%}.left-2{left:.5rem}.right-0,[right-0=""]{right:0}.top-0,[top-0=""],[top~="0"]{top:0}.top-1\/2,[top~="50%"]{top:50%}.top-2{top:.5rem}[bottom~="-10"]{bottom:-2.5rem}[bottom~="20%"]{bottom:20%}[bottom~="3"]{bottom:.75rem}[right~="-50%"]{right:-50%}[right~="3"]{right:.75rem}.after\:left-\[2px\]:after{left:2px}.after\:top-\[2px\]:after{top:2px}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2}.line-clamp-3,[line-clamp-3=""]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3}.z--1,[z--1=""]{z-index:-1}.z--2{z-index:-2}.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-2,[z-2=""]{z-index:2}.z-30,[z-30=""]{z-index:30}.z-50{z-index:50}[z~="20"]{z-index:20}[before~=z-0]:before{z-index:0}[after~=z--2]:after{z-index:-2}.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}.cols-\[20px_1fr_60px\],[grid~="cols-[20px_1fr_60px]"]{grid-template-columns:20px 1fr 60px}.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))}.cols-2,[grid~=cols-2]{grid-template-columns:repeat(2,minmax(0,1fr))}.m-0{margin:0}.m-1,[m-1=""]{margin:.25rem}.m-auto{margin:auto}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto,[mx-auto=""]{margin-left:auto;margin-right:auto}.mx2,[mx2=""]{margin-left:.5rem;margin-right:.5rem}.my{margin-top:1rem;margin-bottom:1rem}.my-0,[my-0=""]{margin-top:0;margin-bottom:0}.my-auto,[my-auto=""]{margin-top:auto;margin-bottom:auto}.-mb-px{margin-bottom:-1px}.mb-1,[mb-1=""]{margin-bottom:.25rem}.mb-2,.mb2,[mb-2=""],[mb2=""]{margin-bottom:.5rem}.mb-3,[mb-3=""]{margin-bottom:.75rem}.mb-4,[mb-4=""]{margin-bottom:1rem}.mb-6,[mb-6=""]{margin-bottom:1.5rem}.ml{margin-left:1rem}.ml-0\.5,[ml-0\.5=""]{margin-left:.125rem}.ml-auto{margin-left:auto}.mr{margin-right:1rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.ms,[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-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}.hidden,[hidden=""]{display:none}.size-16,[size-16=""]{width:4rem;height:4rem}.size-24,[size-24=""],[size~="24"]{width:6rem;height:6rem}.size-3,[size-3=""]{width:.75rem;height:.75rem}.size-5{width:1.25rem;height:1.25rem}.size-6,[size-6=""],[size~="6"]{width:1.5rem;height:1.5rem}.h-10{height:2.5rem}.h-100dvh,[h-100dvh=""],[h~="100dvh"]{height:100dvh}.h-12{height:3rem}.h-16{height:4rem}.h-1lh{height:1lh}.h-24,[h-24=""]{height:6rem}.h-48,[h-48=""]{height:12rem}.h-6{height:1.5rem}.h-7,[h-7=""]{height:1.75rem}.h-8,[h-8=""]{height:2rem}.h-fit,[h-fit=""]{height:fit-content}.h-full,[h-full=""]{height:100%}.h1{height:.25rem}.h2{height:.5rem}.h3{height:.75rem}.max-h-\[10lh\],[max-h~="[10lh]"]{max-height:10lh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100dvh-7lh\)\]{max-height:calc(100dvh - 7lh)}.max-h-60,[max-h-60=""]{max-height:15rem}.max-h-none,[max-h-none=""]{max-height:none}.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-h~="[1lh]"]{min-height:1lh}.min-h-16,[min-h-16=""]{min-height:4rem}.min-h-40px,[min-h-40px=""]{min-height:40px}.min-w-\[200px\]{min-width:200px}.min-w-0,[min-w-0=""]{min-width:0}.min-w-20,[min-w-20=""]{min-width:5rem}.min-w-50,[min-w-50=""]{min-width:12.5rem}.w-\[92vw\]{width:92vw}.w-1\/2,[w~="50%"]{width:50%}.w-100,[w-100=""]{width:25rem}.w-100vw,[w-100vw=""]{width:100vw}.w-11{width:2.75rem}.w-2{width:.5rem}.w-25\%{width:25%}.w-8,[w-8=""]{width:2rem}.w-fit,[w-fit=""]{width:fit-content}.w-full,[w-full=""],[w~=full]{width:100%}[h~="[14px]"]{height:14px}[h~="80vh"]{height:80vh}[h~=unset]{height:unset}[max-h~="[300px]"]{max-height:300px}[max-h~="[85vh]"]{max-height:85vh}[max-h~="100"]{max-height:25rem}[max-h~="30vh"]{max-height:30vh}[max-w~="500px"]{max-width:500px}[min-h~="[100px]"]{min-height:100px}[min-h~="100"]{min-height:25rem}[min-w~="1/2"],[min-w~="50%"]{min-width:50%}[min-w~="30%"]{min-width:30%}[min-w~="3em"]{min-width:3em}[min-w~="50vw"]{min-width:50vw}[min-w~="6"]{min-width:1.5rem}[w~="[1px]"]{width:1px}[w~="100dvw"]{width:100dvw}[w~="12.5"]{width:3.125rem}.before\:w-50\%:before{width:50%}[before~=h-full]:before{height:100%}[before~="w-25%"]:before{width:25%}[hover~="before:w-50%"]:hover:before{width:50%}.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~="~"]{display:inline-flex}.flex-1,[flex-1=""],[flex~="1"]{flex:1 1 0%}.flex-shrink-0,.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-wrap,[flex-wrap=""]{flex-wrap:wrap}[perspective~="800"]{-webkit-perspective:800px;perspective:800px}.-translate-x-1\/2,.translate-x--1\/2,.translate-x-\[-50\%\],[transform~="translate-x--1/2"]{--un-translate-x:-50%;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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%]"]{--un-translate-y:-50%;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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-10,[translate-x-10=""]{--un-translate-x:2.5rem;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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\%,.translate-y-\[-100\%\],[transform~="translate-y--100%"],[transform~="translate-y-[-100%]"]{--un-translate-y:-100%;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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-10,[translate-y-10=""]{--un-translate-y:2.5rem;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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-150{--un-scale-x:1.5;--un-scale-y:1.5;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin{animation:spin 1s linear infinite}.disabled\:cursor-default:disabled{cursor:default}.cursor-pointer,[cursor-pointer=""],[cursor~=pointer]{cursor:pointer}.cursor-not-allowed{cursor:not-allowed}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}[cursor~="disabled:not-allowed"]:disabled{cursor:not-allowed}.cursor-ew-resize,[cursor-ew-resize=""]{cursor:ew-resize}.select-none,[select-none=""]{-webkit-user-select:none;user-select:none}.resize-none,[resize-none=""]{resize:none}.appearance-none,[appearance-none=""]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.place-self-end{place-self:end}.items-start,[items-start=""]{align-items:flex-start}.items-end,[items-end=""]{align-items:flex-end}.items-center,[items-center=""]{align-items:center}.justify-end,[justify-end=""]{justify-content:flex-end}.justify-center,[justify-center=""]{justify-content:center}.justify-between,[justify-between=""]{justify-content:space-between}.gap-0\.5,[gap-0\.5=""]{gap:.125rem}.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:1.25rem}.gap-6,[flex~=gap-6]{gap:1.5rem}.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]),[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-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-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))}[divide~=y]>:not([hidden])~:not([hidden]){--un-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--un-divide-y-reverse)));border-bottom-width:calc(1px * var(--un-divide-y-reverse))}[divide~="gray/25"]>:not([hidden])~:not([hidden]){border-color:#9ca3af40}.border-dashed,[border~=dashed],[divide~=dashed]>:not([hidden])~:not([hidden]){border-style:dashed}.of-clip,[of-clip=""]{overflow:clip}.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-scroll,[overflow-y-scroll=""]{overflow-y:scroll}.scroll-smooth,[scroll-smooth=""]{scroll-behavior:smooth}.truncate,[truncate=""]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line,[whitespace-pre-line=""]{white-space:pre-line}.break-words{overflow-wrap:break-word}.b,.border,[border~="~"],[border~="1"]{border-width:1px}.b-2,.border-2,[b-2=""],[border~="2"],[border~="2px"]{border-width:2px}[border~="4"]{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2,[border~=b-2]{border-bottom-width:2px}[border~=l-2]{border-left-width:2px}[border~=r-2]{border-right-width:2px}[border~=t-2]{border-top-width:2px}.\[\&\:checked\+div\]\:border-primary-500:checked+div,.border-primary-500{--un-border-opacity:1;border-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 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-200,.dark [border~="dark: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-primary-100,[border~=primary-100]{border-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 0)) 80%,oklch(100% 0 360))}.border-primary-200,[border~="data-[state=checked]:primary-200"][data-state=checked]{--un-border-opacity:1;border-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}.border-red-200{--un-border-opacity:1;border-color:rgb(254 202 202 / var(--un-border-opacity))}.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"]{--un-border-opacity:1;border-color:rgb(64 64 64 / var(--un-border-opacity))}.dark .dark\:border-neutral-800\/25,.dark [border~="dark:neutral-800/25"]{border-color:#26262640}.dark .dark\:border-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(--theme-colors-chroma-600) calc(var(--theme-colors-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(--theme-colors-chroma-800) calc(var(--theme-colors-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(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}.dark .dark\:border-red-800{--un-border-opacity:1;border-color:rgb(153 27 27 / var(--un-border-opacity))}.dark [border~="dark:cyan-500/50"]{border-color:#06b6d480}.dark [border~="dark:cyan-800"]{--un-border-opacity:1;border-color:rgb(21 94 117 / var(--un-border-opacity))}.dark [border~="dark:neutral-700/30"]{border-color:#4040404d}.dark [border~="dark:neutral-800"],[border~=neutral-800]{--un-border-opacity:1;border-color:rgb(38 38 38 / var(--un-border-opacity))}.dark [border~="dark:primary-400/20"]{border-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2)}.dark [border~="dark:primary-500/50"]{border-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .5)}.dark [border~="dark:violet-500/50"]{border-color:#8b5cf680}.dark [border~="dark:zinc-800"]{--un-border-opacity:1;border-color:rgb(39 39 42 / var(--un-border-opacity))}[border~=cyan-200]{--un-border-opacity:1;border-color:rgb(165 243 252 / var(--un-border-opacity))}[border~="cyan-200/50"]{border-color:#a5f3fc80}[border~="gray/25"]{border-color:#9ca3af40}[border~="neutral-200/50"]{border-color:#e5e5e580}[border~="primary-200/50"]{border-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / .5)}[border~=primary-300]{--un-border-opacity:1;border-color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}[border~="violet-200/50"]{border-color:#ddd6fe80}[border~=zinc-300]{--un-border-opacity:1;border-color:rgb(212 212 216 / var(--un-border-opacity))}.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,.dark [border~="dark:hover:primary-400/30"]:hover{border-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .3)}.dark [border~="dark:hover:primary-700"]:hover{--un-border-opacity:1;border-color:oklch(49% var(--theme-colors-chroma-700) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}.hover\:border-primary-500\/30:hover{border-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .3)}[border~="hover:primary-300"]:hover{--un-border-opacity:1;border-color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}[border~="hover:primary-500/30"]:hover{border-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .5)}.dark [border~="dark:focus:zinc-600"]:focus{--un-border-opacity:1;border-color:rgb(82 82 91 / var(--un-border-opacity))}[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{border-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 0)) 80%,oklch(100% 0 360))}[border~="focus:zinc-400"]:focus{--un-border-opacity:1;border-color:rgb(161 161 170 / var(--un-border-opacity))}.rounded,[rounded=""]{border-radius:.25rem}.rounded-2xl,[rounded-2xl=""]{border-radius:1rem}.rounded-full,[rounded-full=""]{border-radius:9999px}.rounded-lg,[border~=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}.after\:rounded-full:after{border-radius:9999px}.rounded-l-lg,[rounded-l-lg=""]{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-r-lg,[rounded-r-lg=""]{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-t-xl,[rounded-t-xl=""]{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border-none,[border-none=""]{border-style:none}[border~=solid]{border-style:solid}.bg-amber-50{--un-bg-opacity:1;background-color:rgb(255 251 235 / var(--un-bg-opacity))}.bg-amber-50\/80{background-color:#fffbebcc}.bg-black\/50{background-color:#00000080}.bg-neutral-100,[bg~=neutral-100]{--un-bg-opacity:1;background-color:rgb(245 245 245 / var(--un-bg-opacity))}.bg-neutral-200,[bg~=neutral-200]{--un-bg-opacity:1;background-color:rgb(229 229 229 / var(--un-bg-opacity))}.bg-neutral-400,[bg~=neutral-400]{--un-bg-opacity:1;background-color:rgb(163 163 163 / var(--un-bg-opacity))}.bg-neutral-400\/80{background-color:#a3a3a3cc}.bg-neutral-50,[bg~=neutral-50]{--un-bg-opacity:1;background-color:rgb(250 250 250 / var(--un-bg-opacity))}.bg-neutral-500,.dark [bg~="dark:neutral-500"]{--un-bg-opacity:1;background-color:rgb(115 115 115 / var(--un-bg-opacity))}.bg-neutral-500\/80{background-color:#737373cc}.bg-primary-100,.bg-primary-100\/80,[bg-primary-100=""],[bg~=primary-100]{background-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 0)) 80%,oklch(100% 0 360))}.bg-primary-200,[bg-primary-200=""]{--un-bg-opacity:1;background-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-300,[bg-primary-300=""]{--un-bg-opacity:1;background-color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-50,[bg-primary-50=""],[bg~=primary-50]{background-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-50) calc(var(--theme-colors-hue) + 0)) 30%,oklch(100% 0 360))}.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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-500\/20,[bg~="primary-500/20"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2)}.bg-primary-600,[bg-primary-600=""]{--un-bg-opacity:1;background-color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-700,[bg-primary-700=""]{--un-bg-opacity:1;background-color:oklch(49% var(--theme-colors-chroma-700) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-800,[bg-primary-800=""]{--un-bg-opacity:1;background-color:oklch(42% var(--theme-colors-chroma-800) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-900,.dark .dark\:bg-primary-900,[bg-primary-900=""]{--un-bg-opacity:1;background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-950,.dark .dark\:bg-primary-950,.dark [bg~="dark:primary-950"],[bg-primary-950=""]{--un-bg-opacity:1;background-color:oklch(29% var(--theme-colors-chroma-950) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.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-transparent,.dark [bg~="dark:transparent"],[bg-transparent=""],[bg~=transparent]{background-color:transparent}.bg-white,[bg-white=""],[bg~=white]{--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity))}.bg-white\/80{background-color:#fffc}.bg-zinc-100,[bg-zinc-100=""],[bg~=zinc-100]{--un-bg-opacity:1;background-color:rgb(244 244 245 / var(--un-bg-opacity))}.bg-zinc-200,.dark .dark\:bg-zinc-200{--un-bg-opacity:1;background-color:rgb(228 228 231 / var(--un-bg-opacity))}.bg-zinc-300,[bg-zinc-300=""]{--un-bg-opacity:1;background-color:rgb(212 212 216 / var(--un-bg-opacity))}.dark .dark\:bg-amber-900\/20{background-color:#78350f33}.dark .dark\:bg-amber-900\/30{background-color:#78350f4d}.dark .dark\:bg-black\/40{background-color:#0006}.dark .dark\:bg-neutral-600{--un-bg-opacity:1;background-color:rgb(82 82 82 / var(--un-bg-opacity))}.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-800,.dark [bg~="dark:data-[state=unchecked]:neutral-800"][data-state=unchecked],.dark [bg~="dark:neutral-800"]{--un-bg-opacity:1;background-color:rgb(38 38 38 / var(--un-bg-opacity))}.dark .dark\:bg-neutral-800\/50,.dark [bg~="dark:neutral-800/50"]{background-color:#26262680}.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-primary-900\/20{background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / .2)}.dark .dark\:bg-primary-900\/30{background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / .3)}.dark .dark\:bg-primary-900\/40,.dark [bg~="dark:primary-900/40"]{background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / .4)}.dark .dark\:bg-primary-900\/80{background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / .8)}.dark .dark\:bg-red-400{--un-bg-opacity:1;background-color:rgb(248 113 113 / var(--un-bg-opacity))}.dark .dark\:bg-red-900\/20{background-color:#7f1d1d33}.dark .dark\:bg-zinc-700,.dark [bg~="dark:zinc-700"]{--un-bg-opacity:1;background-color:rgb(63 63 70 / var(--un-bg-opacity))}.dark .dark\:bg-zinc-800,.dark [bg~="dark:zinc-800"]{--un-bg-opacity:1;background-color:rgb(39 39 42 / var(--un-bg-opacity))}.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/20"]{background-color:#0003}.dark [bg~="dark:black/30"]{background-color:#0000004d}.dark [bg~="dark:complementary-800"]{--un-bg-opacity:1;background-color:oklch(42% var(--theme-colors-chroma-800) calc(var(--theme-colors-hue) + 180) / var(--un-bg-opacity))}.dark [bg~="dark:cyan-900"]{--un-bg-opacity:1;background-color:rgb(22 78 99 / 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-300"],[bg~="data-[state=unchecked]:neutral-300"][data-state=unchecked]{--un-bg-opacity:1;background-color:rgb(212 212 212 / var(--un-bg-opacity))}.dark [bg~="dark:neutral-900/50"]{background-color:#17171780}.dark [bg~="dark:orange-900/20"]{background-color:#7c2d1233}.dark [bg~="dark:primary-400/20"]{background-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2)}.dark [bg~="dark:zinc-400"]{--un-bg-opacity:1;background-color:rgb(161 161 170 / var(--un-bg-opacity))}.dark [bg~="dark:zinc-800/50"]{background-color:#27272a80}.dark [bg~="data-[state=checked]:dark:primary-400/80"][data-state=checked]{background-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .8)}[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~=complementary-100]{background-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 180)) 80%,oklch(100% 0 360))}[bg~=green-500]{--un-bg-opacity:1;background-color:rgb(34 197 94 / var(--un-bg-opacity))}[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~="primary-500/10"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1)}[bg~="primary-500/30"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .3)}[bg~="primary-500/40"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .4)}[bg~="primary-500/5"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .05)}[bg~="primary-500/50"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .5)}[bg~="primary-500/60"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .6)}[bg~="primary-500/70"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .7)}[bg~="primary-500/80"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .8)}[bg~="primary-500/90"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .9)}[bg~="white/60"]{background-color:#fff9}[bg~="zinc-100/70"]{background-color:#f4f4f5b3}[bg~="zinc-200/20"]{background-color:#e4e4e733}.dark [dark\:bg-zinc-700~="default:"]:default{--un-bg-opacity:1;background-color:rgb(63 63 70 / var(--un-bg-opacity))}.dark [dark\:bg-zinc-700~="checked:"]:checked{--un-bg-opacity:1;background-color:rgb(63 63 70 / var(--un-bg-opacity))}.dark .\[\&_div_span\]\:dark\:hover\:bg-cyan-300:hover div span{--un-bg-opacity:1;background-color:rgb(103 232 249 / var(--un-bg-opacity))}.dark .\[\&_div_span\]\:dark\:hover\:bg-cyan-900:hover div span{--un-bg-opacity:1;background-color:rgb(22 78 99 / var(--un-bg-opacity))}.dark .dark\:hover\:bg-neutral-500:hover{--un-bg-opacity:1;background-color:rgb(115 115 115 / var(--un-bg-opacity))}.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-500:hover{--un-bg-opacity:1;background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.dark .dark\:hover\:bg-red-500:hover{--un-bg-opacity:1;background-color:rgb(239 68 68 / var(--un-bg-opacity))}.dark [bg~="dark:hover:black/40"]:hover{background-color:#0006}.dark [bg~="dark:hover:complementary-700"]:hover{--un-bg-opacity:1;background-color:oklch(49% var(--theme-colors-chroma-700) calc(var(--theme-colors-hue) + 180) / var(--un-bg-opacity))}.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:primary-900"]:hover{--un-bg-opacity:1;background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.dark [dark\:hover\:bg-cyan-300=""]:hover{--un-bg-opacity:1;background-color:rgb(103 232 249 / var(--un-bg-opacity))}.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}.dark [hover~="dark:bg-zinc-700"]:hover{--un-bg-opacity:1;background-color:rgb(63 63 70 / var(--un-bg-opacity))}.hover\:bg-neutral-100:hover{--un-bg-opacity:1;background-color:rgb(245 245 245 / 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-primary-600:hover{--un-bg-opacity:1;background-color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.hover\:bg-red-600:hover{--un-bg-opacity:1;background-color:rgb(220 38 38 / var(--un-bg-opacity))}[bg~="hover:complementary-200"]:hover{--un-bg-opacity:1;background-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 180) / 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:primary-100"]:hover{background-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 0)) 80%,oklch(100% 0 360))}[bg~="hover:white/80"]:hover{background-color:#fffc}[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}[hover~=bg-zinc-200]:hover{--un-bg-opacity:1;background-color:rgb(228 228 231 / var(--un-bg-opacity))}.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))}.dark [bg~="dark:active:neutral-700"]:active{--un-bg-opacity:1;background-color:rgb(64 64 64 / var(--un-bg-opacity))}[bg~="active:neutral-300"]:active{--un-bg-opacity:1;background-color:rgb(212 212 212 / 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-primary-400\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) 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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-from-opacity, 1)) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.from-primary-500\/20{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.before\:from-primary-500\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.via-primary-500\/10{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.before\:via-primary-500\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark .before\:dark\:via-primary-400\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark [hover~="before:dark:via-primary-400/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark .dark\:to-primary-400\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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-primary-400{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.before\:to-transparent:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.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(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-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-r{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.before\:bg-gradient-to-r: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))}[before~=bg-gradient-to-r]: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))}[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))}.p-1,[p-1=""]{padding:.25rem}.p-1\.5,[p-1\.5=""]{padding:.375rem}.p-2,.p2,[p-2=""],[p~="2"],[p2=""]{padding:.5rem}.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-10,[px-10=""]{padding-left:2.5rem;padding-right:2.5rem}.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"]{padding-top:1rem;padding-bottom:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1,.py1,[py-1=""],[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}.py-6,[py-6=""]{padding-top:1.5rem;padding-bottom:1.5rem}[px~="12"]{padding-left:3rem;padding-right:3rem}.pb-2,[pb-2=""]{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl{padding-left:1rem}.pl-10{padding-left:2.5rem}.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-4,[pr-4=""]{padding-right:1rem}.pt,.pt-4,[pt-4=""]{padding-top:1rem}.pt-2,[pt-2=""]{padding-top:.5rem}.text-center,[text-center=""],[text~=center]{text-align:center}.text-left,[text-left=""]{text-align:left}.text-right,[text-right=""]{text-align:right}.text-wrap,[text-wrap=""]{text-wrap:wrap}.text-nowrap,[text-nowrap=""]{text-wrap:nowrap}.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=""]{font-size:.75rem;line-height:1rem}[text~="40"]{font-size:10rem}[text~="60"]{font-size:15rem}.dark .dark\:text-amber-400{--un-text-opacity:1;color:rgb(251 191 36 / var(--un-text-opacity))}.dark .dark\:text-neutral-100,[text~=neutral-100]{--un-text-opacity:1;color:rgb(245 245 245 / 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,.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-primary-300,.dark [text~="dark:primary-300"],.text-primary-300,[text~=primary-300]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-primary-300\/80{color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / .8)}.dark .dark\:text-primary-400,.dark [text~="dark:primary-400"],.text-primary-400{--un-text-opacity:1;color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-primary-500,.text-primary-500{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-red-400{--un-text-opacity:1;color:rgb(248 113 113 / var(--un-text-opacity))}.dark .dark\:text-white,.dark [dark\:text-white=""],.dark [text~="dark:white"],.text-white,[text-white=""],[text~=white]{--un-text-opacity:1;color:rgb(255 255 255 / var(--un-text-opacity))}.dark .dark\:text-white\/50{color:#ffffff80}.dark .dark\:text-zinc-400,.dark [text~="dark:zinc-400"],[text~=zinc-400]{--un-text-opacity:1;color:rgb(161 161 170 / 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-500/20"]{color:#73737333}.dark [text~="dark:neutral-600/50"]{color:#52525280}.dark [text~="dark:neutral-900"],.text-neutral-900{--un-text-opacity:1;color:rgb(23 23 23 / var(--un-text-opacity))}.dark [text~="dark:orange-500"]{--un-text-opacity:1;color:rgb(249 115 22 / var(--un-text-opacity))}.dark [text~="dark:primary-300/50"]{color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / .5)}.dark [text~="dark:primary-600/90"]{color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / .9)}.dark [text~="dark:violet-600/90"]{color:#7c3aede6}.dark [text~="dark:zinc-500"],.text-zinc-500,[text~=zinc-500]{--un-text-opacity:1;color:rgb(113 113 122 / var(--un-text-opacity))}.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-black,[text-black=""]{--un-text-opacity:1;color:rgb(0 0 0 / var(--un-text-opacity))}.text-cyan,[text~=cyan-400]{--un-text-opacity:1;color:rgb(34 211 238 / 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-700,[text-neutral-700=""]{--un-text-opacity:1;color:rgb(64 64 64 / var(--un-text-opacity))}.text-primary-600\/80{color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / .8)}.text-primary-700{--un-text-opacity:1;color:oklch(49% var(--theme-colors-chroma-700) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.text-red-500{--un-text-opacity:1;color:rgb(239 68 68 / var(--un-text-opacity))}.text-red-600{--un-text-opacity:1;color:rgb(220 38 38 / var(--un-text-opacity))}.text-transparent{color:transparent}.text-violet-500,[text-violet-500=""]{--un-text-opacity:1;color:rgb(139 92 246 / var(--un-text-opacity))}[text~=complementary-400]{--un-text-opacity:1;color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 180) / 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~="primary-400/90"]{color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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"]:hover{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark [hover~="dark:text-primary-300/80"]:hover{color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / .8)}.dark [text~="dark:hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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]:hover{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}[hover~="text-primary-600/80"]:hover{color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / .8)}[text~="hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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{--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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark [text~="placeholder:dark:primary-300/50"]::placeholder{color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / .5)}[text~="placeholder:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}[text~="placeholder:primary-300"]::placeholder{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.font-bold,[font-bold=""]{font-weight:700}.font-medium,[font-medium=""]{font-weight:500}.font-semibold,[font-semibold=""]{font-weight:600}.lh-10{line-height:2.5rem}.font-cute,[font-cute=""]{font-family:Kiwi Maru}.font-cuteen,[font-cuteen=""]{font-family:Sniglet}.font-mono,[font-mono=""]{font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans,[font-sans=""]{font-family:DM Sans,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"}.italic{font-style:italic}.underline,[underline=""]{text-decoration-line:underline}.tab,[aria-checked~=tab][aria-checked=true],[tab=""]{-moz-tab-size:4;-o-tab-size:4;tab-size:4}[checked~=tab]:checked{-moz-tab-size:4;-o-tab-size:4;tab-size:4}.\[\&\:checked\+div_\.radio-dot\]\:opacity-100:checked+div .radio-dot,.opacity-100{opacity:1}.op50,.opacity-50,[op50=""]{opacity:.5}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-60{opacity:.6}[hover~=opacity-100]:hover{opacity:1}.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}.dark .dark\:shadow-xl,.shadow-xl,[shadow-xl=""]{--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color, rgb(0 0 0 / .1));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, rgb(0 0 0 / 0));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, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-md,[shadow-md=""],[shadow~=md]{--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1));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, rgb(0 0 0 / .05));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}[shadow~="cyan-200/50"]{--un-shadow-color:rgb(165 243 252 / .5) }[shadow~="primary-200/50"]{--un-shadow-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / .5) }[shadow~="violet-200/50"]{--un-shadow-color:rgb(221 214 254 / .5) }.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-xl"]:hover{--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color, rgb(0 0 0 / .1));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, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline{outline-style:solid}.outline-none,[outline-none=""]{outline:2px solid transparent;outline-offset:2px}[outline~="focus-within:none"]:focus-within{outline:2px solid transparent;outline-offset:2px}.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)}.focus\:ring-offset-2:focus{--un-ring-offset-width:2px}.dark .dark\:focus\:ring-primary-400\/50:focus{--un-ring-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .5) }.focus\:ring-primary-500\/50:focus{--un-ring-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .5) }.dark .dark\:focus\:ring-offset-neutral-900:focus{--un-ring-offset-opacity:1;--un-ring-offset-color:rgb(23 23 23 / var(--un-ring-offset-opacity)) }.focus\:ring-offset-white:focus{--un-ring-offset-opacity:1;--un-ring-offset-color:rgb(255 255 255 / var(--un-ring-offset-opacity)) }.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, rgb(0 0 0 / .1))) drop-shadow(0 1px 1px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));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, rgb(0 0 0 / 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)}[drop-shadow~="hover:[0px_4px_4px_rgba(220,220,220,0.4)]"]:hover{--un-drop-shadow:drop-shadow(0px 4px 4px rgba(220,220,220,.4));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 rgba(220,220,220,.25));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)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all,[transition~=all]{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors,[transition-colors=""],[transition~=colors]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity,[transition-opacity=""]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform,[transition~=transform]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[transition~="100"]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}[transition~=border]{transition-property:border;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[transition~="placeholder:all"]::placeholder{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[before~=transition-all]:before{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:transition-all:after{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[after~=transition-all]:after{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200,[transition~=duration-200]{transition-duration:.2s}.duration-250,[duration-250=""],[duration~="250"],[transition~=duration-250]{transition-duration:.25s}.duration-300{transition-duration:.3s}.duration-400,[transition~=duration-400]{transition-duration:.4s}.duration-500,[transition~=duration-500]{transition-duration:.5s}[duration~="10"]{transition-duration:10ms}[duration~="100"]{transition-duration:.1s}[duration~="1000"]{transition-duration:1s}.placeholder\:duration-250::placeholder{transition-duration:.25s}[placeholder\:duration-250=""]::placeholder{transition-duration:.25s}[transition~="placeholder:duration-250"]::placeholder{transition-duration:.25s}[before~=duration-400]:before{transition-duration:.4s}[after~=duration-400]:after{transition-duration:.4s}[delay~="50"]{transition-delay:50ms}.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-timing-function:cubic-bezier(.4,0,.2,1)}[transition~="placeholder:ease-in-out"]::placeholder{transition-timing-function:cubic-bezier(.4,0,.2,1)}[before~=ease-in-out]:before{transition-timing-function:cubic-bezier(.4,0,.2,1)}[after~=ease-in-out]:after{transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-transform,[will-change-transform=""]{will-change:transform}.after\:content-\[\'\'\]:after{content:""}.content-empty{content:""}[before~=content-empty]:before{content:""}[after~=content-empty]:after{content:""}.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(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}.hover\:bg-dotted-\[primary-300\/50\]:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.after\:bg-dotted-\[primary-300\/50\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.dark .dark\:after\:bg-dotted-\[primary-200\/20\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}.dark [hover~="dark:after:bg-dotted-[primary-200/20]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}[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(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.transition-colors-none{transition-property:color,background-color,border-color,text-color;transition-duration:0s}.placeholder\:transition-colors-none::placeholder{transition-property:color,background-color,border-color,text-color;transition-duration:0s}@media (max-width: 1023.9px){[min-w~=""; initial-value: 0; inherits: true;}@keyframes hue-anim{0%{--theme-colors-hue: 0}to{--theme-colors-hue: 360}}.dynamic-hue{animation:hue-anim 10s linear infinite}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings: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:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-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{list-style:none;margin:0;padding:0}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{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--airi-theme-primary-50: #fff0f2;--airi-theme-primary-100: #ffe3e6;--airi-theme-primary-200: #ffcad4;--airi-theme-primary-300: #ff9fb0;--airi-theme-primary-400: #ff6988;--airi-theme-primary-500: #fe456e;--airi-theme-primary-600: #ec124d;--airi-theme-primary-700: #c70941;--airi-theme-primary-800: #a70a3e;--airi-theme-primary-900: #8e0d3b;--airi-theme-primary-950: #50011b;--theme-colors-hue: 354.31;--theme-colors-chroma: calc(.18 + cos(var(--theme-colors-hue) * 3.14159265 / 180)/25) ;--theme-colors-chroma-50: calc(var(--theme-colors-chroma) * .3);--theme-colors-chroma-100: calc(var(--theme-colors-chroma) * .5);--theme-colors-chroma-200: calc(var(--theme-colors-chroma) * .6);--theme-colors-chroma-300: calc(var(--theme-colors-chroma) * .75);--theme-colors-chroma-400: var(--theme-colors-chroma);--theme-colors-chroma-600: calc(var(--theme-colors-chroma) * 1.15);--theme-colors-chroma-700: calc(var(--theme-colors-chroma) * 1.1);--theme-colors-chroma-800: calc(var(--theme-colors-chroma) * .85);--theme-colors-chroma-900: calc(var(--theme-colors-chroma) * .7);--theme-colors-chroma-950: calc(var(--theme-colors-chroma) * .5)}.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{transform:translateY(-10px);opacity:0}.slide-away-enter-from,.slide-away-leave{transform:translateY(10px);opacity:0}html,body,#app{height:100%;margin:0;padding:0;overscroll-behavior:none}html{background:#fff;transition:all .3s ease-in-out}html.dark{background:#121212;color-scheme:dark}#nprogress{pointer-events:none}#nprogress .bar{background:#f472b6;opacity:.75;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}*,:before,:after{--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 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--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: }::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 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--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: }@font-face{font-family:DM Mono;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthSQBK6PYK3EXw.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthqQBK6PYK0.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRR232RmYJp8I5zzw.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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 Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRSW32RmYJp8I5.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v15/-nFnOHM81r4j6k0gjAW3mujVU2B2G_5x0vrx52jJ3Q.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/dmserifdisplay/v15/-nFnOHM81r4j6k0gjAW3mujVU2B2G_Bx0vrx52g.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.0.woff2) format("woff2");unicode-range:U+25ee8,U+25f23,U+25f5c,U+25fd4,U+25fe0,U+25ffb,U+2600c,U+26017,U+26060,U+260ed,U+26222,U+2626a,U+26270,U+26286,U+2634c,U+26402,U+2667e,U+266b0,U+2671d,U+268dd,U+268ea,U+26951,U+2696f,U+26999,U+269dd,U+26a1e,U+26a58,U+26a8c,U+26ab7,U+26aff,U+26c29,U+26c73,U+26c9e,U+26cdd,U+26e40,U+26e65,U+26f94,U+26ff6-26ff8,U+270f4,U+2710d,U+27139,U+273da-273db,U+273fe,U+27410,U+27449,U+27614-27615,U+27631,U+27684,U+27693,U+2770e,U+27723,U+27752,U+278b2,U+27985,U+279b4,U+27a84,U+27bb3,U+27bbe,U+27bc7,U+27c3c,U+27cb8,U+27d73,U+27da0,U+27e10,U+27eaf,U+27fb7,U+2808a,U+280bb,U+28277,U+28282,U+282f3,U+283cd,U+2840c,U+28455,U+284dc,U+2856b,U+285c8-285c9,U+286d7,U+286fa,U+28946,U+28949,U+2896b,U+28987-28988,U+289ba-289bb,U+28a1e,U+28a29,U+28a43,U+28a71,U+28a99,U+28acd,U+28add,U+28ae4,U+28bc1,U+28bef,U+28cdd,U+28d10,U+28d71,U+28dfb,U+28e0f,U+28e17,U+28e1f,U+28e36,U+28e89,U+28eeb,U+28ef6,U+28f32,U+28ff8,U+292a0,U+292b1,U+29490,U+295cf,U+2967f,U+296f0,U+29719,U+29750,U+29810,U+298c6,U+29a72,U+29d4b,U+29ddb,U+29e15,U+29e3d,U+29e49,U+29e8a,U+29ec4,U+29edb,U+29ee9,U+29fce,U+29fd7,U+2a01a,U+2a02f,U+2a082,U+2a0f9,U+2a190,U+2a2b2,U+2a38c,U+2a437,U+2a5f1,U+2a602,U+2a61a,U+2a6b2,U+2a9e6,U+2b746,U+2b751,U+2b753,U+2b75a,U+2b75c,U+2b765,U+2b776-2b777,U+2b77c,U+2b782,U+2b789,U+2b78b,U+2b78e,U+2b794,U+2b7ac,U+2b7af,U+2b7bd,U+2b7c9,U+2b7cf,U+2b7d2,U+2b7d8,U+2b7f0,U+2b80d,U+2b817,U+2b81a,U+2d544,U+2e278,U+2e569,U+2e6ea,U+2f804,U+2f80f,U+2f815,U+2f818,U+2f81a,U+2f822,U+2f828,U+2f82c,U+2f833,U+2f83f,U+2f846,U+2f852,U+2f862,U+2f86d,U+2f873,U+2f877,U+2f884,U+2f899-2f89a,U+2f8a6,U+2f8ac,U+2f8b2,U+2f8b6,U+2f8d3,U+2f8db-2f8dc,U+2f8e1,U+2f8e5,U+2f8ea,U+2f8ed,U+2f8fc,U+2f903,U+2f90b,U+2f90f,U+2f91a,U+2f920-2f921,U+2f945,U+2f947,U+2f96c,U+2f995,U+2f9d0,U+2f9de-2f9df,U+2f9f4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.1.woff2) format("woff2");unicode-range:U+1f235-1f23b,U+1f240-1f248,U+1f250-1f251,U+2000b,U+20089-2008a,U+200a2,U+200a4,U+200b0,U+200f5,U+20158,U+201a2,U+20213,U+2032b,U+20371,U+20381,U+203f9,U+2044a,U+20509,U+2053f,U+205b1,U+205d6,U+20611,U+20628,U+206ec,U+2074f,U+207c8,U+20807,U+2083a,U+208b9,U+2090e,U+2097c,U+20984,U+2099d,U+20a64,U+20ad3,U+20b1d,U+20b9f,U+20bb7,U+20d45,U+20d58,U+20de1,U+20e64,U+20e6d,U+20e95,U+20f5f,U+21201,U+2123d,U+21255,U+21274,U+2127b,U+212d7,U+212e4,U+212fd,U+2131b,U+21336,U+21344,U+213c4,U+2146d-2146e,U+215d7,U+21647,U+216b4,U+21706,U+21742,U+218bd,U+219c3,U+21a1a,U+21c56,U+21d2d,U+21d45,U+21d62,U+21d78,U+21d92,U+21d9c,U+21da1,U+21db7,U+21de0,U+21e33-21e34,U+21f1e,U+21f76,U+21ffa,U+2217b,U+22218,U+2231e,U+223ad,U+22609,U+226f3,U+2285b,U+228ab,U+2298f,U+22ab8,U+22b46,U+22b4f-22b50,U+22ba6,U+22c1d,U+22c24,U+22de1,U+22e42,U+22feb,U+231b6,U+231c3-231c4,U+231f5,U+23372,U+233cc,U+233d0,U+233d2-233d3,U+233d5,U+233da,U+233df,U+233e4,U+233fe,U+2344a-2344b,U+23451,U+23465,U+234e4,U+2355a,U+23594,U+235c4,U+23638-2363a,U+23647,U+2370c,U+2371c,U+2373f,U+23763-23764,U+237e7,U+237f1,U+237ff,U+23824,U+2383d,U+23a98,U+23c7f,U+23cbe,U+23cfe,U+23d00,U+23d0e,U+23d40,U+23dd3,U+23df9-23dfa,U+23f7e,U+2404b,U+24096,U+24103,U+241c6,U+241fe,U+242ee,U+243bc,U+243d0,U+24629,U+246a5,U+247f1,U+24896,U+248e9,U+24a4d,U+24b56,U+24b6f,U+24c16,U+24d14,U+24e04,U+24e0e,U+24e37,U+24e6a,U+24e8b,U+24ff2,U+2504a,U+25055,U+25122,U+251a9,U+251cd,U+251e5,U+2521e,U+2524c,U+2542e,U+2548e,U+254d9,U+2550e,U+255a7,U+2567f,U+25771,U+257a9,U+257b4,U+25874,U+259c4,U+259cc,U+259d4,U+25ad7,U+25ae3-25ae4,U+25af1,U+25bb2,U+25c4b,U+25c64,U+25da1,U+25e2e,U+25e56,U+25e62,U+25e65,U+25ec2,U+25ed8}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.2.woff2) format("woff2");unicode-range:U+ffd7,U+ffda-ffdc,U+ffe0-ffe2,U+ffe4,U+ffe6,U+ffe8-ffee,U+1f100-1f10c,U+1f110-1f16c,U+1f170-1f1ac,U+1f200-1f202,U+1f210-1f234}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.3.woff2) format("woff2");unicode-range:U+fa10,U+fa12-fa6d,U+fb00-fb04,U+fe10-fe19,U+fe30-fe42,U+fe44-fe52,U+fe54-fe66,U+fe68-fe6b,U+ff02,U+ff04,U+ff07,U+ff51,U+ff5b,U+ff5d,U+ff5f-ff60,U+ff66,U+ff69,U+ff87,U+ffa1-ffbe,U+ffc2-ffc7,U+ffca-ffcf,U+ffd2-ffd6}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.4.woff2) format("woff2");unicode-range:U+f92d-f959,U+f95b-f9f2,U+f9f4-fa0b,U+fa0e-fa0f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.5.woff2) format("woff2");unicode-range:U+9e8b-9e8c,U+9e8e-9e8f,U+9e91-9e92,U+9e95-9e96,U+9e98,U+9e9b,U+9e9d-9e9e,U+9ea4-9ea5,U+9ea8-9eaa,U+9eac-9eb0,U+9eb3-9eb5,U+9eb8,U+9ebc-9ebf,U+9ec3,U+9ec6,U+9ec8,U+9ecb-9ecd,U+9ecf-9ed1,U+9ed4-9ed5,U+9ed8,U+9edb-9ee0,U+9ee4-9ee5,U+9ee7-9ee8,U+9eec-9ef2,U+9ef4-9ef9,U+9efb-9eff,U+9f02-9f03,U+9f07-9f09,U+9f0e-9f12,U+9f14-9f17,U+9f19-9f1b,U+9f1f-9f22,U+9f26,U+9f2a-9f2c,U+9f2f,U+9f31-9f32,U+9f34,U+9f37,U+9f39-9f3a,U+9f3c-9f3f,U+9f41,U+9f43-9f47,U+9f4a,U+9f4e-9f50,U+9f52-9f58,U+9f5a,U+9f5d-9f61,U+9f63,U+9f66-9f6a,U+9f6c-9f73,U+9f75-9f77,U+9f7a,U+9f7d,U+9f7f,U+9f8f-9f92,U+9f94-9f97,U+9f99,U+9f9c-9fa3,U+9fa5,U+9fb4,U+9fbc-9fc2,U+9fc4,U+9fc6,U+9fcc,U+f900-f92c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.6.woff2) format("woff2");unicode-range:U+9c3e,U+9c41,U+9c43-9c4a,U+9c4e-9c50,U+9c52-9c54,U+9c56,U+9c58,U+9c5a-9c61,U+9c63,U+9c65,U+9c67-9c6b,U+9c6d-9c6e,U+9c70,U+9c72,U+9c75-9c78,U+9c7a-9c7c,U+9ce6-9ce7,U+9ceb-9cec,U+9cf0,U+9cf2,U+9cf6-9cf7,U+9cf9,U+9d02-9d03,U+9d06-9d09,U+9d0b,U+9d0e,U+9d11-9d12,U+9d15,U+9d17-9d18,U+9d1b-9d1f,U+9d23,U+9d26,U+9d2a-9d2c,U+9d2f-9d30,U+9d32-9d34,U+9d3a,U+9d3c-9d3f,U+9d41-9d48,U+9d4a,U+9d50-9d54,U+9d59,U+9d5d-9d65,U+9d69-9d6c,U+9d6f-9d70,U+9d72-9d73,U+9d76-9d77,U+9d7a-9d7c,U+9d7e,U+9d83-9d84,U+9d86-9d87,U+9d89-9d8a,U+9d8d-9d8e,U+9d92-9d93,U+9d95-9d9a,U+9da1,U+9da4,U+9da9-9dac,U+9dae,U+9db1-9db2,U+9db5,U+9db8-9dbd,U+9dbf-9dc4,U+9dc6-9dc7,U+9dc9-9dca,U+9dcf,U+9dd3-9dd7,U+9dd9-9dda,U+9dde-9de0,U+9de3,U+9de5-9de7,U+9de9,U+9deb,U+9ded-9df0,U+9df3-9df4,U+9df8,U+9dfd-9dfe,U+9e02,U+9e07,U+9e0a,U+9e0d-9e0e,U+9e10-9e12,U+9e15-9e16,U+9e19-9e1f,U+9e75,U+9e79-9e7d,U+9e80-9e85,U+9e87-9e88}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.7.woff2) format("woff2");unicode-range:U+9ae5-9ae7,U+9ae9,U+9aeb-9aec,U+9aee-9aef,U+9af1-9af5,U+9af7,U+9af9-9afb,U+9afd,U+9aff-9b06,U+9b08-9b09,U+9b0b-9b0e,U+9b10,U+9b12,U+9b16,U+9b18-9b1d,U+9b1f-9b20,U+9b22-9b23,U+9b25-9b2f,U+9b32-9b35,U+9b37,U+9b39-9b3b,U+9b3d,U+9b43-9b44,U+9b48,U+9b4b-9b4f,U+9b51,U+9b55-9b58,U+9b5b,U+9b5e,U+9b61,U+9b63,U+9b65-9b66,U+9b68,U+9b6a-9b6f,U+9b72-9b79,U+9b7f-9b80,U+9b83-9b87,U+9b89-9b8b,U+9b8d,U+9b8f-9b94,U+9b96-9b97,U+9b9a,U+9b9d-9ba0,U+9ba6-9ba7,U+9ba9-9baa,U+9bac,U+9bb0-9bb2,U+9bb4,U+9bb7-9bb9,U+9bbb-9bbc,U+9bbe-9bc1,U+9bc6-9bc8,U+9bca,U+9bce-9bd2,U+9bd4,U+9bd7-9bd8,U+9bdd,U+9bdf,U+9be1-9be5,U+9be7,U+9bea-9beb,U+9bee-9bf3,U+9bf5,U+9bf7-9bfa,U+9bfd,U+9bff-9c00,U+9c02,U+9c04,U+9c06,U+9c08-9c0d,U+9c0f-9c16,U+9c18-9c1e,U+9c21-9c2a,U+9c2d-9c32,U+9c35-9c37,U+9c39-9c3a,U+9c3d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.8.woff2) format("woff2");unicode-range:U+98eb,U+98ed-98ee,U+98f0-98f1,U+98f3,U+98f6,U+9902,U+9907-9909,U+9911-9912,U+9914-9918,U+991a-9922,U+9924,U+9926-9927,U+992b-992c,U+992e,U+9931-9935,U+9939-993e,U+9940-9942,U+9945-9949,U+994b-994e,U+9950-9952,U+9954-9955,U+9958-9959,U+995b-995c,U+995e-9960,U+9963,U+9997-9998,U+999b,U+999d-999f,U+99a3,U+99a5-99a6,U+99a8,U+99ad-99ae,U+99b0-99b2,U+99b5,U+99b9-99ba,U+99bc-99bd,U+99bf,U+99c1,U+99c3,U+99c8-99c9,U+99d1,U+99d3-99d5,U+99d8-99df,U+99e1-99e2,U+99e7,U+99ea-99ee,U+99f0-99f2,U+99f4-99f5,U+99f8-99f9,U+99fb-99fe,U+9a01-9a05,U+9a08,U+9a0a-9a0c,U+9a0f-9a11,U+9a16,U+9a1a,U+9a1e,U+9a20,U+9a22-9a24,U+9a27,U+9a2b,U+9a2d-9a2e,U+9a31,U+9a33,U+9a35-9a38,U+9a3e,U+9a40-9a45,U+9a47,U+9a4a-9a4e,U+9a51-9a52,U+9a54-9a58,U+9a5b,U+9a5d,U+9a5f,U+9a62,U+9a64-9a65,U+9a69-9a6c,U+9aaa,U+9aac-9ab0,U+9ab2,U+9ab4-9ab7,U+9ab9,U+9abb-9ac1,U+9ac3,U+9ac6,U+9ac8,U+9ace-9ad3,U+9ad5-9ad7,U+9adb-9adc,U+9ade-9ae0,U+9ae2-9ae4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.9.woff2) format("woff2");unicode-range:U+971d,U+9721-9724,U+9728,U+972a,U+9730-9731,U+9733,U+9736,U+9738-9739,U+973b,U+973d-973e,U+9741-9744,U+9746-974a,U+974d-974f,U+9751,U+9755,U+9757-9758,U+975a-975c,U+9760-9761,U+9763-9764,U+9766-9768,U+976a-976b,U+976e,U+9771,U+9773,U+9776-977d,U+977f-9781,U+9785-9786,U+9789,U+978b,U+978f-9790,U+9795-9797,U+9799-979a,U+979c,U+979e-97a0,U+97a2-97a3,U+97a6,U+97a8,U+97ab-97ac,U+97ae,U+97b1-97b6,U+97b8-97ba,U+97bc,U+97be-97bf,U+97c1,U+97c3-97ce,U+97d0-97d1,U+97d4,U+97d7-97d9,U+97db-97de,U+97e0-97e1,U+97e4,U+97e6,U+97ed-97ef,U+97f1-97f2,U+97f4-97f8,U+97fa,U+9804,U+9807,U+980a,U+980c-980f,U+9814,U+9816-9817,U+9819-981a,U+981c,U+981e,U+9820-9821,U+9823-9826,U+982b,U+982e-9830,U+9832-9835,U+9837,U+9839,U+983d-983e,U+9844,U+9846-9847,U+984a-984b,U+984f,U+9851-9853,U+9856-9857,U+9859-985b,U+9862-9863,U+9865-9866,U+986a-986c,U+986f-9871,U+9873-9875,U+98aa-98ab,U+98ad-98ae,U+98b0-98b1,U+98b4,U+98b6-98b8,U+98ba-98bc,U+98bf,U+98c2-98c8,U+98cb-98cc,U+98ce,U+98dc,U+98de,U+98e0-98e1,U+98e3,U+98e5-98e7,U+98e9-98ea}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.10.woff2) format("woff2");unicode-range:U+944a,U+944c,U+9452-9453,U+9455,U+9459-945c,U+945e-9463,U+9468,U+946a-946b,U+946d-9472,U+9475,U+9477,U+947c-947f,U+9481,U+9483-9485,U+9578-9579,U+957e-957f,U+9582,U+9584,U+9586-9588,U+958a,U+958c-958f,U+9592,U+9594,U+9596,U+9598-9599,U+959d-95a1,U+95a4,U+95a6-95a9,U+95ab-95ad,U+95b1,U+95b4,U+95b6,U+95b9-95bf,U+95c3,U+95c6,U+95c8-95cd,U+95d0-95d6,U+95d9-95da,U+95dc-95e2,U+95e4-95e6,U+95e8,U+961d-961e,U+9621-9622,U+9624-9626,U+9628,U+962c,U+962e-962f,U+9631,U+9633-9634,U+9637-963a,U+963c-963d,U+9641-9642,U+964b-964c,U+964f,U+9652,U+9654,U+9656-9658,U+965c-965f,U+9661,U+9666,U+966a,U+966c,U+966e,U+9672,U+9674,U+9677,U+967b-967c,U+967e-967f,U+9681-9684,U+9689,U+968b,U+968d,U+9691,U+9695-9698,U+969a,U+969d,U+969f,U+96a4-96aa,U+96ae-96b4,U+96b6,U+96b8-96bb,U+96bd,U+96c1,U+96c9-96cb,U+96cd-96ce,U+96d2,U+96d5-96d6,U+96d8-96da,U+96dc-96df,U+96e9,U+96ef,U+96f1,U+96f9-96fa,U+9702-9706,U+9708-9709,U+970d-970f,U+9711,U+9713-9714,U+9716,U+9719-971b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.11.woff2) format("woff2");unicode-range:U+92bc-92bd,U+92bf-92c3,U+92c5-92c8,U+92cb-92d0,U+92d2-92d3,U+92d5,U+92d7-92d9,U+92dc-92dd,U+92df-92e1,U+92e3-92e5,U+92e7-92ea,U+92ec,U+92ee,U+92f0,U+92f2,U+92f7-92fb,U+92ff-9300,U+9302,U+9304,U+9308,U+930d,U+930f-9311,U+9314-9315,U+9318-931a,U+931c-931f,U+9321-9325,U+9327-932b,U+932e,U+9333-9337,U+933a-933b,U+9344,U+9347-934a,U+934d,U+9350-9352,U+9354-9358,U+935a,U+935c,U+935e,U+9360,U+9364-9365,U+9367,U+9369-936d,U+936f-9371,U+9373-9374,U+9376,U+937a,U+937d-9382,U+9388,U+938a-938b,U+938d,U+938f,U+9392,U+9394-9395,U+9397-9398,U+939a-939b,U+939e,U+93a1,U+93a3-93a4,U+93a6,U+93a8-93a9,U+93ab-93ad,U+93b0,U+93b4-93b6,U+93b9-93bb,U+93c1,U+93c3-93cd,U+93d0-93d1,U+93d3,U+93d6-93d9,U+93dc-93df,U+93e2,U+93e4-93e8,U+93f1,U+93f5,U+93f7-93fb,U+93fd,U+9401-9404,U+9407-9409,U+940d-9410,U+9413-9417,U+9419-941a,U+941f,U+9421,U+942b,U+942e-942f,U+9431-9434,U+9436,U+9438,U+943a-943b,U+943d,U+943f,U+9441,U+9443-9445,U+9448}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.12.woff2) format("woff2");unicode-range:U+9143,U+9146-914c,U+914f,U+9153,U+9156-915b,U+9161,U+9163-9165,U+9167,U+9169,U+916d,U+9172-9174,U+9179-917b,U+9181-9183,U+9185-9187,U+9189-918b,U+918e,U+9191,U+9193-9195,U+9197-9198,U+919e,U+91a1-91a2,U+91a6,U+91a8,U+91aa-91b6,U+91ba-91bd,U+91bf-91c6,U+91c9,U+91cb,U+91d0,U+91d3-91d4,U+91d6-91d7,U+91d9-91db,U+91de-91df,U+91e1,U+91e4-91e6,U+91e9-91ea,U+91ec-91f1,U+91f5-91f7,U+91f9,U+91fb-91fd,U+91ff-9201,U+9204-9207,U+9209-920a,U+920c,U+920e,U+9210-9218,U+921c-921e,U+9223-9226,U+9228-9229,U+922c,U+922e-9230,U+9233,U+9235-923a,U+923c,U+923e-9240,U+9242-9243,U+9245-924b,U+924d-9251,U+9256-925a,U+925c-925e,U+9260-9261,U+9264-9269,U+926e-9270,U+9275-9279,U+927b-927f,U+9288-928a,U+928d-928e,U+9291-9293,U+9295-9297,U+9299,U+929b-929c,U+929f-92a0,U+92a4-92a5,U+92a7-92a8,U+92ab,U+92af,U+92b2-92b3,U+92b6-92bb}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.13.woff2) format("woff2");unicode-range:U+8f52-8f55,U+8f57-8f58,U+8f5c-8f5e,U+8f61-8f66,U+8f9c-8f9d,U+8f9f-8fa2,U+8fa4-8fa8,U+8fad-8faf,U+8fb4-8fb8,U+8fbe,U+8fc0-8fc2,U+8fc6,U+8fc8,U+8fca-8fcb,U+8fcd,U+8fd0,U+8fd2-8fd3,U+8fd5,U+8fda,U+8fe0,U+8fe2-8fe5,U+8fe8-8fea,U+8fed-8fef,U+8ff1,U+8ff4-8ff6,U+8ff8-8ffb,U+8ffe,U+9002,U+9004-9005,U+9008,U+900b-900e,U+9011,U+9013,U+9015-9016,U+9018,U+901b,U+901e,U+9021,U+9027-902a,U+902c-902d,U+902f,U+9033-9037,U+9039,U+903c,U+903e-903f,U+9041,U+9043-9044,U+9049,U+904c,U+904f-9052,U+9056,U+9058,U+905b-905e,U+9062,U+9066-9068,U+906c,U+906f-9070,U+9072,U+9074,U+9076,U+9079,U+9080-9083,U+9085,U+9087-9088,U+908b-908c,U+908e-9090,U+9095,U+9097-9099,U+909b,U+90a0-90a2,U+90a5,U+90a8,U+90af-90b6,U+90bd-90be,U+90c3-90c5,U+90c7-90c9,U+90cc,U+90d2,U+90d5,U+90d7-90d9,U+90db-90df,U+90e2,U+90e4-90e5,U+90eb,U+90ef-90f0,U+90f2,U+90f4,U+90f6,U+90fe-9100,U+9102,U+9104-9106,U+9108,U+910d,U+9110,U+9112,U+9114-911a,U+911c,U+911e,U+9120,U+9122-9123,U+9125,U+9127,U+9129,U+912d-9132,U+9134,U+9136-9137,U+9139-913a,U+913c-913d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.14.woff2) format("woff2");unicode-range:U+8dc0,U+8dc2,U+8dc5-8dc8,U+8dca-8dcc,U+8dce-8dcf,U+8dd1,U+8dd4-8dd7,U+8dd9-8ddb,U+8ddf,U+8de3-8de5,U+8de7,U+8dea-8dec,U+8df0-8df2,U+8df4,U+8dfc-8dfd,U+8dff,U+8e01,U+8e04-8e06,U+8e08-8e09,U+8e0b-8e0c,U+8e10-8e11,U+8e14,U+8e16,U+8e1d-8e23,U+8e26-8e27,U+8e30-8e31,U+8e33-8e39,U+8e3d,U+8e40-8e42,U+8e44,U+8e47-8e50,U+8e54-8e55,U+8e59,U+8e5b-8e64,U+8e69,U+8e6c-8e6d,U+8e6f-8e72,U+8e75-8e77,U+8e79-8e7c,U+8e81-8e85,U+8e89,U+8e8b,U+8e90-8e95,U+8e98-8e9b,U+8e9d-8e9e,U+8ea1-8ea2,U+8ea7,U+8ea9-8eaa,U+8eac-8eb1,U+8eb3,U+8eb5-8eb6,U+8eba-8ebb,U+8ebe,U+8ec0-8ec1,U+8ec3-8ec8,U+8ecb,U+8ecf,U+8ed1,U+8ed4,U+8edb-8edc,U+8ee3,U+8ee8,U+8eeb,U+8eed-8eee,U+8ef0-8ef1,U+8ef7,U+8ef9-8efc,U+8efe,U+8f00,U+8f02,U+8f05,U+8f07-8f08,U+8f0a,U+8f0f-8f10,U+8f12-8f13,U+8f15-8f19,U+8f1b-8f1c,U+8f1e-8f21,U+8f23,U+8f25-8f28,U+8f2b-8f2f,U+8f33-8f37,U+8f39-8f3b,U+8f3e,U+8f40-8f43,U+8f45-8f47,U+8f49-8f4a,U+8f4c-8f4f,U+8f51}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.15.woff2) format("woff2");unicode-range:U+8b2d,U+8b30,U+8b37,U+8b3c,U+8b3e,U+8b41-8b46,U+8b48-8b49,U+8b4c-8b4f,U+8b51-8b54,U+8b56,U+8b59,U+8b5b,U+8b5e-8b5f,U+8b63,U+8b69,U+8b6b-8b6d,U+8b6f,U+8b71,U+8b74,U+8b76,U+8b78-8b79,U+8b7c-8b81,U+8b84-8b85,U+8b8a-8b8f,U+8b92-8b96,U+8b99-8b9a,U+8b9c-8ba0,U+8c38-8c3a,U+8c3d-8c3f,U+8c41,U+8c45,U+8c47-8c49,U+8c4b-8c4c,U+8c4e-8c51,U+8c53-8c55,U+8c57-8c59,U+8c5b,U+8c5d,U+8c62-8c64,U+8c66,U+8c68-8c69,U+8c6b-8c6d,U+8c73,U+8c75-8c76,U+8c78,U+8c7a-8c7c,U+8c7e,U+8c82,U+8c85-8c87,U+8c89-8c8b,U+8c8d-8c8e,U+8c90,U+8c92-8c94,U+8c98-8c99,U+8c9b-8c9c,U+8c9f,U+8ca4,U+8cad-8cae,U+8cb2-8cb3,U+8cb6,U+8cb9-8cba,U+8cbd,U+8cc1-8cc2,U+8cc4-8cc6,U+8cc8-8cc9,U+8ccb,U+8ccd-8ccf,U+8cd2,U+8cd5-8cd6,U+8cd9-8cda,U+8cdd,U+8ce1,U+8ce3-8ce4,U+8ce6,U+8ce8,U+8cec,U+8cef-8cf2,U+8cf4-8cf5,U+8cf7-8cf8,U+8cfa-8cfb,U+8cfd-8cff,U+8d01,U+8d03-8d04,U+8d07,U+8d09-8d0b,U+8d0d-8d10,U+8d12-8d14,U+8d16-8d17,U+8d1b-8d1d,U+8d65,U+8d67,U+8d69,U+8d6b-8d6e,U+8d71,U+8d73,U+8d76,U+8d7f,U+8d81-8d82,U+8d84,U+8d88,U+8d8d,U+8d90-8d91,U+8d95,U+8d99,U+8d9e-8da0,U+8da6,U+8da8,U+8dab-8dac,U+8daf,U+8db2,U+8db5,U+8db7,U+8db9-8dbc,U+8dbe}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.16.woff2) format("woff2");unicode-range:U+8973-8975,U+8977,U+897a-897e,U+8980,U+8983,U+8988-898a,U+898d,U+8990,U+8993-8995,U+8998,U+899b-899c,U+899f-89a1,U+89a5-89a6,U+89a9,U+89ac,U+89af-89b0,U+89b2,U+89b4-89b7,U+89ba,U+89bc-89bd,U+89bf-89c1,U+89d4-89d8,U+89da,U+89dc-89dd,U+89e5,U+89e7,U+89e9,U+89eb,U+89ed,U+89f1,U+89f3-89f4,U+89f6,U+89f8-89f9,U+89fd,U+89ff,U+8a01,U+8a04-8a05,U+8a07,U+8a0c,U+8a0f-8a12,U+8a14-8a16,U+8a1b,U+8a1d-8a1e,U+8a20-8a22,U+8a24-8a26,U+8a2b-8a2c,U+8a2f,U+8a35-8a37,U+8a3b,U+8a3d-8a3e,U+8a40-8a41,U+8a43,U+8a45-8a49,U+8a4d-8a4e,U+8a51-8a54,U+8a56-8a58,U+8a5b-8a5d,U+8a61-8a62,U+8a65,U+8a67,U+8a6c-8a6d,U+8a75-8a77,U+8a79-8a7c,U+8a7e-8a80,U+8a82-8a86,U+8a8b,U+8a8f-8a92,U+8a96-8a97,U+8a99-8a9a,U+8a9f,U+8aa1,U+8aa3,U+8aa5-8aaa,U+8aae-8aaf,U+8ab3,U+8ab6-8ab7,U+8abb-8abc,U+8abe,U+8ac2-8ac4,U+8ac6,U+8ac8-8aca,U+8acc-8acd,U+8ad0-8ad1,U+8ad3-8ad5,U+8ad7,U+8ada-8ae2,U+8ae4,U+8ae7,U+8aeb-8aec,U+8aee,U+8af0-8af1,U+8af3-8af7,U+8afa,U+8afc,U+8aff,U+8b01-8b02,U+8b04-8b07,U+8b0a-8b0d,U+8b0f-8b11,U+8b14,U+8b16,U+8b1a,U+8b1c,U+8b1e-8b20,U+8b26,U+8b28,U+8b2b-8b2c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.17.woff2) format("woff2");unicode-range:U+87e2-87e6,U+87ea-87ed,U+87ef,U+87f1,U+87f3,U+87f5-87f8,U+87fa-87fb,U+87fe-87ff,U+8801,U+8803,U+8805-8807,U+8809-880b,U+880d-8816,U+8818-881c,U+881e-881f,U+8821-8822,U+8827-8828,U+882d-882e,U+8830-8832,U+8835-8836,U+8839-883c,U+8841-8845,U+8848-884b,U+884d-884e,U+8851-8852,U+8855-8856,U+8858-885a,U+885c,U+885e-8860,U+8862,U+8864,U+8869,U+886b,U+886e-886f,U+8871-8872,U+8875,U+8877,U+8879,U+887b,U+887d-887e,U+8880-8882,U+8888,U+888d,U+8892,U+8897-889c,U+889e-88a0,U+88a2,U+88a4,U+88a8,U+88aa,U+88ae,U+88b0-88b1,U+88b5,U+88b7,U+88ba,U+88bc-88c0,U+88c3-88c4,U+88c6,U+88ca-88ce,U+88d1-88d4,U+88d8-88d9,U+88db,U+88dd-88e1,U+88e7-88e8,U+88ef-88f2,U+88f4-88f5,U+88f7,U+88f9,U+88fc,U+8901-8902,U+8904,U+8906,U+890a,U+890c-890f,U+8913,U+8915-8916,U+8918-891a,U+891c-891e,U+8920,U+8925-8928,U+892a-892b,U+8930-8932,U+8935-893b,U+893e,U+8940-8946,U+8949,U+894c-894d,U+894f,U+8952,U+8956-8957,U+895a-895c,U+895e,U+8960-8964,U+8966,U+896a-896b,U+896d-8970}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.18.woff2) format("woff2");unicode-range:U+8655-8659,U+865b,U+865d-8664,U+8667,U+8669,U+866c,U+866f,U+8671,U+8675-8677,U+867a-867b,U+867d,U+8687-8689,U+868b-868d,U+8691,U+8693,U+8695-8696,U+8698,U+869a,U+869c-869d,U+86a1,U+86a3-86a4,U+86a6-86ab,U+86ad,U+86af-86b1,U+86b3-86b9,U+86bf-86c1,U+86c3-86c6,U+86c9,U+86cb,U+86ce,U+86d1-86d2,U+86d4-86d5,U+86d7,U+86da,U+86dc,U+86de-86e0,U+86e3-86e7,U+86e9,U+86ec-86ed,U+86ef,U+86f8-86fe,U+8700,U+8703-870b,U+870d-8714,U+8719-871a,U+871e-871f,U+8721-8723,U+8725,U+8728-8729,U+872e-872f,U+8731-8732,U+8734,U+8737,U+8739-8740,U+8743,U+8745,U+8749,U+874b-874e,U+8751,U+8753,U+8755,U+8757-8759,U+875d,U+875f-8761,U+8763-8766,U+8768,U+876a,U+876e-876f,U+8771-8772,U+8774,U+8778,U+877b-877c,U+877f,U+8782-8789,U+878b-878c,U+878e,U+8790,U+8793,U+8795,U+8797-8799,U+879e-87a0,U+87a2-87a3,U+87a7,U+87ab-87af,U+87b1,U+87b3,U+87b5,U+87bb,U+87bd-87c1,U+87c4,U+87c6-87cb,U+87ce,U+87d0,U+87d2,U+87d5-87d6,U+87d9-87da,U+87dc,U+87df-87e0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.19.woff2) format("woff2");unicode-range:U+84b4,U+84b9-84bb,U+84bd-84c2,U+84c6-84ca,U+84cc-84d1,U+84d3,U+84d6,U+84d9-84da,U+84dc,U+84e7,U+84ea,U+84ec,U+84ef-84f2,U+84f4,U+84f7,U+84fa-84fd,U+84ff-8500,U+8502-8503,U+8506-8507,U+850c,U+850e,U+8510,U+8514-8515,U+8517-8518,U+851a-851c,U+851e-851f,U+8521-8525,U+8527,U+852a-852c,U+852f,U+8532-8534,U+8536,U+853e-8541,U+8543,U+8546,U+8548,U+854a-854b,U+854f-8553,U+8555-855a,U+855c-8564,U+8569-856b,U+856d,U+856f,U+8577,U+8579-857b,U+857d-8581,U+8585-8586,U+8588-858c,U+858f-8591,U+8593,U+8597-8598,U+859b-859d,U+859f-85a0,U+85a2,U+85a4-85a5,U+85a7-85a8,U+85ad-85b0,U+85b4,U+85b6-85ba,U+85bc-85bf,U+85c1-85c2,U+85c7,U+85c9-85cb,U+85ce-85d0,U+85d5,U+85d8-85da,U+85dc,U+85df-85e1,U+85e5-85e6,U+85e8,U+85ed,U+85f3-85f4,U+85f6-85f7,U+85f9-85fa,U+85fc,U+85fe-8600,U+8602,U+8604-8606,U+860a-860b,U+860d-860e,U+8610-8613,U+8616-861b,U+861e,U+8621-8622,U+8624,U+8627,U+8629,U+862f-8630,U+8636,U+8638-863a,U+863c-863d,U+863f-8642,U+8646,U+864d,U+8652-8654}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.20.woff2) format("woff2");unicode-range:U+82e8,U+82ea,U+82ed,U+82ef,U+82f3-82f4,U+82f6-82f7,U+82f9,U+82fb,U+82fd-82fe,U+8300-8301,U+8303,U+8306-8308,U+830a-830c,U+8316-8318,U+831b,U+831d-831f,U+8321-8323,U+832b-8335,U+8337,U+833a,U+833c-833d,U+8340,U+8342-8347,U+834a,U+834d-8351,U+8353-8357,U+835a,U+8362-8363,U+8370,U+8373,U+8375,U+8378,U+837c-837d,U+837f-8380,U+8382,U+8384-8387,U+838a,U+838d-838e,U+8392-8396,U+8398-83a0,U+83a2,U+83a6-83ad,U+83b1,U+83b5,U+83bd-83c1,U+83c7,U+83c9,U+83ce-83d1,U+83d4,U+83d6,U+83d8,U+83dd,U+83df-83e1,U+83e5,U+83e8,U+83ea-83eb,U+83f0,U+83f2,U+83f4,U+83f6-83f9,U+83fb-83fd,U+8401,U+8403-8404,U+8406-8407,U+840a-840b,U+840d,U+840f,U+8411,U+8413,U+8415,U+8417,U+8419,U+8420,U+8422,U+842a,U+842f,U+8431,U+8435,U+8438-8439,U+843c,U+8445-8448,U+844a,U+844d-844f,U+8451-8452,U+8456,U+8458-845a,U+845c,U+845f-8462,U+8464-8467,U+8469-846b,U+846d-8470,U+8473-8474,U+8476-847a,U+847c-847d,U+8481-8482,U+8484-8485,U+848b,U+8490,U+8492-8493,U+8495,U+8497,U+849c,U+849e-849f,U+84a1,U+84a6,U+84a8-84aa,U+84ad,U+84af,U+84b1}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.21.woff2) format("woff2");unicode-range:U+814a,U+814c,U+8151-8153,U+8157,U+815f-8161,U+8165-8169,U+816d-816f,U+8171,U+8173-8174,U+8177,U+8180-8186,U+8188,U+818a-818b,U+818e,U+8190,U+8193,U+8195-8196,U+8198,U+819b,U+819e,U+81a0,U+81a2,U+81a4,U+81a9,U+81ae,U+81b0,U+81b2,U+81b4-81b5,U+81b8,U+81ba-81bb,U+81bd-81be,U+81c0-81c3,U+81c5-81c6,U+81c8-81cb,U+81cd-81cf,U+81d1,U+81d5-81db,U+81dd-81e1,U+81e4-81e5,U+81e7,U+81eb-81ec,U+81ef-81f2,U+81f5-81f6,U+81f8-81fb,U+81fd-8205,U+8209-820b,U+820d,U+820f,U+8212-8214,U+8216,U+8219-821d,U+8221-8222,U+8228-8229,U+822b,U+822e,U+8232-8235,U+8237-8238,U+823a,U+823c,U+8240,U+8243-8246,U+8249,U+824b,U+824e-824f,U+8251,U+8256-825a,U+825c-825d,U+825f-8260,U+8262-8264,U+8267-8268,U+826a-826b,U+826d-826e,U+8271,U+8274,U+8277,U+8279,U+827b,U+827d-8281,U+8283-8284,U+8287,U+8289-828a,U+828d-828e,U+8291-8294,U+8296,U+8298-829b,U+829f-82a1,U+82a3-82a4,U+82a7-82ac,U+82ae,U+82b0,U+82b2,U+82b4,U+82b7,U+82ba-82bc,U+82be-82bf,U+82c5-82c6,U+82d0,U+82d2-82d3,U+82d5,U+82d9-82da,U+82dc,U+82de-82e4,U+82e7}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.22.woff2) format("woff2");unicode-range:U+7f77-7f79,U+7f7d-7f80,U+7f82-7f83,U+7f86-7f88,U+7f8b-7f8d,U+7f8f-7f91,U+7f94,U+7f96-7f97,U+7f9a,U+7f9c-7f9d,U+7fa1-7fa3,U+7fa6,U+7faa,U+7fad-7faf,U+7fb2,U+7fb4,U+7fb6,U+7fb8-7fb9,U+7fbc,U+7fbf-7fc0,U+7fc3,U+7fc5-7fc6,U+7fc8,U+7fca,U+7fce-7fcf,U+7fd5,U+7fdb,U+7fdf,U+7fe1,U+7fe3,U+7fe5-7fe6,U+7fe8-7fe9,U+7feb-7fec,U+7fee-7ff0,U+7ff2-7ff3,U+7ff9-7ffa,U+7ffd-7fff,U+8002,U+8004,U+8006-8008,U+800a-800f,U+8011-8014,U+8016,U+8018-8019,U+801c-8021,U+8024,U+8026,U+8028,U+802c,U+802e,U+8030,U+8034-8035,U+8037,U+8039-8040,U+8043-8044,U+8046,U+804a,U+8052,U+8058,U+805a,U+805f-8060,U+8062,U+8064,U+8066,U+8068,U+806d,U+806f-8073,U+8075-8076,U+8079,U+807b,U+807d-8081,U+8084-8088,U+808b,U+808e,U+8093,U+8099-809a,U+809c,U+809e,U+80a4,U+80a6-80a7,U+80ab-80ad,U+80b1,U+80b8-80b9,U+80c4-80c5,U+80c8,U+80ca,U+80cd,U+80cf,U+80d2,U+80d4-80db,U+80dd,U+80e0,U+80e4-80e6,U+80ed-80f3,U+80f5-80f7,U+80f9-80fc,U+80fe,U+8101,U+8103,U+8109,U+810b,U+810d,U+8116-8118,U+811b-811c,U+811e,U+8120,U+8123-8124,U+8127,U+8129,U+812b-812c,U+812f-8130,U+8135,U+8139-813a,U+813c-813e,U+8141,U+8145-8147}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.23.woff2) format("woff2");unicode-range:U+7d57,U+7d59-7d5d,U+7d63,U+7d65,U+7d67,U+7d6a,U+7d6e,U+7d70,U+7d72-7d73,U+7d78,U+7d7a-7d7b,U+7d7d,U+7d7f,U+7d81-7d83,U+7d85-7d86,U+7d88-7d89,U+7d8b-7d8d,U+7d8f,U+7d91,U+7d93,U+7d96-7d97,U+7d9b-7da0,U+7da2-7da3,U+7da6-7da7,U+7daa-7dac,U+7dae-7db0,U+7db3,U+7db5-7db9,U+7dbd,U+7dc0,U+7dc2-7dc7,U+7dcc-7dce,U+7dd0,U+7dd5-7dd9,U+7ddc-7dde,U+7de1-7de6,U+7dea-7ded,U+7df1-7df2,U+7df5-7df6,U+7df9-7dfa,U+7e00,U+7e05,U+7e08-7e0b,U+7e10-7e12,U+7e15,U+7e17,U+7e1c-7e1d,U+7e1f-7e23,U+7e27-7e28,U+7e2c-7e2d,U+7e2f,U+7e31-7e33,U+7e35-7e37,U+7e39-7e3b,U+7e3d,U+7e3f,U+7e43-7e48,U+7e4e,U+7e50,U+7e52,U+7e56,U+7e58-7e5a,U+7e5d-7e5f,U+7e61-7e62,U+7e65-7e67,U+7e69-7e6b,U+7e6d-7e6f,U+7e73,U+7e75,U+7e78-7e79,U+7e7b-7e7f,U+7e81-7e83,U+7e86-7e8a,U+7e8c-7e8e,U+7e90-7e96,U+7e98,U+7e9a-7e9f,U+7f38,U+7f3a-7f3f,U+7f43-7f45,U+7f47,U+7f4c-7f50,U+7f52-7f55,U+7f58,U+7f5b-7f5d,U+7f5f,U+7f61,U+7f63-7f69,U+7f6b,U+7f6d,U+7f71}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.24.woff2) format("woff2");unicode-range:U+7bc8,U+7bca-7bcc,U+7bcf,U+7bd4,U+7bd6-7bd7,U+7bd9-7bdb,U+7bdd,U+7be5-7be6,U+7be8-7bea,U+7bf0,U+7bf2-7bfa,U+7bfc,U+7bfe,U+7c00-7c04,U+7c06-7c07,U+7c09,U+7c0b-7c0f,U+7c11-7c14,U+7c17,U+7c19,U+7c1b,U+7c1e-7c20,U+7c23,U+7c25-7c28,U+7c2a-7c2c,U+7c2f,U+7c31,U+7c33-7c34,U+7c36-7c3a,U+7c3d-7c3e,U+7c40,U+7c42-7c43,U+7c45-7c46,U+7c4a,U+7c4c,U+7c4f-7c5f,U+7c61,U+7c63-7c65,U+7c67,U+7c69,U+7c6c-7c70,U+7c72,U+7c75,U+7c79,U+7c7b-7c7e,U+7c81-7c83,U+7c86-7c87,U+7c8d,U+7c8f-7c90,U+7c94,U+7c9e,U+7ca0-7ca2,U+7ca4-7ca6,U+7ca8,U+7cab,U+7cad-7cae,U+7cb0-7cb3,U+7cb6-7cb7,U+7cb9-7cbd,U+7cbf-7cc0,U+7cc2,U+7cc4-7cc5,U+7cc7-7cca,U+7ccd-7ccf,U+7cd2-7cd5,U+7cd7-7cda,U+7cdc-7cdd,U+7cdf-7ce0,U+7ce2,U+7ce6,U+7ce9,U+7ceb,U+7cef,U+7cf2,U+7cf4-7cf6,U+7cf9-7cfa,U+7cfe,U+7d02-7d03,U+7d06-7d0a,U+7d0f,U+7d11-7d13,U+7d15-7d16,U+7d1c-7d1e,U+7d23,U+7d26,U+7d2a,U+7d2c-7d2e,U+7d31-7d32,U+7d35,U+7d3c-7d41,U+7d43,U+7d45,U+7d47-7d48,U+7d4b,U+7d4d-7d4f,U+7d51,U+7d53,U+7d55-7d56}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.25.woff2) format("woff2");unicode-range:U+7a17-7a19,U+7a1b,U+7a1e-7a21,U+7a27,U+7a2b,U+7a2d,U+7a2f-7a31,U+7a34-7a35,U+7a37-7a3b,U+7a3e,U+7a43-7a49,U+7a4c,U+7a4e,U+7a50,U+7a55-7a57,U+7a59,U+7a5c-7a5d,U+7a5f-7a63,U+7a65,U+7a67,U+7a69-7a6a,U+7a6d,U+7a70,U+7a75,U+7a78-7a79,U+7a7d-7a7e,U+7a80,U+7a82,U+7a84-7a86,U+7a88,U+7a8a-7a8b,U+7a90-7a91,U+7a94-7a98,U+7a9e,U+7aa0,U+7aa3,U+7aa9,U+7aac,U+7ab0,U+7ab3,U+7ab5-7ab6,U+7ab9-7abf,U+7ac3,U+7ac5-7aca,U+7acc-7acf,U+7ad1-7ad3,U+7ad5,U+7ada-7adb,U+7add,U+7adf,U+7ae1-7ae2,U+7ae6-7aed,U+7af0-7af1,U+7af4,U+7af8,U+7afa-7afb,U+7afd-7afe,U+7b02,U+7b04,U+7b06-7b08,U+7b0a-7b0b,U+7b0f,U+7b12,U+7b14,U+7b18-7b19,U+7b1e-7b1f,U+7b23,U+7b25,U+7b27-7b2b,U+7b2d-7b31,U+7b33-7b36,U+7b3b,U+7b3d,U+7b3f-7b41,U+7b45,U+7b47,U+7b4c-7b50,U+7b53,U+7b55,U+7b5d,U+7b60,U+7b64-7b66,U+7b69-7b6a,U+7b6c-7b75,U+7b77,U+7b79-7b7a,U+7b7f,U+7b84,U+7b86,U+7b89,U+7b8d-7b92,U+7b96,U+7b98-7ba0,U+7ba5,U+7bac-7bad,U+7baf-7bb0,U+7bb2,U+7bb4-7bb6,U+7bba-7bbd,U+7bc1-7bc2,U+7bc5-7bc6}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.26.woff2) format("woff2");unicode-range:U+7851-7852,U+785c,U+785e,U+7860-7861,U+7863-7864,U+7868,U+786a,U+786e-786f,U+7872,U+7874,U+787a,U+787c,U+787e,U+7886-7887,U+788a,U+788c-788f,U+7893-7895,U+7898,U+789a,U+789d-789f,U+78a1,U+78a3-78a4,U+78a8-78aa,U+78ac-78ad,U+78af-78b3,U+78b5,U+78bb-78bf,U+78c5-78cc,U+78ce,U+78d1-78d6,U+78da-78db,U+78df-78e1,U+78e4,U+78e6-78e7,U+78ea,U+78ec,U+78f2-78f4,U+78f6-78f7,U+78f9-78fb,U+78fd-7901,U+7906-7907,U+790c,U+7910-7912,U+7919-791c,U+791e-7920,U+7925-792e,U+7930-7931,U+7934-7935,U+793b,U+793d,U+793f,U+7941-7942,U+7944-7946,U+794a-794b,U+794f,U+7951,U+7954-7955,U+7957-7958,U+795a-795c,U+795f-7960,U+7962,U+7967,U+7969,U+796b,U+7972,U+7977,U+7979-797c,U+797e-7980,U+798a-798e,U+7991,U+7993-7996,U+7998,U+799b-799d,U+79a1,U+79a6-79ab,U+79ae-79b1,U+79b3-79b4,U+79b8-79bb,U+79bd-79be,U+79c2,U+79c4,U+79c7-79ca,U+79cc-79cd,U+79cf,U+79d4-79d6,U+79da,U+79dd-79e3,U+79e5,U+79e7,U+79ea-79ed,U+79f1,U+79f8,U+79fc,U+7a02-7a03,U+7a05,U+7a07-7a0a,U+7a0c-7a0d,U+7a11,U+7a15}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.27.woff2) format("woff2");unicode-range:U+768c-768e,U+7690,U+7693,U+7695-7696,U+7699-76a8,U+76aa,U+76ad,U+76af-76b0,U+76b4,U+76b6-76ba,U+76bd,U+76c1-76c3,U+76c5,U+76c8-76c9,U+76cb-76ce,U+76d2,U+76d4,U+76d6,U+76d9,U+76dc,U+76de,U+76e0-76e1,U+76e5-76e8,U+76ea-76ec,U+76f0-76f1,U+76f6,U+76f9,U+76fb-76fc,U+7700,U+7704,U+7706-7708,U+770a,U+770e,U+7712,U+7714-7715,U+7717,U+7719-771c,U+7722,U+7724-7726,U+7728,U+772d-772f,U+7734-7739,U+773d-773e,U+7742,U+7745-7747,U+774a,U+774d-774f,U+7752,U+7756-7758,U+775a-775c,U+775e-7760,U+7762,U+7764-7765,U+7767,U+776a-776c,U+7770,U+7772-7774,U+7779-777a,U+777c-7780,U+7784,U+778b-778e,U+7794-7796,U+779a,U+779e-77a0,U+77a2,U+77a4-77a5,U+77a7,U+77a9-77aa,U+77ae-77b1,U+77b5-77b7,U+77b9,U+77bb-77bf,U+77c3,U+77c7,U+77c9,U+77cd,U+77d1-77d2,U+77d5,U+77d7,U+77d9-77da,U+77dc,U+77de-77e0,U+77e3-77e4,U+77e6-77e7,U+77e9-77ea,U+77ec,U+77ee,U+77f0-77f1,U+77f4,U+77f8,U+77fb-77fc,U+7805-7806,U+7809,U+780c-780e,U+7811-7812,U+7819,U+781d,U+7820-7823,U+7826-7827,U+782c-782e,U+7830,U+7835,U+7837,U+783a,U+783f,U+7843-7845,U+7847-7848,U+784c,U+784e-784f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.28.woff2) format("woff2");unicode-range:U+7511-7513,U+7515-7517,U+751c,U+751e,U+7520-7522,U+7524,U+7526-7527,U+7529-752c,U+752f,U+7536,U+7538-7539,U+753c-7540,U+7543-7544,U+7546-754b,U+754d-7550,U+7552,U+7557,U+755a-755b,U+755d-755f,U+7561-7562,U+7564,U+7566-7567,U+7569,U+756b-756d,U+756f,U+7571-7572,U+7574-757e,U+7581-7582,U+7585-7587,U+7589-758c,U+758f-7590,U+7592-7595,U+7599-759a,U+759c-759d,U+75a2-75a5,U+75b0-75b1,U+75b3-75b5,U+75b7-75b8,U+75ba,U+75bd,U+75bf-75c4,U+75c6,U+75ca,U+75cc-75cf,U+75d3-75d4,U+75d7-75d8,U+75dc-75e1,U+75e3-75e4,U+75e7,U+75ec,U+75ee-75f3,U+75f9,U+75fc,U+75fe-7604,U+7607-760c,U+760f,U+7612-7613,U+7615-7616,U+7618-7619,U+761b-7629,U+762d,U+7630,U+7632-7635,U+7638-763c,U+7640-7641,U+7643-764b,U+764e,U+7655,U+7658-7659,U+765c,U+765f,U+7661-7662,U+7664-7665,U+7667-766a,U+766c-7672,U+7674,U+7676,U+7678,U+7680-7683,U+7685,U+7688,U+768b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.29.woff2) format("woff2");unicode-range:U+736c,U+736e-7371,U+7375,U+7377-737c,U+7380-7381,U+7383,U+7385-7386,U+738a,U+738e,U+7390,U+7393-7398,U+739c,U+739e-73a0,U+73a2,U+73a5-73a6,U+73a8,U+73aa-73ab,U+73ad,U+73b3,U+73b5,U+73b7,U+73b9-73bd,U+73bf,U+73c5-73c6,U+73c9-73cc,U+73ce-73cf,U+73d2-73d3,U+73d6,U+73d9,U+73dd-73de,U+73e1,U+73e3-73e7,U+73e9-73ea,U+73ee,U+73f1,U+73f4-73f5,U+73f7-73fb,U+73fd,U+73ff-7401,U+7404-7405,U+7407,U+740a,U+7411,U+7413,U+741a-741b,U+7421,U+7424,U+7426,U+7428-7431,U+7433,U+7439-743a,U+743f-7441,U+7443-7444,U+7446-7447,U+744b,U+744d,U+7451-7453,U+7455,U+7457,U+7459-745a,U+745c-745d,U+745f,U+7462-7464,U+7466-746b,U+746d-7473,U+7476,U+747e,U+7480-7481,U+7485-7489,U+748b,U+748f-7492,U+7497-749a,U+749c,U+749e-74a3,U+74a5-74a6,U+74a8-74ab,U+74ae-74af,U+74b1-74b2,U+74b5,U+74b9-74bb,U+74bd,U+74bf,U+74c8-74ca,U+74cc,U+74cf-74d0,U+74d3-74d4,U+74d6,U+74d8,U+74da-74db,U+74de-74e0,U+74e3-74e4,U+74e7-74eb,U+74ee-74f2,U+74f4,U+74f7-74f8,U+74fa-74fc,U+74ff,U+7501,U+7503-7506,U+750c-750e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.30.woff2) format("woff2");unicode-range:U+7166,U+7168,U+716c,U+7179,U+7180,U+7184-7185,U+7187-7188,U+718c,U+718f,U+7192,U+7194-7196,U+7199-719b,U+71a0,U+71a2,U+71a8,U+71ac,U+71ae-71b0,U+71b2-71b3,U+71b9-71ba,U+71be-71c1,U+71c4,U+71c9,U+71cb-71cc,U+71ce,U+71d0,U+71d2-71d4,U+71d6-71d7,U+71d9-71da,U+71dc,U+71df-71e0,U+71e6-71e7,U+71ec-71ee,U+71f4-71f5,U+71f8-71f9,U+71fc,U+71fe-7200,U+7207-7209,U+720d,U+7210,U+7213,U+7215,U+7217,U+721a,U+721d,U+721f,U+7224,U+7228,U+722b,U+722d,U+722f-7230,U+7232,U+7234,U+7238-7239,U+723b-723c,U+723e-7243,U+7245-7246,U+724b,U+724e-7250,U+7252-7253,U+7255-7258,U+725a,U+725c,U+725e,U+7260,U+7263,U+7268,U+726b,U+726e-726f,U+7271,U+7274,U+7277-7278,U+727b-727c,U+727e-7282,U+7284,U+7287,U+7289,U+728d-728e,U+7292-7293,U+7296,U+729b,U+72a2,U+72a7-72a8,U+72ad-72ae,U+72b0-72b2,U+72b4,U+72b9,U+72be,U+72c0-72c1,U+72c3-72c4,U+72c6-72c7,U+72c9,U+72cc,U+72ce,U+72d2,U+72d5-72d6,U+72d8,U+72df-72e2,U+72e5,U+72f3-72f4,U+72f7,U+72f9-72fb,U+72fd-72fe,U+7302,U+7304-7305,U+7307,U+730a-730b,U+730d,U+7312-7313,U+7316-7319,U+731c-731e,U+7322,U+7324,U+7327-7329,U+732c,U+732f,U+7331-7337,U+7339-733b,U+733d-733e,U+7343,U+734d-7350,U+7352,U+7356-7358,U+735d-7360,U+7366-736b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.31.woff2) format("woff2");unicode-range:U+6f58-6f5b,U+6f5d-6f5e,U+6f60-6f62,U+6f66,U+6f68,U+6f6c-6f6d,U+6f6f,U+6f74,U+6f78,U+6f7a,U+6f7c-6f7e,U+6f80,U+6f82-6f83,U+6f86-6f88,U+6f8b-6f8e,U+6f90-6f94,U+6f96-6f98,U+6f9a,U+6f9d,U+6f9f-6fa1,U+6fa3,U+6fa5-6fa8,U+6fae-6fb1,U+6fb3,U+6fb5-6fb7,U+6fb9,U+6fbc,U+6fbe,U+6fc2,U+6fc5-6fca,U+6fd4-6fd5,U+6fd8,U+6fda-6fdb,U+6fde-6fe0,U+6fe4,U+6fe8-6fe9,U+6feb-6fec,U+6fee,U+6ff0,U+6ff3,U+6ff5-6ff6,U+6ff9-6ffa,U+6ffc-6ffe,U+7000-7001,U+7005-7007,U+7009-700b,U+700d,U+700f,U+7011,U+7015,U+7017-7018,U+701a-701b,U+701d-7020,U+7023,U+7026,U+7028,U+702f-7030,U+7032,U+7034,U+7037,U+7039-703a,U+703c,U+703e,U+7043-7044,U+7047-704c,U+704e,U+7051,U+7054-7055,U+705d-705e,U+7064-7065,U+7069,U+706c,U+706e,U+7075-7076,U+707e,U+7081,U+7085-7086,U+7094-7098,U+709b,U+709f,U+70a4,U+70ab-70ac,U+70ae-70b1,U+70b3-70b4,U+70b7,U+70bb,U+70ca-70cb,U+70d1,U+70d3-70d6,U+70d8-70d9,U+70dc-70dd,U+70df,U+70e4,U+70ec,U+70f1,U+70fa,U+70fd,U+7103-7108,U+710b-710c,U+710f,U+7114,U+7119,U+711c,U+711e,U+7120,U+712b,U+712d-7131,U+7138,U+7141,U+7145-7147,U+7149-714b,U+7150-7153,U+7155-7157,U+715a,U+715c,U+715e,U+7160,U+7162,U+7164-7165}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.32.woff2) format("woff2");unicode-range:U+6d7c,U+6d80-6d82,U+6d85,U+6d87,U+6d89-6d8a,U+6d8c-6d8e,U+6d91-6d98,U+6d9c,U+6daa-6dac,U+6dae,U+6db4-6db5,U+6db7-6db9,U+6dbd,U+6dbf,U+6dc2,U+6dc4-6dc8,U+6dca,U+6dcc,U+6dce-6dd0,U+6dd2,U+6dd5-6dd6,U+6dd8-6ddb,U+6ddd-6de0,U+6de2,U+6de4-6de6,U+6de8-6dea,U+6dec,U+6dee-6df0,U+6df2,U+6df4,U+6df6,U+6df8-6dfa,U+6dfc,U+6e00,U+6e04,U+6e0a,U+6e17,U+6e19,U+6e1d-6e20,U+6e22-6e25,U+6e27,U+6e2b,U+6e2d-6e2e,U+6e32,U+6e34,U+6e36,U+6e38-6e3c,U+6e42-6e45,U+6e48-6e49,U+6e4b-6e4f,U+6e51-6e54,U+6e57,U+6e5b-6e5f,U+6e62-6e63,U+6e68,U+6e6b,U+6e6e,U+6e72-6e73,U+6e76,U+6e7b,U+6e7d,U+6e82,U+6e89,U+6e8c-6e8d,U+6e8f,U+6e93,U+6e98-6e99,U+6e9f-6ea0,U+6ea5,U+6ea7,U+6eaa-6eab,U+6ead-6eaf,U+6eb1-6eb4,U+6eb7,U+6ebb-6ebd,U+6ebf-6ec4,U+6ec7-6eca,U+6ecc-6ecf,U+6ed3-6ed5,U+6ed9-6edb,U+6ee6,U+6eeb-6eef,U+6ef7-6ef9,U+6efb,U+6efd-6eff,U+6f04,U+6f08-6f0a,U+6f0c-6f0d,U+6f10-6f11,U+6f13,U+6f15-6f16,U+6f18,U+6f1a-6f1b,U+6f25-6f26,U+6f29-6f2a,U+6f2d,U+6f2f-6f33,U+6f35-6f36,U+6f38,U+6f3b-6f3c,U+6f3e-6f3f,U+6f41,U+6f45,U+6f4f,U+6f51-6f53,U+6f57}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.33.woff2) format("woff2");unicode-range:U+6b85,U+6b89,U+6b8d,U+6b95,U+6b97-6b98,U+6b9b,U+6b9e-6ba0,U+6ba2-6ba4,U+6ba8-6bb3,U+6bb7-6bb9,U+6bbc-6bbe,U+6bc0,U+6bc3-6bc4,U+6bc6-6bc9,U+6bcb-6bcc,U+6bcf,U+6bd3,U+6bd6-6bd8,U+6bda,U+6bdf,U+6be1,U+6be3,U+6be6-6be7,U+6beb-6bec,U+6bee,U+6bf1,U+6bf3,U+6bf7,U+6bf9,U+6bff,U+6c02,U+6c04-6c05,U+6c08-6c0a,U+6c0d-6c0e,U+6c10,U+6c12-6c14,U+6c19,U+6c1b,U+6c1f,U+6c24,U+6c26-6c28,U+6c2c,U+6c2e,U+6c33,U+6c35-6c36,U+6c3a-6c3b,U+6c3e-6c40,U+6c4a-6c4b,U+6c4d,U+6c4f,U+6c52,U+6c54-6c55,U+6c59,U+6c5b-6c5e,U+6c62,U+6c67-6c68,U+6c6a-6c6b,U+6c6d,U+6c6f,U+6c73-6c74,U+6c76,U+6c78-6c79,U+6c7b,U+6c7e,U+6c81-6c87,U+6c89,U+6c8c-6c8d,U+6c90,U+6c92-6c95,U+6c97-6c98,U+6c9a-6c9c,U+6c9f,U+6caa-6cae,U+6cb0-6cb2,U+6cb4,U+6cba,U+6cbd-6cbe,U+6cc2,U+6cc5-6cc6,U+6ccd,U+6ccf-6cd4,U+6cd6-6cd7,U+6cd9-6cdd,U+6ce0,U+6ce7,U+6ce9-6cef,U+6cf1-6cf2,U+6cf4,U+6cfb,U+6d00-6d01,U+6d04,U+6d07,U+6d0a,U+6d0c,U+6d0e-6d0f,U+6d11,U+6d13,U+6d19-6d1a,U+6d1f,U+6d24,U+6d26-6d28,U+6d2b,U+6d2e-6d2f,U+6d31,U+6d33-6d36,U+6d38-6d39,U+6d3c-6d3d,U+6d3f,U+6d57-6d5b,U+6d5e-6d61,U+6d64-6d65,U+6d67,U+6d6c,U+6d6f-6d70,U+6d79}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.34.woff2) format("woff2");unicode-range:U+69dd-69de,U+69e2-69e3,U+69e5,U+69e7-69eb,U+69ed-69ef,U+69f1-69f6,U+69f9,U+69fe-6a01,U+6a03,U+6a05,U+6a0a,U+6a0c,U+6a0f,U+6a11-6a15,U+6a17,U+6a1a-6a1b,U+6a1d-6a20,U+6a22-6a24,U+6a28,U+6a2e,U+6a30,U+6a32-6a38,U+6a3b,U+6a3e-6a3f,U+6a44-6a4a,U+6a4e,U+6a50-6a52,U+6a54-6a56,U+6a5b,U+6a61-6a62,U+6a64,U+6a66-6a67,U+6a6a-6a6b,U+6a71-6a73,U+6a78,U+6a7a,U+6a7e-6a7f,U+6a81,U+6a83-6a84,U+6a86-6a87,U+6a89,U+6a8b,U+6a8d,U+6a90-6a91,U+6a94,U+6a97,U+6a9b,U+6a9d-6aa3,U+6aa5,U+6aaa-6aac,U+6aae-6ab1,U+6ab3-6ab4,U+6ab8,U+6abb,U+6abd-6abf,U+6ac1-6ac3,U+6ac6,U+6ac8-6ac9,U+6acc,U+6ad0-6ad1,U+6ad3-6ad6,U+6ada-6adf,U+6ae2,U+6ae4,U+6ae7-6ae8,U+6aea,U+6aec,U+6af0-6af3,U+6af8,U+6afa,U+6afc-6afd,U+6b02-6b03,U+6b06-6b07,U+6b09-6b0b,U+6b0f-6b12,U+6b16-6b17,U+6b1b,U+6b1d-6b1f,U+6b23-6b24,U+6b28,U+6b2b-6b2c,U+6b2f,U+6b35-6b39,U+6b3b,U+6b3d,U+6b3f,U+6b43,U+6b46-6b47,U+6b49-6b4a,U+6b4d-6b4e,U+6b50,U+6b52,U+6b54,U+6b56,U+6b58-6b59,U+6b5b,U+6b5d,U+6b5f-6b61,U+6b65,U+6b67,U+6b6b-6b6c,U+6b6e,U+6b70,U+6b72,U+6b75,U+6b77-6b7a,U+6b7d-6b84}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.35.woff2) format("woff2");unicode-range:U+6855,U+6857-6859,U+685b,U+685d,U+685f,U+6863,U+6867,U+686b,U+686e-6872,U+6874-6875,U+6877,U+6879-687c,U+687e-687f,U+6882-6884,U+6886,U+6888,U+688d-6890,U+6894,U+6896,U+6898-689c,U+689f-68a3,U+68a5-68a7,U+68a9-68ab,U+68ad-68af,U+68b2-68b5,U+68b9-68bc,U+68c3,U+68c5-68c6,U+68c8-68ca,U+68cc-68cd,U+68cf-68d1,U+68d3-68d9,U+68dc-68dd,U+68e0-68e1,U+68e3-68e5,U+68e7-68e8,U+68ea-68ed,U+68ef-68f1,U+68f5-68f7,U+68f9,U+68fb-68fd,U+6900-6901,U+6903-6904,U+6906-690c,U+690f-6911,U+6913,U+6916-6917,U+6919-691b,U+6921-6923,U+6925-6926,U+6928,U+692a,U+6930-6931,U+6933-6936,U+6938-6939,U+693b,U+693d,U+6942,U+6945-6946,U+6949,U+694e,U+6954,U+6957,U+6959,U+695b-695e,U+6961-6966,U+6968-696c,U+696e-6974,U+6977-697b,U+697e-6981,U+6986,U+698d,U+6991-6992,U+6994-6996,U+6998,U+699c,U+69a0-69a1,U+69a5-69a8,U+69ab,U+69ad,U+69af-69b2,U+69b4,U+69b7-69b8,U+69ba-69bc,U+69be-69c1,U+69c3,U+69c5,U+69c7-69c8,U+69ca,U+69ce-69d1,U+69d3,U+69d6-69d7,U+69d9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.36.woff2) format("woff2");unicode-range:U+667e-6680,U+6683-6684,U+6688,U+668b-668e,U+6690,U+6692,U+6698-669d,U+669f-66a0,U+66a2,U+66a4,U+66ad,U+66b1-66b3,U+66b5,U+66b8-66b9,U+66bb-66bc,U+66be-66c4,U+66c6,U+66c8-66c9,U+66cc,U+66ce-66cf,U+66d4,U+66da-66db,U+66dd,U+66df-66e0,U+66e6,U+66e8-66e9,U+66eb-66ec,U+66ee,U+66f5,U+66f7,U+66fa-66fc,U+6701,U+6705,U+6707,U+670c,U+670e-6710,U+6712-6716,U+6719,U+671c,U+671e,U+6720,U+6722,U+6725-6726,U+672e,U+6733,U+6735-6738,U+673e-673f,U+6741,U+6743,U+6745-6748,U+674c-674d,U+6753-6755,U+6759,U+675d-675e,U+6760,U+6762-6764,U+6766,U+676a,U+676c,U+676e,U+6770,U+6772-6774,U+6776-6777,U+677b-677c,U+6780-6781,U+6784-6785,U+6787,U+6789,U+678b-678c,U+678e-678f,U+6791-6793,U+6796,U+6798-6799,U+679b,U+67a1,U+67a4,U+67a6,U+67a9,U+67b0-67b5,U+67b7-67b9,U+67bb-67be,U+67c0-67c3,U+67c5-67c6,U+67c8-67c9,U+67ce,U+67d2,U+67d7-67d9,U+67db-67de,U+67e1-67e2,U+67e4,U+67e6-67e7,U+67e9,U+67ec,U+67ee-67f0,U+67f2,U+67f6-67f7,U+67f9-67fa,U+67fc,U+67fe,U+6801-6802,U+6805,U+6810,U+6814,U+6818-6819,U+681d,U+681f,U+6822,U+6827-6829,U+682b-682d,U+682f-6834,U+683b,U+683e-6840,U+6844-6846,U+6849-684a,U+684c-684e,U+6852-6854}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.37.woff2) format("woff2");unicode-range:U+64d2,U+64d4-64d5,U+64d7-64d8,U+64da,U+64e0-64e1,U+64e3-64e5,U+64e7,U+64e9-64ea,U+64ed,U+64ef-64f2,U+64f4-64f7,U+64fa-64fb,U+64fd-6501,U+6504-6505,U+6508-650a,U+650f,U+6513-6514,U+6516,U+6518-6519,U+651b-651f,U+6522,U+6524,U+6526,U+6529-652c,U+652e,U+6531-6532,U+6534-6538,U+653a,U+653c-653d,U+6543-6544,U+6547-6549,U+654d-654e,U+6550,U+6552,U+6554-6556,U+6558,U+655d-6560,U+6567,U+656b,U+6572,U+6578,U+657a,U+657d,U+6581-6585,U+6588,U+658a,U+658c,U+6592,U+6595,U+6598,U+659b,U+659d,U+659f-65a1,U+65a3-65a6,U+65ab,U+65ae,U+65b2-65b5,U+65b7-65b8,U+65be-65bf,U+65c1-65c4,U+65c6,U+65c8-65c9,U+65cc,U+65ce,U+65d0,U+65d2,U+65d4,U+65d6,U+65d8-65d9,U+65db,U+65df-65e1,U+65e3,U+65f0-65f2,U+65f4-65f5,U+65f9,U+65fb-65fc,U+65fe-6600,U+6603-6604,U+6608-660a,U+660d,U+6611-6612,U+6615-6616,U+661c-661e,U+6621-6624,U+6626,U+6629-662c,U+662e,U+6630-6631,U+6633-6637,U+6639-663b,U+663f-6641,U+6644-6646,U+6648-664a,U+664c,U+664e-664f,U+6651,U+6657-6665,U+6667-6668,U+666a-666d,U+6670,U+6673,U+6675,U+6677-6679,U+667b-667c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.38.woff2) format("woff2");unicode-range:U+62cf,U+62d1,U+62d4-62d6,U+62da,U+62dc,U+62ea,U+62ee-62ef,U+62f1-62f2,U+62f4-62f5,U+62fc-62fd,U+62ff,U+6302-6304,U+6308-630d,U+6310,U+6313,U+6316,U+6318,U+631b,U+6327,U+6329-632a,U+632d,U+6332,U+6335-6336,U+6339-633c,U+633e,U+6341-6344,U+6346,U+634a-634e,U+6350,U+6352-6354,U+6358-6359,U+635b,U+6365-6366,U+6369,U+636b-636d,U+6371-6372,U+6374-6378,U+637a,U+637c-637d,U+637f-6380,U+6382,U+6384,U+6387,U+6389-638a,U+638e-6390,U+6394-6396,U+6399-639a,U+639e,U+63a0,U+63a3-63a4,U+63a6,U+63a9,U+63ab-63af,U+63b5,U+63bd-63be,U+63c0-63c1,U+63c4-63c6,U+63c8,U+63ce,U+63d1-63d6,U+63dc,U+63e0,U+63e3,U+63e5,U+63e9-63ed,U+63f2-63f3,U+63f5-63f9,U+6406,U+6409-640a,U+640f-6410,U+6412-6414,U+6416-6418,U+641e,U+6420,U+6422,U+6424-6426,U+6428-642a,U+642f-6430,U+6434-6436,U+643d,U+643f,U+644b,U+644e-644f,U+6451-6454,U+645a-645d,U+645f-6461,U+6463,U+6467,U+646d,U+6473-6474,U+6476,U+6478-6479,U+647b,U+647d,U+6485,U+6487-6488,U+648f-6491,U+6493,U+6495,U+6498-649b,U+649d-649f,U+64a1,U+64a3,U+64a6,U+64a8-64a9,U+64ac,U+64b3,U+64bb-64bf,U+64c2,U+64c4-64c5,U+64c7,U+64c9-64cc,U+64ce,U+64d0-64d1}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.39.woff2) format("woff2");unicode-range:U+6117,U+6119,U+611c,U+611e,U+6120-6122,U+6127-6128,U+612a-612c,U+6130-6131,U+6134-6137,U+6139-613a,U+613c-613f,U+6141-6142,U+6144-6147,U+6149-614a,U+614d,U+6153,U+6158-615a,U+615d-6160,U+6164-6165,U+616b-616c,U+616f,U+6171-6175,U+6177-6178,U+617b-6181,U+6183-6184,U+6187,U+618a-618b,U+618d,U+6192-6194,U+6196-619a,U+619c-619d,U+619f-61a0,U+61a5,U+61a8,U+61aa-61ae,U+61b8-61ba,U+61bc,U+61be,U+61c0-61c3,U+61c6,U+61c8,U+61ca-61cf,U+61d5,U+61dc-61df,U+61e1-61e3,U+61e5-61e9,U+61ec-61ed,U+61ef,U+61f4-61f7,U+61fa,U+61fc-6201,U+6203-6204,U+6207-620a,U+620d-620e,U+6213-6215,U+621b-621e,U+6220-6223,U+6227,U+6229-622b,U+622e,U+6230-6233,U+6236,U+6239,U+623d-623e,U+6241-6244,U+6246,U+6248,U+624c,U+624e,U+6250-6252,U+6254,U+6256,U+6258,U+625a-625c,U+625e,U+6260-6261,U+6263-6264,U+6268,U+626d,U+626f,U+6273,U+627a-627e,U+6282-6283,U+6285,U+6289,U+628d-6290,U+6292-6294,U+6296,U+6299,U+629b,U+62a6,U+62a8,U+62ac,U+62b3,U+62b6-62b7,U+62ba-62bb,U+62be-62bf,U+62c2,U+62c4,U+62c6-62c8,U+62ca,U+62ce}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.40.woff2) format("woff2");unicode-range:U+5f6c-5f6d,U+5f6f,U+5f72-5f75,U+5f78,U+5f7a,U+5f7d-5f7f,U+5f82-5f83,U+5f87-5f89,U+5f8d,U+5f8f,U+5f91,U+5f96,U+5f99,U+5f9c-5f9d,U+5fa0,U+5fa2,U+5fa4,U+5fa7-5fa8,U+5fab-5fad,U+5faf-5fb1,U+5fb5,U+5fb7-5fb8,U+5fbc-5fbd,U+5fc4,U+5fc7-5fc9,U+5fcb,U+5fd0-5fd4,U+5fdd-5fde,U+5fe1-5fe2,U+5fe4,U+5fe8-5fea,U+5fec-5ff3,U+5ff6,U+5ff8,U+5ffa-5ffd,U+5fff,U+6007,U+600a,U+600d-6010,U+6013-6015,U+6017-601b,U+601f,U+6021-6022,U+6024,U+6026,U+6029,U+602b,U+602d,U+6031,U+6033,U+6035,U+603a,U+6040-6043,U+6046-604a,U+604c-604d,U+6051,U+6054-6057,U+6059-605a,U+605d,U+605f-6064,U+6067,U+606a-606c,U+6070-6071,U+6077,U+607e-607f,U+6081-6086,U+6088-608e,U+6091-6093,U+6095-6098,U+609a-609b,U+609d-609e,U+60a2,U+60a4-60a5,U+60a7-60a8,U+60b0-60b1,U+60b3-60b5,U+60b7-60b8,U+60bb,U+60bd-60be,U+60c2,U+60c4,U+60c6-60cb,U+60ce-60cf,U+60d3-60d5,U+60d8-60d9,U+60db,U+60dd-60df,U+60e1-60e2,U+60e5,U+60ee,U+60f0-60f2,U+60f4-60f8,U+60fa-60fd,U+6100,U+6102-6103,U+6106-6108,U+610a,U+610c-610e,U+6110-6114,U+6116}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.41.woff2) format("woff2");unicode-range:U+5d9b,U+5d9d,U+5d9f-5da0,U+5da2,U+5da4,U+5da7,U+5dab-5dac,U+5dae,U+5db0,U+5db2,U+5db4,U+5db7-5db9,U+5dbc-5dbd,U+5dc3,U+5dc7,U+5dc9,U+5dcb-5dce,U+5dd0-5dd3,U+5dd6-5dd9,U+5ddb,U+5de0,U+5de2,U+5de4,U+5de9,U+5df2,U+5df5,U+5df8-5df9,U+5dfd,U+5dff-5e00,U+5e07,U+5e0b,U+5e0d,U+5e11-5e12,U+5e14-5e15,U+5e18-5e1b,U+5e1f-5e20,U+5e25,U+5e28,U+5e2e,U+5e32,U+5e35-5e37,U+5e3e,U+5e40,U+5e43-5e44,U+5e47,U+5e49,U+5e4b,U+5e4e,U+5e50-5e51,U+5e54,U+5e56-5e58,U+5e5b-5e5c,U+5e5e-5e5f,U+5e62,U+5e64,U+5e68,U+5e6a-5e6e,U+5e70,U+5e75-5e77,U+5e7a,U+5e7f-5e80,U+5e87,U+5e8b,U+5e8e,U+5e96,U+5e99-5e9a,U+5ea0,U+5ea2,U+5ea4-5ea5,U+5ea8,U+5eaa,U+5eac,U+5eb1,U+5eb3,U+5eb8-5eb9,U+5ebd-5ebf,U+5ec1-5ec2,U+5ec6,U+5ec8,U+5ecb-5ecc,U+5ece-5ed6,U+5ed9-5ee2,U+5ee5,U+5ee8-5ee9,U+5eeb-5eec,U+5ef0-5ef1,U+5ef3-5ef4,U+5ef8-5ef9,U+5efc-5f00,U+5f02-5f03,U+5f06-5f09,U+5f0b-5f0e,U+5f11,U+5f16-5f17,U+5f19,U+5f1b-5f1e,U+5f21-5f24,U+5f27-5f29,U+5f2b-5f30,U+5f34,U+5f36,U+5f38,U+5f3a-5f3d,U+5f3f-5f41,U+5f44-5f45,U+5f47-5f48,U+5f4a,U+5f4c-5f4e,U+5f50-5f51,U+5f54,U+5f56-5f58,U+5f5b-5f5d,U+5f60,U+5f63-5f65,U+5f67,U+5f6a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.42.woff2) format("woff2");unicode-range:U+5bbc,U+5bc0-5bc1,U+5bc3,U+5bc7,U+5bc9,U+5bcd-5bd0,U+5bd3-5bd4,U+5bd6-5bda,U+5bde,U+5be0-5be2,U+5be4-5be6,U+5be8,U+5beb-5bec,U+5bef-5bf1,U+5bf3-5bf6,U+5bfd,U+5c03,U+5c05,U+5c07-5c09,U+5c0c-5c0d,U+5c12-5c14,U+5c17,U+5c19,U+5c1e-5c20,U+5c22-5c24,U+5c26,U+5c28-5c2e,U+5c30,U+5c32,U+5c35-5c36,U+5c38-5c39,U+5c46,U+5c4d-5c50,U+5c53,U+5c59-5c5c,U+5c5f-5c63,U+5c67-5c69,U+5c6c-5c70,U+5c74-5c76,U+5c79-5c7d,U+5c87-5c88,U+5c8a,U+5c8c,U+5c8f,U+5c91-5c92,U+5c94,U+5c9d,U+5c9f-5ca0,U+5ca2-5ca3,U+5ca6-5ca8,U+5caa-5cab,U+5cad,U+5cb1-5cb2,U+5cb4-5cb7,U+5cba-5cbc,U+5cbe,U+5cc5,U+5cc7,U+5cc9,U+5ccb,U+5cd0,U+5cd2,U+5cd7,U+5cd9,U+5cdd,U+5ce6,U+5ce8-5cea,U+5ced-5cee,U+5cf1-5cf2,U+5cf4-5cf5,U+5cfa-5cfb,U+5cfd,U+5d01,U+5d06,U+5d0b,U+5d0d,U+5d10-5d12,U+5d14-5d15,U+5d17-5d1b,U+5d1d,U+5d1f-5d20,U+5d22-5d24,U+5d26-5d27,U+5d2b,U+5d31,U+5d34,U+5d39,U+5d3d,U+5d3f,U+5d42-5d43,U+5d46-5d48,U+5d4a-5d4b,U+5d4e,U+5d51-5d53,U+5d55,U+5d59,U+5d5c,U+5d5f-5d62,U+5d64,U+5d69-5d6a,U+5d6c-5d6d,U+5d6f-5d70,U+5d73,U+5d76,U+5d79-5d7a,U+5d7e-5d7f,U+5d81-5d84,U+5d87-5d88,U+5d8a,U+5d8c,U+5d90,U+5d92-5d95,U+5d97,U+5d99}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.43.woff2) format("woff2");unicode-range:U+598b-598e,U+5992,U+5995,U+5997,U+599b,U+599d,U+599f,U+59a3-59a4,U+59a7,U+59ad-59b0,U+59b2-59b3,U+59b7,U+59ba,U+59bc,U+59be,U+59c1,U+59c3-59c4,U+59c6,U+59c8,U+59ca,U+59cd,U+59d2,U+59d9-59da,U+59dd-59df,U+59e3-59e5,U+59e7-59e8,U+59ec,U+59ee-59ef,U+59f1-59f2,U+59f4,U+59f6-59f8,U+5a00,U+5a03-5a04,U+5a09,U+5a0c-5a0e,U+5a11-5a13,U+5a17,U+5a1a-5a1c,U+5a1e-5a1f,U+5a23-5a25,U+5a27-5a28,U+5a2a,U+5a2d,U+5a30,U+5a35-5a36,U+5a40-5a41,U+5a44-5a45,U+5a47-5a49,U+5a4c,U+5a50,U+5a55,U+5a5e,U+5a62-5a63,U+5a65,U+5a67,U+5a6a,U+5a6c-5a6d,U+5a77,U+5a7a-5a7b,U+5a7e,U+5a84,U+5a8b,U+5a90,U+5a93,U+5a96,U+5a99,U+5a9c,U+5a9e-5aa0,U+5aa2,U+5aa7,U+5aac,U+5ab1-5ab3,U+5ab5,U+5ab8,U+5aba-5abf,U+5ac2,U+5ac4,U+5ac6,U+5ac8,U+5acb,U+5acf-5ad0,U+5ad6-5ad7,U+5ada,U+5adc,U+5ae0-5ae1,U+5ae3,U+5ae5-5ae6,U+5ae9-5aea,U+5aee,U+5af0,U+5af5-5af6,U+5afa-5afb,U+5afd,U+5b00-5b01,U+5b08,U+5b0b,U+5b16-5b17,U+5b19,U+5b1b,U+5b1d,U+5b21,U+5b25,U+5b2a,U+5b2c-5b2d,U+5b30,U+5b32,U+5b34,U+5b36,U+5b38,U+5b3e,U+5b40-5b41,U+5b43,U+5b45,U+5b4b-5b4c,U+5b51-5b52,U+5b56,U+5b5a-5b5c,U+5b5e-5b5f,U+5b65,U+5b68-5b69,U+5b6e-5b71,U+5b73,U+5b75-5b76,U+5b7a,U+5b7c-5b84,U+5b86,U+5b8a-5b8b,U+5b8d-5b8e,U+5b90-5b91,U+5b93-5b94,U+5b96,U+5ba5-5ba6,U+5ba8-5ba9,U+5bac-5bad,U+5baf,U+5bb1-5bb2,U+5bb7-5bb8,U+5bba}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.44.woff2) format("woff2");unicode-range:U+57b3,U+57b8,U+57bd,U+57c0,U+57c3,U+57c6-57c8,U+57cc,U+57cf,U+57d2-57d7,U+57dc-57de,U+57e0-57e1,U+57e3-57e4,U+57e6-57e7,U+57e9,U+57ed,U+57f0,U+57f4-57f6,U+57f8,U+57fb,U+57fd-57ff,U+5803-5804,U+5808-580d,U+5819,U+581b,U+581d-5821,U+5826-5827,U+582d,U+582f-5830,U+5832,U+5835,U+5839,U+583d,U+583f-5840,U+5849,U+584b-584d,U+584f-5852,U+5855,U+5858-5859,U+585f,U+5861-5862,U+5864,U+5867-5868,U+586d,U+5870,U+5872,U+5878-5879,U+587c,U+587f-5881,U+5885,U+5887-588d,U+588f-5890,U+5894,U+5896,U+5898,U+589d-589e,U+58a0-58a2,U+58a6,U+58a9-58ab,U+58ae,U+58b1-58b3,U+58b8-58bc,U+58be,U+58c2-58c5,U+58c8,U+58cd-58ce,U+58d0-58da,U+58dc-58e2,U+58e4-58e5,U+58e9,U+58ec,U+58ef,U+58f3-58f4,U+58f7,U+58f9,U+58fb-58fd,U+5902,U+5905-5906,U+590a-590d,U+5910,U+5912-5914,U+5918-5919,U+591b,U+591d,U+591f,U+5921,U+5923-5925,U+5928,U+592c-592d,U+592f-5930,U+5932-5933,U+5935-5936,U+5938-5939,U+593d-593f,U+5943,U+5946,U+594e,U+5950,U+5952-5953,U+5955,U+5957-595b,U+595d-5961,U+5963,U+5967,U+5969,U+596b-596d,U+596f,U+5972,U+5975-5976,U+5978-5979,U+597b-597c,U+5981}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.45.woff2) format("woff2");unicode-range:U+5616-5617,U+5619,U+561b,U+5620,U+5628,U+562c,U+562f-5639,U+563b-563d,U+563f-5641,U+5643-5644,U+5646-5647,U+5649,U+564b,U+564d-5650,U+5653-5654,U+565e,U+5660-5664,U+5666,U+5669-566d,U+566f,U+5671-5672,U+5675-5676,U+5678,U+567a,U+5680,U+5684-5688,U+568a-568c,U+568f,U+5694-5695,U+5699-569a,U+569d-56a0,U+56a5-56a9,U+56ab-56ae,U+56b1-56b4,U+56b6-56b7,U+56bc,U+56be,U+56c0,U+56c2-56c3,U+56c5,U+56c8-56d1,U+56d3,U+56d7-56d9,U+56dc-56dd,U+56df,U+56e1,U+56e4-56e8,U+56eb,U+56ed-56ee,U+56f1,U+56f6-56f7,U+56f9,U+56ff-5704,U+5707-570a,U+570c-570d,U+5711,U+5713,U+5715-5716,U+5718,U+571a-571d,U+5720-5726,U+5729-572a,U+572c,U+572e-572f,U+5733-5734,U+5737-5738,U+573b,U+573d-573f,U+5745-5746,U+574c-574f,U+5751-5752,U+5759,U+575f,U+5761-5762,U+5764-5765,U+5767-5769,U+576b,U+576d-5771,U+5773-5775,U+5777,U+5779-577c,U+577e-577f,U+5781,U+5783,U+5788-5789,U+578c,U+5793-5795,U+5797,U+5799-579a,U+579c-57a1,U+57a4,U+57a7-57aa,U+57ac,U+57ae,U+57b0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.46.woff2) format("woff2");unicode-range:U+543f-5440,U+5443-5444,U+5447,U+544c-544f,U+5455,U+545e,U+5462,U+5464,U+5466-5467,U+5469,U+546b-546e,U+5470-5471,U+5474-5477,U+547b,U+547f-5481,U+5483-5486,U+5488-548b,U+548d-5492,U+5495-5496,U+549c,U+549f-54a2,U+54a4,U+54a6-54af,U+54b1,U+54b7-54bc,U+54be-54bf,U+54c2-54c4,U+54c6-54c8,U+54ca,U+54cd-54ce,U+54d8,U+54e0,U+54e2,U+54e5-54e6,U+54e8-54ea,U+54ec-54ef,U+54f1,U+54f3,U+54f6,U+54fc-5501,U+5505,U+5508-5509,U+550c-550f,U+5514-5516,U+5527,U+552a-552b,U+552e,U+5532-5533,U+5535-5536,U+5538-5539,U+553b-553d,U+5540-5541,U+5544-5545,U+5547,U+5549-554a,U+554c-554d,U+5550-5551,U+5556-5558,U+555a-555e,U+5560-5561,U+5563-5564,U+5566,U+557b-5583,U+5586-5588,U+558a,U+558e-558f,U+5591-5594,U+5597,U+5599,U+559e-559f,U+55a3-55a4,U+55a8-55a9,U+55ac-55ae,U+55b2,U+55bf,U+55c1,U+55c3-55c4,U+55c6-55c7,U+55c9,U+55cb-55cc,U+55ce,U+55d1-55d4,U+55d7-55d8,U+55da-55db,U+55dd-55df,U+55e2,U+55e4,U+55e9,U+55ec,U+55ee,U+55f1,U+55f6-55f9,U+55fd-55ff,U+5605,U+5607-5608,U+560a,U+560d-5612}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.47.woff2) format("woff2");unicode-range:U+528d,U+5291-5298,U+529a,U+529c,U+52a4-52a7,U+52ab-52ad,U+52af-52b0,U+52b5-52b8,U+52ba-52be,U+52c0-52c1,U+52c4-52c6,U+52c8,U+52ca,U+52cc-52cd,U+52cf-52d2,U+52d4,U+52d6-52d7,U+52db-52dc,U+52de,U+52e0-52e1,U+52e3,U+52e5-52e6,U+52e8-52ea,U+52ec,U+52f0-52f1,U+52f3-52fb,U+5300-5301,U+5303,U+5306-5308,U+530a-530d,U+530f-5311,U+5313,U+5315,U+5318-531f,U+5321,U+5323-5325,U+5327-532d,U+532f-5333,U+5335,U+5338,U+533c-533e,U+5340,U+5342,U+5345-5346,U+5349,U+534b-534c,U+5359,U+535b,U+535e,U+5361,U+5363-5367,U+5369,U+536c-536e,U+5372,U+5377,U+5379-537b,U+537d-537f,U+5382-5383,U+5387-5389,U+538e,U+5393-5394,U+5396,U+5398-5399,U+539d,U+53a0-53a1,U+53a4-53a6,U+53a9-53ab,U+53ad-53b0,U+53b2,U+53b4-53b8,U+53ba,U+53bd,U+53c0-53c1,U+53c3-53c5,U+53cf,U+53d2-53d3,U+53d5,U+53da-53db,U+53dd-53e0,U+53e2,U+53e6-53e8,U+53ed-53ee,U+53f4-53f5,U+53fa,U+5401-5403,U+540b,U+540f,U+5412-5413,U+541a,U+541d-541e,U+5421,U+5424,U+5427-542a,U+542c-542f,U+5431,U+5433-5436,U+543c-543d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.48.woff2) format("woff2");unicode-range:U+50dd-50df,U+50e1-50e6,U+50e8-50e9,U+50ed-50f6,U+50f9-50fb,U+50fe,U+5101-5103,U+5106-5109,U+510b-510e,U+5110,U+5112,U+5114-511e,U+5121,U+5123,U+5127-5128,U+512c-512d,U+512f,U+5131,U+5133-5135,U+5137-513c,U+513f-5142,U+5147,U+514a,U+514c,U+514f,U+5152-5155,U+5157-5158,U+515f-5160,U+5162,U+5164,U+5166-5167,U+5169-516a,U+516e,U+5173-5174,U+5179,U+517b,U+517e,U+5180,U+5182-5184,U+5189,U+518b-518c,U+518e-5191,U+5193,U+5195-5196,U+5198,U+519d,U+51a1-51a4,U+51a6,U+51a9-51ab,U+51ad,U+51b0-51b3,U+51b5,U+51b8,U+51ba,U+51bc-51bf,U+51c2-51c3,U+51c5,U+51c8-51cb,U+51cf,U+51d1-51d6,U+51d8,U+51de-51e0,U+51e2,U+51e5,U+51e7,U+51e9,U+51ec-51ee,U+51f2-51f5,U+51f7,U+51fe,U+5201-5202,U+5204-5205,U+520b,U+520e,U+5212-5216,U+5218,U+5222,U+5226-5228,U+522a-522b,U+522e,U+5231-5233,U+5235,U+523c,U+5244-5245,U+5249,U+524b-524c,U+524f,U+5254-5255,U+5257-5258,U+525a,U+525c-5261,U+5266,U+5269,U+526c,U+526e,U+5271,U+5273-5274,U+5277-5279,U+527d,U+527f-5280,U+5282-5285,U+5288-528a,U+528c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.49.woff2) format("woff2");unicode-range:U+4f57-4f58,U+4f5a-4f5b,U+4f5d-4f5f,U+4f63-4f64,U+4f69-4f6a,U+4f6c,U+4f6e-4f71,U+4f76-4f7e,U+4f81-4f85,U+4f88-4f8a,U+4f8c,U+4f8e-4f90,U+4f92-4f94,U+4f96-4f9a,U+4f9e-4fa0,U+4fab,U+4fad,U+4faf,U+4fb2,U+4fb7,U+4fb9,U+4fbb-4fbe,U+4fc0-4fc1,U+4fc4-4fc6,U+4fc8-4fc9,U+4fcb-4fd4,U+4fd8,U+4fda-4fdc,U+4fdf-4fe0,U+4fe2,U+4fe4-4fe6,U+4fef-4ff2,U+4ff6,U+4ffc-5002,U+5004-5007,U+500a,U+500c,U+500e-5011,U+5013-5014,U+5016-5018,U+501a-501e,U+5021-5023,U+5025-502a,U+502c-502e,U+5030,U+5032-5033,U+5035,U+5039,U+503b,U+5040-5043,U+5045-5048,U+504a,U+504c,U+504e,U+5050-5053,U+5055-5057,U+5059-505a,U+505f-5060,U+5062-5063,U+5066-5067,U+506a,U+506c-506d,U+5070-5072,U+5077-5078,U+5080-5081,U+5083-5086,U+5088,U+508a,U+508e-5090,U+5092-5096,U+509a-509c,U+509e-50a3,U+50aa,U+50ad,U+50af-50b4,U+50b9-50bb,U+50bd,U+50c0,U+50c2-50c4,U+50c7,U+50c9-50ca,U+50cc,U+50ce,U+50d0-50d1,U+50d3-50d4,U+50d6,U+50d8-50d9,U+50dc}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.50.woff2) format("woff2");unicode-range:U+4093,U+4103,U+4105,U+4148,U+414f,U+4163,U+41b4,U+41bf,U+41e6,U+41ee,U+41f3,U+4207,U+420e,U+4264,U+4293,U+42c6,U+42d6,U+42dd,U+4302,U+432b,U+4343,U+43ee,U+43f0,U+4408,U+440c,U+4417,U+441c,U+4422,U+4453,U+445b,U+4476,U+447a,U+4491,U+44b3,U+44be,U+44d4,U+4508,U+450d,U+4525,U+4543,U+457a,U+459d,U+45b8,U+45be,U+45e5,U+45ea,U+460f-4610,U+4641,U+4665,U+46a1,U+46ae-46af,U+470c,U+471f,U+4764,U+47e6,U+47fd,U+4816,U+481e,U+4844,U+484e,U+48b5,U+49b0,U+49e7,U+49fa,U+4a04,U+4a29,U+4abc,U+4b38,U+4b3b,U+4b7e,U+4bc2,U+4bca,U+4bd2,U+4be8,U+4c17,U+4c20,U+4c38,U+4cc4,U+4cd1,U+4ce1,U+4d07,U+4d77,U+4e02,U+4e04-4e05,U+4e0c,U+4e0f-4e12,U+4e15,U+4e17,U+4e19,U+4e1e-4e1f,U+4e23-4e24,U+4e28-4e2c,U+4e2e-4e31,U+4e35-4e37,U+4e3f-4e42,U+4e44,U+4e47-4e48,U+4e4d-4e4e,U+4e51,U+4e55-4e56,U+4e58,U+4e5a-4e5c,U+4e62-4e63,U+4e68-4e69,U+4e74-4e75,U+4e79,U+4e7f,U+4e82,U+4e85,U+4e8a,U+4e8d-4e8e,U+4e96-4e99,U+4e9d-4ea0,U+4ea2,U+4ea5-4ea6,U+4ea8,U+4eaf-4eb0,U+4eb3,U+4eb6,U+4eb9,U+4ebb-4ebc,U+4ec2-4ec4,U+4ec6-4ec8,U+4ecd,U+4ed0,U+4ed7,U+4eda-4edb,U+4edd-4ee2,U+4ee8,U+4eeb,U+4eed,U+4eef,U+4ef1,U+4ef3,U+4ef5,U+4ef7,U+4efc-4f00,U+4f02-4f03,U+4f08-4f09,U+4f0b-4f0d,U+4f12,U+4f15-4f17,U+4f19,U+4f1c,U+4f2b,U+4f2e,U+4f30-4f31,U+4f33,U+4f35-4f37,U+4f39,U+4f3b,U+4f3e,U+4f40,U+4f42-4f43,U+4f48-4f49,U+4f4b-4f4c,U+4f52,U+4f54,U+4f56}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.51.woff2) format("woff2");unicode-range:U+3395-339b,U+339e-33a0,U+33a2-33ff,U+3402,U+3405-3406,U+3427,U+342c,U+342e,U+3468,U+346a,U+3488,U+3492,U+34b5,U+34bc,U+34c1,U+34c7,U+34db,U+351f,U+353e,U+355d-355e,U+3563,U+356e,U+35a6,U+35a8,U+35c5,U+35da,U+35de,U+35f4,U+3605,U+3614,U+364a,U+3691,U+3696,U+3699,U+36cf,U+3761-3762,U+376b-376c,U+3775,U+378d,U+37c1,U+37e2,U+37e8,U+37f4,U+37fd,U+3800,U+382f,U+3836,U+3840,U+385c,U+3861,U+38a1,U+38ad,U+38fa,U+3917,U+391a,U+396f,U+39a4,U+39b8,U+3a5c,U+3a6e,U+3a73,U+3a85,U+3ac4,U+3acb,U+3ad6-3ad7,U+3aea,U+3af3,U+3b0e,U+3b1a,U+3b1c,U+3b22,U+3b35,U+3b6d,U+3b77,U+3b87-3b88,U+3b8d,U+3ba4,U+3bb6,U+3bc3,U+3bcd,U+3bf0,U+3bf3,U+3c0f,U+3c26,U+3cc3,U+3cd2,U+3d11,U+3d1e,U+3d31,U+3d4e,U+3d64,U+3d9a,U+3dc0,U+3dcc,U+3dd4,U+3e05,U+3e3f-3e40,U+3e60,U+3e66,U+3e68,U+3e83,U+3e8a,U+3e94,U+3eda,U+3f57,U+3f72,U+3f75,U+3f77,U+3fae,U+3fb1,U+3fc9,U+3fd7,U+3fdc,U+4039,U+4058}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.52.woff2) format("woff2");unicode-range:U+32b5-332b,U+332d-3394}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.53.woff2) format("woff2");unicode-range:U+31c8-31e3,U+31f0-321e,U+3220-3230,U+3232-32b4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.54.woff2) format("woff2");unicode-range:U+3028-303f,U+3094-3096,U+309f-30a0,U+30ee,U+30f7-30fa,U+30ff,U+3105-312f,U+3131-3163,U+3165-318e,U+3190-31bb,U+31c0-31c7}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.55.woff2) format("woff2");unicode-range:U+2f14-2fd5,U+2ff0-2ffb,U+3004,U+3013,U+3016-301b,U+301e,U+3020-3027}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.56.woff2) format("woff2");unicode-range:U+25e4-25e6,U+2601-2603,U+2609,U+260e-260f,U+2616-2617,U+261c-261f,U+262f,U+2641,U+2660,U+2662-2664,U+2666-2668,U+266d-266e,U+2672-267d,U+26bd-26be,U+2702,U+271a,U+273d,U+2740,U+2756,U+2776-2793,U+27a1,U+2934-2935,U+29bf,U+29fa-29fb,U+2b05-2b07,U+2b1a,U+2b95,U+2e3a-2e3b,U+2e80-2e99,U+2e9b-2ef3,U+2f00-2f13}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.57.woff2) format("woff2");unicode-range:U+24d1-24ff,U+2503-2513,U+2515-2516,U+2518-251b,U+251d-2522,U+2524-259f,U+25a2-25ab,U+25b1,U+25b7,U+25c0-25c1,U+25c9-25ca,U+25cc,U+25d0-25d3,U+25e2-25e3}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.58.woff2) format("woff2");unicode-range:U+2105,U+2109-210a,U+210f,U+2116,U+2121,U+2126-2127,U+212b,U+212e,U+2135,U+213b,U+2194-2199,U+21b8-21b9,U+21c4-21c6,U+21cb-21cc,U+21d0,U+21e6-21e9,U+21f5,U+2202-2203,U+2205-2206,U+2208-220b,U+220f,U+2211,U+2213,U+2215,U+221a,U+221d,U+2220,U+2223,U+2225-2226,U+2228,U+222a-222e,U+2234-2237,U+223d,U+2243,U+2245,U+2248,U+224c,U+2260,U+2262,U+2264-2265,U+226e-226f,U+2272-2273,U+2276-2277,U+2283-2287,U+228a-228b,U+2295-2299,U+22a0,U+22a5,U+22bf,U+22da-22db,U+22ef,U+2305-2307,U+2318,U+2329-232a,U+23b0-23b1,U+23be-23cc,U+23ce,U+23da-23db,U+2423,U+2469-24d0}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.59.woff2) format("woff2");unicode-range:U+a1-a4,U+a6-a7,U+aa,U+ac-ad,U+b5-b6,U+b8-ba,U+bc-c8,U+ca-cc,U+ce-d5,U+d9-db,U+dd-df,U+e6,U+ee,U+f0,U+f5,U+f7,U+f9,U+fb,U+fe-102,U+110-113,U+11a-11b,U+128-12b,U+143-144,U+147-148,U+14c,U+14e-14f,U+152-153,U+168-16d,U+192,U+1a0-1a1,U+1af,U+1cd-1dc,U+1f8-1f9,U+251,U+261,U+2bb,U+2c7,U+2c9,U+2ea-2eb,U+304,U+307,U+30c,U+1e3e-1e3f,U+1ea0-1ebe,U+1ec0-1ec6,U+1ec8-1ef9,U+2011-2012,U+2016,U+2018-201a,U+201e,U+2021,U+2030,U+2033,U+2035,U+2042,U+2047,U+2051,U+2074,U+20a9,U+20ab-20ac,U+20dd-20de,U+2100}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.60.woff2) format("woff2");unicode-range:U+2227,U+26a0,U+2713,U+301f,U+4ff8,U+5239,U+526a,U+54fa,U+5740,U+5937,U+5993,U+59fb,U+5a3c,U+5c41,U+6028,U+626e,U+646f,U+647a,U+64b0,U+64e2,U+65a7,U+66fe,U+6727,U+6955,U+6bef,U+6f23,U+724c,U+767c,U+7a83,U+7ac4,U+7b67,U+8000,U+8471,U+8513,U+8599,U+86db,U+8718,U+87f2,U+88f3,U+8ad2,U+8e2a,U+8fa3,U+95a5,U+9798,U+9910,U+9957,U+9bab,U+9c3b,U+9daf,U+ff95}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.61.woff2) format("woff2");unicode-range:U+a8,U+2032,U+2261,U+2282,U+3090,U+30f1,U+339c,U+535c,U+53d9,U+56a2,U+56c1,U+5806,U+589f,U+59d0,U+5a7f,U+60e0,U+639f,U+65af,U+68fa,U+69ae,U+6d1b,U+6ef2,U+71fb,U+725d,U+7262,U+75bc,U+7768,U+7940,U+79bf,U+7bed,U+7d68,U+7dfb,U+814b,U+8207,U+83e9,U+8494,U+8526,U+8568,U+85ea,U+86d9,U+87ba,U+8861,U+887f,U+8fe6,U+9059,U+9061,U+916a,U+976d,U+97ad,U+9ece}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.62.woff2) format("woff2");unicode-range:U+2d9,U+21d4,U+301d,U+515c,U+52fe,U+5420,U+5750,U+5766,U+5954,U+5b95,U+5f8a,U+5f98,U+620c,U+621f,U+641c,U+66d9,U+676d,U+6775,U+67f5,U+694a,U+6a02,U+6a3a,U+6a80,U+6c23,U+6c72,U+6dcb,U+6faa,U+707c,U+71c8,U+7422,U+74e2,U+7791,U+7825,U+7a14,U+7a1c,U+7c95,U+7fc1,U+82a5,U+82db,U+8304,U+853d,U+8cd3,U+8de8,U+8f0c,U+8f3f,U+9091,U+91c7,U+929a,U+98af,U+9913}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.63.woff2) format("woff2");unicode-range:U+2ca-2cb,U+2229,U+2468,U+2669,U+266f,U+273f,U+4ec0,U+4f60,U+4fb6,U+5347,U+540e,U+543b,U+5b0c,U+5d4c,U+5f14,U+5f9e,U+6155,U+62d0,U+6602,U+6666,U+66f3,U+67a2,U+67ca,U+69cc,U+6d29,U+6d9b,U+6e3e,U+6f81,U+7109,U+73c0,U+73c2,U+7425,U+7435-7436,U+7525,U+7554,U+785d,U+786b,U+7ae3,U+7b94,U+7d18,U+81bf,U+8511,U+8549,U+9075,U+9640,U+98e2,U+9e9f,U+ff96}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.64.woff2) format("woff2");unicode-range:U+2467,U+4ece,U+4ed4,U+4f91,U+4fae,U+534d,U+53c9,U+54b3,U+586b,U+5944,U+5b78,U+5df7,U+5f77,U+6101,U+6167-6168,U+61a4,U+62d9,U+698a,U+699b,U+6a59,U+6cc4,U+6e07,U+7099,U+75d2,U+77ad,U+7953,U+7984,U+7a92,U+7baa,U+7dbb,U+817f,U+82ad,U+85e9,U+868a,U+8caa,U+8f44,U+9017,U+907c,U+908a,U+92f3,U+936e,U+9435,U+978d,U+9838,U+9a28,U+9b41,U+9ba8,U+9c57,U+9eb9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.65.woff2) format("woff2");unicode-range:U+b1,U+309b,U+4e5e,U+51f1,U+5506,U+55c5,U+58cc,U+59d1,U+5c51,U+5ef7,U+6284,U+62d7,U+6689,U+673d,U+6a2b,U+6a8e,U+6a9c,U+6d63,U+6dd1,U+70b8,U+7235,U+72db,U+72f8,U+7560,U+7c9b,U+7ce7,U+7e1e,U+80af,U+82eb,U+8463,U+8499,U+85dd,U+86ee,U+8a60,U+8a6e,U+8c79,U+8e87,U+8e8a,U+8f5f,U+9010,U+918d,U+9190,U+965b,U+97fb,U+9ab8,U+9bad,U+9d3b,U+9d5c,U+9dfa,U+9e93}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.66.woff2) format("woff2");unicode-range:U+2020,U+3003,U+3231,U+4e9b,U+4f3d,U+4f47,U+51b6,U+51dc,U+53e1,U+5bc5,U+602f,U+60bc,U+61c9,U+633d,U+637b,U+6492,U+65fa,U+660f,U+66f0,U+6703,U+681e,U+6876,U+6893,U+6912,U+698e,U+6c7d,U+714c,U+7169,U+71d5,U+725f,U+72d7,U+745b,U+74dc,U+75e2,U+7891,U+7897,U+7dcb,U+810a,U+8218,U+8339,U+840e,U+852d,U+8823,U+8a0a,U+9089,U+919c,U+971c,U+9ad9,U+ff4a,U+ff5a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.67.woff2) format("woff2");unicode-range:U+2466,U+2600,U+4eab,U+4fe3,U+4ff5,U+51a5,U+51f0,U+536f,U+53d4,U+53f1,U+54a5,U+559d,U+55e3,U+58fa,U+5962,U+59ea,U+5c16,U+5cef,U+5d16,U+5f10,U+5fd6,U+6190,U+6216,U+634f,U+63bb,U+66d6,U+6756,U+6bc5,U+6e26,U+727d,U+731f,U+76f2,U+7729,U+7a7f,U+7aff,U+7c9f,U+818f,U+8236,U+82b9,U+8338,U+85aa,U+88b4,U+8b33,U+904d,U+93a7,U+96cc,U+96eb,U+9aed,U+9b8e,U+fa11}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.68.woff2) format("woff2");unicode-range:U+251c,U+2523,U+4e14,U+545f,U+54bd,U+553e,U+55dc,U+56da,U+589c,U+5b55,U+5bb5,U+5ce1,U+5df4,U+5eb6,U+5ec9,U+6191,U+62f7,U+6357,U+64a5,U+6591,U+65bc,U+6897,U+6e1a,U+7063,U+711a,U+721b,U+722c,U+75b9,U+75d5,U+75fa,U+7766,U+7aae,U+7b48,U+7b8b,U+7d21,U+7e55,U+7f75,U+842c,U+8910,U+8a63,U+8b39,U+8b5a,U+8cdc,U+8d74,U+907d,U+91e7,U+9306,U+96bc,U+98f4,U+9ac4}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.69.woff2) format("woff2");unicode-range:U+2003,U+2312,U+266c,U+4f86,U+51ea,U+5243,U+5256,U+541f,U+5841,U+59dc,U+5df3,U+601c,U+60e7,U+632b,U+638c,U+64ad,U+6881,U+697c,U+69cd,U+6c50,U+6d2a,U+6fc1,U+7027,U+7058,U+70f9,U+714e,U+7345,U+751a,U+760d,U+764c,U+77db,U+7d79,U+7e8f,U+80ce,U+814e,U+81fc,U+8247,U+8278,U+85a9,U+8a03,U+90ed,U+9784,U+9801,U+984e,U+99b3,U+9bc9,U+9bdb,U+9be8,U+9e78,U+ff6b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.70.woff2) format("woff2");unicode-range:U+266b,U+3006,U+5176,U+5197,U+51a8,U+51c6,U+52f2,U+5614,U+5875,U+5a2f,U+5b54,U+5ce0,U+5dba,U+5deb,U+5e63,U+5f59,U+5fcc,U+6068,U+6367,U+68b6,U+6a0b,U+6b64,U+6e15,U+6eba,U+7272,U+72a0,U+7947,U+7985,U+79e6,U+79e9,U+7a3d,U+7a9f,U+7aaf,U+7b95,U+7f60,U+7f9e,U+7fe0,U+8098,U+80ba,U+8106,U+82d4,U+831c,U+87f9,U+8a1f,U+8acf,U+90c1,U+920d,U+9756,U+fe43,U+ff94}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.71.woff2) format("woff2");unicode-range:U+af,U+2465,U+2517,U+33a1,U+4f10,U+50c5,U+51b4,U+5384,U+5606,U+5bb0,U+5cac,U+5ee3,U+618e,U+61f2,U+62c9,U+66ab,U+66f9,U+6816,U+6960,U+6b3e,U+6f20,U+7078,U+72d0,U+73ed,U+7ad9,U+7b1b,U+7be4,U+7d62,U+7f51,U+80b4,U+80f4,U+8154,U+85fb,U+865c,U+8702,U+895f,U+8aed,U+8b90,U+8ced,U+8fbf,U+91d8,U+9418,U+9583,U+9591,U+9813,U+982c,U+9bd6,U+ff46,U+ff7f,U+ff88}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.72.woff2) format("woff2");unicode-range:U+4e91,U+508d,U+50e7,U+514e,U+51f6,U+5446,U+5504,U+584a,U+59a8,U+59d3,U+5a46,U+5ac9,U+6020,U+60a6,U+6148,U+621a,U+6234,U+64c1,U+6523,U+675c,U+67d1,U+6953,U+6ccc,U+6df5,U+6e13,U+6f06,U+723a,U+7325,U+74e6,U+758e,U+75ab,U+75d9,U+7a40,U+8096,U+82fa,U+8587,U+8594,U+8a6b,U+8ab9,U+8b17,U+8b83,U+937c,U+963b,U+9673,U+96db,U+9ce9,U+9f4b,U+ff67,U+ff82,U+ff93}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.73.woff2) format("woff2");unicode-range:U+221e,U+2514,U+51f9,U+5270,U+5449,U+5824,U+59a5,U+5a29,U+5d07,U+5e16,U+60e3,U+614c,U+6276,U+643e,U+64ab,U+6562,U+6681,U+670b,U+6734,U+67af,U+6a3d,U+6b05,U+6dc0,U+6e4a,U+7259,U+732a,U+7409,U+78a7,U+7a6b,U+8015,U+809b,U+817a,U+830e,U+837b,U+85ab,U+8a23,U+8a93,U+8b00,U+8b19,U+8b21,U+8cbf,U+8fb0,U+901d,U+91b8,U+9320,U+932c,U+9688,U+96f6,U+9df2,U+ff6a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.74.woff2) format("woff2");unicode-range:U+2002,U+2025,U+4f8d,U+51e1,U+51f8,U+5507,U+5598,U+58f1,U+5983,U+59ac,U+5c3c,U+5de7,U+5e7d,U+5eca,U+5f61,U+606d,U+60f9,U+636e,U+64ec,U+67da,U+67ff,U+6813,U+68f2,U+693f,U+6b6a,U+6bbb,U+6ef4,U+7092,U+717d,U+7261,U+73c8,U+7432,U+7483,U+76fe,U+7709,U+78d0,U+81a3,U+81b3,U+82af,U+8305,U+8309,U+8870,U+88fe,U+8cd1,U+8d66,U+906e,U+971e,U+9812,U+ff79,U+ff90}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.75.woff2) format("woff2");unicode-range:U+2464,U+2501,U+2640,U+2642,U+339d,U+4f0e,U+5091,U+50b5,U+5132,U+51cc,U+558b,U+55aa,U+585e,U+5bee,U+5dfe,U+60b6,U+62b9,U+6349,U+6566,U+6590,U+6842,U+689d,U+6a58,U+6c70,U+6ff1,U+7815,U+7881,U+7aaa,U+7bc7,U+7def,U+7fa8,U+8017,U+8036,U+8061,U+821f,U+8429,U+8ce0,U+8e74,U+9019,U+90ca,U+9162,U+932f,U+93ae,U+9644,U+990c,U+9cf3,U+ff56,U+ff6e,U+ff7e,U+ff85}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.76.woff2) format("woff2");unicode-range:U+2266-2267,U+4f2f,U+5208,U+5451,U+546a,U+5589,U+576a,U+5815,U+5a9a,U+5b9b,U+5c3a,U+5efb,U+5faa,U+6109,U+6643,U+6652,U+695a,U+69fd,U+6b86,U+6bb4,U+6daf,U+7089,U+70cf,U+7a00,U+7a4f,U+7b39,U+7d33,U+80e1,U+828b,U+82a6,U+86cd,U+8c8c,U+8cca,U+8df3,U+9077,U+9175,U+91dc,U+925b,U+9262,U+9271,U+92ed,U+9855,U+9905,U+9d28,U+ff3f,U+ff58,U+ff68,U+ff6d,U+ff9c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.77.woff2) format("woff2");unicode-range:U+2207,U+25ef,U+309c,U+4e4f,U+5146,U+51dd,U+5351,U+540a,U+5629,U+5eb5,U+5f04,U+5f13,U+60dc,U+6212,U+63b4,U+642c,U+6627,U+66a6,U+66c7,U+66fd,U+674e,U+6b96,U+6c4e,U+6df3,U+6e67,U+6f84,U+72fc,U+733f,U+7c97,U+7db1,U+7e4d,U+816b,U+82d1,U+84cb,U+854e,U+8607,U+86c7,U+871c,U+8776,U+8a89,U+8fc4,U+91a4,U+9285,U+9685,U+9903,U+9b31,U+9f13,U+ff42,U+ff74,U+ff91}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.78.woff2) format("woff2");unicode-range:U+4e32,U+51db,U+53a8,U+53ea,U+5609,U+5674,U+5a92,U+5e7e,U+6115,U+611a,U+62cc,U+62ed,U+63c9,U+64b9,U+64e6,U+65cb,U+6606,U+6731,U+683d,U+6afb,U+7460,U+771e,U+78ef,U+7b26,U+7b51,U+7cde,U+7d10,U+7d2f,U+7d46,U+80de,U+819c,U+84b2,U+85cd,U+865a,U+8ecc,U+9022,U+90b8,U+9192,U+9675,U+96b7,U+99ff,U+ff44,U+ff55,U+ff6c,U+ff73,U+ff75,U+ff86,U+ff8d,U+ff92,U+ffe3}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.79.woff2) format("woff2");unicode-range:U+25b3,U+30f5,U+4eae,U+4f46,U+4f51,U+5203,U+52ff,U+55a7,U+564c,U+565b,U+57f9,U+5805,U+5b64,U+5e06,U+5f70,U+5f90,U+60e8,U+6182,U+62f3,U+62fe,U+63aa,U+64a4,U+65d7,U+673a,U+6851,U+68cb,U+68df,U+6d1e,U+6e58,U+6e9d,U+77b3,U+7832,U+7c3f,U+7db4,U+7f70,U+80aa,U+80c6,U+8105,U+819d,U+8276,U+8679,U+8986,U+8c9d,U+8fc5,U+916c,U+9665,U+9699,U+96c0,U+9a19,U+ff8b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.80.woff2) format("woff2");unicode-range:U+2463,U+25a1,U+4ef0,U+5076,U+5098,U+51fd,U+5302,U+5448,U+54c9,U+570b,U+583a,U+5893,U+58a8,U+58ee,U+5949,U+5bdb,U+5f26,U+5f81,U+6052,U+6170,U+61c7,U+631f,U+635c,U+664b,U+69fb,U+6f01,U+7070,U+722a,U+745e,U+755c,U+76c6,U+78c1,U+79e4,U+7bb8,U+7d0b,U+81a8,U+82d7,U+8b5c,U+8f14,U+8fb1,U+8fbb,U+9283,U+9298,U+9a30,U+ff03,U+ff50,U+ff59,U+ff7b,U+ff8e-ff8f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.81.woff2) format("woff2");unicode-range:U+2010,U+2502,U+25b6,U+4f3a,U+514b,U+5265,U+52c3,U+5339,U+53ec,U+54c0,U+55b0,U+5854,U+5b8f,U+5cb3,U+5e84,U+60da,U+6247,U+6249,U+628a,U+62cd,U+65ac,U+6838,U+690e,U+6cf0,U+6f02,U+6f2c,U+6f70,U+708a,U+7434,U+75be,U+77ef,U+7c60,U+7c98,U+7d1b,U+7e2b,U+80a5,U+81e3,U+820c,U+8210,U+8475,U+862d,U+8650,U+8997,U+906d,U+91c8,U+9700,U+9727,U+9df9,U+ff3a,U+ff9a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.82.woff2) format("woff2");unicode-range:U+2103,U+5049,U+52b1,U+5320,U+5553,U+572d,U+58c7,U+5b5d,U+5bc2,U+5de3,U+5e61,U+5f80,U+61a9,U+67d0,U+67f4,U+6c88,U+6ca1,U+6ce5,U+6d78,U+6e9c,U+6f54,U+731b,U+73b2,U+74a7,U+74f6,U+75e9,U+7b20,U+7c8b,U+7f72,U+809d,U+8108,U+82b3,U+82bd,U+84b8,U+84c4,U+88c2,U+8ae6,U+8ef8,U+902e,U+9065,U+9326,U+935b,U+938c,U+9676,U+9694,U+96f7,U+9ed9,U+ff48,U+ff4c,U+ff81}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.83.woff2) format("woff2");unicode-range:U+2500,U+3008-3009,U+4ead,U+4f0f,U+4fca,U+53eb,U+543e,U+57a2,U+5cf0,U+5e8f,U+5fe0,U+61b2,U+62d8,U+6442,U+64b2,U+6589,U+659c,U+67f1,U+68c4,U+6cb8,U+6d12,U+6de1,U+6fe1,U+70c8,U+723d,U+73e0,U+7656,U+773a,U+7948,U+7b87,U+7c92,U+7d3a,U+7e1b,U+7e4a,U+819a,U+8358,U+83c5,U+84bc,U+864e,U+8912,U+8c9e,U+8d05,U+92fc,U+9396,U+98fd,U+99d2,U+ff64,U+ff7a,U+ff83}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.84.woff2) format("woff2");unicode-range:U+3014-3015,U+4e3c,U+5036,U+5075,U+533f,U+53e9,U+5531,U+5642,U+5984,U+59e6,U+5a01,U+5b6b,U+5c0b,U+5f25,U+6069,U+60a0,U+614e,U+62b5,U+62d2-62d3,U+6597,U+660c,U+674f,U+67cf,U+6841,U+6905,U+6cf3,U+6d32,U+6d69,U+6f64,U+716e,U+7761,U+7b52,U+7be0,U+7dbf,U+7de9,U+7f36,U+81d3,U+8302,U+8389,U+846c,U+84ee,U+8a69,U+9038,U+9d8f,U+ff47,U+ff4b,U+ff76,U+ff9b}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.85.woff2) format("woff2");unicode-range:U+25c7,U+3007,U+504f,U+507d,U+51a0,U+52a3,U+5410,U+5510,U+559a,U+5782,U+582a,U+5c0a,U+5c3f,U+5c48,U+5f6b,U+6176,U+622f,U+6279,U+62bd,U+62dd,U+65ed,U+67b6,U+6817,U+6850,U+6d6a,U+6deb,U+6ea2,U+6edd,U+6f5c,U+72e9,U+73a9,U+7573,U+76bf,U+7950,U+7956,U+7f8a,U+7ffc,U+80a2,U+80c3,U+83ca,U+8a02,U+8a13,U+8df5,U+9375,U+983b,U+99b4,U+ff4e,U+ff71,U+ff89,U+ff97}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.86.woff2) format("woff2");unicode-range:U+24,U+2022,U+2212,U+221f,U+2665,U+4ecf,U+5100,U+51cd,U+52d8,U+5378,U+53f6,U+574a,U+5982,U+5996,U+5c1a,U+5e1d,U+5f84,U+609f,U+61a7,U+61f8,U+6398,U+63ee,U+6676,U+6691,U+6eb6,U+7126,U+71e5,U+7687,U+7965,U+7d17,U+80a1,U+8107,U+8266,U+85a6,U+8987,U+8ca2,U+8cab,U+8e0a,U+9042,U+95c7,U+9810,U+9867,U+98fc,U+ff52-ff54,U+ff61,U+ff77,U+ff98-ff99}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.87.woff2) format("woff2");unicode-range:U+b0,U+226a,U+2462,U+4e39,U+4fc3,U+4fd7,U+50be,U+50da,U+5200,U+5211,U+54f2,U+5618,U+596a,U+5b22,U+5bb4,U+5d50,U+60a3,U+63fa,U+658e,U+65e8,U+6669,U+6795,U+679d,U+67a0,U+6b3a,U+6e09,U+757f,U+7cd6,U+7dbe,U+7ffb,U+83cc,U+83f1,U+840c,U+845b,U+8846,U+8972,U+8a34,U+8a50,U+8a87,U+8edf,U+8ff0,U+90a6,U+9154,U+95a3,U+9663,U+9686,U+96c7,U+ff3c,U+ff7c,U+ff8a}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.88.woff2) format("woff2");unicode-range:U+25bd,U+4e59,U+4ec1,U+4ff3,U+515a,U+518a,U+525b,U+5375,U+552f,U+57a3,U+5b9c,U+5c3d,U+5e3d,U+5e7b,U+5f0a,U+6094,U+6458,U+654f,U+67f3,U+6b8a,U+6bd2,U+6c37,U+6ce1,U+6e56,U+6e7f,U+6ed1,U+6ede,U+6f0f,U+70ad,U+7267,U+7363,U+786c,U+7a42,U+7db2,U+7f85,U+8178,U+829d,U+8896,U+8c5a,U+8cb0,U+8ce2,U+8ed2,U+9047,U+9177,U+970a,U+9ea6,U+ff1b,U+ff31,U+ff39,U+ff80}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.89.woff2) format("woff2");unicode-range:U+a5,U+4e80,U+4f34,U+4f73,U+4f75,U+511f,U+5192,U+52aa,U+53c8,U+570f,U+57cb,U+596e,U+5d8b,U+5f66,U+5fd9,U+62db,U+62f6,U+6328,U+633f,U+63a7,U+6469,U+6bbf,U+6c41,U+6c57,U+6d44,U+6dbc,U+706f,U+72c2,U+72ed,U+7551,U+75f4,U+7949,U+7e26,U+7fd4,U+8150,U+8af8,U+8b0e,U+8b72,U+8ca7,U+934b,U+9a0e,U+9a12,U+9b42,U+ff41,U+ff43,U+ff45,U+ff49,U+ff4f,U+ff62-ff63}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.90.woff2) format("woff2");unicode-range:U+4e18,U+4fb5,U+5104,U+52c7,U+5353,U+5374,U+53e5,U+587e,U+594f,U+5a20,U+5de1,U+5f18,U+5fcd,U+6291,U+62ab,U+6355,U+6392,U+63da,U+63e1,U+656c,U+6687,U+68b0-68b1,U+68d2,U+68da,U+6b27,U+6cbc,U+7159,U+7344,U+73cd,U+76df,U+790e,U+7cf8,U+8102,U+88c1,U+8aa0,U+8e0f,U+9178,U+92ad,U+9670,U+96c5,U+9cf4,U+9db4,U+ff3e,U+ff6f,U+ff72,U+ff78,U+ff7d,U+ff84,U+ff8c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.91.woff2) format("woff2");unicode-range:U+60,U+2200,U+226b,U+2461,U+517c,U+526f,U+5800,U+5b97,U+5bf8,U+5c01,U+5d29,U+5e4c,U+5e81,U+6065,U+61d0,U+667a,U+6696,U+6843,U+6c99,U+6d99,U+6ec5,U+6f22,U+6f6e,U+6fa4,U+6fef,U+71c3,U+72d9,U+7384,U+78e8,U+7a1a,U+7a32,U+7a3c,U+7adc,U+7ca7,U+7d2b,U+7dad,U+7e4b,U+80a9,U+8170,U+81ed,U+820e,U+8a17,U+8afe,U+90aa,U+914e,U+963f,U+99c4,U+9eba,U+9f3b,U+ff38}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.92.woff2) format("woff2");unicode-range:U+2460,U+4e5f,U+4e7e,U+4ed9,U+501f,U+502b,U+5968,U+5974,U+5ac1,U+5b99,U+5ba3,U+5be7,U+5be9,U+5c64,U+5cb8,U+5ec3,U+5f1f,U+616e,U+6297,U+62e0,U+62ec,U+6368,U+642d,U+65e6,U+6717,U+676f,U+6b04,U+732e,U+7652,U+76ca,U+76d7,U+7802,U+7e70,U+7f6a,U+8133,U+81e8,U+866b,U+878d,U+88f8,U+8a5e,U+8cdb,U+8d08,U+907a,U+90e1,U+96f2,U+9f8d,U+ff35,U+ff37,U+ff40,U+ff9d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.93.woff2) format("woff2");unicode-range:U+21d2,U+25ce,U+300a-300b,U+4e89,U+4e9c,U+4ea1,U+5263,U+53cc,U+5426,U+5869,U+5947,U+598a,U+5999,U+5e55,U+5e72,U+5e79,U+5fae,U+5fb9,U+602a,U+6163,U+624d,U+6749,U+6c5a,U+6cbf,U+6d45,U+6dfb,U+6e7e,U+708e,U+725b,U+7763,U+79c0,U+7bc4,U+7c89,U+7e01,U+7e2e,U+8010,U+8033,U+8c6a,U+8cc3,U+8f1d,U+8f9b,U+8fb2,U+907f,U+90f7,U+9707,U+9818,U+9b3c,U+ff0a,U+ff4d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.94.woff2) format("woff2");unicode-range:U+2015,U+2190,U+4e43,U+5019,U+5247,U+52e7,U+5438,U+54b2,U+55ab,U+57f7,U+5bd2,U+5e8a,U+5ef6,U+6016,U+60b2,U+6162,U+6319,U+6551,U+6607,U+66b4,U+675f,U+67d4,U+6b20,U+6b53,U+6ce3,U+719f,U+75b2,U+770b,U+7720,U+77ac,U+79d2,U+7af9,U+7d05,U+7dca,U+8056,U+80f8,U+81f3,U+8352,U+885d,U+8a70,U+8aa4,U+8cbc,U+900f,U+9084,U+91e3,U+9451,U+96c4,U+99c6,U+9ad4,U+ff70}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.95.woff2) format("woff2");unicode-range:U+2193,U+25b2,U+4e4b,U+516d,U+51c4,U+529f,U+52c9,U+5360,U+5442,U+5857,U+5915,U+59eb,U+5a9b,U+5c3b,U+6012,U+61b6,U+62b1,U+6311,U+6577,U+65e2,U+65ec,U+6613,U+6790,U+6cb9,U+7372,U+76ae,U+7d5e,U+7fcc,U+88ab,U+88d5,U+8caf,U+8ddd,U+8ecd,U+8f38,U+8f9e,U+8feb,U+9063,U+90f5,U+93e1,U+968a,U+968f,U+98fe,U+9ec4,U+ff1d,U+ff27,U+ff2a,U+ff36,U+ff3b,U+ff3d,U+ffe5}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.96.woff2) format("woff2");unicode-range:U+4e03,U+4f38,U+50b7,U+5264,U+5348,U+5371,U+585a,U+58ca,U+5951,U+59b9,U+59d4,U+5b98,U+5f8b,U+6388,U+64cd,U+65e7,U+6803,U+6b6f,U+6d66,U+6e0b,U+6ecb,U+6fc3,U+72ac,U+773c,U+77e2,U+7968,U+7a74,U+7dba,U+7dd1,U+7e3e,U+808c,U+811a,U+8179,U+8239,U+8584,U+8a0e,U+8a72,U+8b66,U+8c46,U+8f29,U+90a3,U+9234,U+96f0,U+9769,U+9774,U+9aa8,U+ff26,U+ff28,U+ff9e-ff9f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.97.woff2) format("woff2");unicode-range:U+7e,U+b4,U+25c6,U+2661,U+4e92,U+4eee,U+4ffa,U+5144,U+5237,U+5287,U+52b4,U+58c1,U+5bff,U+5c04,U+5c06,U+5e95,U+5f31,U+5f93,U+63c3,U+640d,U+6557,U+6614,U+662f,U+67d3,U+690d,U+6bba,U+6e6f,U+72af,U+732b,U+7518,U+7ae0,U+7ae5,U+7af6,U+822a,U+89e6,U+8a3a,U+8a98,U+8cb8,U+8de1,U+8e8d,U+95d8,U+961c,U+96a3,U+96ea,U+9bae,U+ff20,U+ff22,U+ff29,U+ff2b-ff2c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.98.woff2) format("woff2");unicode-range:U+25cb,U+4e71,U+4f59,U+50d5,U+520a,U+5217,U+5230,U+523a-523b,U+541b,U+5439,U+5747,U+59c9,U+5bdf,U+5c31,U+5de8,U+5e7c,U+5f69,U+6050,U+60d1,U+63cf,U+663c,U+67c4,U+6885,U+6c38,U+6d6e,U+6db2,U+6df7,U+6e2c,U+6f5f,U+7532,U+76e3-76e4,U+7701,U+793c,U+79f0,U+7a93,U+7d00,U+7de0,U+7e54,U+8328,U+8840,U+969c,U+96e8,U+9811,U+9aea,U+9b5a,U+ff24,U+ff2e,U+ff57}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.99.woff2) format("woff2");unicode-range:U+2191,U+505c,U+52e4,U+5305,U+535a,U+56e0,U+59bb,U+5acc,U+5b09,U+5b87,U+5c90,U+5df1,U+5e2d,U+5e33,U+5f3e,U+6298,U+6383,U+653b,U+6697,U+6804,U+6a39,U+6cca,U+6e90,U+6f2b,U+702c,U+7206,U+7236,U+7559,U+7565,U+7591,U+75c7,U+75db,U+7b4b,U+7bb1,U+7d99,U+7fbd,U+8131,U+885b,U+8b1d,U+8ff7,U+9003,U+9045,U+96a0,U+9732,U+990a,U+99d0,U+9e97,U+9f62,U+ff25,U+ff2d}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.100.woff2) format("woff2");unicode-range:U+4e08,U+4f9d,U+5012,U+514d,U+51b7,U+5275,U+53ca,U+53f8,U+5584,U+57fc,U+5b9d,U+5bfa,U+5c3e,U+5f01,U+5fb4,U+5fd7,U+606f,U+62e1,U+6563,U+6674,U+6cb3,U+6d3e,U+6d74,U+6e1b,U+6e2f,U+718a,U+7247,U+79d8,U+7d14,U+7d66,U+7d71,U+7df4,U+7e41,U+80cc,U+8155,U+83d3,U+8a95,U+8ab2,U+8ad6,U+8ca1,U+9000,U+9006,U+9678,U+97d3,U+9808,U+98ef,U+9a5a,U+9b45,U+ff23,U+ff30}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.101.woff2) format("woff2");unicode-range:U+25bc,U+3012,U+4ef2,U+4f0a,U+516b,U+5373,U+539a,U+53b3,U+559c,U+56f0,U+5727,U+5742,U+5965,U+59ff,U+5bc6,U+5dfb,U+5e45,U+5ead,U+5fb3,U+6211,U+6253,U+639b,U+63a8,U+6545,U+6575,U+6628,U+672d,U+68a8,U+6bdb,U+6d25,U+707d,U+767e,U+7834,U+7b46,U+7bc9,U+8074,U+82e6,U+8349,U+8a2a,U+8d70,U+8da3,U+8fce,U+91cc,U+967d,U+97ff,U+9996,U+ff1c,U+ff2f,U+ff32,U+ff34}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.102.woff2) format("woff2");unicode-range:U+3d,U+5e,U+25cf,U+4e0e,U+4e5d,U+4e73,U+4e94,U+4f3c,U+5009,U+5145,U+51ac,U+5238,U+524a,U+53f3,U+547c,U+5802,U+5922,U+5a66,U+5c0e,U+5de6,U+5fd8,U+5feb,U+6797,U+685c,U+6b7b,U+6c5f-6c60,U+6cc9,U+6ce2,U+6d17,U+6e21,U+7167,U+7642,U+76db,U+8001,U+821e,U+8857,U+89d2,U+8b1b,U+8b70,U+8cb4,U+8cde,U+8f03,U+8f2a,U+968e,U+9b54,U+9e7f,U+9ebb,U+ff05,U+ff33}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.103.woff2) format("woff2");unicode-range:U+500d,U+5074,U+50cd,U+5175,U+52e2,U+5352,U+5354,U+53f2,U+5409,U+56fa,U+5a18,U+5b88,U+5bdd,U+5ca9,U+5f92,U+5fa9,U+60a9,U+623f,U+6483,U+653f,U+666f,U+66ae,U+66f2,U+6a21,U+6b66,U+6bcd,U+6d5c,U+796d,U+7a4d,U+7aef,U+7b56,U+7b97,U+7c4d,U+7e04,U+7fa9,U+8377,U+83dc,U+83ef,U+8535,U+8863,U+88cf,U+88dc,U+8907,U+8acb,U+90ce,U+91dd,U+ff0b,U+ff0d,U+ff19,U+ff65}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.104.woff2) format("woff2");unicode-range:U+4e01,U+4e21,U+4e38,U+52a9,U+547d,U+592e,U+5931,U+5b63,U+5c40,U+5dde,U+5e78,U+5efa,U+5fa1,U+604b,U+6075,U+62c5,U+632f,U+6a19,U+6c0f,U+6c11,U+6c96,U+6e05,U+70ba,U+71b1,U+7387,U+7403,U+75c5,U+77ed,U+795d,U+7b54,U+7cbe,U+7d19,U+7fa4,U+8089,U+81f4,U+8208,U+8336,U+8457,U+8a33,U+8c4a,U+8ca0,U+8ca8,U+8cc0,U+9014,U+964d,U+9803,U+983c,U+98db,U+ff17,U+ff21}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.105.woff2) format("woff2");unicode-range:U+25,U+25a0,U+4e26,U+4f4e,U+5341,U+56f2,U+5bbf,U+5c45,U+5c55,U+5c5e,U+5dee,U+5e9c,U+5f7c,U+6255,U+627f,U+62bc,U+65cf,U+661f,U+666e,U+66dc,U+67fb,U+6975,U+6a4b,U+6b32,U+6df1,U+6e29,U+6fc0,U+738b,U+7686,U+7a76,U+7a81,U+7c73,U+7d75,U+7dd2,U+82e5,U+82f1,U+85ac,U+888b,U+899a,U+8a31,U+8a8c,U+8ab0,U+8b58,U+904a,U+9060,U+9280,U+95b2,U+984d,U+9ce5,U+ff18}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.106.woff2) format("woff2");unicode-range:U+30f6,U+50ac,U+5178,U+51e6,U+5224,U+52dd,U+5883,U+5897,U+590f,U+5a5a,U+5bb3,U+5c65,U+5e03,U+5e2b,U+5e30,U+5eb7,U+6271,U+63f4,U+64ae,U+6574,U+672b,U+679a,U+6a29-6a2a,U+6ca2,U+6cc1,U+6d0b,U+713c,U+74b0,U+7981,U+7a0b,U+7bc0,U+7d1a,U+7d61,U+7fd2,U+822c,U+8996,U+89aa,U+8cac,U+8cbb,U+8d77,U+8def,U+9020,U+9152,U+9244,U+9662,U+967a,U+96e3,U+9759,U+ff16}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.107.woff2) format("woff2");unicode-range:U+23,U+3c,U+2192,U+4e45,U+4efb,U+4f50,U+4f8b,U+4fc2,U+5024,U+5150,U+5272,U+5370,U+53bb,U+542b,U+56db,U+56e3,U+57ce,U+5bc4,U+5bcc,U+5f71,U+60aa,U+6238,U+6280,U+629c,U+6539,U+66ff,U+670d,U+677e-677f,U+6839,U+69cb,U+6b4c,U+6bb5,U+6e96,U+6f14,U+72ec,U+7389,U+7814,U+79cb,U+79d1,U+79fb,U+7a0e,U+7d0d,U+85e4,U+8d64,U+9632,U+96e2,U+9805,U+99ac,U+ff1e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.108.woff2) format("woff2");unicode-range:U+2605-2606,U+301c,U+4e57,U+4fee,U+5065,U+52df,U+533b,U+5357,U+57df,U+58eb,U+58f0,U+591c,U+592a-592b,U+5948,U+5b85,U+5d0e,U+5ea7,U+5ff5,U+6025,U+63a1,U+63a5,U+63db,U+643a,U+65bd,U+671d,U+68ee,U+6982,U+6b73,U+6bd4,U+6d88,U+7570,U+7b11,U+7d76,U+8077,U+8217,U+8c37,U+8c61,U+8cc7,U+8d85,U+901f,U+962a,U+9802,U+9806,U+9854,U+98f2,U+9928,U+99c5,U+9ed2}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.109.woff2) format("woff2");unicode-range:U+266a,U+4f11,U+533a,U+5343,U+534a,U+53cd,U+5404,U+56f3,U+5b57-5b58,U+5bae,U+5c4a,U+5e0c,U+5e2f,U+5eab,U+5f35,U+5f79,U+614b,U+6226,U+629e,U+65c5,U+6625,U+6751,U+6821,U+6b69,U+6b8b,U+6bce,U+6c42,U+706b,U+7c21,U+7cfb,U+805e,U+80b2,U+82b8,U+843d,U+8853,U+88c5,U+8a3c,U+8a66,U+8d8a,U+8fba,U+9069,U+91cf,U+9752,U+975e,U+9999,U+ff0f-ff10,U+ff14-ff15}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.110.woff2) format("woff2");unicode-range:U+40,U+4e86,U+4e95,U+4f01,U+4f1d,U+4fbf,U+5099,U+5171,U+5177,U+53cb,U+53ce,U+53f0,U+5668,U+5712,U+5ba4,U+5ca1,U+5f85,U+60f3,U+653e,U+65ad,U+65e9,U+6620,U+6750,U+6761,U+6b62,U+6b74,U+6e08,U+6e80,U+7248,U+7531,U+7533,U+753a,U+77f3,U+798f,U+7f6e,U+8449,U+88fd,U+89b3,U+8a55,U+8ac7,U+8b77,U+8db3,U+8efd,U+8fd4,U+9031-9032,U+9580,U+9589,U+96d1,U+985e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.111.woff2) format("woff2");unicode-range:U+2b,U+d7,U+300e-300f,U+4e07,U+4e8c,U+512a,U+5149,U+518d,U+5236,U+52b9,U+52d9,U+5468,U+578b,U+57fa,U+5b8c,U+5ba2,U+5c02,U+5de5,U+5f37,U+5f62,U+623b,U+63d0,U+652f,U+672a,U+6848,U+6d41,U+7136,U+7537,U+754c,U+76f4,U+79c1,U+7ba1,U+7d44,U+7d4c,U+7dcf,U+7dda,U+7de8,U+82b1,U+897f,U+8ca9,U+8cfc,U+904e,U+9664,U+982d,U+9858,U+98a8,U+9a13,U+ff13,U+ff5c}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.112.woff2) format("woff2");unicode-range:U+4e16,U+4e3b,U+4ea4,U+4ee4,U+4f4d,U+4f4f,U+4f55,U+4f9b,U+5317,U+5358,U+53c2,U+53e4,U+548c,U+571f,U+59cb,U+5cf6,U+5e38,U+63a2,U+63b2,U+6559,U+662d,U+679c,U+6c7a,U+72b6,U+7523,U+767d,U+770c,U+7a2e,U+7a3f,U+7a7a,U+7b2c,U+7b49,U+7d20,U+7d42,U+8003,U+8272,U+8a08,U+8aac,U+8cb7,U+8eab,U+8ee2,U+9054-9055,U+90fd,U+914d,U+91cd,U+969b,U+97f3,U+984c,U+ff06}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.113.woff2) format("woff2");unicode-range:U+26,U+5f,U+2026,U+203b,U+4e09,U+4eac,U+4ed5,U+4fa1,U+5143,U+5199,U+5207,U+539f,U+53e3,U+53f7,U+5411,U+5473,U+5546,U+55b6,U+5929,U+597d,U+5bb9,U+5c11,U+5c4b,U+5ddd,U+5f97,U+5fc5,U+6295,U+6301,U+6307,U+671b,U+76f8,U+78ba,U+795e,U+7d30,U+7d39,U+7d9a,U+89e3,U+8a00,U+8a73,U+8a8d,U+8a9e,U+8aad,U+8abf,U+8cea,U+8eca,U+8ffd,U+904b,U+9650,U+ff11-ff12}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.114.woff2) format("woff2");unicode-range:U+3e,U+3005,U+4e0d,U+4e88,U+4ecb,U+4ee3,U+4ef6,U+4fdd,U+4fe1,U+500b,U+50cf,U+5186,U+5316,U+53d7,U+540c,U+544a,U+54e1,U+5728,U+58f2,U+5973,U+5b89,U+5c71,U+5e02,U+5e97,U+5f15,U+5fc3,U+5fdc,U+601d,U+611b,U+611f,U+671f,U+6728,U+6765,U+683c,U+6b21,U+6ce8,U+6d3b,U+6d77,U+7530,U+7740,U+7acb,U+7d50,U+826f,U+8f09,U+8fbc,U+9001,U+9053,U+91ce,U+9762,U+98df}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.115.woff2) format("woff2");unicode-range:U+7c,U+3080,U+4ee5,U+5148,U+516c,U+521d,U+5225,U+529b,U+52a0,U+53ef,U+56de,U+56fd,U+5909,U+591a,U+5b66,U+5b9f,U+5bb6,U+5bfe,U+5e73,U+5e83,U+5ea6,U+5f53,U+6027,U+610f,U+6210,U+6240,U+660e,U+66f4,U+66f8,U+6709,U+6771,U+697d,U+69d8,U+6a5f,U+6c34,U+6cbb,U+73fe,U+756a,U+7684,U+771f,U+793a,U+7f8e,U+898f,U+8a2d,U+8a71,U+8fd1,U+9078,U+9577,U+96fb,U+ff5e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.116.woff2) format("woff2");unicode-range:U+a9,U+3010-3011,U+30e2,U+4e0b,U+4eca,U+4ed6,U+4ed8,U+4f53,U+4f5c,U+4f7f,U+53d6,U+540d,U+54c1,U+5730,U+5916,U+5b50,U+5c0f,U+5f8c,U+624b,U+6570,U+6587,U+6599,U+691c,U+696d,U+6cd5,U+7269,U+7279,U+7406,U+767a-767b,U+77e5,U+7d04,U+7d22,U+8005,U+80fd,U+81ea,U+8868,U+8981,U+89a7,U+901a,U+9023,U+90e8,U+91d1,U+9332,U+958b,U+96c6,U+9ad8,U+ff1a,U+ff1f}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.117.woff2) format("woff2");unicode-range:U+4e,U+a0,U+3000,U+300c-300d,U+4e00,U+4e0a,U+4e2d,U+4e8b,U+4eba,U+4f1a,U+5165,U+5168,U+5185,U+51fa,U+5206,U+5229,U+524d,U+52d5,U+5408,U+554f,U+5831,U+5834,U+5927,U+5b9a,U+5e74,U+5f0f,U+60c5,U+65b0,U+65b9,U+6642,U+6700,U+672c,U+682a,U+6b63,U+6c17,U+7121,U+751f,U+7528,U+753b,U+76ee,U+793e,U+884c,U+898b,U+8a18,U+9593,U+95a2,U+ff01,U+ff08-ff09}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.118.woff2) format("woff2");unicode-range:U+21-22,U+27-2a,U+2c-3b,U+3f,U+41-4d,U+4f-5d,U+61-7b,U+7d,U+ab,U+ae,U+b2-b3,U+b7,U+bb,U+c9,U+cd,U+d6,U+d8,U+dc,U+e0-e5,U+e7-ed,U+ef,U+f1-f4,U+f6,U+f8,U+fa,U+fc-fd,U+103,U+14d,U+1b0,U+300-301,U+1ebf,U+1ec7,U+2013-2014,U+201c-201d,U+2039-203a,U+203c,U+2048-2049,U+2113,U+2122,U+65e5,U+6708,U+70b9}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6YnQCWXzO7W5-p9wTrkzI9ywX1Ff4zgPYcAW70.119.woff2) format("woff2");unicode-range:U+20,U+2027,U+3001-3002,U+3041-307f,U+3081-308f,U+3091-3093,U+3099-309a,U+309d-309e,U+30a1-30e1,U+30e3-30ed,U+30ef-30f0,U+30f2-30f4,U+30fb-30fe,U+ff0c,U+ff0e}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6omwqRfTHxT624.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Kiwi Maru;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6okQqRfTHxT624.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/kiwimaru/v19/R70YjykGkuuDep-hRg6onwqRfTHxTw.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sniglet/v17/cIf9MaFLtkE3UjaJ9CChYUsEkIpdQQ.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,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-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/sniglet/v17/cIf9MaFLtkE3UjaJ9C6hYUsEkIo.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:cloudflare-color{background: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='none' fill-rule='evenodd'%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' fill='%23F38020'/%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' fill='%23FCAD32'/%3E%3C/g%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.i-lobe-icons\:deepseek-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %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' fill='%234D6BFE'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:microsoft-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cpath d='M11.49 2H2v9.492h9.492V2h-.002z' fill='%23F25022'/%3E%3Cpath d='M22 2h-9.492v9.492H22V2z' fill='%237FBA00'/%3E%3Cpath d='M11.49 12.508H2V22h9.492v-9.492h-.002z' fill='%2300A4EF'/%3E%3Cpath d='M22 12.508h-9.492V22H22v-9.492z' fill='%23FFB900'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.i-lobe-icons\:mistral-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cpath d='M3.428 3.4h3.429v3.428H3.428V3.4zm13.714 0h3.43v3.428h-3.43V3.4z' fill='gold'/%3E%3Cpath d='M3.428 6.828h6.857v3.429H3.429V6.828zm10.286 0h6.857v3.429h-6.857V6.828z' fill='%23FFAF00'/%3E%3Cpath d='M3.428 10.258h17.144v3.428H3.428v-3.428z' fill='%23FF8205'/%3E%3Cpath d='M3.428 13.686h3.429v3.428H3.428v-3.428zm6.858 0h3.429v3.428h-3.429v-3.428zm6.856 0h3.43v3.428h-3.43v-3.428z' fill='%23FA500F'/%3E%3Cpath d='M0 17.114h10.286v3.429H0v-3.429zm13.714 0H24v3.429H13.714v-3.429z' fill='%23E10500'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:novita-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cpath clip-rule='evenodd' d='M9.167 4.17v5.665L0 19.003h9.167v-5.666l5.666 5.666H24L9.167 4.17z' fill='%2323D57C' fill-rule='evenodd'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:together-color{--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' fill='%230F6FFF' r='4.615'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lobe-icons\:vllm-color{background:url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='1em' height='1em' %3E%3Cpath d='M0 4.973h9.324V23L0 4.973z' fill='%23FDB515'/%3E%3Cpath d='M13.986 4.351L22.378 0l-6.216 23H9.324l4.662-18.649z' fill='%2330A2FF'/%3E%3C/svg%3E") no-repeat;background-size:100% 100%;background-color:transparent;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:blocks,[i-lucide\:blocks=""]{--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%3Crect width='7' height='7' x='14' y='3' rx='1'/%3E%3Cpath d='M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:book{--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='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:book-copy{--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='M2 16V4a2 2 0 0 1 2-2h11'/%3E%3Cpath d='M22 18H11a2 2 0 1 0 0 4h10.5a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5H11a2 2 0 0 0-2 2v12m-4-6H4a2 2 0 1 0 0 4h1'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:brain,[i-lucide\:brain=""]{--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 5a3 3 0 1 0-5.997.125a4 4 0 0 0-2.526 5.77a4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z'/%3E%3Cpath d='M12 5a3 3 0 1 1 5.997.125a4 4 0 0 1 2.526 5.77a4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z'/%3E%3Cpath d='M15 13a4.5 4.5 0 0 1-3-4a4.5 4.5 0 0 1-3 4m8.599-6.5a3 3 0 0 0 .399-1.375m-11.995 0A3 3 0 0 0 6.401 6.5m-2.924 4.396a4 4 0 0 1 .585-.396m15.876 0a4 4 0 0 1 .585.396M6 18a4 4 0 0 1-1.967-.516m15.934 0A4 4 0 0 1 18 18'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:check,[i-lucide\:check=""]{--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='M20 6L9 17l-5-5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:cog,[i-lucide\:cog=""]{--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 20a8 8 0 1 0 0-16a8 8 0 0 0 0 16'/%3E%3Cpath d='M12 14a2 2 0 1 0 0-4a2 2 0 0 0 0 4m0-12v2m0 18v-2m5 .66l-1-1.73m-5-8.66L7 3.34M20.66 17l-1.73-1M3.34 7l1.73 1M14 12h8M2 12h2m16.66-5l-1.73 1M3.34 17l1.73-1M17 3.34l-1 1.73m-5 8.66l-4 6.93'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:ear{--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='M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0'/%3E%3Cpath d='M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:eye{--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='M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:id-card,[i-lucide\:id-card=""]{--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='M16 10h2m-2 4h2M6.17 15a3 3 0 0 1 5.66 0'/%3E%3Ccircle cx='9' cy='11' r='2'/%3E%3Crect width='20' height='14' x='2' y='5' rx='2'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:loader-circle{--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='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2m7 9v3'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:paintbrush,[i-lucide\:paintbrush=""]{--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='m14.622 17.897l-10.68-2.913M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0zM9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:person-standing,[i-lucide\:person-standing=""]{--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%3Ccircle cx='12' cy='5' r='1'/%3E%3Cpath d='m9 20l3-6l3 6M6 8l6 2l6-2m-6 2v4'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:sprout{--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='M7 20h10m-7 0c5.5-2.5.8-6.4 3-10'/%3E%3Cpath d='M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7c-2 .4-3.5.4-4.8-.3c-1.2-.6-2.3-1.9-3-4.2c2.8-.5 4.4 0 5.5.8M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4c1-1 1.6-2.3 1.7-4.6c-2.7.1-4 1-4.9 2'/%3E%3C/g%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-lucide\:volume-2,[i-lucide\:volume-2=""]{--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='M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298zM16 9a5 5 0 0 1 0 6m3.364 3.364a9 9 0 0 0 0-12.728'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:alt-arrow-down-bold-duotone,[i-solar\:alt-arrow-down-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.303 12.404l3.327 3.431c.213.22.527.22.74 0l6.43-6.63C19.201 8.79 18.958 8 18.43 8h-5.723z'/%3E%3Cpath fill='currentColor' d='M11.293 8H5.57c-.528 0-.771.79-.37 1.205l2.406 2.481z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:bug-bold-duotone,[i-solar\:bug-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='M19 11.938V15a7 7 0 0 1-6.25 6.96V15a.75.75 0 0 0-1.5 0v6.96A7 7 0 0 1 5 15v-3.062A3.94 3.94 0 0 1 8.938 8h6.124A3.94 3.94 0 0 1 19 11.938' clip-rule='evenodd' opacity='.5'/%3E%3Cpath fill='currentColor' d='M19 14.75v-1.5h3a.75.75 0 0 1 0 1.5zm-1.504 4.586c.31-.393.58-.82.801-1.276l2.538 1.27a.75.75 0 1 1-.67 1.34zM5.703 18.06q.333.684.801 1.276l-2.669 1.335a.75.75 0 0 1-.67-1.342zM5 13.25H2a.75.75 0 0 0 0 1.5h3zm12.354-4.515l2.81-1.406a.75.75 0 1 1 .671 1.341L18.42 9.88a4 4 0 0 0-1.065-1.144M6.647 8.735c-.427.306-.79.695-1.067 1.144L3.165 8.67a.75.75 0 0 1 .67-1.341zM16.5 8.27V7.5a4.5 4.5 0 1 0-9 0v.77A3.9 3.9 0 0 1 8.938 8h6.124c.508 0 .993.096 1.438.27'/%3E%3Cpath fill='currentColor' d='M6.376 1.584a.75.75 0 0 0 .208 1.04l2.36 1.573a4.5 4.5 0 0 1 1.387-.877L7.416 1.376a.75.75 0 0 0-1.04.208m8.68 2.613a4.5 4.5 0 0 0-1.387-.877l2.915-1.944a.75.75 0 1 1 .832 1.248z' opacity='.5'/%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M12 14.25a.75.75 0 0 1 .75.75v7h-1.5v-7a.75.75 0 0 1 .75-.75' clip-rule='evenodd'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:magic-stick-3-bold-duotone,[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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:microphone-2-bold-duotone,[i-solar\:microphone-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='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' d='M9.75 7.75A.75.75 0 0 0 9 7H6.298a5.751 5.751 0 0 1 11.404 0H13.5a.75.75 0 0 0 0 1.5h4.25V10H13.5a.75.75 0 0 0 0 1.5h4.201a5.751 5.751 0 0 1-11.403 0H9A.75.75 0 0 0 9 10H6.25V8.5H9a.75.75 0 0 0 .75-.75' opacity='.5'/%3E%3Cpath fill='currentColor' d='M12.75 10.75c0 .414.336.75.75.75h4.201l.049-1.5H13.5a.75.75 0 0 0-.75.75m0-3c0 .414.336.75.75.75h4.25L17.701 7H13.5a.75.75 0 0 0-.75.75m-3 0A.75.75 0 0 0 9 7H6.298L6.25 8.5H9a.75.75 0 0 0 .75-.75m0 3A.75.75 0 0 0 9 10H6.25l.048 1.5H9a.75.75 0 0 0 .75-.75'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:moon-stars-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.9 2.307a.483.483 0 0 0-.9 0l-.43 1.095a.48.48 0 0 1-.272.274l-1.091.432a.486.486 0 0 0 0 .903l1.091.432a.48.48 0 0 1 .272.273L19 6.81c.162.41.74.41.9 0l.43-1.095a.48.48 0 0 1 .273-.273l1.091-.432a.486.486 0 0 0 0-.903l-1.091-.432a.48.48 0 0 1-.273-.274zM16.033 8.13a.483.483 0 0 0-.9 0l-.157.399a.48.48 0 0 1-.272.273l-.398.158a.486.486 0 0 0 0 .903l.398.157c.125.05.223.148.272.274l.157.399c.161.41.739.41.9 0l.157-.4a.48.48 0 0 1 .272-.273l.398-.157a.486.486 0 0 0 0-.903l-.398-.158a.48.48 0 0 1-.272-.273z'/%3E%3Cpath fill='currentColor' d='M12 22c5.523 0 10-4.477 10-10c0-.463-.694-.54-.933-.143a6.5 6.5 0 1 1-8.924-8.924C12.54 2.693 12.463 2 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:star-fall-2-bold-duotone,[i-solar\:star-fall-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='M11.58 4.776c.695-1.77 1.043-2.656 1.769-2.765c.726-.11 1.35.63 2.6 2.109l.323.382c.355.42.532.63.774.75c.24.12.518.137 1.074.17l.506.029c1.955.114 2.932.172 3.271.81c.34.64-.184 1.438-1.231 3.033l-.271.413c-.298.453-.447.68-.487.939s.033.52.179 1.043l.133.477c.513 1.842.77 2.762.253 3.266c-.517.505-1.465.258-3.361-.235l-.49-.127c-.54-.14-.809-.21-1.075-.17s-.499.185-.964.476l-.424.265c-1.638 1.024-2.456 1.536-3.115 1.208c-.659-.327-.72-1.277-.845-3.177l-.033-.492c-.035-.54-.053-.81-.177-1.044s-.34-.406-.774-.75l-.395-.312C7.294 9.865 6.53 9.26 6.64 8.554s1.02-1.047 2.839-1.729l.47-.176c.518-.194.776-.29.965-.475c.19-.185.288-.437.486-.94z'/%3E%3Cpath fill='currentColor' d='M5.31 9.593C2.873 11.92 1.275 15.806 2.331 22c.943-2.603 3.526-4.76 6.581-6.047c-.106-.593-.154-1.317-.204-2.08l-.039-.595a22 22 0 0 0-.032-.43l-.086-.071l-.268-.215l-.475-.376c-.694-.55-1.34-1.06-1.783-1.532c-.253-.269-.536-.624-.715-1.061m5.037 5.83l-.015-.114l.056.101z' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-solar\:sun-fog-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.25 22a.75.75 0 0 1 .75-.75h8a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75M12 1.25a.75.75 0 0 1 .75.75v1a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75M1.25 12a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5H2a.75.75 0 0 1-.75-.75m19 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75M6.083 15.25H2a.75.75 0 0 0 0 1.5h20a.75.75 0 0 0 0-1.5z' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M4.25 19a.75.75 0 0 1 .75-.75h14a.75.75 0 0 1 0 1.5H5a.75.75 0 0 1-.75-.75m.148-14.602a.75.75 0 0 1 1.061 0l.393.393a.75.75 0 0 1-1.06 1.06l-.394-.392a.75.75 0 0 1 0-1.06m15.202 0a.75.75 0 0 1 0 1.06l-.392.393a.75.75 0 0 1-1.06-1.06l.392-.393a.75.75 0 0 1 1.06 0M5.25 12c0 1.178.302 2.286.833 3.25h11.834A6.75 6.75 0 1 0 5.25 12' opacity='.5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.i-svg-spinners\:bouncing-ball,[i-svg-spinners\:bouncing-ball=""]{--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%3Cellipse cx='12' cy='5' fill='currentColor' rx='4' ry='4'%3E%3Canimate id='svgSpinnersBouncingBall0' fill='freeze' attributeName='cy' begin='0;svgSpinnersBouncingBall2.end' calcMode='spline' dur='0.375s' keySplines='.33,0,.66,.33' values='5;20'/%3E%3Canimate attributeName='rx' begin='svgSpinnersBouncingBall0.end' calcMode='spline' dur='0.05s' keySplines='.33,0,.66,.33;.33,.66,.66,1' values='4;4.8;4'/%3E%3Canimate attributeName='ry' begin='svgSpinnersBouncingBall0.end' calcMode='spline' dur='0.05s' keySplines='.33,0,.66,.33;.33,.66,.66,1' values='4;3;4'/%3E%3Canimate id='svgSpinnersBouncingBall1' attributeName='cy' begin='svgSpinnersBouncingBall0.end' calcMode='spline' dur='0.025s' keySplines='.33,0,.66,.33' values='20;20.5'/%3E%3Canimate id='svgSpinnersBouncingBall2' attributeName='cy' begin='svgSpinnersBouncingBall1.end' calcMode='spline' dur='0.4s' keySplines='.33,.66,.66,1' values='20.5;5'/%3E%3C/ellipse%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;width:1.2em;height:1.2em}.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") no-repeat;background-size:100% 100%;background-color:transparent;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);text-decoration:underline;font-weight:500}.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 *)){margin:1em 0;padding-left:1em;font-style:italic;border-left:.25em solid var(--un-prose-borders)}.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-size:.875em;font-weight:600;font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.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 *)){padding:1.25rem 1.5rem;overflow-x:auto;border-radius:.375rem}.prose :where(pre,code):not(:where(.not-prose,.not-prose *)){white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;hyphens:none;background:transparent}.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,.prose :where(ul>li):not(:where(.not-prose,.not-prose *))::marker,.prose :where(summary):not(:where(.not-prose,.not-prose *))::marker{color:var(--un-prose-lists)}.prose :where(hr):not(:where(.not-prose,.not-prose *)){margin:2em 0;border:1px solid var(--un-prose-hr)}.prose :where(table):not(:where(.not-prose,.not-prose *)){display:block;margin:1em 0;border-collapse:collapse;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;padding:.25rem .5rem;font-size:.875em;border-radius:.25rem}.prose :where(details):not(:where(.not-prose,.not-prose *)){margin:1em 0;padding:1.25rem 1.5rem;background:var(--un-prose-bg-soft)}.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%}@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{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none,[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~=absolute]:before{position:absolute}.after\:absolute:after{position:absolute}[after~=absolute]:after{position:absolute}.inset-0,[inset-0=""]{top:0;right:0;bottom:0;left:0}[before~=inset-0]:before{top:0;right:0;bottom:0;left:0}[after~=inset-0]:after{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-0,[bottom-0=""]{bottom:0}.bottom-11,[bottom-11=""]{bottom:2.75rem}.left-0,[left-0=""]{left:0}.left-1\/2,[left~="1/2"]{left:50%}.left-2{left:.5rem}.right-0,[right-0=""]{right:0}.top-0,[top-0=""],[top~="0"]{top:0}.top-1\/2,[top~="50%"]{top:50%}.top-2{top:.5rem}[bottom~="-10"]{bottom:-2.5rem}[bottom~="20%"]{bottom:20%}[bottom~="3"]{bottom:.75rem}[right~="-50%"]{right:-50%}[right~="3"]{right:.75rem}.after\:left-\[2px\]:after{left:2px}.after\:top-\[2px\]:after{top:2px}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2}.line-clamp-3,[line-clamp-3=""]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3}.z--1,[z--1=""]{z-index:-1}.z--2{z-index:-2}.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-2,[z-2=""]{z-index:2}.z-30,[z-30=""]{z-index:30}.z-50{z-index:50}[z~="20"]{z-index:20}[before~=z-0]:before{z-index:0}[after~=z--2]:after{z-index:-2}.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}.cols-\[20px_1fr_60px\],[grid~="cols-[20px_1fr_60px]"]{grid-template-columns:20px 1fr 60px}.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))}.cols-2,[grid~=cols-2]{grid-template-columns:repeat(2,minmax(0,1fr))}.m-0{margin:0}.m-1,[m-1=""]{margin:.25rem}.m-auto{margin:auto}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto,[mx-auto=""]{margin-left:auto;margin-right:auto}.mx2,[mx2=""]{margin-left:.5rem;margin-right:.5rem}.my{margin-top:1rem;margin-bottom:1rem}.my-0,[my-0=""]{margin-top:0;margin-bottom:0}.my-auto,[my-auto=""]{margin-top:auto;margin-bottom:auto}.-mb-px{margin-bottom:-1px}.mb-1,[mb-1=""]{margin-bottom:.25rem}.mb-2,.mb2,[mb-2=""],[mb2=""]{margin-bottom:.5rem}.mb-3,[mb-3=""]{margin-bottom:.75rem}.mb-4,[mb-4=""]{margin-bottom:1rem}.mb-6,[mb-6=""]{margin-bottom:1.5rem}.ml{margin-left:1rem}.ml-0\.5,[ml-0\.5=""]{margin-left:.125rem}.ml-auto{margin-left:auto}.mr{margin-right:1rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.ms,[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-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}.hidden,[hidden=""]{display:none}.size-16,[size-16=""]{width:4rem;height:4rem}.size-24,[size-24=""],[size~="24"]{width:6rem;height:6rem}.size-3,[size-3=""]{width:.75rem;height:.75rem}.size-5{width:1.25rem;height:1.25rem}.size-6,[size-6=""],[size~="6"]{width:1.5rem;height:1.5rem}.h-10{height:2.5rem}.h-100dvh,[h-100dvh=""],[h~="100dvh"]{height:100dvh}.h-12{height:3rem}.h-16{height:4rem}.h-1lh{height:1lh}.h-24,[h-24=""]{height:6rem}.h-48,[h-48=""]{height:12rem}.h-6{height:1.5rem}.h-7,[h-7=""]{height:1.75rem}.h-8,[h-8=""]{height:2rem}.h-fit,[h-fit=""]{height:fit-content}.h-full,[h-full=""]{height:100%}.h1{height:.25rem}.h2{height:.5rem}.h3{height:.75rem}.max-h-\[10lh\],[max-h~="[10lh]"]{max-height:10lh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[calc\(100dvh-7lh\)\]{max-height:calc(100dvh - 7lh)}.max-h-60,[max-h-60=""]{max-height:15rem}.max-h-none,[max-h-none=""]{max-height:none}.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-h~="[1lh]"]{min-height:1lh}.min-h-16,[min-h-16=""]{min-height:4rem}.min-h-40px,[min-h-40px=""]{min-height:40px}.min-w-\[200px\]{min-width:200px}.min-w-0,[min-w-0=""]{min-width:0}.min-w-20,[min-w-20=""]{min-width:5rem}.min-w-50,[min-w-50=""]{min-width:12.5rem}.w-\[92vw\]{width:92vw}.w-1\/2,[w~="50%"]{width:50%}.w-100,[w-100=""]{width:25rem}.w-100vw,[w-100vw=""]{width:100vw}.w-11{width:2.75rem}.w-2{width:.5rem}.w-25\%{width:25%}.w-8,[w-8=""]{width:2rem}.w-fit,[w-fit=""]{width:fit-content}.w-full,[w-full=""],[w~=full]{width:100%}[h~="[14px]"]{height:14px}[h~="80vh"]{height:80vh}[h~=unset]{height:unset}[max-h~="[300px]"]{max-height:300px}[max-h~="[85vh]"]{max-height:85vh}[max-h~="100"]{max-height:25rem}[max-h~="30vh"]{max-height:30vh}[max-w~="500px"]{max-width:500px}[min-h~="[100px]"]{min-height:100px}[min-h~="100"]{min-height:25rem}[min-w~="1/2"],[min-w~="50%"]{min-width:50%}[min-w~="30%"]{min-width:30%}[min-w~="3em"]{min-width:3em}[min-w~="50vw"]{min-width:50vw}[min-w~="6"]{min-width:1.5rem}[w~="[1px]"]{width:1px}[w~="100dvw"]{width:100dvw}[w~="12.5"]{width:3.125rem}.before\:w-50\%:before{width:50%}[before~=h-full]:before{height:100%}[before~="w-25%"]:before{width:25%}[hover~="before:w-50%"]:hover:before{width:50%}.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~="~"]{display:inline-flex}.flex-1,[flex-1=""],[flex~="1"]{flex:1 1 0%}.flex-shrink-0,.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-wrap,[flex-wrap=""]{flex-wrap:wrap}[perspective~="800"]{-webkit-perspective:800px;perspective:800px}.-translate-x-1\/2,.translate-x--1\/2,.translate-x-\[-50\%\],[transform~="translate-x--1/2"]{--un-translate-x:-50%;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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%]"]{--un-translate-y:-50%;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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-10,[translate-x-10=""]{--un-translate-x:2.5rem;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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\%,.translate-y-\[-100\%\],[transform~="translate-y--100%"],[transform~="translate-y-[-100%]"]{--un-translate-y:-100%;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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-10,[translate-y-10=""]{--un-translate-y:2.5rem;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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-150{--un-scale-x:1.5;--un-scale-y:1.5;transform:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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:translate(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)) rotate(var(--un-rotate-z)) skew(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{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin{animation:spin 1s linear infinite}.disabled\:cursor-default:disabled{cursor:default}.cursor-pointer,[cursor-pointer=""],[cursor~=pointer]{cursor:pointer}.cursor-not-allowed{cursor:not-allowed}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}[cursor~="disabled:not-allowed"]:disabled{cursor:not-allowed}.cursor-ew-resize,[cursor-ew-resize=""]{cursor:ew-resize}.select-none,[select-none=""]{-webkit-user-select:none;user-select:none}.resize-none,[resize-none=""]{resize:none}.appearance-none,[appearance-none=""]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.place-self-end{place-self:end}.items-start,[items-start=""]{align-items:flex-start}.items-end,[items-end=""]{align-items:flex-end}.items-center,[items-center=""]{align-items:center}.justify-end,[justify-end=""]{justify-content:flex-end}.justify-center,[justify-center=""]{justify-content:center}.justify-between,[justify-between=""]{justify-content:space-between}.gap-0\.5,[gap-0\.5=""]{gap:.125rem}.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:1.25rem}.gap-6,[flex~=gap-6]{gap:1.5rem}.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]),[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-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-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))}[divide~=y]>:not([hidden])~:not([hidden]){--un-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--un-divide-y-reverse)));border-bottom-width:calc(1px * var(--un-divide-y-reverse))}[divide~="gray/25"]>:not([hidden])~:not([hidden]){border-color:#9ca3af40}.border-dashed,[border~=dashed],[divide~=dashed]>:not([hidden])~:not([hidden]){border-style:dashed}.of-clip,[of-clip=""]{overflow:clip}.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-scroll,[overflow-y-scroll=""]{overflow-y:scroll}.scroll-smooth,[scroll-smooth=""]{scroll-behavior:smooth}.truncate,[truncate=""]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line,[whitespace-pre-line=""]{white-space:pre-line}.break-words{overflow-wrap:break-word}.b,.border,[border~="~"],[border~="1"]{border-width:1px}.b-2,.border-2,[b-2=""],[border~="2"],[border~="2px"]{border-width:2px}[border~="4"]{border-width:4px}.border-b{border-bottom-width:1px}.border-b-2,[border~=b-2]{border-bottom-width:2px}[border~=l-2]{border-left-width:2px}[border~=r-2]{border-right-width:2px}[border~=t-2]{border-top-width:2px}.\[\&\:checked\+div\]\:border-primary-500:checked+div,.border-primary-500{--un-border-opacity:1;border-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 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-200,.dark [border~="dark: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-primary-100,[border~=primary-100]{border-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 0)) 80%,oklch(100% 0 360))}.border-primary-200,[border~="data-[state=checked]:primary-200"][data-state=checked]{--un-border-opacity:1;border-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}.border-red-200{--un-border-opacity:1;border-color:rgb(254 202 202 / var(--un-border-opacity))}.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"]{--un-border-opacity:1;border-color:rgb(64 64 64 / var(--un-border-opacity))}.dark .dark\:border-neutral-800\/25,.dark [border~="dark:neutral-800/25"]{border-color:#26262640}.dark .dark\:border-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(--theme-colors-chroma-600) calc(var(--theme-colors-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(--theme-colors-chroma-800) calc(var(--theme-colors-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(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}.dark .dark\:border-red-800{--un-border-opacity:1;border-color:rgb(153 27 27 / var(--un-border-opacity))}.dark [border~="dark:cyan-500/50"]{border-color:#06b6d480}.dark [border~="dark:cyan-800"]{--un-border-opacity:1;border-color:rgb(21 94 117 / var(--un-border-opacity))}.dark [border~="dark:neutral-700/30"]{border-color:#4040404d}.dark [border~="dark:neutral-800"],[border~=neutral-800]{--un-border-opacity:1;border-color:rgb(38 38 38 / var(--un-border-opacity))}.dark [border~="dark:primary-400/20"]{border-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2)}.dark [border~="dark:primary-500/50"]{border-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .5)}.dark [border~="dark:violet-500/50"]{border-color:#8b5cf680}.dark [border~="dark:zinc-800"]{--un-border-opacity:1;border-color:rgb(39 39 42 / var(--un-border-opacity))}[border~=cyan-200]{--un-border-opacity:1;border-color:rgb(165 243 252 / var(--un-border-opacity))}[border~="cyan-200/50"]{border-color:#a5f3fc80}[border~="gray/25"]{border-color:#9ca3af40}[border~="neutral-200/50"]{border-color:#e5e5e580}[border~="primary-200/50"]{border-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / .5)}[border~=primary-300]{--un-border-opacity:1;border-color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}[border~="violet-200/50"]{border-color:#ddd6fe80}[border~=zinc-300]{--un-border-opacity:1;border-color:rgb(212 212 216 / var(--un-border-opacity))}.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,.dark [border~="dark:hover:primary-400/30"]:hover{border-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .3)}.dark [border~="dark:hover:primary-700"]:hover{--un-border-opacity:1;border-color:oklch(49% var(--theme-colors-chroma-700) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}.hover\:border-primary-500\/30:hover{border-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .3)}[border~="hover:primary-300"]:hover{--un-border-opacity:1;border-color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-border-opacity))}[border~="hover:primary-500/30"]:hover{border-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .5)}.dark [border~="dark:focus:zinc-600"]:focus{--un-border-opacity:1;border-color:rgb(82 82 91 / var(--un-border-opacity))}[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{border-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 0)) 80%,oklch(100% 0 360))}[border~="focus:zinc-400"]:focus{--un-border-opacity:1;border-color:rgb(161 161 170 / var(--un-border-opacity))}.rounded,[rounded=""]{border-radius:.25rem}.rounded-2xl,[rounded-2xl=""]{border-radius:1rem}.rounded-full,[rounded-full=""]{border-radius:9999px}.rounded-lg,[border~=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}.after\:rounded-full:after{border-radius:9999px}.rounded-l-lg,[rounded-l-lg=""]{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-r-lg,[rounded-r-lg=""]{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-t-xl,[rounded-t-xl=""]{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border-none,[border-none=""]{border-style:none}[border~=solid]{border-style:solid}.bg-amber-50{--un-bg-opacity:1;background-color:rgb(255 251 235 / var(--un-bg-opacity))}.bg-amber-50\/80{background-color:#fffbebcc}.bg-black\/50{background-color:#00000080}.bg-neutral-100,[bg~=neutral-100]{--un-bg-opacity:1;background-color:rgb(245 245 245 / var(--un-bg-opacity))}.bg-neutral-200,[bg~=neutral-200]{--un-bg-opacity:1;background-color:rgb(229 229 229 / var(--un-bg-opacity))}.bg-neutral-400,[bg~=neutral-400]{--un-bg-opacity:1;background-color:rgb(163 163 163 / var(--un-bg-opacity))}.bg-neutral-400\/80{background-color:#a3a3a3cc}.bg-neutral-50,[bg~=neutral-50]{--un-bg-opacity:1;background-color:rgb(250 250 250 / var(--un-bg-opacity))}.bg-neutral-500,.dark [bg~="dark:neutral-500"]{--un-bg-opacity:1;background-color:rgb(115 115 115 / var(--un-bg-opacity))}.bg-neutral-500\/80{background-color:#737373cc}.bg-primary-100,.bg-primary-100\/80,[bg-primary-100=""],[bg~=primary-100]{background-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 0)) 80%,oklch(100% 0 360))}.bg-primary-200,[bg-primary-200=""]{--un-bg-opacity:1;background-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-300,[bg-primary-300=""]{--un-bg-opacity:1;background-color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-50,[bg-primary-50=""],[bg~=primary-50]{background-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-50) calc(var(--theme-colors-hue) + 0)) 30%,oklch(100% 0 360))}.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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-500\/20,[bg~="primary-500/20"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2)}.bg-primary-600,[bg-primary-600=""]{--un-bg-opacity:1;background-color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-700,[bg-primary-700=""]{--un-bg-opacity:1;background-color:oklch(49% var(--theme-colors-chroma-700) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-800,[bg-primary-800=""]{--un-bg-opacity:1;background-color:oklch(42% var(--theme-colors-chroma-800) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-900,.dark .dark\:bg-primary-900,[bg-primary-900=""]{--un-bg-opacity:1;background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.bg-primary-950,.dark .dark\:bg-primary-950,.dark [bg~="dark:primary-950"],[bg-primary-950=""]{--un-bg-opacity:1;background-color:oklch(29% var(--theme-colors-chroma-950) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.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-transparent,.dark [bg~="dark:transparent"],[bg-transparent=""],[bg~=transparent]{background-color:transparent}.bg-white,[bg-white=""],[bg~=white]{--un-bg-opacity:1;background-color:rgb(255 255 255 / var(--un-bg-opacity))}.bg-white\/80{background-color:#fffc}.bg-zinc-100,[bg-zinc-100=""],[bg~=zinc-100]{--un-bg-opacity:1;background-color:rgb(244 244 245 / var(--un-bg-opacity))}.bg-zinc-200,.dark .dark\:bg-zinc-200{--un-bg-opacity:1;background-color:rgb(228 228 231 / var(--un-bg-opacity))}.bg-zinc-300,[bg-zinc-300=""]{--un-bg-opacity:1;background-color:rgb(212 212 216 / var(--un-bg-opacity))}.dark .dark\:bg-amber-900\/20{background-color:#78350f33}.dark .dark\:bg-amber-900\/30{background-color:#78350f4d}.dark .dark\:bg-black\/40{background-color:#0006}.dark .dark\:bg-neutral-600{--un-bg-opacity:1;background-color:rgb(82 82 82 / var(--un-bg-opacity))}.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-800,.dark [bg~="dark:data-[state=unchecked]:neutral-800"][data-state=unchecked],.dark [bg~="dark:neutral-800"]{--un-bg-opacity:1;background-color:rgb(38 38 38 / var(--un-bg-opacity))}.dark .dark\:bg-neutral-800\/50,.dark [bg~="dark:neutral-800/50"]{background-color:#26262680}.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-primary-900\/20{background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / .2)}.dark .dark\:bg-primary-900\/30{background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / .3)}.dark .dark\:bg-primary-900\/40,.dark [bg~="dark:primary-900/40"]{background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / .4)}.dark .dark\:bg-primary-900\/80{background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / .8)}.dark .dark\:bg-red-400{--un-bg-opacity:1;background-color:rgb(248 113 113 / var(--un-bg-opacity))}.dark .dark\:bg-red-900\/20{background-color:#7f1d1d33}.dark .dark\:bg-zinc-700,.dark [bg~="dark:zinc-700"]{--un-bg-opacity:1;background-color:rgb(63 63 70 / var(--un-bg-opacity))}.dark .dark\:bg-zinc-800,.dark [bg~="dark:zinc-800"]{--un-bg-opacity:1;background-color:rgb(39 39 42 / var(--un-bg-opacity))}.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/20"]{background-color:#0003}.dark [bg~="dark:black/30"]{background-color:#0000004d}.dark [bg~="dark:complementary-800"]{--un-bg-opacity:1;background-color:oklch(42% var(--theme-colors-chroma-800) calc(var(--theme-colors-hue) + 180) / var(--un-bg-opacity))}.dark [bg~="dark:cyan-900"]{--un-bg-opacity:1;background-color:rgb(22 78 99 / 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-300"],[bg~="data-[state=unchecked]:neutral-300"][data-state=unchecked]{--un-bg-opacity:1;background-color:rgb(212 212 212 / var(--un-bg-opacity))}.dark [bg~="dark:neutral-900/50"]{background-color:#17171780}.dark [bg~="dark:orange-900/20"]{background-color:#7c2d1233}.dark [bg~="dark:primary-400/20"]{background-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2)}.dark [bg~="dark:zinc-400"]{--un-bg-opacity:1;background-color:rgb(161 161 170 / var(--un-bg-opacity))}.dark [bg~="dark:zinc-800/50"]{background-color:#27272a80}.dark [bg~="data-[state=checked]:dark:primary-400/80"][data-state=checked]{background-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .8)}[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~=complementary-100]{background-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 180)) 80%,oklch(100% 0 360))}[bg~=green-500]{--un-bg-opacity:1;background-color:rgb(34 197 94 / var(--un-bg-opacity))}[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~="primary-500/10"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1)}[bg~="primary-500/30"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .3)}[bg~="primary-500/40"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .4)}[bg~="primary-500/5"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .05)}[bg~="primary-500/50"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .5)}[bg~="primary-500/60"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .6)}[bg~="primary-500/70"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .7)}[bg~="primary-500/80"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .8)}[bg~="primary-500/90"]{background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .9)}[bg~="white/60"]{background-color:#fff9}[bg~="zinc-100/70"]{background-color:#f4f4f5b3}[bg~="zinc-200/20"]{background-color:#e4e4e733}.dark [dark\:bg-zinc-700~="default:"]:default{--un-bg-opacity:1;background-color:rgb(63 63 70 / var(--un-bg-opacity))}.dark [dark\:bg-zinc-700~="checked:"]:checked{--un-bg-opacity:1;background-color:rgb(63 63 70 / var(--un-bg-opacity))}.dark .\[\&_div_span\]\:dark\:hover\:bg-cyan-300:hover div span{--un-bg-opacity:1;background-color:rgb(103 232 249 / var(--un-bg-opacity))}.dark .\[\&_div_span\]\:dark\:hover\:bg-cyan-900:hover div span{--un-bg-opacity:1;background-color:rgb(22 78 99 / var(--un-bg-opacity))}.dark .dark\:hover\:bg-neutral-500:hover{--un-bg-opacity:1;background-color:rgb(115 115 115 / var(--un-bg-opacity))}.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-500:hover{--un-bg-opacity:1;background-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.dark .dark\:hover\:bg-red-500:hover{--un-bg-opacity:1;background-color:rgb(239 68 68 / var(--un-bg-opacity))}.dark [bg~="dark:hover:black/40"]:hover{background-color:#0006}.dark [bg~="dark:hover:complementary-700"]:hover{--un-bg-opacity:1;background-color:oklch(49% var(--theme-colors-chroma-700) calc(var(--theme-colors-hue) + 180) / var(--un-bg-opacity))}.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:primary-900"]:hover{--un-bg-opacity:1;background-color:oklch(37% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.dark [dark\:hover\:bg-cyan-300=""]:hover{--un-bg-opacity:1;background-color:rgb(103 232 249 / var(--un-bg-opacity))}.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}.dark [hover~="dark:bg-zinc-700"]:hover{--un-bg-opacity:1;background-color:rgb(63 63 70 / var(--un-bg-opacity))}.hover\:bg-neutral-100:hover{--un-bg-opacity:1;background-color:rgb(245 245 245 / 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-primary-600:hover{--un-bg-opacity:1;background-color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-bg-opacity))}.hover\:bg-red-600:hover{--un-bg-opacity:1;background-color:rgb(220 38 38 / var(--un-bg-opacity))}[bg~="hover:complementary-200"]:hover{--un-bg-opacity:1;background-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 180) / 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:primary-100"]:hover{background-color:color-mix(in srgb,oklch(95% var(--theme-colors-chroma-100) calc(var(--theme-colors-hue) + 0)) 80%,oklch(100% 0 360))}[bg~="hover:white/80"]:hover{background-color:#fffc}[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}[hover~=bg-zinc-200]:hover{--un-bg-opacity:1;background-color:rgb(228 228 231 / var(--un-bg-opacity))}.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))}.dark [bg~="dark:active:neutral-700"]:active{--un-bg-opacity:1;background-color:rgb(64 64 64 / var(--un-bg-opacity))}[bg~="active:neutral-300"]:active{--un-bg-opacity:1;background-color:rgb(212 212 212 / 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-primary-400\/0{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) 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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-from-opacity, 1)) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.from-primary-500\/20{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to)}.before\:from-primary-500\/20:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.via-primary-500\/10{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.before\:via-primary-500\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark .before\:dark\:via-primary-400\/10:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark [hover~="before:dark:via-primary-400/10"]:hover:before{--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to)}.dark .dark\:to-primary-400\/0{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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-primary-400{--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.before\:to-transparent:before{--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.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(--theme-colors-chroma-400) calc(var(--theme-colors-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(--theme-colors-chroma) calc(var(--theme-colors-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-r{--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient))}.before\:bg-gradient-to-r: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))}[before~=bg-gradient-to-r]: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))}[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))}.p-1,[p-1=""]{padding:.25rem}.p-1\.5,[p-1\.5=""]{padding:.375rem}.p-2,.p2,[p-2=""],[p~="2"],[p2=""]{padding:.5rem}.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-10,[px-10=""]{padding-left:2.5rem;padding-right:2.5rem}.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"]{padding-top:1rem;padding-bottom:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1,.py1,[py-1=""],[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}.py-6,[py-6=""]{padding-top:1.5rem;padding-bottom:1.5rem}[px~="12"]{padding-left:3rem;padding-right:3rem}.pb-2,[pb-2=""]{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl{padding-left:1rem}.pl-10{padding-left:2.5rem}.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-4,[pr-4=""]{padding-right:1rem}.pt,.pt-4,[pt-4=""]{padding-top:1rem}.pt-2,[pt-2=""]{padding-top:.5rem}.text-center,[text-center=""],[text~=center]{text-align:center}.text-left,[text-left=""]{text-align:left}.text-right,[text-right=""]{text-align:right}.text-wrap,[text-wrap=""]{text-wrap:wrap}.text-nowrap,[text-nowrap=""]{text-wrap:nowrap}.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=""]{font-size:.75rem;line-height:1rem}[text~="40"]{font-size:10rem}[text~="60"]{font-size:15rem}.dark .dark\:text-amber-400{--un-text-opacity:1;color:rgb(251 191 36 / var(--un-text-opacity))}.dark .dark\:text-neutral-100,[text~=neutral-100]{--un-text-opacity:1;color:rgb(245 245 245 / 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,.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-primary-300,.dark [text~="dark:primary-300"],.text-primary-300,[text~=primary-300]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-primary-300\/80{color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / .8)}.dark .dark\:text-primary-400,.dark [text~="dark:primary-400"],.text-primary-400{--un-text-opacity:1;color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-primary-500,.text-primary-500{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .dark\:text-red-400{--un-text-opacity:1;color:rgb(248 113 113 / var(--un-text-opacity))}.dark .dark\:text-white,.dark [dark\:text-white=""],.dark [text~="dark:white"],.text-white,[text-white=""],[text~=white]{--un-text-opacity:1;color:rgb(255 255 255 / var(--un-text-opacity))}.dark .dark\:text-white\/50{color:#ffffff80}.dark .dark\:text-zinc-400,.dark [text~="dark:zinc-400"],[text~=zinc-400]{--un-text-opacity:1;color:rgb(161 161 170 / 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-500/20"]{color:#73737333}.dark [text~="dark:neutral-600/50"]{color:#52525280}.dark [text~="dark:neutral-900"],.text-neutral-900{--un-text-opacity:1;color:rgb(23 23 23 / var(--un-text-opacity))}.dark [text~="dark:orange-500"]{--un-text-opacity:1;color:rgb(249 115 22 / var(--un-text-opacity))}.dark [text~="dark:primary-300/50"]{color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / .5)}.dark [text~="dark:primary-600/90"]{color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / .9)}.dark [text~="dark:violet-600/90"]{color:#7c3aede6}.dark [text~="dark:zinc-500"],.text-zinc-500,[text~=zinc-500]{--un-text-opacity:1;color:rgb(113 113 122 / var(--un-text-opacity))}.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-black,[text-black=""]{--un-text-opacity:1;color:rgb(0 0 0 / var(--un-text-opacity))}.text-cyan,[text~=cyan-400]{--un-text-opacity:1;color:rgb(34 211 238 / 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-700,[text-neutral-700=""]{--un-text-opacity:1;color:rgb(64 64 64 / var(--un-text-opacity))}.text-primary-600\/80{color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / .8)}.text-primary-700{--un-text-opacity:1;color:oklch(49% var(--theme-colors-chroma-700) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.text-red-500{--un-text-opacity:1;color:rgb(239 68 68 / var(--un-text-opacity))}.text-red-600{--un-text-opacity:1;color:rgb(220 38 38 / var(--un-text-opacity))}.text-transparent{color:transparent}.text-violet-500,[text-violet-500=""]{--un-text-opacity:1;color:rgb(139 92 246 / var(--un-text-opacity))}[text~=complementary-400]{--un-text-opacity:1;color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 180) / 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~="primary-400/90"]{color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-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"]:hover{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark [hover~="dark:text-primary-300/80"]:hover{color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / .8)}.dark [text~="dark:hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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]:hover{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}[hover~="text-primary-600/80"]:hover{color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / .8)}[text~="hover:primary-500"]:hover{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-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{--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(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark [text~="placeholder:dark:primary-300/50"]::placeholder{color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / .5)}[text~="placeholder:hover:primary-500"]:hover::placeholder{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}[text~="placeholder:primary-300"]::placeholder{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.font-bold,[font-bold=""]{font-weight:700}.font-medium,[font-medium=""]{font-weight:500}.font-semibold,[font-semibold=""]{font-weight:600}.lh-10{line-height:2.5rem}.font-cute,[font-cute=""]{font-family:Kiwi Maru}.font-cuteen,[font-cuteen=""]{font-family:Sniglet}.font-mono,[font-mono=""]{font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans,[font-sans=""]{font-family:DM Sans,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"}.italic{font-style:italic}.underline,[underline=""]{text-decoration-line:underline}.tab,[aria-checked~=tab][aria-checked=true],[tab=""]{-moz-tab-size:4;-o-tab-size:4;tab-size:4}[checked~=tab]:checked{-moz-tab-size:4;-o-tab-size:4;tab-size:4}.\[\&\:checked\+div_\.radio-dot\]\:opacity-100:checked+div .radio-dot,.opacity-100{opacity:1}.op50,.opacity-50,[op50=""]{opacity:.5}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-60{opacity:.6}[hover~=opacity-100]:hover{opacity:1}.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}.dark .dark\:shadow-xl,.shadow-xl,[shadow-xl=""]{--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color, rgb(0 0 0 / .1));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, rgb(0 0 0 / 0));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, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-md,[shadow-md=""],[shadow~=md]{--un-shadow:var(--un-shadow-inset) 0 4px 6px -1px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1));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, rgb(0 0 0 / .05));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}[shadow~="cyan-200/50"]{--un-shadow-color:rgb(165 243 252 / .5) }[shadow~="primary-200/50"]{--un-shadow-color:oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / .5) }[shadow~="violet-200/50"]{--un-shadow-color:rgb(221 214 254 / .5) }.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-xl"]:hover{--un-shadow:var(--un-shadow-inset) 0 20px 25px -5px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 8px 10px -6px var(--un-shadow-color, rgb(0 0 0 / .1));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, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 2px 4px -2px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline{outline-style:solid}.outline-none,[outline-none=""]{outline:2px solid transparent;outline-offset:2px}[outline~="focus-within:none"]:focus-within{outline:2px solid transparent;outline-offset:2px}.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)}.focus\:ring-offset-2:focus{--un-ring-offset-width:2px}.dark .dark\:focus\:ring-primary-400\/50:focus{--un-ring-color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .5) }.focus\:ring-primary-500\/50:focus{--un-ring-color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .5) }.dark .dark\:focus\:ring-offset-neutral-900:focus{--un-ring-offset-opacity:1;--un-ring-offset-color:rgb(23 23 23 / var(--un-ring-offset-opacity)) }.focus\:ring-offset-white:focus{--un-ring-offset-opacity:1;--un-ring-offset-color:rgb(255 255 255 / var(--un-ring-offset-opacity)) }.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, rgb(0 0 0 / .1))) drop-shadow(0 1px 1px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));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, rgb(0 0 0 / 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)}[drop-shadow~="hover:[0px_4px_4px_rgba(220,220,220,0.4)]"]:hover{--un-drop-shadow:drop-shadow(0px 4px 4px rgba(220,220,220,.4));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 rgba(220,220,220,.25));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)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all,[transition~=all]{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors,[transition-colors=""],[transition~=colors]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity,[transition-opacity=""]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform,[transition~=transform]{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[transition~="100"]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}[transition~=border]{transition-property:border;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[transition~="placeholder:all"]::placeholder{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[before~=transition-all]:before{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.after\:transition-all:after{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[after~=transition-all]:after{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200,[transition~=duration-200]{transition-duration:.2s}.duration-250,[duration-250=""],[duration~="250"],[transition~=duration-250]{transition-duration:.25s}.duration-300{transition-duration:.3s}.duration-400,[transition~=duration-400]{transition-duration:.4s}.duration-500,[transition~=duration-500]{transition-duration:.5s}[duration~="10"]{transition-duration:10ms}[duration~="100"]{transition-duration:.1s}[duration~="1000"]{transition-duration:1s}.placeholder\:duration-250::placeholder{transition-duration:.25s}[placeholder\:duration-250=""]::placeholder{transition-duration:.25s}[transition~="placeholder:duration-250"]::placeholder{transition-duration:.25s}[before~=duration-400]:before{transition-duration:.4s}[after~=duration-400]:after{transition-duration:.4s}[delay~="50"]{transition-delay:50ms}.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-timing-function:cubic-bezier(.4,0,.2,1)}[transition~="placeholder:ease-in-out"]::placeholder{transition-timing-function:cubic-bezier(.4,0,.2,1)}[before~=ease-in-out]:before{transition-timing-function:cubic-bezier(.4,0,.2,1)}[after~=ease-in-out]:after{transition-timing-function:cubic-bezier(.4,0,.2,1)}.will-change-transform,[will-change-transform=""]{will-change:transform}.after\:content-\[\'\'\]:after{content:""}.content-empty{content:""}[before~=content-empty]:before{content:""}[after~=content-empty]:after{content:""}.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(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}.hover\:bg-dotted-\[primary-300\/50\]:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.after\:bg-dotted-\[primary-300\/50\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.dark .dark\:after\:bg-dotted-\[primary-200\/20\]:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}.dark [hover~="dark:after:bg-dotted-[primary-200/20]"]:hover:after{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}[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(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.transition-colors-none{transition-property:color,background-color,border-color,text-color;transition-duration:0s}.placeholder\:transition-colors-none::placeholder{transition-property:color,background-color,border-color,text-color;transition-duration:0s}@media (max-width: 1023.9px){[min-w~="Array.from(p.value.entries()).map(([a,e])=>({id:a,name:e.name,description:e.description}))),L=h(()=>{if(!x.value)return D.value;const a=x.value.toLowerCase();return D.value.filter(e=>e.name.toLowerCase().includes(a)||e.description&&e.description.toLowerCase().includes(a))}),V=h(()=>{const a=[...L.value];return g.value==="nameAsc"?a.sort((e,o)=>e.name.localeCompare(o.name)):g.value==="nameDesc"?a.sort((e,o)=>o.name.localeCompare(e.name)):g.value==="recent"?a.sort((e,o)=>o.id.localeCompare(e.id)):a}),_=c(!1),d=c(null);function O(){d.value&&(B(d.value),d.value=null,_.value=!1)}function q(a){d.value=a,_.value=!0}async function F(){const a=document.createElement("input");a.type="file",a.accept=".json",a.onchange=async e=>{var i;const o=(i=e.target.files)==null?void 0:i[0];if(o)try{const r=await o.text(),u=JSON.parse(r);b.value=j(u),f.value=!0}catch(r){console.error("Error processing card file:",r)}},a.click()}function M(a){b.value=a,f.value=!0}function T(a){w.value=a}function J(a){const e=p.value.get(a);return(e==null?void 0:e.version)||"1.0.0"}function S(a,e){var r,u,A,$;const o=p.value.get(a);if(!o||!((u=(r=o.extensions)==null?void 0:r.airi)!=null&&u.modules))return"default";const i=o.extensions.airi.modules;return e==="consciousness"?(A=i.consciousness)!=null&&A.model&&i.consciousness.model.split("-").pop()||"default":e==="voice"&&(($=i.speech)==null?void 0:$.voice_id)||"default"}return(a,e)=>{var i;const o=K("motion");return m(),v(z,null,[C((m(),v("div",se,[t("button",{onClick:e[0]||(e[0]=r=>s(U).back())},e[6]||(e[6]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",oe,[t("div",ne,[t("span",le,l(s(n)("settings.title")),1)]),t("div",ie,l(s(n)("settings.pages.card.title")),1)])])),[[o]]),t("div",de,[t("div",ue,[t("div",ce,[e[7]||(e[7]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),C(t("input",{"onUpdate:modelValue":e[1]||(e[1]=r=>x.value=r),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(n)("settings.pages.card.search")},null,8,me),[[P,x.value]])]),t("div",pe,[t("div",ve,l(s(n)("settings.pages.card.sort_by"))+": ",1),C(t("select",{"onUpdate:modelValue":e[2]||(e[2]=r=>g.value=r),class:"rounded-lg p-1.5 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",bg:"white dark:neutral-900"},[t("option",fe,l(s(n)("settings.pages.card.name_asc")),1),t("option",xe,l(s(n)("settings.pages.card.name_desc")),1),t("option",ge,l(s(n)("settings.pages.card.recent")),1)],512),[[W,g.value]])])]),t("div",{class:X(["mt-4",{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":s(p).size>0}])},[t("div",{class:"relative min-h-[120px] flex flex-col cursor-pointer items-center justify-center border-2 rounded-xl border-dashed p-6 transition-all duration-300",border:"neutral-200 dark:neutral-700 hover:primary-300 dark:hover:primary-700",bg:"white/60 dark:black/30 hover:white/80 dark:hover:black/40",style:{transform:"scale(0.98)",opacity:.95},hover:"scale-100 opacity-100 shadow-md dark:shadow-xl",onClick:F},[e[9]||(e[9]=t("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),t("p",be,l(s(n)("settings.pages.card.upload")),1),t("p",_e,l(s(n)("settings.pages.card.upload_desc")),1),I.value?(m(),v("div",ye,[t("div",ke,[e[8]||(e[8]=t("div",{"i-solar:upload-minimalistic-bold":"",class:"dark:text-primary-400 text-primary-500 mb-2 text-5xl"},null,-1)),t("p",he,l(s(n)("settings.pages.card.drop_here")),1)])])):y("",!0)]),s(p).size>0?(m(!0),v(z,{key:0},Y(V.value,r=>(m(),Z(re,{id:r.id,key:r.id,name:r.name,description:r.description,"is-active":r.id===s(w),"is-selected":r.id===b.value&&f.value,version:J(r.id),"consciousness-model":S(r.id,"consciousness"),"voice-model":S(r.id,"voice"),onSelect:u=>M(r.id),onActivate:u=>T(r.id),onDelete:u=>q(r.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):y("",!0),s(p).size===0?(m(),v("div",Ce,[e[10]||(e[10]=t("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),t("p",null,l(s(n)("settings.pages.card.no_cards")),1)])):y("",!0),x.value&&V.value.length===0?(m(),v("div",we,[e[11]||(e[11]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",De,[t("span",Ve,l(s(n)("settings.pages.card.no_results")),1),t("span",Se,l(s(n)("settings.pages.card.try_different_search")),1)])])):y("",!0)],2)]),N(ae,{modelValue:_.value,"onUpdate:modelValue":e[3]||(e[3]=r=>_.value=r),"card-name":d.value?(i=s(k).getCard(d.value))==null?void 0:i.name:"",onConfirm:O,onCancel:e[4]||(e[4]=r=>d.value=null)},null,8,["modelValue","card-name"]),N(te,{modelValue:f.value,"onUpdate:modelValue":e[5]||(e[5]=r=>f.value=r),"card-id":b.value},null,8,["modelValue","card-id"]),e[12]||(e[12]=t("div",{text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},[t("div",{text:"40","i-lucide:id-card":""})],-1))],64)}}});typeof E=="function"&&E(Ae);export{Ae as default}; +import{d as R,bE as G,q as Q,s as H,g as c,h,bw as K,c as v,o as m,A as C,a as t,b as N,e as s,D as l,bF as P,bG as W,z as X,C as y,bx as z,by as Y,x as Z}from"./index-CL4rmUJ-.js";import{u as ee}from"./airi-card-CWMQJScT.js";import{_ as te}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-DwW72nHQ.js";import{_ as re}from"./CardListItem.vue_vue_type_script_setup_true_lang-D1pbLBEG.js";import{_ as ae}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C1JwBLjv.js";import{b as E}from"./route-block-B_A1xBdJ.js";import"./live2d-zip-loader-DFrBymqv.js";import"./consciousness-nHboP4iV.js";import"./providers-BHCrT0RZ.js";import"./speech-Ae5ywnpY.js";import"./index-CDeQ6Zfm.js";const se={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},oe={relative:""},ne={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},le={text:"neutral-300 dark:neutral-500","text-nowrap":""},ie={"text-nowrap":"","text-3xl":"","font-semibold":""},de={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},ue={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},ce={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},me=["placeholder"],pe={class:"flex items-center gap-2"},ve={"text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},fe={value:"nameAsc"},xe={value:"nameDesc"},ge={value:"recent"},be={"font-medium":"",text:"center neutral-600 dark:neutral-300"},_e={text:"center neutral-500 dark:neutral-400","mt-2":"","text-sm":""},ye={key:0,class:"bg-primary-100/80 border-primary-400 dark:bg-primary-900/80 dark:border-primary-600 absolute inset-0 flex items-center justify-center border-2 rounded-xl"},ke={class:"text-center"},he={"font-medium":"",text:"primary-600 dark:primary-300"},Ce={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"},we={key:2,class:"col-span-full flex items-center gap-3 border-2 border-amber-200 rounded-xl bg-amber-50/80 p-4 dark:border-amber-800 dark:bg-amber-900/30"},De={class:"flex flex-col"},Ve={class:"font-medium"},Se={class:"text-sm text-amber-600 dark:text-amber-400"},Ae=R({__name:"index",setup($e){const U=G(),{t:n}=Q(),k=ee(),{addCard:j,removeCard:B}=k,{cards:p,activeCardId:w}=H(k),b=c(""),f=c(!1),x=c(""),g=c("nameAsc"),I=c(!1),D=h(()=>Array.from(p.value.entries()).map(([a,e])=>({id:a,name:e.name,description:e.description}))),L=h(()=>{if(!x.value)return D.value;const a=x.value.toLowerCase();return D.value.filter(e=>e.name.toLowerCase().includes(a)||e.description&&e.description.toLowerCase().includes(a))}),V=h(()=>{const a=[...L.value];return g.value==="nameAsc"?a.sort((e,o)=>e.name.localeCompare(o.name)):g.value==="nameDesc"?a.sort((e,o)=>o.name.localeCompare(e.name)):g.value==="recent"?a.sort((e,o)=>o.id.localeCompare(e.id)):a}),_=c(!1),d=c(null);function O(){d.value&&(B(d.value),d.value=null,_.value=!1)}function q(a){d.value=a,_.value=!0}async function F(){const a=document.createElement("input");a.type="file",a.accept=".json",a.onchange=async e=>{var i;const o=(i=e.target.files)==null?void 0:i[0];if(o)try{const r=await o.text(),u=JSON.parse(r);b.value=j(u),f.value=!0}catch(r){console.error("Error processing card file:",r)}},a.click()}function M(a){b.value=a,f.value=!0}function T(a){w.value=a}function J(a){const e=p.value.get(a);return(e==null?void 0:e.version)||"1.0.0"}function S(a,e){var r,u,A,$;const o=p.value.get(a);if(!o||!((u=(r=o.extensions)==null?void 0:r.airi)!=null&&u.modules))return"default";const i=o.extensions.airi.modules;return e==="consciousness"?(A=i.consciousness)!=null&&A.model&&i.consciousness.model.split("-").pop()||"default":e==="voice"&&(($=i.speech)==null?void 0:$.voice_id)||"default"}return(a,e)=>{var i;const o=K("motion");return m(),v(z,null,[C((m(),v("div",se,[t("button",{onClick:e[0]||(e[0]=r=>s(U).back())},e[6]||(e[6]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",oe,[t("div",ne,[t("span",le,l(s(n)("settings.title")),1)]),t("div",ie,l(s(n)("settings.pages.card.title")),1)])])),[[o]]),t("div",de,[t("div",ue,[t("div",ce,[e[7]||(e[7]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),C(t("input",{"onUpdate:modelValue":e[1]||(e[1]=r=>x.value=r),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(n)("settings.pages.card.search")},null,8,me),[[P,x.value]])]),t("div",pe,[t("div",ve,l(s(n)("settings.pages.card.sort_by"))+": ",1),C(t("select",{"onUpdate:modelValue":e[2]||(e[2]=r=>g.value=r),class:"rounded-lg p-1.5 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",bg:"white dark:neutral-900"},[t("option",fe,l(s(n)("settings.pages.card.name_asc")),1),t("option",xe,l(s(n)("settings.pages.card.name_desc")),1),t("option",ge,l(s(n)("settings.pages.card.recent")),1)],512),[[W,g.value]])])]),t("div",{class:X(["mt-4",{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":s(p).size>0}])},[t("div",{class:"relative min-h-[120px] flex flex-col cursor-pointer items-center justify-center border-2 rounded-xl border-dashed p-6 transition-all duration-300",border:"neutral-200 dark:neutral-700 hover:primary-300 dark:hover:primary-700",bg:"white/60 dark:black/30 hover:white/80 dark:hover:black/40",style:{transform:"scale(0.98)",opacity:.95},hover:"scale-100 opacity-100 shadow-md dark:shadow-xl",onClick:F},[e[9]||(e[9]=t("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),t("p",be,l(s(n)("settings.pages.card.upload")),1),t("p",_e,l(s(n)("settings.pages.card.upload_desc")),1),I.value?(m(),v("div",ye,[t("div",ke,[e[8]||(e[8]=t("div",{"i-solar:upload-minimalistic-bold":"",class:"dark:text-primary-400 text-primary-500 mb-2 text-5xl"},null,-1)),t("p",he,l(s(n)("settings.pages.card.drop_here")),1)])])):y("",!0)]),s(p).size>0?(m(!0),v(z,{key:0},Y(V.value,r=>(m(),Z(re,{id:r.id,key:r.id,name:r.name,description:r.description,"is-active":r.id===s(w),"is-selected":r.id===b.value&&f.value,version:J(r.id),"consciousness-model":S(r.id,"consciousness"),"voice-model":S(r.id,"voice"),onSelect:u=>M(r.id),onActivate:u=>T(r.id),onDelete:u=>q(r.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):y("",!0),s(p).size===0?(m(),v("div",Ce,[e[10]||(e[10]=t("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),t("p",null,l(s(n)("settings.pages.card.no_cards")),1)])):y("",!0),x.value&&V.value.length===0?(m(),v("div",we,[e[11]||(e[11]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",De,[t("span",Ve,l(s(n)("settings.pages.card.no_results")),1),t("span",Se,l(s(n)("settings.pages.card.try_different_search")),1)])])):y("",!0)],2)]),N(ae,{modelValue:_.value,"onUpdate:modelValue":e[3]||(e[3]=r=>_.value=r),"card-name":d.value?(i=s(k).getCard(d.value))==null?void 0:i.name:"",onConfirm:O,onCancel:e[4]||(e[4]=r=>d.value=null)},null,8,["modelValue","card-name"]),N(te,{modelValue:f.value,"onUpdate:modelValue":e[5]||(e[5]=r=>f.value=r),"card-id":b.value},null,8,["modelValue","card-id"]),e[12]||(e[12]=t("div",{text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},[t("div",{text:"40","i-lucide:id-card":""})],-1))],64)}}});typeof E=="function"&&E(Ae);export{Ae as default}; diff --git a/assets/index-CYuYLZwp.js b/assets/index-Bs3BUlfx.js similarity index 97% rename from assets/index-CYuYLZwp.js rename to assets/index-Bs3BUlfx.js index ba09e2a02279eb6c838b62c4549d3b5497edd02e..eb8244a57ddac2f97ff0abbc1973eb3c82af9460 100644 --- a/assets/index-CYuYLZwp.js +++ b/assets/index-Bs3BUlfx.js @@ -1 +1 @@ -import{_ as mt}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js";import{_ as dt,a as gt}from"./Model.vue_vue_type_script_setup_true_lang-CvOp1AJu.js";import{d as Y,v as Z,c as O,o as z,e as p,m as ft,q as ut,bM as _t,s as bt,g as R,w as vt,bN as pt,b as S,x as ct,C as H,y as E,a as y,A as W,bF as wt,bH as P,D as U,bx as J,by as nt,bG as xt,bn as Ct,bE as Mt,k as kt,bw as Lt}from"./index-BYewP6KR.js";import{k as rt,l as yt,m as Vt,J as Dt}from"./live2d-zip-loader-CvpgOHsT.js";import{_ as ot,a as St}from"./ColorPalette.vue_vue_type_script_setup_true_lang-EIEI_2Ix.js";import{u as zt}from"./useIconAnimation-B3hjTK1u.js";import{b as st}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./index-C4TaASqf.js";class Nt{constructor(t,e){this.pixels=t,this.opts=e;const{sigBits:i}=e,r=(M,L,v)=>(M<<2*i)+(L<>o,u=u>>o,d=d>>o;const L=r(l,u,d);a[L]===void 0&&(a[L]=0),a[L]+=1,l>c&&(c=l),lm&&(m=u),u_&&(_=d),dL>0?M+1:M,0),this.hist=a,this.rmax=c,this.rmin=h,this.gmax=m,this.gmin=f,this.bmax=_,this.bmin=b}get colorCount(){return this._colorCount}}class It{scaleDown(t){const e=this.getWidth(),i=this.getHeight();let r=1;if(t.maxDimension>0){const o=Math.max(e,i);o>t.maxDimension&&(r=t.maxDimension/o)}else r=1/t.quality;r<1&&this.resize(e*r,i*r,r)}}function Et(n,t){var e;if(t.length>0){const i=n.data,r=i.length/4;let o,s,a,c,h;for(let m=0;m{const s=()=>{this._initCanvas(),r(this)};e.complete?s():(e.onload=s,e.onerror=a=>o(new Error(`Fail to load image: ${i}`)))})}clear(){this._getContext().clearRect(0,0,this._getWidth(),this._getHeight())}update(t){this._getContext().putImageData(t,0,0)}getWidth(){return this._getWidth()}getHeight(){return this._getHeight()}resize(t,e,i){if(!this.image)throw new Error("Image is not initialized");this._width=this._getCanvas().width=t,this._height=this._getCanvas().height=e,this._getContext().scale(i,i),this._getContext().drawImage(this.image,0,0)}getPixelCount(){return this._getWidth()*this._getHeight()}getImageData(){return this._getContext().getImageData(0,0,this._getWidth(),this._getHeight())}remove(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)}}function T(n,...t){return t.forEach(e=>{if(e){for(const i in e)if(e.hasOwnProperty(i)){const r=e[i];Array.isArray(r)?n[i]=r.slice(0):typeof r=="object"?(n[i]||(n[i]={}),T(n[i],r)):n[i]=r}}}),n}function $t(n,t){const{colorCount:e,quantizer:i,generators:r,filters:o}=n,s={colorCount:e},a=typeof i=="string"?{name:i,options:{}}:i;return a.options=T({},s,a.options),T({},{quantizer:a,generators:r,filters:o},t)}class jt{constructor(t,e={}){this._src=t,this._opts=T({},F.DefaultOpts,e)}maxColorCount(t){return this._opts.colorCount=t,this}maxDimension(t){return this._opts.maxDimension=t,this}addFilter(t){return this._opts.filters?this._opts.filters.push(t):this._opts.filters=[t],this}removeFilter(t){if(this._opts.filters){const e=this._opts.filters.indexOf(t);e>0&&this._opts.filters.splice(e)}return this}clearFilters(){return this._opts.filters=[],this}quality(t){return this._opts.quality=t,this}useImageClass(t){return this._opts.ImageClass=t,this}useGenerator(t,e){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(e?{name:t,options:e}:t),this}useQuantizer(t,e){return this._opts.quantizer=e?{name:t,options:e}:t,this}build(){return new F(this._src,this._opts)}getPalette(){return this.build().getPalette()}}class B{constructor(t){this.pipeline=t,this._map={}}names(){return Object.keys(this._map)}has(t){return!!this._map[t]}get(t){return this._map[t]}register(t,e){return this._map[t]=e,this.pipeline}}class Ut{constructor(){this.filter=new B(this),this.quantizer=new B(this),this.generator=new B(this)}_buildProcessTasks({filters:t,quantizer:e,generators:i}){return i.length===1&&i[0]==="*"&&(i=this.generator.names()),{filters:t.map(o=>r(this.filter,o)),quantizer:r(this.quantizer,e),generators:i.map(o=>r(this.generator,o))};function r(o,s){let a,c;return typeof s=="string"?a=s:(a=s.name,c=s.options),{name:a,fn:o.get(a),options:c}}}async process(t,e){const{filters:i,quantizer:r,generators:o}=this._buildProcessTasks(e),s=await this._filterColors(i,t),a=await this._generateColors(r,s),c=await this._generatePalettes(o,a);return{colors:a,palettes:c}}_filterColors(t,e){return Promise.resolve(Et(e,t.map(({fn:i})=>i)))}_generateColors(t,e){return Promise.resolve(t.fn(e.data,t.options))}async _generatePalettes(t,e){const i=await Promise.all(t.map(({fn:r,options:o})=>Promise.resolve(r(e,o))));return Promise.resolve(i.reduce((r,o,s)=>(r[t[s].name]=o,r),{}))}}function Tt(n,t,e){return"#"+((1<<24)+(n<<16)+(t<<8)+e).toString(16).slice(1,7)}function Rt(n,t,e){n/=255,t/=255,e/=255;const i=Math.max(n,t,e),r=Math.min(n,t,e);let o=0,s=0;const a=(i+r)/2;if(i!==r){const c=i-r;switch(s=a>.5?c/(2-i-r):c/(i+r),i){case n:o=(t-e)/c+(t1&&(h-=1),h<1/6?a+(c-a)*6*h:h<1/2?c:h<2/3?a+(c-a)*(2/3-h)*6:a}if(t===0)i=r=o=e;else{const a=e<.5?e*(1+t):e+t-e*t,c=2*e-a;i=s(c,a,n+1/3),r=s(c,a,n),o=s(c,a,n-1/3)}return[i*255,r*255,o*255]}class V{static applyFilters(t,e){return e.length>0?t.filter(({r:i,g:r,b:o})=>{var s;for(let a=0;a>=q,i>>=q,r>>=q,e>=o&&e<=s&&i>=a&&i<=c&&r>=h&&r<=m}split(){const{hist:t,getColorIndex:e}=this.histogram,{r1:i,r2:r,g1:o,g2:s,b1:a,b2:c}=this.dimension,h=this.count();if(!h)return[];if(h===1)return[this.clone()];const m=r-i+1,f=s-o+1,_=c-a+1,b=Math.max(m,f,_);let l=null,u,d;u=d=0;let g=null;if(b===m){g="r",l=new Uint32Array(r+1);for(let v=i;v<=r;v++){u=0;for(let x=o;x<=s;x++)for(let C=a;C<=c;C++){const D=e(v,x,C);t[D]&&(u+=t[D])}d+=u,l[v]=d}}else if(b===f){g="g",l=new Uint32Array(s+1);for(let v=o;v<=s;v++){u=0;for(let x=i;x<=r;x++)for(let C=a;C<=c;C++){const D=e(x,v,C);t[D]&&(u+=t[D])}d+=u,l[v]=d}}else{g="b",l=new Uint32Array(c+1);for(let v=a;v<=c;v++){u=0;for(let x=i;x<=r;x++)for(let C=o;C<=s;C++){const D=e(x,C,v);t[D]&&(u+=t[D])}d+=u,l[v]=d}}let w=-1;const N=new Uint32Array(l.length);for(let v=0;vd/2&&(w=v),N[v]=d-x)}const M=this;function L(v){const x=v+"1",C=v+"2",D=M.dimension[x];let k=M.dimension[C];const X=M.clone(),K=M.clone(),tt=w-D,et=k-w;for(tt<=et?(k=Math.min(k-1,~~(w+et/2)),k=Math.max(0,k)):(k=Math.max(D,~~(w-1-tt/2)),k=Math.min(M.dimension[C],k));!l[k];)k++;let it=N[k];for(;!it&&l[k-1];)it=N[--k];return X.dimension[C]=k,K.dimension[x]=k+1,[X,K]}return L(g)}}class at{_sort(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)}constructor(t){this._comparator=t,this.contents=[],this._sorted=!1}push(t){this.contents.push(t),this._sorted=!1}peek(t){return this._sort(),t=typeof t=="number"?t:this.contents.length-1,this.contents[t]}pop(){return this._sort(),this.contents.pop()}size(){return this.contents.length}map(t){return this._sort(),this.contents.map(t)}}const At=.75;function lt(n,t){let e=n.size();for(;n.size()0){const[r,o]=i.split();if(!r||(n.push(r),o&&o.count()>0&&n.push(o),n.size()===e))break;e=n.size()}else break}}const Bt=(n,t)=>{if(n.length===0||t.colorCount<2||t.colorCount>256)throw new Error("Wrong MMCQ parameters");const e=A.build(n);e.histogram.colorCount;const i=new at((o,s)=>o.count()-s.count());i.push(e),lt(i,At*t.colorCount);const r=new at((o,s)=>o.count()*o.volume()-s.count()*s.volume());return r.contents=i.contents,lt(r,t.colorCount-r.size()),qt(r)};function qt(n){const t=[];for(;n.size();){const e=n.pop(),i=e.avg();t.push(new V(i,e.count()))}return t}const Ht={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function Wt(n){let t=0;return n.forEach(e=>{t=Math.max(t,e.population)}),t}function Jt(n,t){return n.Vibrant===t||n.DarkVibrant===t||n.LightVibrant===t||n.Muted===t||n.DarkMuted===t||n.LightMuted===t}function Gt(n,t,e,i,r,o,s){function a(...h){let m=0,f=0;for(let _=0;_{const[,b,l]=_.hsl;if(b>=a&&b<=c&&l>=r&&l<=o&&!Jt(n,_)){const u=Gt(b,s,l,i,_.population,e,h);(m===null||u>f)&&(m=_,f=u)}}),m}function Qt(n,t,e){const i={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return i.Vibrant=$(i,n,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.LightVibrant=$(i,n,t,e.targetLightLuma,e.minLightLuma,1,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.DarkVibrant=$(i,n,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.Muted=$(i,n,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.LightMuted=$(i,n,t,e.targetLightLuma,e.minLightLuma,1,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.DarkMuted=$(i,n,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i}function Yt(n,t,e){if(!n.Vibrant&&!n.DarkVibrant&&!n.LightVibrant){if(!n.DarkVibrant&&n.DarkMuted){let[i,r,o]=n.DarkMuted.hsl;o=e.targetDarkLuma,n.DarkVibrant=new V(I(i,r,o),0)}if(!n.LightVibrant&&n.LightMuted){let[i,r,o]=n.LightMuted.hsl;o=e.targetDarkLuma,n.DarkVibrant=new V(I(i,r,o),0)}}if(!n.Vibrant&&n.DarkVibrant){let[i,r,o]=n.DarkVibrant.hsl;o=e.targetNormalLuma,n.Vibrant=new V(I(i,r,o),0)}else if(!n.Vibrant&&n.LightVibrant){let[i,r,o]=n.LightVibrant.hsl;o=e.targetNormalLuma,n.Vibrant=new V(I(i,r,o),0)}if(!n.DarkVibrant&&n.Vibrant){let[i,r,o]=n.Vibrant.hsl;o=e.targetDarkLuma,n.DarkVibrant=new V(I(i,r,o),0)}if(!n.LightVibrant&&n.Vibrant){let[i,r,o]=n.Vibrant.hsl;o=e.targetLightLuma,n.LightVibrant=new V(I(i,r,o),0)}if(!n.Muted&&n.Vibrant){let[i,r,o]=n.Vibrant.hsl;o=e.targetMutesSaturation,n.Muted=new V(I(i,r,o),0)}if(!n.DarkMuted&&n.DarkVibrant){let[i,r,o]=n.DarkVibrant.hsl;o=e.targetMutesSaturation,n.DarkMuted=new V(I(i,r,o),0)}if(!n.LightMuted&&n.LightVibrant){let[i,r,o]=n.LightVibrant.hsl;o=e.targetMutesSaturation,n.LightMuted=new V(I(i,r,o),0)}}const Zt=(n,t)=>{t=Object.assign({},Ht,t);const e=Wt(n),i=Qt(n,e,t);return Yt(i,e,t),i},Xt=new Ut().filter.register("default",(n,t,e,i)=>i>=125&&!(n>250&&t>250&&e>250)).quantizer.register("mmcq",Bt).generator.register("default",Zt);F.use(Xt);const Kt=["disabled"],j=Y({__name:"Live2DModelControlButton",emits:["click"],setup(n){const t=Z();return(e,i)=>(z(),O("button",{disabled:p(t).loadingLive2dModel,bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250",rounded:"",onClick:i[0]||(i[0]=r=>e.$emit("click"))},[ft(e.$slots,"default")],8,Kt))}}),te={flex:"~ col gap-4"},ee={flex:"","items-center":"","gap-2":""},ie=["disabled","placeholder"],ne={"font-medium":""},re={flex:"","gap-2":""},oe=["onUpdate:modelValue"],se=["href","download"],ae=Y({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(n){const{t}=ut(),e=_t({accept:"application/zip"}),i=Z(),{live2dModelFile:r,live2dMotionMap:o,live2dLoadSource:s,loadingLive2dModel:a,availableLive2dMotions:c,live2dModelUrl:h}=bt(i),m=R(h.value);e.onChange(l=>{l&&l.length>0&&(o.value={},r.value=l[0],s.value="file",a.value=!0)}),vt(()=>i.loadingLive2dModel,l=>{l||s.value==="file"&&c.value.forEach(u=>{u.motionName in rt?o.value[u.fileName]=u.motionName:o.value[u.fileName]=yt})});async function f(l,u){if(!Object.keys(u).length)return l;const g=await new Dt().loadAsync(l),w=Object.keys(g.files).find(x=>x.endsWith("model3.json"));if(!w)throw new Error("model3.json not found");const N=await g.file(w).async("string"),M=JSON.parse(N),L={};Object.entries(u).forEach(([x,C])=>{if(L[C]){L[C].push({File:x});return}L[C]=[{File:x}]}),M.FileReferences.Motions=L,g.file(w,JSON.stringify(M,null,2));const v=await g.generateAsync({type:"blob"});return new File([v],l.name,{type:l.type,lastModified:l.lastModified})}async function _(){const l=await Vt.getItem("live2dModel");if(!l)return;const u=await f(l,o.value);r.value=u,s.value="file",a.value=!0}const b=pt(r);return(l,u)=>(z(),O("div",te,[S(p(ot),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:E(()=>[y("div",ee,[W(y("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>m.value=d),disabled:p(i).loadingLive2dModel,class:"form-control flex-1",border:"zinc-300 dark:zinc-800 solid 1 focus:zinc-400 dark:focus:zinc-600",transition:"border duration-250 ease-in-out",placeholder:p(t)("settings.live2d.change-model.from-url-placeholder")},null,8,ie),[[wt,m.value]]),S(j,{class:"form-control",onClick:u[1]||(u[1]=d=>h.value=m.value)},{default:E(()=>[P(U(p(t)("settings.live2d.change-model.from-url")),1)]),_:1})]),S(j,{class:"form-control place-self-end",onClick:u[2]||(u[2]=d=>p(e).open())},{default:E(()=>[P(U(p(t)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),S(j,{class:"form-control",onClick:u[3]||(u[3]=d=>l.$emit("extractColorsFromModel"))},{default:E(()=>u[4]||(u[4]=[P(" Extract colors from model ")])),_:1}),S(St,{colors:n.palette.map(d=>({hex:d,name:d}))},null,8,["colors"])]),_:1}),p(i).live2dLoadSource==="file"?(z(),ct(p(ot),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:E(()=>{var d;return[(z(!0),O(J,null,nt(p(i).availableLive2dMotions,g=>(z(),O("div",{key:g.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[y("span",ne,U(g.fileName),1),y("div",re,[W(y("select",{"onUpdate:modelValue":w=>p(i).live2dMotionMap[g.fileName]=w},[(z(!0),O(J,null,nt(Object.keys(p(rt)),w=>(z(),O("option",{key:w},U(w),1))),128))],8,oe),[[xt,p(i).live2dMotionMap[g.fileName]]]),S(j,{class:"form-control",onClick:w=>p(i).live2dCurrentMotion={group:g.motionName,index:g.motionIndex}},{default:E(()=>u[5]||(u[5]=[P(" Play ")])),_:2},1032,["onClick"])])]))),128)),S(j,{onClick:_},{default:E(()=>u[6]||(u[6]=[P(" Save and patch ")])),_:1}),y("a",{"mt-2":"",block:"",href:p(b),download:`${((d=p(i).live2dModelFile)==null?void 0:d.name)||"live2d"}-motion-edited.zip`},[S(j,{"w-full":""},{default:E(()=>u[7]||(u[7]=[P("Export")])),_:1})],8,se)]}),_:1})):H("",!0)]))}}),le=Ct(ae,[["__scopeId","data-v-de39498b"]]),ue={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},ce={relative:"","text-nowrap":""},he={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]",text:"neutral-300 dark:neutral-500"},me={"text-3xl":"","font-semibold":""},de={flex:""},ge={key:1,text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},fe=Y({__name:"index",setup(n){const{t}=ut(),e=Mt(),i=R(),r=R(),{width:o,height:s}=kt(i),a=Z(),c=R([]);async function h(){if(!r.value)return;const b=await r.value.captureFrame();if(!b){console.error("No frame captured");return}const l=URL.createObjectURL(b);try{const d=await new F(l).getPalette();c.value=Object.values(d).map(g=>g==null?void 0:g.hex).filter(g=>typeof g=="string")}finally{URL.revokeObjectURL(l)}}const{iconAnimationStarted:m,showIconAnimation:f,animationIcon:_}=zt("i-lucide:person-standing");return(b,l)=>{const u=mt,d=Lt("motion");return z(),O(J,null,[W((z(),O("div",ue,[y("button",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":"",onClick:l[0]||(l[0]=g=>p(e).back())}),y("h1",ce,[y("div",he,U(p(t)("settings.title")),1),y("div",me,U(p(t)("settings.pages.models.title")),1)])])),[[d]]),y("div",de,[y("div",{ref_key:"live2dContainerRef",ref:i,w:"50%",h:"80vh"},[S(gt,{ref_key:"live2dCanvasRef",ref:r,width:p(o),height:p(s)},{default:E(({app:g})=>[S(dt,{app:g,"mouth-open-size":0,width:p(o),height:p(s),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),S(le,{w:"50%",h:"80vh",palette:c.value,onExtractColorsFromModel:h},null,8,["palette"])]),p(f)?(z(),ct(u,{key:0,"z-index":-1,icon:p(_),"icon-size":12,duration:1e3,started:p(m),"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"])):H("",!0),p(a).usePageSpecificTransitions?H("",!0):(z(),O("div",ge,l[1]||(l[1]=[y("div",{text:"40","i-lucide:person-standing":""},null,-1)])))],64)}}});typeof st=="function"&&st(fe);export{fe as default}; +import{_ as mt}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js";import{_ as dt,a as gt}from"./Model.vue_vue_type_script_setup_true_lang-CuI1gVrl.js";import{d as Y,v as Z,c as O,o as z,e as p,m as ft,q as ut,bM as _t,s as bt,g as R,w as vt,bN as pt,b as S,x as ct,C as H,y as E,a as y,A as W,bF as wt,bH as P,D as U,bx as J,by as nt,bG as xt,bn as Ct,bE as Mt,k as kt,bw as Lt}from"./index-CL4rmUJ-.js";import{k as rt,l as yt,m as Vt,J as Dt}from"./live2d-zip-loader-DFrBymqv.js";import{_ as ot,a as St}from"./ColorPalette.vue_vue_type_script_setup_true_lang-CzX7Yr-T.js";import{u as zt}from"./useIconAnimation-D_Q3CYV7.js";import{b as st}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./index-CDeQ6Zfm.js";class Nt{constructor(t,e){this.pixels=t,this.opts=e;const{sigBits:i}=e,r=(M,L,v)=>(M<<2*i)+(L<>o,u=u>>o,d=d>>o;const L=r(l,u,d);a[L]===void 0&&(a[L]=0),a[L]+=1,l>c&&(c=l),lm&&(m=u),u_&&(_=d),dL>0?M+1:M,0),this.hist=a,this.rmax=c,this.rmin=h,this.gmax=m,this.gmin=f,this.bmax=_,this.bmin=b}get colorCount(){return this._colorCount}}class It{scaleDown(t){const e=this.getWidth(),i=this.getHeight();let r=1;if(t.maxDimension>0){const o=Math.max(e,i);o>t.maxDimension&&(r=t.maxDimension/o)}else r=1/t.quality;r<1&&this.resize(e*r,i*r,r)}}function Et(n,t){var e;if(t.length>0){const i=n.data,r=i.length/4;let o,s,a,c,h;for(let m=0;m{const s=()=>{this._initCanvas(),r(this)};e.complete?s():(e.onload=s,e.onerror=a=>o(new Error(`Fail to load image: ${i}`)))})}clear(){this._getContext().clearRect(0,0,this._getWidth(),this._getHeight())}update(t){this._getContext().putImageData(t,0,0)}getWidth(){return this._getWidth()}getHeight(){return this._getHeight()}resize(t,e,i){if(!this.image)throw new Error("Image is not initialized");this._width=this._getCanvas().width=t,this._height=this._getCanvas().height=e,this._getContext().scale(i,i),this._getContext().drawImage(this.image,0,0)}getPixelCount(){return this._getWidth()*this._getHeight()}getImageData(){return this._getContext().getImageData(0,0,this._getWidth(),this._getHeight())}remove(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)}}function T(n,...t){return t.forEach(e=>{if(e){for(const i in e)if(e.hasOwnProperty(i)){const r=e[i];Array.isArray(r)?n[i]=r.slice(0):typeof r=="object"?(n[i]||(n[i]={}),T(n[i],r)):n[i]=r}}}),n}function $t(n,t){const{colorCount:e,quantizer:i,generators:r,filters:o}=n,s={colorCount:e},a=typeof i=="string"?{name:i,options:{}}:i;return a.options=T({},s,a.options),T({},{quantizer:a,generators:r,filters:o},t)}class jt{constructor(t,e={}){this._src=t,this._opts=T({},F.DefaultOpts,e)}maxColorCount(t){return this._opts.colorCount=t,this}maxDimension(t){return this._opts.maxDimension=t,this}addFilter(t){return this._opts.filters?this._opts.filters.push(t):this._opts.filters=[t],this}removeFilter(t){if(this._opts.filters){const e=this._opts.filters.indexOf(t);e>0&&this._opts.filters.splice(e)}return this}clearFilters(){return this._opts.filters=[],this}quality(t){return this._opts.quality=t,this}useImageClass(t){return this._opts.ImageClass=t,this}useGenerator(t,e){return this._opts.generators||(this._opts.generators=[]),this._opts.generators.push(e?{name:t,options:e}:t),this}useQuantizer(t,e){return this._opts.quantizer=e?{name:t,options:e}:t,this}build(){return new F(this._src,this._opts)}getPalette(){return this.build().getPalette()}}class B{constructor(t){this.pipeline=t,this._map={}}names(){return Object.keys(this._map)}has(t){return!!this._map[t]}get(t){return this._map[t]}register(t,e){return this._map[t]=e,this.pipeline}}class Ut{constructor(){this.filter=new B(this),this.quantizer=new B(this),this.generator=new B(this)}_buildProcessTasks({filters:t,quantizer:e,generators:i}){return i.length===1&&i[0]==="*"&&(i=this.generator.names()),{filters:t.map(o=>r(this.filter,o)),quantizer:r(this.quantizer,e),generators:i.map(o=>r(this.generator,o))};function r(o,s){let a,c;return typeof s=="string"?a=s:(a=s.name,c=s.options),{name:a,fn:o.get(a),options:c}}}async process(t,e){const{filters:i,quantizer:r,generators:o}=this._buildProcessTasks(e),s=await this._filterColors(i,t),a=await this._generateColors(r,s),c=await this._generatePalettes(o,a);return{colors:a,palettes:c}}_filterColors(t,e){return Promise.resolve(Et(e,t.map(({fn:i})=>i)))}_generateColors(t,e){return Promise.resolve(t.fn(e.data,t.options))}async _generatePalettes(t,e){const i=await Promise.all(t.map(({fn:r,options:o})=>Promise.resolve(r(e,o))));return Promise.resolve(i.reduce((r,o,s)=>(r[t[s].name]=o,r),{}))}}function Tt(n,t,e){return"#"+((1<<24)+(n<<16)+(t<<8)+e).toString(16).slice(1,7)}function Rt(n,t,e){n/=255,t/=255,e/=255;const i=Math.max(n,t,e),r=Math.min(n,t,e);let o=0,s=0;const a=(i+r)/2;if(i!==r){const c=i-r;switch(s=a>.5?c/(2-i-r):c/(i+r),i){case n:o=(t-e)/c+(t1&&(h-=1),h<1/6?a+(c-a)*6*h:h<1/2?c:h<2/3?a+(c-a)*(2/3-h)*6:a}if(t===0)i=r=o=e;else{const a=e<.5?e*(1+t):e+t-e*t,c=2*e-a;i=s(c,a,n+1/3),r=s(c,a,n),o=s(c,a,n-1/3)}return[i*255,r*255,o*255]}class V{static applyFilters(t,e){return e.length>0?t.filter(({r:i,g:r,b:o})=>{var s;for(let a=0;a>=q,i>>=q,r>>=q,e>=o&&e<=s&&i>=a&&i<=c&&r>=h&&r<=m}split(){const{hist:t,getColorIndex:e}=this.histogram,{r1:i,r2:r,g1:o,g2:s,b1:a,b2:c}=this.dimension,h=this.count();if(!h)return[];if(h===1)return[this.clone()];const m=r-i+1,f=s-o+1,_=c-a+1,b=Math.max(m,f,_);let l=null,u,d;u=d=0;let g=null;if(b===m){g="r",l=new Uint32Array(r+1);for(let v=i;v<=r;v++){u=0;for(let x=o;x<=s;x++)for(let C=a;C<=c;C++){const D=e(v,x,C);t[D]&&(u+=t[D])}d+=u,l[v]=d}}else if(b===f){g="g",l=new Uint32Array(s+1);for(let v=o;v<=s;v++){u=0;for(let x=i;x<=r;x++)for(let C=a;C<=c;C++){const D=e(x,v,C);t[D]&&(u+=t[D])}d+=u,l[v]=d}}else{g="b",l=new Uint32Array(c+1);for(let v=a;v<=c;v++){u=0;for(let x=i;x<=r;x++)for(let C=o;C<=s;C++){const D=e(x,C,v);t[D]&&(u+=t[D])}d+=u,l[v]=d}}let w=-1;const N=new Uint32Array(l.length);for(let v=0;vd/2&&(w=v),N[v]=d-x)}const M=this;function L(v){const x=v+"1",C=v+"2",D=M.dimension[x];let k=M.dimension[C];const X=M.clone(),K=M.clone(),tt=w-D,et=k-w;for(tt<=et?(k=Math.min(k-1,~~(w+et/2)),k=Math.max(0,k)):(k=Math.max(D,~~(w-1-tt/2)),k=Math.min(M.dimension[C],k));!l[k];)k++;let it=N[k];for(;!it&&l[k-1];)it=N[--k];return X.dimension[C]=k,K.dimension[x]=k+1,[X,K]}return L(g)}}class at{_sort(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)}constructor(t){this._comparator=t,this.contents=[],this._sorted=!1}push(t){this.contents.push(t),this._sorted=!1}peek(t){return this._sort(),t=typeof t=="number"?t:this.contents.length-1,this.contents[t]}pop(){return this._sort(),this.contents.pop()}size(){return this.contents.length}map(t){return this._sort(),this.contents.map(t)}}const At=.75;function lt(n,t){let e=n.size();for(;n.size()0){const[r,o]=i.split();if(!r||(n.push(r),o&&o.count()>0&&n.push(o),n.size()===e))break;e=n.size()}else break}}const Bt=(n,t)=>{if(n.length===0||t.colorCount<2||t.colorCount>256)throw new Error("Wrong MMCQ parameters");const e=A.build(n);e.histogram.colorCount;const i=new at((o,s)=>o.count()-s.count());i.push(e),lt(i,At*t.colorCount);const r=new at((o,s)=>o.count()*o.volume()-s.count()*s.volume());return r.contents=i.contents,lt(r,t.colorCount-r.size()),qt(r)};function qt(n){const t=[];for(;n.size();){const e=n.pop(),i=e.avg();t.push(new V(i,e.count()))}return t}const Ht={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function Wt(n){let t=0;return n.forEach(e=>{t=Math.max(t,e.population)}),t}function Jt(n,t){return n.Vibrant===t||n.DarkVibrant===t||n.LightVibrant===t||n.Muted===t||n.DarkMuted===t||n.LightMuted===t}function Gt(n,t,e,i,r,o,s){function a(...h){let m=0,f=0;for(let _=0;_{const[,b,l]=_.hsl;if(b>=a&&b<=c&&l>=r&&l<=o&&!Jt(n,_)){const u=Gt(b,s,l,i,_.population,e,h);(m===null||u>f)&&(m=_,f=u)}}),m}function Qt(n,t,e){const i={Vibrant:null,DarkVibrant:null,LightVibrant:null,Muted:null,DarkMuted:null,LightMuted:null};return i.Vibrant=$(i,n,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.LightVibrant=$(i,n,t,e.targetLightLuma,e.minLightLuma,1,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.DarkVibrant=$(i,n,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetVibrantSaturation,e.minVibrantSaturation,1,e),i.Muted=$(i,n,t,e.targetNormalLuma,e.minNormalLuma,e.maxNormalLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.LightMuted=$(i,n,t,e.targetLightLuma,e.minLightLuma,1,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i.DarkMuted=$(i,n,t,e.targetDarkLuma,0,e.maxDarkLuma,e.targetMutesSaturation,0,e.maxMutesSaturation,e),i}function Yt(n,t,e){if(!n.Vibrant&&!n.DarkVibrant&&!n.LightVibrant){if(!n.DarkVibrant&&n.DarkMuted){let[i,r,o]=n.DarkMuted.hsl;o=e.targetDarkLuma,n.DarkVibrant=new V(I(i,r,o),0)}if(!n.LightVibrant&&n.LightMuted){let[i,r,o]=n.LightMuted.hsl;o=e.targetDarkLuma,n.DarkVibrant=new V(I(i,r,o),0)}}if(!n.Vibrant&&n.DarkVibrant){let[i,r,o]=n.DarkVibrant.hsl;o=e.targetNormalLuma,n.Vibrant=new V(I(i,r,o),0)}else if(!n.Vibrant&&n.LightVibrant){let[i,r,o]=n.LightVibrant.hsl;o=e.targetNormalLuma,n.Vibrant=new V(I(i,r,o),0)}if(!n.DarkVibrant&&n.Vibrant){let[i,r,o]=n.Vibrant.hsl;o=e.targetDarkLuma,n.DarkVibrant=new V(I(i,r,o),0)}if(!n.LightVibrant&&n.Vibrant){let[i,r,o]=n.Vibrant.hsl;o=e.targetLightLuma,n.LightVibrant=new V(I(i,r,o),0)}if(!n.Muted&&n.Vibrant){let[i,r,o]=n.Vibrant.hsl;o=e.targetMutesSaturation,n.Muted=new V(I(i,r,o),0)}if(!n.DarkMuted&&n.DarkVibrant){let[i,r,o]=n.DarkVibrant.hsl;o=e.targetMutesSaturation,n.DarkMuted=new V(I(i,r,o),0)}if(!n.LightMuted&&n.LightVibrant){let[i,r,o]=n.LightVibrant.hsl;o=e.targetMutesSaturation,n.LightMuted=new V(I(i,r,o),0)}}const Zt=(n,t)=>{t=Object.assign({},Ht,t);const e=Wt(n),i=Qt(n,e,t);return Yt(i,e,t),i},Xt=new Ut().filter.register("default",(n,t,e,i)=>i>=125&&!(n>250&&t>250&&e>250)).quantizer.register("mmcq",Bt).generator.register("default",Zt);F.use(Xt);const Kt=["disabled"],j=Y({__name:"Live2DModelControlButton",emits:["click"],setup(n){const t=Z();return(e,i)=>(z(),O("button",{disabled:p(t).loadingLive2dModel,bg:"zinc-100 dark:zinc-800",hover:"bg-zinc-200 dark:bg-zinc-700",transition:"all ease-in-out duration-250",rounded:"",onClick:i[0]||(i[0]=r=>e.$emit("click"))},[ft(e.$slots,"default")],8,Kt))}}),te={flex:"~ col gap-4"},ee={flex:"","items-center":"","gap-2":""},ie=["disabled","placeholder"],ne={"font-medium":""},re={flex:"","gap-2":""},oe=["onUpdate:modelValue"],se=["href","download"],ae=Y({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(n){const{t}=ut(),e=_t({accept:"application/zip"}),i=Z(),{live2dModelFile:r,live2dMotionMap:o,live2dLoadSource:s,loadingLive2dModel:a,availableLive2dMotions:c,live2dModelUrl:h}=bt(i),m=R(h.value);e.onChange(l=>{l&&l.length>0&&(o.value={},r.value=l[0],s.value="file",a.value=!0)}),vt(()=>i.loadingLive2dModel,l=>{l||s.value==="file"&&c.value.forEach(u=>{u.motionName in rt?o.value[u.fileName]=u.motionName:o.value[u.fileName]=yt})});async function f(l,u){if(!Object.keys(u).length)return l;const g=await new Dt().loadAsync(l),w=Object.keys(g.files).find(x=>x.endsWith("model3.json"));if(!w)throw new Error("model3.json not found");const N=await g.file(w).async("string"),M=JSON.parse(N),L={};Object.entries(u).forEach(([x,C])=>{if(L[C]){L[C].push({File:x});return}L[C]=[{File:x}]}),M.FileReferences.Motions=L,g.file(w,JSON.stringify(M,null,2));const v=await g.generateAsync({type:"blob"});return new File([v],l.name,{type:l.type,lastModified:l.lastModified})}async function _(){const l=await Vt.getItem("live2dModel");if(!l)return;const u=await f(l,o.value);r.value=u,s.value="file",a.value=!0}const b=pt(r);return(l,u)=>(z(),O("div",te,[S(p(ot),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:E(()=>[y("div",ee,[W(y("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>m.value=d),disabled:p(i).loadingLive2dModel,class:"form-control flex-1",border:"zinc-300 dark:zinc-800 solid 1 focus:zinc-400 dark:focus:zinc-600",transition:"border duration-250 ease-in-out",placeholder:p(t)("settings.live2d.change-model.from-url-placeholder")},null,8,ie),[[wt,m.value]]),S(j,{class:"form-control",onClick:u[1]||(u[1]=d=>h.value=m.value)},{default:E(()=>[P(U(p(t)("settings.live2d.change-model.from-url")),1)]),_:1})]),S(j,{class:"form-control place-self-end",onClick:u[2]||(u[2]=d=>p(e).open())},{default:E(()=>[P(U(p(t)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),S(j,{class:"form-control",onClick:u[3]||(u[3]=d=>l.$emit("extractColorsFromModel"))},{default:E(()=>u[4]||(u[4]=[P(" Extract colors from model ")])),_:1}),S(St,{colors:n.palette.map(d=>({hex:d,name:d}))},null,8,["colors"])]),_:1}),p(i).live2dLoadSource==="file"?(z(),ct(p(ot),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:E(()=>{var d;return[(z(!0),O(J,null,nt(p(i).availableLive2dMotions,g=>(z(),O("div",{key:g.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[y("span",ne,U(g.fileName),1),y("div",re,[W(y("select",{"onUpdate:modelValue":w=>p(i).live2dMotionMap[g.fileName]=w},[(z(!0),O(J,null,nt(Object.keys(p(rt)),w=>(z(),O("option",{key:w},U(w),1))),128))],8,oe),[[xt,p(i).live2dMotionMap[g.fileName]]]),S(j,{class:"form-control",onClick:w=>p(i).live2dCurrentMotion={group:g.motionName,index:g.motionIndex}},{default:E(()=>u[5]||(u[5]=[P(" Play ")])),_:2},1032,["onClick"])])]))),128)),S(j,{onClick:_},{default:E(()=>u[6]||(u[6]=[P(" Save and patch ")])),_:1}),y("a",{"mt-2":"",block:"",href:p(b),download:`${((d=p(i).live2dModelFile)==null?void 0:d.name)||"live2d"}-motion-edited.zip`},[S(j,{"w-full":""},{default:E(()=>u[7]||(u[7]=[P("Export")])),_:1})],8,se)]}),_:1})):H("",!0)]))}}),le=Ct(ae,[["__scopeId","data-v-de39498b"]]),ue={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},ce={relative:"","text-nowrap":""},he={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]",text:"neutral-300 dark:neutral-500"},me={"text-3xl":"","font-semibold":""},de={flex:""},ge={key:1,text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},fe=Y({__name:"index",setup(n){const{t}=ut(),e=Mt(),i=R(),r=R(),{width:o,height:s}=kt(i),a=Z(),c=R([]);async function h(){if(!r.value)return;const b=await r.value.captureFrame();if(!b){console.error("No frame captured");return}const l=URL.createObjectURL(b);try{const d=await new F(l).getPalette();c.value=Object.values(d).map(g=>g==null?void 0:g.hex).filter(g=>typeof g=="string")}finally{URL.revokeObjectURL(l)}}const{iconAnimationStarted:m,showIconAnimation:f,animationIcon:_}=zt("i-lucide:person-standing");return(b,l)=>{const u=mt,d=Lt("motion");return z(),O(J,null,[W((z(),O("div",ue,[y("button",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":"",onClick:l[0]||(l[0]=g=>p(e).back())}),y("h1",ce,[y("div",he,U(p(t)("settings.title")),1),y("div",me,U(p(t)("settings.pages.models.title")),1)])])),[[d]]),y("div",de,[y("div",{ref_key:"live2dContainerRef",ref:i,w:"50%",h:"80vh"},[S(gt,{ref_key:"live2dCanvasRef",ref:r,width:p(o),height:p(s)},{default:E(({app:g})=>[S(dt,{app:g,"mouth-open-size":0,width:p(o),height:p(s),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),S(le,{w:"50%",h:"80vh",palette:c.value,onExtractColorsFromModel:h},null,8,["palette"])]),p(f)?(z(),ct(u,{key:0,"z-index":-1,icon:p(_),"icon-size":12,duration:1e3,started:p(m),"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"])):H("",!0),p(a).usePageSpecificTransitions?H("",!0):(z(),O("div",ge,l[1]||(l[1]=[y("div",{text:"40","i-lucide:person-standing":""},null,-1)])))],64)}}});typeof st=="function"&&st(fe);export{fe as default}; diff --git a/assets/index-BQRIrFxp.js b/assets/index-C7IMxg5Y.js similarity index 94% rename from assets/index-BQRIrFxp.js rename to assets/index-C7IMxg5Y.js index 089dcb533c8f1cf3f846276097735b5f0770349e..810ae324eb5ff97270b21e3ca777e8acb3e0b891 100644 --- a/assets/index-BQRIrFxp.js +++ b/assets/index-C7IMxg5Y.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as S,r as A,x as y,o as r,y as D,a as i,c as g,C as h,m as P,D as k,z as R,bn as L,bE as q,g as l,q as N,v as V,h as F,bw as O,A as x,e as m,bx as $,by as j,n as G,bv as H}from"./index-BYewP6KR.js";import{_ as J}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js";import{b as I}from"./route-block-B_A1xBdJ.js";const K={"z-1":"","flex-1":""},M={"text-lg":"","font-bold":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},Q={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},U=S({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(n){return(c,v)=>{const f=A("RouterLink");return r(),y(f,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-800/50",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","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",class:"menu-icon-item",transition:"all ease-in-out duration-400",relative:"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",cursor:"pointer",to:n.to},{default:D(()=>[i("div",K,[i("div",M,k(n.title),1),i("div",Q,[i("span",null,k(n.description),1)])]),typeof n.icon=="string"?(r(),g("div",{key:0,class:R(["menu-icon-item-icon",[n.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-24":"","translate-y-4":"",text:"neutral-400/50 dark:neutral-600/50"},null,2)):h("",!0),n.iconTemplate?P(c.$slots,"icon",{key:1},void 0,!0):h("",!0)]),_:3},8,["to"])}}}),W=L(U,[["__scopeId","data-v-41370514"]]),X={flex:"","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},duration:100},Y={"text-3xl":""},Z={flex:"~ col gap-4"},tt={flex:"~ col gap-4"},et={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},it={text:"60","i-lucide:cog":""},nt=S({__name:"index",setup(n){const c=q(),v=l(!1),f=l(),d=l(),{t}=N(),b=l(""),w=l(""),C=l(!1),u=V();function T(){var o;(o=d.value)==null||o.call(d)}async function z(o,s){const e=o.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const p=e.getBoundingClientRect(),_=`${p.left}px, ${p.top}px`;b.value=s.icon,w.value=_,C.value=!0,await H(),v.value=!0}const B=c.beforeEach(async(o,s,a)=>{if(!u.usePageSpecificTransitions||u.disableTransitions){a();return}await new Promise(e=>{d.value=e}),B(),a()}),E=F(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-lucide:id-card",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-lucide:blocks",to:"/settings/modules"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-lucide:person-standing",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-lucide:sprout",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-lucide:brain",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-lucide:paintbrush",to:"/settings/appearance"}]);return(o,s)=>{const a=O("motion");return r(),g($,null,[x((r(),g("div",X,[i("button",{onClick:s[0]||(s[0]=e=>m(c).back())},s[1]||(s[1]=[i("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),i("h1",Y,k(o.$t("settings.title")),1)])),[[a]]),i("div",Z,[i("div",tt,[(r(!0),g($,null,j(E.value,(e,p)=>x((r(),y(m(W),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:G({transitionDelay:`${p*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:_=>z(_,e)},null,8,["style","title","description","icon","to","onClick"])),[[a]])),128))]),i("div",et,[x(i("div",it,null,512),[[a]])]),C.value&&!m(u).disableTransitions&&m(u).usePageSpecificTransitions?(r(),y(J,{key:0,ref_key:"iconAnimation",ref:f,icon:b.value,"icon-size":6*1.2,position:w.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:v.value,onAnimationEndedOnce:T},null,8,["icon","position","started"])):h("",!0)])],64)}}});typeof I=="function"&&I(nt);export{nt as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as S,r as A,x as y,o as r,y as D,a as i,c as g,C as h,m as P,D as k,z as R,bn as L,bE as q,g as l,q as N,v as V,h as F,bw as O,A as x,e as m,bx as $,by as j,n as G,bv as H}from"./index-CL4rmUJ-.js";import{_ as J}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js";import{b as I}from"./route-block-B_A1xBdJ.js";const K={"z-1":"","flex-1":""},M={"text-lg":"","font-bold":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},Q={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},U=S({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(n){return(c,v)=>{const f=A("RouterLink");return r(),y(f,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-800/50",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","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",class:"menu-icon-item",transition:"all ease-in-out duration-400",relative:"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",cursor:"pointer",to:n.to},{default:D(()=>[i("div",K,[i("div",M,k(n.title),1),i("div",Q,[i("span",null,k(n.description),1)])]),typeof n.icon=="string"?(r(),g("div",{key:0,class:R(["menu-icon-item-icon",[n.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-24":"","translate-y-4":"",text:"neutral-400/50 dark:neutral-600/50"},null,2)):h("",!0),n.iconTemplate?P(c.$slots,"icon",{key:1},void 0,!0):h("",!0)]),_:3},8,["to"])}}}),W=L(U,[["__scopeId","data-v-41370514"]]),X={flex:"","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},duration:100},Y={"text-3xl":""},Z={flex:"~ col gap-4"},tt={flex:"~ col gap-4"},et={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},it={text:"60","i-lucide:cog":""},nt=S({__name:"index",setup(n){const c=q(),v=l(!1),f=l(),d=l(),{t}=N(),b=l(""),w=l(""),C=l(!1),u=V();function T(){var o;(o=d.value)==null||o.call(d)}async function z(o,s){const e=o.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const p=e.getBoundingClientRect(),_=`${p.left}px, ${p.top}px`;b.value=s.icon,w.value=_,C.value=!0,await H(),v.value=!0}const B=c.beforeEach(async(o,s,a)=>{if(!u.usePageSpecificTransitions||u.disableTransitions){a();return}await new Promise(e=>{d.value=e}),B(),a()}),E=F(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-lucide:id-card",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-lucide:blocks",to:"/settings/modules"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-lucide:person-standing",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-lucide:sprout",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-lucide:brain",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-lucide:paintbrush",to:"/settings/appearance"}]);return(o,s)=>{const a=O("motion");return r(),g($,null,[x((r(),g("div",X,[i("button",{onClick:s[0]||(s[0]=e=>m(c).back())},s[1]||(s[1]=[i("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),i("h1",Y,k(o.$t("settings.title")),1)])),[[a]]),i("div",Z,[i("div",tt,[(r(!0),g($,null,j(E.value,(e,p)=>x((r(),y(m(W),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:G({transitionDelay:`${p*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:_=>z(_,e)},null,8,["style","title","description","icon","to","onClick"])),[[a]])),128))]),i("div",et,[x(i("div",it,null,512),[[a]])]),C.value&&!m(u).disableTransitions&&m(u).usePageSpecificTransitions?(r(),y(J,{key:0,ref_key:"iconAnimation",ref:f,icon:b.value,"icon-size":6*1.2,position:w.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:v.value,onAnimationEndedOnce:T},null,8,["icon","position","started"])):h("",!0)])],64)}}});typeof I=="function"&&I(nt);export{nt as default}; diff --git a/assets/index-C4TaASqf.js b/assets/index-CDeQ6Zfm.js similarity index 99% rename from assets/index-C4TaASqf.js rename to assets/index-CDeQ6Zfm.js index 4655cc5d7f0b4492239125d81638d4318265879e..4ecd166c9fa765c08a3782f7212fe9ac5ce32282 100644 --- a/assets/index-C4TaASqf.js +++ b/assets/index-CDeQ6Zfm.js @@ -1,3 +1,3 @@ -import{h as O,g as E,G as Mt,w as j,ah as Lt,ai as Ft,bS as xe,e as m,d as D,x as T,o as B,y as A,m as P,bT as de,bU as fe,bV as F,bJ as Ze,bv as ge,l as De,E as lt,C as Nt,b as me,bW as yn,bX as ye,bY as wn,bZ as kt,b_ as bn,b$ as ke,c0 as xn,c1 as On,br as Cn,H as It,bx as An,c2 as Wt,c3 as En,c4 as Ht,c5 as xt,af as K,ab as Dn,bH as Pn,D as _n,c as Vt,n as st,c6 as jt,c7 as Bn,c8 as zt,c9 as Tn,ca as Rn,a as $n,cb as Sn,cc as Mn}from"./index-BYewP6KR.js";const Ln=["top","right","bottom","left"],ae=Math.min,H=Math.max,Ie=Math.round,Me=Math.floor,G=e=>({x:e,y:e}),Fn={left:"right",right:"left",bottom:"top",top:"bottom"},Nn={start:"end",end:"start"};function Qe(e,t,n){return H(e,ae(t,n))}function ee(e,t){return typeof e=="function"?e(t):e}function te(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function at(e){return e==="x"?"y":"x"}function ut(e){return e==="y"?"height":"width"}function ue(e){return["top","bottom"].includes(te(e))?"y":"x"}function ct(e){return at(ue(e))}function kn(e,t,n){n===void 0&&(n=!1);const o=Pe(e),i=ct(e),r=ut(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=We(l)),[l,We(l)]}function In(e){const t=We(e);return[et(e),t,et(t)]}function et(e){return e.replace(/start|end/g,t=>Nn[t])}function Wn(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Hn(e,t,n,o){const i=Pe(e);let r=Wn(te(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(et)))),r}function We(e){return e.replace(/left|right|bottom|top/g,t=>Fn[t])}function Vn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kt(e){return typeof e!="number"?Vn(e):{top:e,right:e,bottom:e,left:e}}function He(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Ot(e,t,n){let{reference:o,floating:i}=e;const r=ue(t),l=ct(t),s=ut(l),d=te(t),c=r==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[s]/2-i[s]/2;let f;switch(d){case"top":f={x:a,y:o.y-i.height};break;case"bottom":f={x:a,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(Pe(t)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1);break}return f}const jn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:u}=Ot(c,o,d),p=o,f={},v=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:d}=t,{element:c,padding:a=0}=ee(e,t)||{};if(c==null)return{};const u=Kt(a),p={x:n,y:o},f=ct(i),v=ut(f),g=await l.getDimensions(c),h=f==="y",y=h?"top":"left",b=h?"bottom":"right",w=h?"clientHeight":"clientWidth",C=r.reference[v]+r.reference[f]-p[f]-r.floating[v],x=p[f]-r.reference[f],S=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let _=S?S[w]:0;(!_||!await(l.isElement==null?void 0:l.isElement(S)))&&(_=s.floating[w]||r.floating[v]);const M=C/2-x/2,N=_/2-g[v]/2-1,R=ae(u[y],N),z=ae(u[b],N),k=R,W=_-g[v]-z,L=_/2-g[v]/2+M,oe=Qe(k,L,W),I=!d.arrow&&Pe(i)!=null&&L!==oe&&r.reference[v]/2-(LL<=0)){var z,k;const L=(((z=r.flip)==null?void 0:z.index)||0)+1,oe=_[L];if(oe)return{data:{index:L,overflows:R},reset:{placement:oe}};let I=(k=R.filter(q=>q.overflows[0]<=0).sort((q,ie)=>q.overflows[1]-ie.overflows[1])[0])==null?void 0:k.placement;if(!I)switch(f){case"bestFit":{var W;const q=(W=R.filter(ie=>{if(S){const re=ue(ie.placement);return re===b||re==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(re=>re>0).reduce((re,gn)=>re+gn,0)]).sort((ie,re)=>ie[1]-re[1])[0])==null?void 0:W[0];q&&(I=q);break}case"initialPlacement":I=s;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function Ct(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function At(e){return Ln.some(t=>e[t]>=0)}const Un=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ee(e,t);switch(o){case"referenceHidden":{const r=await _e(t,{...i,elementContext:"reference"}),l=Ct(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:At(l)}}}case"escaped":{const r=await _e(t,{...i,altBoundary:!0}),l=Ct(r,n.floating);return{data:{escapedOffsets:l,escaped:At(l)}}}default:return{}}}}};async function Yn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=te(n),s=Pe(n),d=ue(n)==="y",c=["left","top"].includes(l)?-1:1,a=r&&d?-1:1,u=ee(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof v=="number"&&(f=s==="end"?v*-1:v),d?{x:f*a,y:p*c}:{x:p*c,y:f*a}}const Xn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,d=await Yn(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:l}}}}},qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:h=>{let{x:y,y:b}=h;return{x:y,y:b}}},...d}=ee(e,t),c={x:n,y:o},a=await _e(t,d),u=ue(te(i)),p=at(u);let f=c[p],v=c[u];if(r){const h=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=f+a[h],w=f-a[y];f=Qe(b,f,w)}if(l){const h=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=v+a[h],w=v-a[y];v=Qe(b,v,w)}const g=s.fn({...t,[p]:f,[u]:v});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[p]:r,[u]:l}}}}}},Gn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=t,{offset:s=0,mainAxis:d=!0,crossAxis:c=!0}=ee(e,t),a={x:n,y:o},u=ue(i),p=at(u);let f=a[p],v=a[u];const g=ee(s,t),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(d){const w=p==="y"?"height":"width",C=r.reference[p]-r.floating[w]+h.mainAxis,x=r.reference[p]+r.reference[w]-h.mainAxis;fx&&(f=x)}if(c){var y,b;const w=p==="y"?"width":"height",C=["top","left"].includes(te(i)),x=r.reference[u]-r.floating[w]+(C&&((y=l.offset)==null?void 0:y[u])||0)+(C?0:h.crossAxis),S=r.reference[u]+r.reference[w]+(C?0:((b=l.offset)==null?void 0:b[u])||0)-(C?h.crossAxis:0);vS&&(v=S)}return{[p]:f,[u]:v}}}},Jn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:r,platform:l,elements:s}=t,{apply:d=()=>{},...c}=ee(e,t),a=await _e(t,c),u=te(i),p=Pe(i),f=ue(i)==="y",{width:v,height:g}=r.floating;let h,y;u==="top"||u==="bottom"?(h=u,y=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,h=p==="end"?"top":"bottom");const b=g-a.top-a.bottom,w=v-a.left-a.right,C=ae(g-a[h],b),x=ae(v-a[y],w),S=!t.middlewareData.shift;let _=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=b),S&&!p){const R=H(a.left,0),z=H(a.right,0),k=H(a.top,0),W=H(a.bottom,0);f?M=v-2*(R!==0||z!==0?R+z:H(a.left,a.right)):_=g-2*(k!==0||W!==0?k+W:H(a.top,a.bottom))}await d({...t,availableWidth:M,availableHeight:_});const N=await l.getDimensions(s.floating);return v!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function je(){return typeof window<"u"}function we(e){return dt(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Z(e){var t;return(t=(dt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dt(e){return je()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return je()?e instanceof Element||e instanceof V(e).Element:!1}function J(e){return je()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function Et(e){return!je()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function Te(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Zn(e){return["table","td","th"].includes(we(e))}function ze(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ft(e){const t=pt(),n=U(e)?Y(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Qn(e){let t=ce(e);for(;J(t)&&!Ee(t);){if(ft(t))return t;if(ze(t))return null;t=ce(t)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ee(e){return["html","body","#document"].includes(we(e))}function Y(e){return V(e).getComputedStyle(e)}function Ke(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(we(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||Z(e);return Et(t)?t.host:t}function Ut(e){const t=ce(e);return Ee(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Te(t)?t:Ut(t)}function Be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ut(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=V(i);if(r){const s=tt(l);return t.concat(l,l.visualViewport||[],Te(i)?i:[],s&&n?Be(s):[])}return t.concat(i,Be(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=Ie(n)!==r||Ie(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function vt(e){return U(e)?e:e.contextElement}function Ae(e){const t=vt(e);if(!J(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Yt(t);let l=(r?Ie(n.width):n.width)/o,s=(r?Ie(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const eo=G(0);function Xt(e){const t=V(e);return!pt()||!t.visualViewport?eo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function to(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function he(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=vt(e);let l=G(1);t&&(o?U(o)&&(l=Ae(o)):l=Ae(e));const s=to(r,n,o)?Xt(r):G(0);let d=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,a=i.width/l.x,u=i.height/l.y;if(r){const p=V(r),f=o&&U(o)?V(o):o;let v=p,g=tt(v);for(;g&&o&&f!==v;){const h=Ae(g),y=g.getBoundingClientRect(),b=Y(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*h.x,C=y.top+(g.clientTop+parseFloat(b.paddingTop))*h.y;d*=h.x,c*=h.y,a*=h.x,u*=h.y,d+=w,c+=C,v=V(g),g=tt(v)}}return He({width:a,height:u,x:d,y:c})}function mt(e,t){const n=Ke(e).scrollLeft;return t?t.left+n:he(Z(e)).left+n}function qt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:mt(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function no(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=Z(o),s=t?ze(t.floating):!1;if(o===l||s&&r)return n;let d={scrollLeft:0,scrollTop:0},c=G(1);const a=G(0),u=J(o);if((u||!u&&!r)&&((we(o)!=="body"||Te(l))&&(d=Ke(o)),J(o))){const f=he(o);c=Ae(o),a.x=f.x+o.clientLeft,a.y=f.y+o.clientTop}const p=l&&!u&&!r?qt(l,d,!0):G(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+a.x+p.x,y:n.y*c.y-d.scrollTop*c.y+a.y+p.y}}function oo(e){return Array.from(e.getClientRects())}function io(e){const t=Z(e),n=Ke(e),o=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+mt(e);const s=-n.scrollTop;return Y(o).direction==="rtl"&&(l+=H(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function ro(e,t){const n=V(e),o=Z(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,d=0;if(i){r=i.width,l=i.height;const c=pt();(!c||c&&t==="fixed")&&(s=i.offsetLeft,d=i.offsetTop)}return{width:r,height:l,x:s,y:d}}function lo(e,t){const n=he(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?Ae(e):G(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,d=i*r.x,c=o*r.y;return{width:l,height:s,x:d,y:c}}function Dt(e,t,n){let o;if(t==="viewport")o=ro(e,n);else if(t==="document")o=io(Z(e));else if(U(t))o=lo(t,n);else{const i=Xt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return He(o)}function Gt(e,t){const n=ce(e);return n===t||!U(n)||Ee(n)?!1:Y(n).position==="fixed"||Gt(n,t)}function so(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(s=>U(s)&&we(s)!=="body"),i=null;const r=Y(e).position==="fixed";let l=r?ce(e):e;for(;U(l)&&!Ee(l);){const s=Y(l),d=ft(l);!d&&s.position==="fixed"&&(i=null),(r?!d&&!i:!d&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Te(l)&&!d&&Gt(e,l))?o=o.filter(a=>a!==l):i=s,l=ce(l)}return t.set(e,o),o}function ao(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?ze(t)?[]:so(t,this._c):[].concat(n),o],s=l[0],d=l.reduce((c,a)=>{const u=Dt(t,a,i);return c.top=H(u.top,c.top),c.right=ae(u.right,c.right),c.bottom=ae(u.bottom,c.bottom),c.left=H(u.left,c.left),c},Dt(t,s,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function uo(e){const{width:t,height:n}=Yt(e);return{width:t,height:n}}function co(e,t,n){const o=J(t),i=Z(t),r=n==="fixed",l=he(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const d=G(0);if(o||!o&&!r)if((we(t)!=="body"||Te(i))&&(s=Ke(t)),o){const p=he(t,!0,r,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else i&&(d.x=mt(i));const c=i&&!o&&!r?qt(i,s):G(0),a=l.left+s.scrollLeft-d.x-c.x,u=l.top+s.scrollTop-d.y-c.y;return{x:a,y:u,width:l.width,height:l.height}}function Ye(e){return Y(e).position==="static"}function Pt(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Z(e)===n&&(n=n.ownerDocument.body),n}function Jt(e,t){const n=V(e);if(ze(e))return n;if(!J(e)){let i=ce(e);for(;i&&!Ee(i);){if(U(i)&&!Ye(i))return i;i=ce(i)}return n}let o=Pt(e,t);for(;o&&Zn(o)&&Ye(o);)o=Pt(o,t);return o&&Ee(o)&&Ye(o)&&!ft(o)?n:o||Qn(e)||n}const fo=async function(e){const t=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(e.floating);return{reference:co(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function po(e){return Y(e).direction==="rtl"}const vo={convertOffsetParentRelativeRectToViewportRelativeRect:no,getDocumentElement:Z,getClippingRect:ao,getOffsetParent:Jt,getElementRects:fo,getClientRects:oo,getDimensions:uo,getScale:Ae,isElement:U,isRTL:po};function Zt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mo(e,t){let n=null,o;const i=Z(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,d){s===void 0&&(s=!1),d===void 0&&(d=1),r();const c=e.getBoundingClientRect(),{left:a,top:u,width:p,height:f}=c;if(s||t(),!p||!f)return;const v=Me(u),g=Me(i.clientWidth-(a+p)),h=Me(i.clientHeight-(u+f)),y=Me(a),w={rootMargin:-v+"px "+-g+"px "+-h+"px "+-y+"px",threshold:H(0,ae(1,d))||1};let C=!0;function x(S){const _=S[0].intersectionRatio;if(_!==d){if(!C)return l();_?l(!1,_):o=setTimeout(()=>{l(!1,1e-7)},1e3)}_===1&&!Zt(c,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(x,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return l(!0),r}function ho(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=vt(e),a=i||r?[...c?Be(c):[],...Be(t)]:[];a.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const u=c&&s?mo(c,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!d&&f.observe(c),f.observe(t));let v,g=d?he(e):null;d&&h();function h(){const y=he(e);g&&!Zt(g,y)&&n(),g=y,v=requestAnimationFrame(h)}return n(),()=>{var y;a.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),u==null||u(),(y=f)==null||y.disconnect(),f=null,d&&cancelAnimationFrame(v)}}const go=Xn,yo=qn,_t=Kn,wo=Jn,bo=Un,xo=zn,Oo=Gn,Co=(e,t,n)=>{const o=new Map,i={platform:vo,...n},r={...i.platform,_c:o};return jn(e,t,{...i,platform:r})};function Ao(e){return e!=null&&typeof e=="object"&&"$el"in e}function nt(e){if(Ao(e)){const t=e.$el;return dt(t)&&we(t)==="#comment"?null:t}return e}function Ce(e){return typeof e=="function"?e():m(e)}function Eo(e){return{name:"arrow",options:e,fn(t){const n=nt(Ce(e.element));return n==null?{}:xo({element:n,padding:e.padding}).fn(t)}}}function Qt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bt(e,t){const n=Qt(e);return Math.round(t*n)/n}function Do(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=O(()=>{var _;return(_=Ce(n.open))!=null?_:!0}),r=O(()=>Ce(n.middleware)),l=O(()=>{var _;return(_=Ce(n.placement))!=null?_:"bottom"}),s=O(()=>{var _;return(_=Ce(n.strategy))!=null?_:"absolute"}),d=O(()=>{var _;return(_=Ce(n.transform))!=null?_:!0}),c=O(()=>nt(e.value)),a=O(()=>nt(t.value)),u=E(0),p=E(0),f=E(s.value),v=E(l.value),g=Mt({}),h=E(!1),y=O(()=>{const _={position:f.value,left:"0",top:"0"};if(!a.value)return _;const M=Bt(a.value,u.value),N=Bt(a.value,p.value);return d.value?{..._,transform:"translate("+M+"px, "+N+"px)",...Qt(a.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:M+"px",top:N+"px"}});let b;function w(){if(c.value==null||a.value==null)return;const _=i.value;Co(c.value,a.value,{middleware:r.value,placement:l.value,strategy:s.value}).then(M=>{u.value=M.x,p.value=M.y,f.value=M.strategy,v.value=M.placement,g.value=M.middlewareData,h.value=_!==!1})}function C(){typeof b=="function"&&(b(),b=void 0)}function x(){if(C(),o===void 0){w();return}if(c.value!=null&&a.value!=null){b=o(c.value,a.value,w);return}}function S(){i.value||(h.value=!1)}return j([r,l,s,i],w,{flush:"sync"}),j([c,a],x,{flush:"sync"}),j(i,S,{flush:"sync"}),Lt()&&Ft(C),{x:xe(u),y:xe(p),strategy:xe(f),placement:xe(v),middlewareData:xe(g),isPositioned:xe(h),floatingStyles:y,update:w}}function be(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[i=>{const r=bn(o,i);if(r||r===null)return r;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},i=>(Mn(o,i),i)]}function en(e,t,n){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(i)}function Po(e,t){var n;const o=Mt();return K(()=>{o.value=e()},{...t,flush:(n=void 0)!=null?n:"sync"}),Ht(o)}function Re(e){return Lt()?(Ft(e),!0):!1}function _o(){const e=new Set,t=n=>{e.delete(n)};return{on:n=>{e.add(n);const o=()=>t(n);return Re(o),{off:o}},off:t,trigger:(...n)=>Promise.all(Array.from(e).map(o=>o(...n)))}}function Bo(e){let t=!1,n;const o=jt(!0);return(...i)=>(t||(n=o.run(()=>e(...i)),t=!0),n)}function To(e){let t=0,n,o;const i=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return(...r)=>(t+=1,n||(o=jt(!0),n=o.run(()=>e(...r))),Re(i),n)}function ve(e){return typeof e=="function"?e():m(e)}const pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ro=e=>typeof e<"u",$o=Object.prototype.toString,So=e=>$o.call(e)==="[object Object]",Mo=()=>{},Tt=Lo();function Lo(){var e,t;return pe&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Fo(e){return ye()}function No(e,t=1e4){return Sn((n,o)=>{let i=ve(e),r;const l=()=>setTimeout(()=>{i=ve(e),o()},ve(t));return Re(()=>{clearTimeout(r)}),{get(){return n(),i},set(s){i=s,o(),clearTimeout(r),r=l()}}})}function ko(e,t){Fo()&&Bn(e,t)}function tn(e,t,n={}){const{immediate:o=!0}=n,i=E(!1);let r=null;function l(){r&&(clearTimeout(r),r=null)}function s(){i.value=!1,l()}function d(...c){l(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...c)},ve(t))}return o&&(i.value=!0,pe&&d()),Re(s),{isPending:Ht(i),start:d,stop:s}}function $e(e){var t;const n=ve(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ht=pe?window:void 0;function Ve(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=ht):[t,n,o,i]=e,!t)return Mo;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],l=()=>{r.forEach(a=>a()),r.length=0},s=(a,u,p,f)=>(a.addEventListener(u,p,f),()=>a.removeEventListener(u,p,f)),d=j(()=>[$e(t),ve(i)],([a,u])=>{if(l(),!a)return;const p=So(u)?{...u}:u;r.push(...n.flatMap(f=>o.map(v=>s(a,f,v,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return Re(c),c}function Io(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Wo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=ht,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=o,d=Io(t);return Ve(i,r,c=>{c.repeat&&ve(s)||d(c)&&n(c)},l)}function Ho(){const e=E(!1),t=ye();return t&&De(()=>{e.value=!0},t),e}function Vo(e){return JSON.parse(JSON.stringify(e))}function nn(e,t,n,o={}){var i,r,l;const{clone:s=!1,passive:d=!1,eventName:c,deep:a=!1,defaultValue:u,shouldEmit:p}=o,f=ye(),v=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let g=c;g=g||`update:${t.toString()}`;const h=w=>s?typeof s=="function"?s(w):Vo(w):w,y=()=>Ro(e[t])?h(e[t]):u,b=w=>{p?p(w)&&v(g,w):v(g,w)};if(d){const w=y(),C=E(w);let x=!1;return j(()=>e[t],S=>{x||(x=!0,C.value=h(S),ge(()=>x=!1))}),j(C,S=>{!x&&(S!==e[t]||a)&&b(S)},{deep:a}),C}else return O({get(){return y()},set(w){b(w)}})}function gt(e){return e?e.flatMap(t=>t.type===An?gt(t.children):[t]):[]}function se(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Xe(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function ot(e,t,n=".",o){if(!Xe(t))return ot(e,{},n);const i=Object.assign({},t);for(const r in e){if(r==="__proto__"||r==="constructor")continue;const l=e[r];l!=null&&(Array.isArray(l)&&Array.isArray(i[r])?i[r]=[...l,...i[r]]:Xe(l)&&Xe(i[r])?i[r]=ot(l,i[r],(n?`${n}.`:"")+r.toString()):i[r]=l)}return i}function jo(e){return(...t)=>t.reduce((n,o)=>ot(n,o,""),{})}const zo=jo(),[on,nr]=be("ConfigProvider");let Ko="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Uo=(e=21)=>{let t="",n=e;for(;n--;)t+=Ko[Math.random()*64|0];return t};const Yo=To(()=>{const e=E(new Map),t=E(),n=O(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=on({scrollBody:E(!0)});let i=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",Tt&&(i==null||i()),t.value=void 0};return j(n,(l,s)=>{var d;if(!pe)return;if(!l){s&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,a={padding:c,margin:0},u=(d=o.scrollBody)!=null&&d.value?typeof o.scrollBody.value=="object"?zo({padding:o.scrollBody.value.padding===!0?c:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?c:o.scrollBody.value.margin},a):a:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),Tt&&(i=Ve(document,"touchmove",p=>qo(p),{passive:!1})),ge(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function Xo(e){const t=Uo(6),n=Yo();n.value.set(t,e);const o=O({get:()=>n.value.get(t)??!1,set:i=>n.value.set(t,i)});return ko(()=>{n.value.delete(t)}),o}function rn(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Se(e){const t=ye(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(i=>{o[wn(kt(i))]=(...r)=>e(i,...r)}),o}function ln(e){const t=ye(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((i,r)=>{const l=(t==null?void 0:t.type.props[r]).default;return l!==void 0&&(i[r]=l),i},{}),o=Cn(e);return O(()=>{const i={},r=(t==null?void 0:t.vnode.props)??{};return Object.keys(r).forEach(l=>{i[kt(l)]=r[l]}),Object.keys({...n,...i}).reduce((l,s)=>(o.value[s]!==void 0&&(l[s]=o.value[s]),l),{})})}function sn(e,t){const n=ln(e),o=t?Se(t):{};return O(()=>({...n.value,...o}))}function $(){const e=ye(),t=E(),n=O(()=>{var l,s;return["#text","#comment"].includes((l=t.value)==null?void 0:l.$el.nodeName)?(s=t.value)==null?void 0:s.$el.nextElementSibling:$e(t)}),o=Object.assign({},e.exposed),i={};for(const l in e.props)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function r(l){t.value=l,l&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=i)}return{forwardRef:r,currentRef:t,currentElement:n}}function Go(e,t){const n=No(!1,300),o=E(null),i=_o();function r(){o.value=null,n.value=!1}function l(s,d){const c=s.currentTarget,a={x:s.clientX,y:s.clientY},u=Jo(a,c.getBoundingClientRect()),p=Zo(a,u),f=Qo(d.getBoundingClientRect()),v=ti([...p,...f]);o.value=v,n.value=!0}return K(s=>{if(e.value&&t.value){const d=a=>l(a,t.value),c=a=>l(a,e.value);e.value.addEventListener("pointerleave",d),t.value.addEventListener("pointerleave",c),s(()=>{var a,u;(a=e.value)==null||a.removeEventListener("pointerleave",d),(u=t.value)==null||u.removeEventListener("pointerleave",c)})}}),K(s=>{var d;if(o.value){const c=a=>{var u,p;if(!o.value)return;const f=a.target,v={x:a.clientX,y:a.clientY},g=((u=e.value)==null?void 0:u.contains(f))||((p=t.value)==null?void 0:p.contains(f)),h=!ei(v,o.value),y=!!f.closest("[data-grace-area-trigger]");g?r():(h||y)&&(r(),i.trigger())};(d=e.value)==null||d.ownerDocument.addEventListener("pointermove",c),s(()=>{var a;return(a=e.value)==null?void 0:a.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function Jo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,o,i,r)){case r:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zo(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Qo(e){const{top:t,right:n,bottom:o,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:o},{x:i,y:o}]}function ei(e,t){const{x:n,y:o}=e;let i=!1;for(let r=0,l=t.length-1;ro!=a>o&&n<(c-s)*(o-d)/(a-d)+s&&(i=!i)}return i}function ti(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),ni(t)}function ni(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const r=t[t.length-1],l=t[t.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;n.length>=2;){const r=n[n.length-1],l=n[n.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var oi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Le=new WeakMap,Fe={},qe=0,an=function(e){return e&&(e.host||an(e.parentNode))},ii=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=an(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ri=function(e,t,n,o){var i=ii(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var r=Fe[n],l=[],s=new Set,d=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var a=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))a(p);else try{var f=p.getAttribute(o),v=f!==null&&f!=="false",g=(Oe.get(p)||0)+1,h=(r.get(p)||0)+1;Oe.set(p,g),r.set(p,h),l.push(p),g===1&&v&&Le.set(p,!0),h===1&&p.setAttribute(n,"true"),v||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return a(t),s.clear(),qe++,function(){l.forEach(function(u){var p=Oe.get(u)-1,f=r.get(u)-1;Oe.set(u,p),r.set(u,f),p||(Le.has(u)||u.removeAttribute(o),Le.delete(u)),f||u.removeAttribute(n)}),qe--,qe||(Oe=new WeakMap,Oe=new WeakMap,Le=new WeakMap,Fe={})}},li=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=oi(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),ri(o,i,n,"aria-hidden")):function(){return null}};function si(e){let t;j(()=>$e(e),n=>{n?t=li(n):t&&t()}),It(()=>{t&&t()})}let ai=0;function it(e,t="radix"){const n=on({useId:void 0});return xt?`${t}-${xt()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++ai}`}function ui(e){const t=E(),n=O(()=>{var i;return((i=t.value)==null?void 0:i.width)??0}),o=O(()=>{var i;return((i=t.value)==null?void 0:i.height)??0});return De(()=>{const i=$e(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const r=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const s=l[0];let d,c;if("borderBoxSize"in s){const a=s.borderBoxSize,u=Array.isArray(a)?a[0]:a;d=u.inlineSize,c=u.blockSize}else d=i.offsetWidth,c=i.offsetHeight;t.value={width:d,height:c}});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else t.value=void 0}),{width:n,height:o}}function ci(e,t){const n=E(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}const di=D({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o,i;if(!n.default)return null;const r=gt(n.default()),l=r.findIndex(a=>a.type!==Wt);if(l===-1)return r;const s=r[l];(o=s.props)==null||delete o.ref;const d=s.props?F(t,s.props):t;t.class&&(i=s.props)!=null&&i.class&&delete s.props.class;const c=En(s,d);for(const a in d)a.startsWith("on")&&(c.props||(c.props={}),c.props[a]=d[a]);return r.length===1?c:(r[l]=c,r)}}}),X=D({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>ke(o,t):o!=="template"?()=>ke(e.as,t,{default:n.default}):()=>ke(di,t,{default:n.default})}});function fi(e,t){var n;const o=E({}),i=E("none"),r=E(e),l=e.value?"mounted":"unmounted";let s;const d=((n=t.value)==null?void 0:n.ownerDocument.defaultView)??ht,{state:c,dispatch:a}=ci(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=h=>{var y;if(pe){const b=new CustomEvent(h,{bubbles:!1,cancelable:!1});(y=t.value)==null||y.dispatchEvent(b)}};j(e,async(h,y)=>{var b;const w=y!==h;if(await ge(),w){const C=i.value,x=Ne(t.value);h?(a("MOUNT"),u("enter"),x==="none"&&u("after-enter")):x==="none"||((b=o.value)==null?void 0:b.display)==="none"?(a("UNMOUNT"),u("leave"),u("after-leave")):y&&C!==x?(a("ANIMATION_OUT"),u("leave")):(a("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=h=>{const y=Ne(t.value),b=y.includes(h.animationName),w=c.value==="mounted"?"enter":"leave";if(h.target===t.value&&b&&(u(`after-${w}`),a("ANIMATION_END"),!r.value)){const C=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",s=d==null?void 0:d.setTimeout(()=>{var x;((x=t.value)==null?void 0:x.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=C)})}h.target===t.value&&y==="none"&&a("ANIMATION_END")},f=h=>{h.target===t.value&&(i.value=Ne(t.value))},v=j(t,(h,y)=>{h?(o.value=getComputedStyle(h),h.addEventListener("animationstart",f),h.addEventListener("animationcancel",p),h.addEventListener("animationend",p)):(a("ANIMATION_END"),s!==void 0&&(d==null||d.clearTimeout(s)),y==null||y.removeEventListener("animationstart",f),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=j(c,()=>{const h=Ne(t.value);i.value=c.value==="mounted"?h:"none"});return It(()=>{v(),g()}),{isPresent:O(()=>["mounted","unmountSuspended"].includes(c.value))}}function Ne(e){return e&&getComputedStyle(e).animationName||"none"}const yt=D({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var o;const{present:i,forceMount:r}=lt(e),l=E(),{isPresent:s}=fi(i,l);n({present:s});let d=t.default({present:s});d=gt(d||[]);const c=ye();if(d&&(d==null?void 0:d.length)>1){const a=(o=c==null?void 0:c.parent)!=null&&o.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${a}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` +import{h as O,g as E,G as Mt,w as j,ah as Lt,ai as Ft,bS as xe,e as m,d as D,x as T,o as B,y as A,m as P,bT as de,bU as fe,bV as F,bJ as Ze,bv as ge,l as De,E as lt,C as Nt,b as me,bW as yn,bX as ye,bY as wn,bZ as kt,b_ as bn,b$ as ke,c0 as xn,c1 as On,br as Cn,H as It,bx as An,c2 as Wt,c3 as En,c4 as Ht,c5 as xt,af as K,ab as Dn,bH as Pn,D as _n,c as Vt,n as st,c6 as jt,c7 as Bn,c8 as zt,c9 as Tn,ca as Rn,a as $n,cb as Sn,cc as Mn}from"./index-CL4rmUJ-.js";const Ln=["top","right","bottom","left"],ae=Math.min,H=Math.max,Ie=Math.round,Me=Math.floor,G=e=>({x:e,y:e}),Fn={left:"right",right:"left",bottom:"top",top:"bottom"},Nn={start:"end",end:"start"};function Qe(e,t,n){return H(e,ae(t,n))}function ee(e,t){return typeof e=="function"?e(t):e}function te(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function at(e){return e==="x"?"y":"x"}function ut(e){return e==="y"?"height":"width"}function ue(e){return["top","bottom"].includes(te(e))?"y":"x"}function ct(e){return at(ue(e))}function kn(e,t,n){n===void 0&&(n=!1);const o=Pe(e),i=ct(e),r=ut(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=We(l)),[l,We(l)]}function In(e){const t=We(e);return[et(e),t,et(t)]}function et(e){return e.replace(/start|end/g,t=>Nn[t])}function Wn(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Hn(e,t,n,o){const i=Pe(e);let r=Wn(te(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(et)))),r}function We(e){return e.replace(/left|right|bottom|top/g,t=>Fn[t])}function Vn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kt(e){return typeof e!="number"?Vn(e):{top:e,right:e,bottom:e,left:e}}function He(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Ot(e,t,n){let{reference:o,floating:i}=e;const r=ue(t),l=ct(t),s=ut(l),d=te(t),c=r==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[s]/2-i[s]/2;let f;switch(d){case"top":f={x:a,y:o.y-i.height};break;case"bottom":f={x:a,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(Pe(t)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1);break}return f}const jn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:u}=Ot(c,o,d),p=o,f={},v=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:d}=t,{element:c,padding:a=0}=ee(e,t)||{};if(c==null)return{};const u=Kt(a),p={x:n,y:o},f=ct(i),v=ut(f),g=await l.getDimensions(c),h=f==="y",y=h?"top":"left",b=h?"bottom":"right",w=h?"clientHeight":"clientWidth",C=r.reference[v]+r.reference[f]-p[f]-r.floating[v],x=p[f]-r.reference[f],S=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let _=S?S[w]:0;(!_||!await(l.isElement==null?void 0:l.isElement(S)))&&(_=s.floating[w]||r.floating[v]);const M=C/2-x/2,N=_/2-g[v]/2-1,R=ae(u[y],N),z=ae(u[b],N),k=R,W=_-g[v]-z,L=_/2-g[v]/2+M,oe=Qe(k,L,W),I=!d.arrow&&Pe(i)!=null&&L!==oe&&r.reference[v]/2-(LL<=0)){var z,k;const L=(((z=r.flip)==null?void 0:z.index)||0)+1,oe=_[L];if(oe)return{data:{index:L,overflows:R},reset:{placement:oe}};let I=(k=R.filter(q=>q.overflows[0]<=0).sort((q,ie)=>q.overflows[1]-ie.overflows[1])[0])==null?void 0:k.placement;if(!I)switch(f){case"bestFit":{var W;const q=(W=R.filter(ie=>{if(S){const re=ue(ie.placement);return re===b||re==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(re=>re>0).reduce((re,gn)=>re+gn,0)]).sort((ie,re)=>ie[1]-re[1])[0])==null?void 0:W[0];q&&(I=q);break}case"initialPlacement":I=s;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function Ct(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function At(e){return Ln.some(t=>e[t]>=0)}const Un=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ee(e,t);switch(o){case"referenceHidden":{const r=await _e(t,{...i,elementContext:"reference"}),l=Ct(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:At(l)}}}case"escaped":{const r=await _e(t,{...i,altBoundary:!0}),l=Ct(r,n.floating);return{data:{escapedOffsets:l,escaped:At(l)}}}default:return{}}}}};async function Yn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=te(n),s=Pe(n),d=ue(n)==="y",c=["left","top"].includes(l)?-1:1,a=r&&d?-1:1,u=ee(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof v=="number"&&(f=s==="end"?v*-1:v),d?{x:f*a,y:p*c}:{x:p*c,y:f*a}}const Xn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,d=await Yn(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:l}}}}},qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:h=>{let{x:y,y:b}=h;return{x:y,y:b}}},...d}=ee(e,t),c={x:n,y:o},a=await _e(t,d),u=ue(te(i)),p=at(u);let f=c[p],v=c[u];if(r){const h=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=f+a[h],w=f-a[y];f=Qe(b,f,w)}if(l){const h=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=v+a[h],w=v-a[y];v=Qe(b,v,w)}const g=s.fn({...t,[p]:f,[u]:v});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[p]:r,[u]:l}}}}}},Gn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=t,{offset:s=0,mainAxis:d=!0,crossAxis:c=!0}=ee(e,t),a={x:n,y:o},u=ue(i),p=at(u);let f=a[p],v=a[u];const g=ee(s,t),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(d){const w=p==="y"?"height":"width",C=r.reference[p]-r.floating[w]+h.mainAxis,x=r.reference[p]+r.reference[w]-h.mainAxis;fx&&(f=x)}if(c){var y,b;const w=p==="y"?"width":"height",C=["top","left"].includes(te(i)),x=r.reference[u]-r.floating[w]+(C&&((y=l.offset)==null?void 0:y[u])||0)+(C?0:h.crossAxis),S=r.reference[u]+r.reference[w]+(C?0:((b=l.offset)==null?void 0:b[u])||0)-(C?h.crossAxis:0);vS&&(v=S)}return{[p]:f,[u]:v}}}},Jn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:r,platform:l,elements:s}=t,{apply:d=()=>{},...c}=ee(e,t),a=await _e(t,c),u=te(i),p=Pe(i),f=ue(i)==="y",{width:v,height:g}=r.floating;let h,y;u==="top"||u==="bottom"?(h=u,y=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,h=p==="end"?"top":"bottom");const b=g-a.top-a.bottom,w=v-a.left-a.right,C=ae(g-a[h],b),x=ae(v-a[y],w),S=!t.middlewareData.shift;let _=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=b),S&&!p){const R=H(a.left,0),z=H(a.right,0),k=H(a.top,0),W=H(a.bottom,0);f?M=v-2*(R!==0||z!==0?R+z:H(a.left,a.right)):_=g-2*(k!==0||W!==0?k+W:H(a.top,a.bottom))}await d({...t,availableWidth:M,availableHeight:_});const N=await l.getDimensions(s.floating);return v!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function je(){return typeof window<"u"}function we(e){return dt(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Z(e){var t;return(t=(dt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dt(e){return je()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return je()?e instanceof Element||e instanceof V(e).Element:!1}function J(e){return je()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function Et(e){return!je()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function Te(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Zn(e){return["table","td","th"].includes(we(e))}function ze(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ft(e){const t=pt(),n=U(e)?Y(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Qn(e){let t=ce(e);for(;J(t)&&!Ee(t);){if(ft(t))return t;if(ze(t))return null;t=ce(t)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ee(e){return["html","body","#document"].includes(we(e))}function Y(e){return V(e).getComputedStyle(e)}function Ke(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(we(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||Z(e);return Et(t)?t.host:t}function Ut(e){const t=ce(e);return Ee(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Te(t)?t:Ut(t)}function Be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ut(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=V(i);if(r){const s=tt(l);return t.concat(l,l.visualViewport||[],Te(i)?i:[],s&&n?Be(s):[])}return t.concat(i,Be(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=Ie(n)!==r||Ie(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function vt(e){return U(e)?e:e.contextElement}function Ae(e){const t=vt(e);if(!J(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Yt(t);let l=(r?Ie(n.width):n.width)/o,s=(r?Ie(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const eo=G(0);function Xt(e){const t=V(e);return!pt()||!t.visualViewport?eo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function to(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function he(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=vt(e);let l=G(1);t&&(o?U(o)&&(l=Ae(o)):l=Ae(e));const s=to(r,n,o)?Xt(r):G(0);let d=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,a=i.width/l.x,u=i.height/l.y;if(r){const p=V(r),f=o&&U(o)?V(o):o;let v=p,g=tt(v);for(;g&&o&&f!==v;){const h=Ae(g),y=g.getBoundingClientRect(),b=Y(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*h.x,C=y.top+(g.clientTop+parseFloat(b.paddingTop))*h.y;d*=h.x,c*=h.y,a*=h.x,u*=h.y,d+=w,c+=C,v=V(g),g=tt(v)}}return He({width:a,height:u,x:d,y:c})}function mt(e,t){const n=Ke(e).scrollLeft;return t?t.left+n:he(Z(e)).left+n}function qt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:mt(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function no(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=Z(o),s=t?ze(t.floating):!1;if(o===l||s&&r)return n;let d={scrollLeft:0,scrollTop:0},c=G(1);const a=G(0),u=J(o);if((u||!u&&!r)&&((we(o)!=="body"||Te(l))&&(d=Ke(o)),J(o))){const f=he(o);c=Ae(o),a.x=f.x+o.clientLeft,a.y=f.y+o.clientTop}const p=l&&!u&&!r?qt(l,d,!0):G(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+a.x+p.x,y:n.y*c.y-d.scrollTop*c.y+a.y+p.y}}function oo(e){return Array.from(e.getClientRects())}function io(e){const t=Z(e),n=Ke(e),o=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+mt(e);const s=-n.scrollTop;return Y(o).direction==="rtl"&&(l+=H(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function ro(e,t){const n=V(e),o=Z(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,d=0;if(i){r=i.width,l=i.height;const c=pt();(!c||c&&t==="fixed")&&(s=i.offsetLeft,d=i.offsetTop)}return{width:r,height:l,x:s,y:d}}function lo(e,t){const n=he(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?Ae(e):G(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,d=i*r.x,c=o*r.y;return{width:l,height:s,x:d,y:c}}function Dt(e,t,n){let o;if(t==="viewport")o=ro(e,n);else if(t==="document")o=io(Z(e));else if(U(t))o=lo(t,n);else{const i=Xt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return He(o)}function Gt(e,t){const n=ce(e);return n===t||!U(n)||Ee(n)?!1:Y(n).position==="fixed"||Gt(n,t)}function so(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(s=>U(s)&&we(s)!=="body"),i=null;const r=Y(e).position==="fixed";let l=r?ce(e):e;for(;U(l)&&!Ee(l);){const s=Y(l),d=ft(l);!d&&s.position==="fixed"&&(i=null),(r?!d&&!i:!d&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Te(l)&&!d&&Gt(e,l))?o=o.filter(a=>a!==l):i=s,l=ce(l)}return t.set(e,o),o}function ao(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?ze(t)?[]:so(t,this._c):[].concat(n),o],s=l[0],d=l.reduce((c,a)=>{const u=Dt(t,a,i);return c.top=H(u.top,c.top),c.right=ae(u.right,c.right),c.bottom=ae(u.bottom,c.bottom),c.left=H(u.left,c.left),c},Dt(t,s,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function uo(e){const{width:t,height:n}=Yt(e);return{width:t,height:n}}function co(e,t,n){const o=J(t),i=Z(t),r=n==="fixed",l=he(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const d=G(0);if(o||!o&&!r)if((we(t)!=="body"||Te(i))&&(s=Ke(t)),o){const p=he(t,!0,r,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else i&&(d.x=mt(i));const c=i&&!o&&!r?qt(i,s):G(0),a=l.left+s.scrollLeft-d.x-c.x,u=l.top+s.scrollTop-d.y-c.y;return{x:a,y:u,width:l.width,height:l.height}}function Ye(e){return Y(e).position==="static"}function Pt(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Z(e)===n&&(n=n.ownerDocument.body),n}function Jt(e,t){const n=V(e);if(ze(e))return n;if(!J(e)){let i=ce(e);for(;i&&!Ee(i);){if(U(i)&&!Ye(i))return i;i=ce(i)}return n}let o=Pt(e,t);for(;o&&Zn(o)&&Ye(o);)o=Pt(o,t);return o&&Ee(o)&&Ye(o)&&!ft(o)?n:o||Qn(e)||n}const fo=async function(e){const t=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(e.floating);return{reference:co(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function po(e){return Y(e).direction==="rtl"}const vo={convertOffsetParentRelativeRectToViewportRelativeRect:no,getDocumentElement:Z,getClippingRect:ao,getOffsetParent:Jt,getElementRects:fo,getClientRects:oo,getDimensions:uo,getScale:Ae,isElement:U,isRTL:po};function Zt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mo(e,t){let n=null,o;const i=Z(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,d){s===void 0&&(s=!1),d===void 0&&(d=1),r();const c=e.getBoundingClientRect(),{left:a,top:u,width:p,height:f}=c;if(s||t(),!p||!f)return;const v=Me(u),g=Me(i.clientWidth-(a+p)),h=Me(i.clientHeight-(u+f)),y=Me(a),w={rootMargin:-v+"px "+-g+"px "+-h+"px "+-y+"px",threshold:H(0,ae(1,d))||1};let C=!0;function x(S){const _=S[0].intersectionRatio;if(_!==d){if(!C)return l();_?l(!1,_):o=setTimeout(()=>{l(!1,1e-7)},1e3)}_===1&&!Zt(c,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(x,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return l(!0),r}function ho(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=vt(e),a=i||r?[...c?Be(c):[],...Be(t)]:[];a.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const u=c&&s?mo(c,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!d&&f.observe(c),f.observe(t));let v,g=d?he(e):null;d&&h();function h(){const y=he(e);g&&!Zt(g,y)&&n(),g=y,v=requestAnimationFrame(h)}return n(),()=>{var y;a.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),u==null||u(),(y=f)==null||y.disconnect(),f=null,d&&cancelAnimationFrame(v)}}const go=Xn,yo=qn,_t=Kn,wo=Jn,bo=Un,xo=zn,Oo=Gn,Co=(e,t,n)=>{const o=new Map,i={platform:vo,...n},r={...i.platform,_c:o};return jn(e,t,{...i,platform:r})};function Ao(e){return e!=null&&typeof e=="object"&&"$el"in e}function nt(e){if(Ao(e)){const t=e.$el;return dt(t)&&we(t)==="#comment"?null:t}return e}function Ce(e){return typeof e=="function"?e():m(e)}function Eo(e){return{name:"arrow",options:e,fn(t){const n=nt(Ce(e.element));return n==null?{}:xo({element:n,padding:e.padding}).fn(t)}}}function Qt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bt(e,t){const n=Qt(e);return Math.round(t*n)/n}function Do(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=O(()=>{var _;return(_=Ce(n.open))!=null?_:!0}),r=O(()=>Ce(n.middleware)),l=O(()=>{var _;return(_=Ce(n.placement))!=null?_:"bottom"}),s=O(()=>{var _;return(_=Ce(n.strategy))!=null?_:"absolute"}),d=O(()=>{var _;return(_=Ce(n.transform))!=null?_:!0}),c=O(()=>nt(e.value)),a=O(()=>nt(t.value)),u=E(0),p=E(0),f=E(s.value),v=E(l.value),g=Mt({}),h=E(!1),y=O(()=>{const _={position:f.value,left:"0",top:"0"};if(!a.value)return _;const M=Bt(a.value,u.value),N=Bt(a.value,p.value);return d.value?{..._,transform:"translate("+M+"px, "+N+"px)",...Qt(a.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:M+"px",top:N+"px"}});let b;function w(){if(c.value==null||a.value==null)return;const _=i.value;Co(c.value,a.value,{middleware:r.value,placement:l.value,strategy:s.value}).then(M=>{u.value=M.x,p.value=M.y,f.value=M.strategy,v.value=M.placement,g.value=M.middlewareData,h.value=_!==!1})}function C(){typeof b=="function"&&(b(),b=void 0)}function x(){if(C(),o===void 0){w();return}if(c.value!=null&&a.value!=null){b=o(c.value,a.value,w);return}}function S(){i.value||(h.value=!1)}return j([r,l,s,i],w,{flush:"sync"}),j([c,a],x,{flush:"sync"}),j(i,S,{flush:"sync"}),Lt()&&Ft(C),{x:xe(u),y:xe(p),strategy:xe(f),placement:xe(v),middlewareData:xe(g),isPositioned:xe(h),floatingStyles:y,update:w}}function be(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[i=>{const r=bn(o,i);if(r||r===null)return r;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},i=>(Mn(o,i),i)]}function en(e,t,n){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(i)}function Po(e,t){var n;const o=Mt();return K(()=>{o.value=e()},{...t,flush:(n=void 0)!=null?n:"sync"}),Ht(o)}function Re(e){return Lt()?(Ft(e),!0):!1}function _o(){const e=new Set,t=n=>{e.delete(n)};return{on:n=>{e.add(n);const o=()=>t(n);return Re(o),{off:o}},off:t,trigger:(...n)=>Promise.all(Array.from(e).map(o=>o(...n)))}}function Bo(e){let t=!1,n;const o=jt(!0);return(...i)=>(t||(n=o.run(()=>e(...i)),t=!0),n)}function To(e){let t=0,n,o;const i=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return(...r)=>(t+=1,n||(o=jt(!0),n=o.run(()=>e(...r))),Re(i),n)}function ve(e){return typeof e=="function"?e():m(e)}const pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ro=e=>typeof e<"u",$o=Object.prototype.toString,So=e=>$o.call(e)==="[object Object]",Mo=()=>{},Tt=Lo();function Lo(){var e,t;return pe&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Fo(e){return ye()}function No(e,t=1e4){return Sn((n,o)=>{let i=ve(e),r;const l=()=>setTimeout(()=>{i=ve(e),o()},ve(t));return Re(()=>{clearTimeout(r)}),{get(){return n(),i},set(s){i=s,o(),clearTimeout(r),r=l()}}})}function ko(e,t){Fo()&&Bn(e,t)}function tn(e,t,n={}){const{immediate:o=!0}=n,i=E(!1);let r=null;function l(){r&&(clearTimeout(r),r=null)}function s(){i.value=!1,l()}function d(...c){l(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...c)},ve(t))}return o&&(i.value=!0,pe&&d()),Re(s),{isPending:Ht(i),start:d,stop:s}}function $e(e){var t;const n=ve(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ht=pe?window:void 0;function Ve(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=ht):[t,n,o,i]=e,!t)return Mo;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],l=()=>{r.forEach(a=>a()),r.length=0},s=(a,u,p,f)=>(a.addEventListener(u,p,f),()=>a.removeEventListener(u,p,f)),d=j(()=>[$e(t),ve(i)],([a,u])=>{if(l(),!a)return;const p=So(u)?{...u}:u;r.push(...n.flatMap(f=>o.map(v=>s(a,f,v,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return Re(c),c}function Io(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Wo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=ht,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=o,d=Io(t);return Ve(i,r,c=>{c.repeat&&ve(s)||d(c)&&n(c)},l)}function Ho(){const e=E(!1),t=ye();return t&&De(()=>{e.value=!0},t),e}function Vo(e){return JSON.parse(JSON.stringify(e))}function nn(e,t,n,o={}){var i,r,l;const{clone:s=!1,passive:d=!1,eventName:c,deep:a=!1,defaultValue:u,shouldEmit:p}=o,f=ye(),v=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let g=c;g=g||`update:${t.toString()}`;const h=w=>s?typeof s=="function"?s(w):Vo(w):w,y=()=>Ro(e[t])?h(e[t]):u,b=w=>{p?p(w)&&v(g,w):v(g,w)};if(d){const w=y(),C=E(w);let x=!1;return j(()=>e[t],S=>{x||(x=!0,C.value=h(S),ge(()=>x=!1))}),j(C,S=>{!x&&(S!==e[t]||a)&&b(S)},{deep:a}),C}else return O({get(){return y()},set(w){b(w)}})}function gt(e){return e?e.flatMap(t=>t.type===An?gt(t.children):[t]):[]}function se(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Xe(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function ot(e,t,n=".",o){if(!Xe(t))return ot(e,{},n);const i=Object.assign({},t);for(const r in e){if(r==="__proto__"||r==="constructor")continue;const l=e[r];l!=null&&(Array.isArray(l)&&Array.isArray(i[r])?i[r]=[...l,...i[r]]:Xe(l)&&Xe(i[r])?i[r]=ot(l,i[r],(n?`${n}.`:"")+r.toString()):i[r]=l)}return i}function jo(e){return(...t)=>t.reduce((n,o)=>ot(n,o,""),{})}const zo=jo(),[on,nr]=be("ConfigProvider");let Ko="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Uo=(e=21)=>{let t="",n=e;for(;n--;)t+=Ko[Math.random()*64|0];return t};const Yo=To(()=>{const e=E(new Map),t=E(),n=O(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=on({scrollBody:E(!0)});let i=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",Tt&&(i==null||i()),t.value=void 0};return j(n,(l,s)=>{var d;if(!pe)return;if(!l){s&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,a={padding:c,margin:0},u=(d=o.scrollBody)!=null&&d.value?typeof o.scrollBody.value=="object"?zo({padding:o.scrollBody.value.padding===!0?c:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?c:o.scrollBody.value.margin},a):a:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),Tt&&(i=Ve(document,"touchmove",p=>qo(p),{passive:!1})),ge(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function Xo(e){const t=Uo(6),n=Yo();n.value.set(t,e);const o=O({get:()=>n.value.get(t)??!1,set:i=>n.value.set(t,i)});return ko(()=>{n.value.delete(t)}),o}function rn(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Se(e){const t=ye(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(i=>{o[wn(kt(i))]=(...r)=>e(i,...r)}),o}function ln(e){const t=ye(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((i,r)=>{const l=(t==null?void 0:t.type.props[r]).default;return l!==void 0&&(i[r]=l),i},{}),o=Cn(e);return O(()=>{const i={},r=(t==null?void 0:t.vnode.props)??{};return Object.keys(r).forEach(l=>{i[kt(l)]=r[l]}),Object.keys({...n,...i}).reduce((l,s)=>(o.value[s]!==void 0&&(l[s]=o.value[s]),l),{})})}function sn(e,t){const n=ln(e),o=t?Se(t):{};return O(()=>({...n.value,...o}))}function $(){const e=ye(),t=E(),n=O(()=>{var l,s;return["#text","#comment"].includes((l=t.value)==null?void 0:l.$el.nodeName)?(s=t.value)==null?void 0:s.$el.nextElementSibling:$e(t)}),o=Object.assign({},e.exposed),i={};for(const l in e.props)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function r(l){t.value=l,l&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=i)}return{forwardRef:r,currentRef:t,currentElement:n}}function Go(e,t){const n=No(!1,300),o=E(null),i=_o();function r(){o.value=null,n.value=!1}function l(s,d){const c=s.currentTarget,a={x:s.clientX,y:s.clientY},u=Jo(a,c.getBoundingClientRect()),p=Zo(a,u),f=Qo(d.getBoundingClientRect()),v=ti([...p,...f]);o.value=v,n.value=!0}return K(s=>{if(e.value&&t.value){const d=a=>l(a,t.value),c=a=>l(a,e.value);e.value.addEventListener("pointerleave",d),t.value.addEventListener("pointerleave",c),s(()=>{var a,u;(a=e.value)==null||a.removeEventListener("pointerleave",d),(u=t.value)==null||u.removeEventListener("pointerleave",c)})}}),K(s=>{var d;if(o.value){const c=a=>{var u,p;if(!o.value)return;const f=a.target,v={x:a.clientX,y:a.clientY},g=((u=e.value)==null?void 0:u.contains(f))||((p=t.value)==null?void 0:p.contains(f)),h=!ei(v,o.value),y=!!f.closest("[data-grace-area-trigger]");g?r():(h||y)&&(r(),i.trigger())};(d=e.value)==null||d.ownerDocument.addEventListener("pointermove",c),s(()=>{var a;return(a=e.value)==null?void 0:a.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function Jo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,o,i,r)){case r:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zo(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Qo(e){const{top:t,right:n,bottom:o,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:o},{x:i,y:o}]}function ei(e,t){const{x:n,y:o}=e;let i=!1;for(let r=0,l=t.length-1;ro!=a>o&&n<(c-s)*(o-d)/(a-d)+s&&(i=!i)}return i}function ti(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),ni(t)}function ni(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const r=t[t.length-1],l=t[t.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;n.length>=2;){const r=n[n.length-1],l=n[n.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var oi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Le=new WeakMap,Fe={},qe=0,an=function(e){return e&&(e.host||an(e.parentNode))},ii=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=an(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ri=function(e,t,n,o){var i=ii(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var r=Fe[n],l=[],s=new Set,d=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var a=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))a(p);else try{var f=p.getAttribute(o),v=f!==null&&f!=="false",g=(Oe.get(p)||0)+1,h=(r.get(p)||0)+1;Oe.set(p,g),r.set(p,h),l.push(p),g===1&&v&&Le.set(p,!0),h===1&&p.setAttribute(n,"true"),v||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return a(t),s.clear(),qe++,function(){l.forEach(function(u){var p=Oe.get(u)-1,f=r.get(u)-1;Oe.set(u,p),r.set(u,f),p||(Le.has(u)||u.removeAttribute(o),Le.delete(u)),f||u.removeAttribute(n)}),qe--,qe||(Oe=new WeakMap,Oe=new WeakMap,Le=new WeakMap,Fe={})}},li=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=oi(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),ri(o,i,n,"aria-hidden")):function(){return null}};function si(e){let t;j(()=>$e(e),n=>{n?t=li(n):t&&t()}),It(()=>{t&&t()})}let ai=0;function it(e,t="radix"){const n=on({useId:void 0});return xt?`${t}-${xt()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++ai}`}function ui(e){const t=E(),n=O(()=>{var i;return((i=t.value)==null?void 0:i.width)??0}),o=O(()=>{var i;return((i=t.value)==null?void 0:i.height)??0});return De(()=>{const i=$e(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const r=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const s=l[0];let d,c;if("borderBoxSize"in s){const a=s.borderBoxSize,u=Array.isArray(a)?a[0]:a;d=u.inlineSize,c=u.blockSize}else d=i.offsetWidth,c=i.offsetHeight;t.value={width:d,height:c}});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else t.value=void 0}),{width:n,height:o}}function ci(e,t){const n=E(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}const di=D({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o,i;if(!n.default)return null;const r=gt(n.default()),l=r.findIndex(a=>a.type!==Wt);if(l===-1)return r;const s=r[l];(o=s.props)==null||delete o.ref;const d=s.props?F(t,s.props):t;t.class&&(i=s.props)!=null&&i.class&&delete s.props.class;const c=En(s,d);for(const a in d)a.startsWith("on")&&(c.props||(c.props={}),c.props[a]=d[a]);return r.length===1?c:(r[l]=c,r)}}}),X=D({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>ke(o,t):o!=="template"?()=>ke(e.as,t,{default:n.default}):()=>ke(di,t,{default:n.default})}});function fi(e,t){var n;const o=E({}),i=E("none"),r=E(e),l=e.value?"mounted":"unmounted";let s;const d=((n=t.value)==null?void 0:n.ownerDocument.defaultView)??ht,{state:c,dispatch:a}=ci(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=h=>{var y;if(pe){const b=new CustomEvent(h,{bubbles:!1,cancelable:!1});(y=t.value)==null||y.dispatchEvent(b)}};j(e,async(h,y)=>{var b;const w=y!==h;if(await ge(),w){const C=i.value,x=Ne(t.value);h?(a("MOUNT"),u("enter"),x==="none"&&u("after-enter")):x==="none"||((b=o.value)==null?void 0:b.display)==="none"?(a("UNMOUNT"),u("leave"),u("after-leave")):y&&C!==x?(a("ANIMATION_OUT"),u("leave")):(a("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=h=>{const y=Ne(t.value),b=y.includes(h.animationName),w=c.value==="mounted"?"enter":"leave";if(h.target===t.value&&b&&(u(`after-${w}`),a("ANIMATION_END"),!r.value)){const C=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",s=d==null?void 0:d.setTimeout(()=>{var x;((x=t.value)==null?void 0:x.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=C)})}h.target===t.value&&y==="none"&&a("ANIMATION_END")},f=h=>{h.target===t.value&&(i.value=Ne(t.value))},v=j(t,(h,y)=>{h?(o.value=getComputedStyle(h),h.addEventListener("animationstart",f),h.addEventListener("animationcancel",p),h.addEventListener("animationend",p)):(a("ANIMATION_END"),s!==void 0&&(d==null||d.clearTimeout(s)),y==null||y.removeEventListener("animationstart",f),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=j(c,()=>{const h=Ne(t.value);i.value=c.value==="mounted"?h:"none"});return It(()=>{v(),g()}),{isPresent:O(()=>["mounted","unmountSuspended"].includes(c.value))}}function Ne(e){return e&&getComputedStyle(e).animationName||"none"}const yt=D({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var o;const{present:i,forceMount:r}=lt(e),l=E(),{isPresent:s}=fi(i,l);n({present:s});let d=t.default({present:s});d=gt(d||[]);const c=ye();if(d&&(d==null?void 0:d.length)>1){const a=(o=c==null?void 0:c.parent)!=null&&o.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${a}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` `)].join(` `))}return()=>r.value||i.value||s.value?ke(t.default({present:s})[0],{ref:a=>{const u=$e(a);return typeof(u==null?void 0:u.hasAttribute)>"u"||(u!=null&&u.hasAttribute("data-radix-popper-content-wrapper")?l.value=u.firstElementChild:l.value=u),u}}):null}}),[ne,pi]=be("DialogRoot"),vi=D({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=nn(n,"open",t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=E(),r=E(),{modal:l}=lt(n);return pi({open:o,modal:l,openModal:()=>{o.value=!0},onOpenChange:s=>{o.value=s},onOpenToggle:()=>{o.value=!o.value},contentId:"",titleId:"",descriptionId:"",triggerElement:i,contentElement:r}),(s,d)=>P(s.$slots,"default",{open:m(o)})}}),wt=D({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=Ho();return(n,o)=>m(t)||n.forceMount?(B(),T(yn,{key:0,to:n.to,disabled:n.disabled},[P(n.$slots,"default")],8,["to","disabled"])):Nt("",!0)}}),or=D({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),mi="dismissableLayer.pointerDownOutside",hi="dismissableLayer.focusOutside";function un(e,t){const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),i=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&o===n||i.indexOf(o){});return K(l=>{if(!pe)return;const s=async c=>{const a=c.target;if(t!=null&&t.value){if(un(t.value,a)){i.value=!1;return}if(c.target&&!i.value){let u=function(){en(mi,e,p)};const p={originalEvent:c};c.pointerType==="touch"?(o.removeEventListener("click",r.value),r.value=u,o.addEventListener("click",r.value,{once:!0})):u()}else o.removeEventListener("click",r.value);i.value=!1}},d=window.setTimeout(()=>{o.addEventListener("pointerdown",s)},0);l(()=>{window.clearTimeout(d),o.removeEventListener("pointerdown",s),o.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>i.value=!0}}function yi(e,t){var n;const o=((n=t==null?void 0:t.value)==null?void 0:n.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=E(!1);return K(r=>{if(!pe)return;const l=async s=>{t!=null&&t.value&&(await ge(),!(!t.value||un(t.value,s.target))&&s.target&&!i.value&&en(hi,e,{originalEvent:s}))};o.addEventListener("focusin",l),r(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const Q=zt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cn=D({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:i,currentElement:r}=$(),l=O(()=>{var v;return((v=r.value)==null?void 0:v.ownerDocument)??globalThis.document}),s=O(()=>Q.layersRoot),d=O(()=>r.value?Array.from(s.value).indexOf(r.value):-1),c=O(()=>Q.layersWithOutsidePointerEventsDisabled.size>0),a=O(()=>{const v=Array.from(s.value),[g]=[...Q.layersWithOutsidePointerEventsDisabled].slice(-1),h=v.indexOf(g);return d.value>=h}),u=gi(async v=>{const g=[...Q.branches].some(h=>h==null?void 0:h.contains(v.target));!a.value||g||(o("pointerDownOutside",v),o("interactOutside",v),await ge(),v.defaultPrevented||o("dismiss"))},r),p=yi(v=>{[...Q.branches].some(g=>g==null?void 0:g.contains(v.target))||(o("focusOutside",v),o("interactOutside",v),v.defaultPrevented||o("dismiss"))},r);Wo("Escape",v=>{d.value===s.value.size-1&&(o("escapeKeyDown",v),v.defaultPrevented||o("dismiss"))});let f;return K(v=>{r.value&&(n.disableOutsidePointerEvents&&(Q.layersWithOutsidePointerEventsDisabled.size===0&&(f=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),Q.layersWithOutsidePointerEventsDisabled.add(r.value)),s.value.add(r.value),v(()=>{n.disableOutsidePointerEvents&&Q.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=f)}))}),K(v=>{v(()=>{r.value&&(s.value.delete(r.value),Q.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(v,g)=>(B(),T(m(X),{ref:m(i),"as-child":v.asChild,as:v.as,"data-dismissable-layer":"",style:st({pointerEvents:c.value?a.value?"auto":"none":void 0}),onFocusCapture:m(p).onFocusCapture,onBlurCapture:m(p).onBlurCapture,onPointerdownCapture:m(u).onPointerDownCapture},{default:A(()=>[P(v.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Ge="focusScope.autoFocusOnMount",Je="focusScope.autoFocusOnUnmount",Rt={bubbles:!1,cancelable:!0};function wi(e,{select:t=!1}={}){const n=se();for(const o of e)if(le(o,{select:t}),se()!==n)return!0}function bi(e){const t=dn(e),n=$t(t,e),o=$t(t.reverse(),e);return[n,o]}function dn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $t(e,t){for(const n of e)if(!xi(n,{upTo:t}))return n}function xi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Oi(e){return e instanceof HTMLInputElement&&"select"in e}function le(e,{select:t=!1}={}){if(e&&e.focus){const n=se();e.focus({preventScroll:!0}),e!==n&&Oi(e)&&t&&e.select()}}const Ci=Bo(()=>E([]));function Ai(){const e=Ci();return{add(t){const n=e.value[0];t!==n&&(n==null||n.pause()),e.value=St(e.value,t),e.value.unshift(t)},remove(t){var n;e.value=St(e.value,t),(n=e.value[0])==null||n.resume()}}}function St(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Ei(e){return e.filter(t=>t.tagName!=="A")}const Di=D({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,o=t,{currentRef:i,currentElement:r}=$(),l=E(null),s=Ai(),d=zt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});K(a=>{if(!pe)return;const u=r.value;if(!n.trapped)return;function p(h){if(d.paused||!u)return;const y=h.target;u.contains(y)?l.value=y:le(l.value,{select:!0})}function f(h){if(d.paused||!u)return;const y=h.relatedTarget;y!==null&&(u.contains(y)||le(l.value,{select:!0}))}function v(h){u.contains(l.value)||le(u)}document.addEventListener("focusin",p),document.addEventListener("focusout",f);const g=new MutationObserver(v);u&&g.observe(u,{childList:!0,subtree:!0}),a(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",f),g.disconnect()})}),K(async a=>{const u=r.value;if(await ge(),!u)return;s.add(d);const p=se();if(!u.contains(p)){const f=new CustomEvent(Ge,Rt);u.addEventListener(Ge,v=>o("mountAutoFocus",v)),u.dispatchEvent(f),f.defaultPrevented||(wi(Ei(dn(u)),{select:!0}),se()===p&&le(u))}a(()=>{u.removeEventListener(Ge,g=>o("mountAutoFocus",g));const f=new CustomEvent(Je,Rt),v=g=>{o("unmountAutoFocus",g)};u.addEventListener(Je,v),u.dispatchEvent(f),setTimeout(()=>{f.defaultPrevented||le(p??document.body,{select:!0}),u.removeEventListener(Je,v),s.remove(d)},0)})});function c(a){if(!n.loop&&!n.trapped||d.paused)return;const u=a.key==="Tab"&&!a.altKey&&!a.ctrlKey&&!a.metaKey,p=se();if(u&&p){const f=a.currentTarget,[v,g]=bi(f);v&&g?!a.shiftKey&&p===g?(a.preventDefault(),n.loop&&le(v,{select:!0})):a.shiftKey&&p===v&&(a.preventDefault(),n.loop&&le(g,{select:!0})):p===f&&a.preventDefault()}}return(a,u)=>(B(),T(m(X),{ref_key:"currentRef",ref:i,tabindex:"-1","as-child":a.asChild,as:a.as,onKeydown:c},{default:A(()=>[P(a.$slots,"default")]),_:3},8,["as-child","as"]))}});function Pi(e){return e?"open":"closed"}const fn=D({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),{forwardRef:r,currentElement:l}=$();return i.titleId||(i.titleId=it(void 0,"radix-vue-dialog-title")),i.descriptionId||(i.descriptionId=it(void 0,"radix-vue-dialog-description")),De(()=>{i.contentElement=l,se()!==document.body&&(i.triggerElement.value=se())}),(s,d)=>(B(),T(m(Di),{"as-child":"",loop:"",trapped:n.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>o("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>o("closeAutoFocus",c))},{default:A(()=>[me(m(cn),F({id:m(i).contentId,ref:m(r),as:s.as,"as-child":s.asChild,"disable-outside-pointer-events":s.disableOutsidePointerEvents,role:"dialog","aria-describedby":m(i).descriptionId,"aria-labelledby":m(i).titleId,"data-state":m(Pi)(m(i).open.value)},s.$attrs,{onDismiss:d[0]||(d[0]=c=>m(i).onOpenChange(!1)),onEscapeKeyDown:d[1]||(d[1]=c=>o("escapeKeyDown",c)),onFocusOutside:d[2]||(d[2]=c=>o("focusOutside",c)),onInteractOutside:d[3]||(d[3]=c=>o("interactOutside",c)),onPointerDownOutside:d[4]||(d[4]=c=>o("pointerDownOutside",c))}),{default:A(()=>[P(s.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),_i=D({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),r=Se(o),{forwardRef:l,currentElement:s}=$();return si(s),(d,c)=>(B(),T(fn,F({...n,...m(r)},{ref:m(l),"trap-focus":m(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:c[0]||(c[0]=a=>{var u;a.defaultPrevented||(a.preventDefault(),(u=m(i).triggerElement.value)==null||u.focus())}),onPointerDownOutside:c[1]||(c[1]=a=>{const u=a.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0;(u.button===2||p)&&a.preventDefault()}),onFocusOutside:c[2]||(c[2]=a=>{a.preventDefault()})}),{default:A(()=>[P(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),Bi=D({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=Se(t);$();const i=ne(),r=E(!1),l=E(!1);return(s,d)=>(B(),T(fn,F({...n,...m(o)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{var a;c.defaultPrevented||(r.value||(a=m(i).triggerElement.value)==null||a.focus(),c.preventDefault()),r.value=!1,l.value=!1}),onInteractOutside:d[1]||(d[1]=c=>{var a;c.defaultPrevented||(r.value=!0,c.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=c.target;(a=m(i).triggerElement.value)!=null&&a.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&l.value&&c.preventDefault()})}),{default:A(()=>[P(s.$slots,"default")]),_:3},16))}}),Ti=D({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),r=Se(o),{forwardRef:l}=$();return(s,d)=>(B(),T(m(yt),{present:s.forceMount||m(i).open.value},{default:A(()=>[m(i).modal.value?(B(),T(_i,F({key:0,ref:m(l)},{...n,...m(r),...s.$attrs}),{default:A(()=>[P(s.$slots,"default")]),_:3},16)):(B(),T(Bi,F({key:1,ref:m(l)},{...n,...m(r),...s.$attrs}),{default:A(()=>[P(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ri=D({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(e){const t=ne();return Xo(!0),$(),(n,o)=>(B(),T(m(X),{as:n.as,"as-child":n.asChild,"data-state":m(t).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:A(()=>[P(n.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),$i=D({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=ne(),{forwardRef:n}=$();return(o,i)=>{var r;return(r=m(t))!=null&&r.modal.value?(B(),T(m(yt),{key:0,present:o.forceMount||m(t).open.value},{default:A(()=>[me(Ri,F(o.$attrs,{ref:m(n),as:o.as,"as-child":o.asChild}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):Nt("",!0)}}}),pn=D({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;$();const n=ne();return(o,i)=>(B(),T(m(X),F(t,{type:o.as==="button"?"button":void 0,onClick:i[0]||(i[0]=r=>m(n).onOpenChange(!1))}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["type"]))}}),Si=D({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const t=e,n=ne();return $(),(o,i)=>(B(),T(m(X),F(t,{id:m(n).titleId}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["id"]))}}),Mi=D({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const t=e;$();const n=ne();return(o,i)=>(B(),T(m(X),F(t,{id:m(n).descriptionId}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["id"]))}}),ir=D({__name:"AlertDialogRoot",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const n=sn(e,t);return $(),(o,i)=>(B(),T(m(vi),F(m(n),{modal:!0}),{default:A(()=>[P(o.$slots,"default")]),_:3},16))}}),rr=D({__name:"AlertDialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),[Li,Fi]=be("AlertDialogContent"),lr=D({__name:"AlertDialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=Se(t);$();const i=E();return Fi({onCancelElementChange:r=>{i.value=r}}),(r,l)=>(B(),T(m(Ti),F({...n,...m(o)},{role:"alertdialog",onPointerDownOutside:l[0]||(l[0]=Ze(()=>{},["prevent"])),onInteractOutside:l[1]||(l[1]=Ze(()=>{},["prevent"])),onOpenAutoFocus:l[2]||(l[2]=()=>{ge(()=>{var s;(s=i.value)==null||s.focus({preventScroll:!0})})})}),{default:A(()=>[P(r.$slots,"default")]),_:3},16))}}),sr=D({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m($i),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),ar=D({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Li(),{forwardRef:o,currentElement:i}=$();return De(()=>{n.onCancelElementChange(i.value)}),(r,l)=>(B(),T(m(pn),F(t,{ref:m(o)}),{default:A(()=>[P(r.$slots,"default")]),_:3},16))}}),ur=D({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(Si),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),cr=D({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(Mi),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),dr=D({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(pn),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),[vn,Ni]=be("PopperRoot"),ki=D({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=E();return Ni({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>P(n.$slots,"default")}}),Ii=D({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const t=e,{forwardRef:n,currentElement:o}=$(),i=vn();return K(()=>{i.onAnchorChange(t.element??o.value)}),(r,l)=>(B(),T(m(X),{ref:m(n),as:r.as,"as-child":r.asChild},{default:A(()=>[P(r.$slots,"default")]),_:3},8,["as","as-child"]))}});function Wi(e){return e!==null}function Hi(e){return{name:"transformOrigin",options:e,fn(t){var n,o,i;const{placement:r,rects:l,middlewareData:s}=t,d=((n=s.arrow)==null?void 0:n.centerOffset)!==0,c=d?0:e.arrowWidth,a=d?0:e.arrowHeight,[u,p]=rt(r),f={start:"0%",center:"50%",end:"100%"}[p],v=(((o=s.arrow)==null?void 0:o.x)??0)+c/2,g=(((i=s.arrow)==null?void 0:i.y)??0)+a/2;let h="",y="";return u==="bottom"?(h=d?f:`${v}px`,y=`${-a}px`):u==="top"?(h=d?f:`${v}px`,y=`${l.floating.height+a}px`):u==="right"?(h=`${-a}px`,y=d?f:`${g}px`):u==="left"&&(h=`${l.floating.width+a}px`,y=d?f:`${g}px`),{data:{x:h,y}}}}}function rt(e){const[t,n="center"]=e.split("-");return[t,n]}const Vi={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[ji,zi]=be("PopperContent"),Ki=D({inheritAttrs:!1,__name:"PopperContent",props:Tn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...Vi}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,i=vn(),{forwardRef:r,currentElement:l}=$(),s=E(),d=E(),{width:c,height:a}=ui(d),u=O(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),p=O(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=O(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),v=O(()=>({padding:p.value,boundary:f.value.filter(Wi),altBoundary:f.value.length>0})),g=Po(()=>[go({mainAxis:n.sideOffset+a.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&_t({...v.value}),n.avoidCollisions&&yo({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Oo():void 0,...v.value}),!n.prioritizePosition&&n.avoidCollisions&&_t({...v.value}),wo({...v.value,apply:({elements:R,rects:z,availableWidth:k,availableHeight:W})=>{const{width:L,height:oe}=z.reference,I=R.floating.style;I.setProperty("--radix-popper-available-width",`${k}px`),I.setProperty("--radix-popper-available-height",`${W}px`),I.setProperty("--radix-popper-anchor-width",`${L}px`),I.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),d.value&&Eo({element:d.value,padding:n.arrowPadding}),Hi({arrowWidth:c.value,arrowHeight:a.value}),n.hideWhenDetached&&bo({strategy:"referenceHidden",...v.value})]),{floatingStyles:h,placement:y,isPositioned:b,middlewareData:w}=Do(i.anchor,s,{strategy:"fixed",placement:u,whileElementsMounted:(...R)=>ho(...R,{animationFrame:n.updatePositionStrategy==="always"}),middleware:g}),C=O(()=>rt(y.value)[0]),x=O(()=>rt(y.value)[1]);Rn(()=>{b.value&&o("placed")});const S=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.centerOffset)!==0}),_=E("");K(()=>{l.value&&(_.value=window.getComputedStyle(l.value).zIndex)});const M=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.x)??0}),N=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.y)??0});return zi({placedSide:C,onArrowChange:R=>d.value=R,arrowX:M,arrowY:N,shouldHideArrow:S}),(R,z)=>{var k,W,L;return B(),Vt("div",{ref_key:"floatingRef",ref:s,"data-radix-popper-content-wrapper":"",style:st({...m(h),transform:m(b)?m(h).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_.value,"--radix-popper-transform-origin":[(k=m(w).transformOrigin)==null?void 0:k.x,(W=m(w).transformOrigin)==null?void 0:W.y].join(" "),...((L=m(w).hide)==null?void 0:L.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[me(m(X),F({ref:m(r)},R.$attrs,{"as-child":n.asChild,as:R.as,"data-side":C.value,"data-align":x.value,style:{animation:m(b)?void 0:"none"}}),{default:A(()=>[P(R.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),Ui=$n("polygon",{points:"0,0 30,0 15,10"},null,-1),Yi=D({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(X),F(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 30 10",preserveAspectRatio:n.asChild?void 0:"none"}),{default:A(()=>[P(n.$slots,"default",{},()=>[Ui])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Xi={top:"bottom",right:"left",bottom:"top",left:"right"},qi=D({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:t}=$(),n=ji(),o=O(()=>Xi[n.placedSide.value]);return(i,r)=>{var l,s,d,c;return B(),Vt("span",{ref:a=>{m(n).onArrowChange(a)},style:st({position:"absolute",left:(l=m(n).arrowX)!=null&&l.value?`${(s=m(n).arrowX)==null?void 0:s.value}px`:void 0,top:(d=m(n).arrowY)!=null&&d.value?`${(c=m(n).arrowY)==null?void 0:c.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[m(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[m(n).placedSide.value],visibility:m(n).shouldHideArrow.value?"hidden":void 0})},[me(Yi,F(i.$attrs,{ref:m(t),style:{display:"block"},as:i.as,"as-child":i.asChild,width:i.width,height:i.height}),{default:A(()=>[P(i.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),Gi=D({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return $(),(t,n)=>(B(),T(m(X),{as:t.as,"as-child":t.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:A(()=>[P(t.$slots,"default")]),_:3},8,["as","as-child"]))}});function Ji(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Ji();const mn="tooltip.open",[bt,Zi]=be("TooltipProvider"),fr=D({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{default:700},skipDelayDuration:{default:300},disableHoverableContent:{type:Boolean,default:!1},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:i,disableClosingTrigger:r,ignoreNonKeyboardFocus:l,disabled:s}=lt(t);$();const d=E(!0),c=E(!1),{start:a,stop:u}=tn(()=>{d.value=!0},o,{immediate:!1});return Zi({isOpenDelayed:d,delayDuration:n,onOpen(){u(),d.value=!1},onClose(){a()},isPointerInTransitRef:c,disableHoverableContent:i,disableClosingTrigger:r,disabled:s,ignoreNonKeyboardFocus:l}),(p,f)=>P(p.$slots,"default")}}),[Ue,Qi]=be("TooltipRoot"),pr=D({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},delayDuration:{default:void 0},disableHoverableContent:{type:Boolean,default:void 0},disableClosingTrigger:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;$();const i=bt(),r=O(()=>n.disableHoverableContent??i.disableHoverableContent.value),l=O(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=O(()=>n.disabled??i.disabled.value),d=O(()=>n.delayDuration??i.delayDuration.value),c=O(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),a=nn(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});j(a,w=>{i.onClose&&(w?(i.onOpen(),document.dispatchEvent(new CustomEvent(mn))):i.onClose())});const u=E(!1),p=E(),f=O(()=>a.value?u.value?"delayed-open":"instant-open":"closed"),{start:v,stop:g}=tn(()=>{u.value=!0,a.value=!0},d,{immediate:!1});function h(){g(),u.value=!1,a.value=!0}function y(){g(),a.value=!1}function b(){v()}return Qi({contentId:"",open:a,stateAttribute:f,trigger:p,onTriggerChange(w){p.value=w},onTriggerEnter(){i.isOpenDelayed.value?b():h()},onTriggerLeave(){r.value?y():g()},onOpen:h,onClose:y,disableHoverableContent:r,disableClosingTrigger:l,disabled:s,ignoreNonKeyboardFocus:c}),(w,C)=>(B(),T(m(ki),null,{default:A(()=>[P(w.$slots,"default",{open:m(a)})]),_:3}))}}),vr=D({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Ue(),o=bt();n.contentId||(n.contentId=it(void 0,"radix-vue-tooltip-content"));const{forwardRef:i,currentElement:r}=$(),l=E(!1),s=E(!1),d=O(()=>n.disabled.value?{}:{click:g,focus:f,pointermove:u,pointerleave:p,pointerdown:a,blur:v});De(()=>{n.onTriggerChange(r.value)});function c(){setTimeout(()=>{l.value=!1},1)}function a(){l.value=!0,document.addEventListener("pointerup",c,{once:!0})}function u(h){h.pointerType!=="touch"&&!s.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),s.value=!0)}function p(){n.onTriggerLeave(),s.value=!1}function f(h){var y,b;l.value||n.ignoreNonKeyboardFocus.value&&!((b=(y=h.target).matches)!=null&&b.call(y,":focus-visible"))||n.onOpen()}function v(){n.onClose()}function g(){n.disableClosingTrigger.value||n.onClose()}return(h,y)=>(B(),T(m(Ii),{"as-child":""},{default:A(()=>[me(m(X),F({ref:m(i),"aria-describedby":m(n).open.value?m(n).contentId:void 0,"data-state":m(n).stateAttribute.value,as:h.as,"as-child":t.asChild,"data-grace-area-trigger":""},xn(d.value)),{default:A(()=>[P(h.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),hn=D({__name:"TooltipContentImpl",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{default:0},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:"partial"},hideWhenDetached:{type:Boolean,default:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ue(),{forwardRef:r}=$(),l=Dn(),s=O(()=>{var a;return(a=l.default)==null?void 0:a.call(l)}),d=O(()=>{var a;if(n.ariaLabel)return n.ariaLabel;let u="";function p(f){typeof f.children=="string"&&f.type!==Wt?u+=f.children:Array.isArray(f.children)&&f.children.forEach(v=>p(v))}return(a=s.value)==null||a.forEach(f=>p(f)),u}),c=O(()=>{const{ariaLabel:a,...u}=n;return u});return De(()=>{Ve(window,"scroll",a=>{const u=a.target;u!=null&&u.contains(i.trigger.value)&&i.onClose()}),Ve(window,mn,i.onClose)}),(a,u)=>(B(),T(m(cn),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var f;m(i).disableClosingTrigger.value&&(f=m(i).trigger.value)!=null&&f.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=Ze(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>m(i).onClose())},{default:A(()=>[me(m(Ki),F({ref:m(r),"data-state":m(i).stateAttribute.value},{...a.$attrs,...c.value},{style:{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),{default:A(()=>[P(a.$slots,"default"),me(m(Gi),{id:m(i).contentId,role:"tooltip"},{default:A(()=>[Pn(_n(d.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),er=D({__name:"TooltipContentHoverable",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},setup(e){const t=ln(e),{forwardRef:n,currentElement:o}=$(),{trigger:i,onClose:r}=Ue(),l=bt(),{isPointerInTransit:s,onPointerExit:d}=Go(i,o);return l.isPointerInTransitRef=s,d(()=>{r()}),(c,a)=>(B(),T(hn,F({ref:m(n)},m(t)),{default:A(()=>[P(c.$slots,"default")]),_:3},16))}}),mr=D({__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ue(),r=sn(n,o),{forwardRef:l}=$();return(s,d)=>(B(),T(m(yt),{present:s.forceMount||m(i).open.value},{default:A(()=>[(B(),T(On(m(i).disableHoverableContent.value?hn:er),F({ref:m(l)},m(r)),{default:A(()=>[P(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),hr=D({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(qi),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),gr=D({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}});export{$i as $,rr as A,Si as B,cr as F,hr as G,fr as H,or as I,ar as M,dr as N,lr as O,Ti as P,ir as T,mr as U,ur as V,pr as W,vr as j,sr as k,vi as n,gr as q}; diff --git a/assets/index-BYewP6KR.js b/assets/index-CL4rmUJ-.js similarity index 98% rename from assets/index-BYewP6KR.js rename to assets/index-CL4rmUJ-.js index 85819bd0b8a8d02d7efc4aec3b4892785e5aa616..21379a512425831f311f8d21d0ab62bf2756449e 100644 --- a/assets/index-BYewP6KR.js +++ b/assets/index-CL4rmUJ-.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-uUrVtnYd.js","assets/HeaderLink-7ZfdE9hW.js","assets/HeaderLink-DsxHr3rn.css","assets/index-BYKB2VRI.js","assets/live2d-zip-loader-CvpgOHsT.js","assets/speech-CLmksxkl.js","assets/providers-CFIOZO6n.js","assets/queue-DRKK1rL_.js","assets/queues-Cj51JWdx.js","assets/airi-card-BM-9G8yH.js","assets/consciousness-MUz60a06.js","assets/Model.vue_vue_type_script_setup_true_lang-CvOp1AJu.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js","assets/index-CBPLaxd6.js","assets/route-block-B_A1xBdJ.js","assets/index-B6DQ8quC.css","assets/image-CEksY4YG.js","assets/image-BhuwcwI9.css","assets/queue-BTScdVVl.js","assets/index-BQRIrFxp.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js","assets/index-wBUQ6CAe.css","assets/index-BQXqZPG9.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-CGAEfOuB.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-_ktQBMkP.js","assets/index-C4TaASqf.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-BD31oKXO.js","assets/CardDetailDialog-CTkvDi54.js","assets/CardListItem-Yj5o7xqu.js","assets/DeleteCardDialog-CzJ6iFuT.js","assets/index-Cq-dDTsD.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-EIEI_2Ix.js","assets/useIconAnimation-B3hjTK1u.js","assets/index-Cm5GgQiK.css","assets/index-CYuYLZwp.js","assets/index-DzMFUKkB.css","assets/index-Cu67dzFi.js","assets/IconStatusItem-DXrpg97R.js","assets/IconStatusItem-Bkq6rmpG.css","assets/consciousness-DZJpow8n.js","assets/RadioCardDetailManySelect-ConUGerY.js","assets/Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js","assets/RadioCardDetailManySelect-DctfBiRo.css","assets/speech-g41aUB8v.js","assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-CGhOEjXF.js","assets/TestDummyMarker-CuAjjIfV.css","assets/FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js","assets/speech-Hr-CnTW2.css","assets/index-Dxee_4oE.js","assets/anthropic-xuZL6YhP.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js","assets/cloudflare-workers-ai-CtD2Pa0I.js","assets/deepseek-CWb6iLhX.js","assets/elevenlabs-DaDbxr9N.js","assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-lVYyoUny.js","assets/fireworks-ai-CiD4t3hx.js","assets/microsoft-speech-CDHTXaj-.js","assets/mistral-ai-pL5Kxw61.js","assets/moonshot-ai-COGUtX1e.js","assets/novita-ai-CfYWAApi.js","assets/ollama-8aEB11fY.js","assets/openai-CgoRZ1EW.js","assets/openrouter-ai-Boprybwg.js","assets/together-ai-Eu2_AJ3V.js","assets/xai-o2OiL_Fi.js","assets/delays-Bgq_JgIR.js","assets/emotions-BY0bSGBW.js","assets/messages-DYJkpUp7.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-BPwzNWfB.js","assets/HeaderLink-ByYQsQjF.js","assets/HeaderLink-DsxHr3rn.css","assets/index-NSbcQ-qE.js","assets/live2d-zip-loader-DFrBymqv.js","assets/speech-Ae5ywnpY.js","assets/providers-BHCrT0RZ.js","assets/queue-DCQeV-U1.js","assets/queues-D3Ic2N1b.js","assets/airi-card-CWMQJScT.js","assets/consciousness-nHboP4iV.js","assets/Model.vue_vue_type_script_setup_true_lang-CuI1gVrl.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js","assets/index-D7ZJqxUE.js","assets/route-block-B_A1xBdJ.js","assets/index-B6DQ8quC.css","assets/image-CcWmIr03.js","assets/image-BhuwcwI9.css","assets/queue-DOUpDv6R.js","assets/index-C7IMxg5Y.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js","assets/index-wBUQ6CAe.css","assets/index-BedZtR3C.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DwW72nHQ.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C1JwBLjv.js","assets/index-CDeQ6Zfm.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-D1pbLBEG.js","assets/CardDetailDialog-0JP7S-1I.js","assets/CardListItem-DjCvxPQ0.js","assets/DeleteCardDialog-B93IlDSL.js","assets/index-CkYx69fn.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-CzX7Yr-T.js","assets/useIconAnimation-D_Q3CYV7.js","assets/index-Cm5GgQiK.css","assets/index-Bs3BUlfx.js","assets/index-DzMFUKkB.css","assets/index-Di3jPqPB.js","assets/IconStatusItem-CKiy6LHl.js","assets/IconStatusItem-Bkq6rmpG.css","assets/consciousness-CJCDq3tD.js","assets/RadioCardDetailManySelect-Cc_QkuwQ.js","assets/Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js","assets/RadioCardDetailManySelect-DctfBiRo.css","assets/speech-DqVeJv2L.js","assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-D5aCIkT4.js","assets/TestDummyMarker-CuAjjIfV.css","assets/FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js","assets/speech-Hr-CnTW2.css","assets/index-CjikULv_.js","assets/anthropic-Dr4rn0dD.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js","assets/cloudflare-workers-ai-BYCqyq2S.js","assets/deepseek-CROYIRyB.js","assets/elevenlabs-BKBDCaFN.js","assets/SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-8IXQG3Jk.js","assets/featherless-ai-PxI_AzkK.js","assets/fireworks-ai-CmtwbW1h.js","assets/microsoft-speech-Cf4yrOLH.js","assets/mistral-ai-Cjk87FuW.js","assets/moonshot-ai-B8RKb1HT.js","assets/novita-ai-CVRJyGOQ.js","assets/ollama-BNerp7db.js","assets/openai-CFF4hUNa.js","assets/openrouter-ai-4M13n7g5.js","assets/together-ai-DeW9vX9c.js","assets/xai-hZPT-RIL.js","assets/delays-DYQGGjQG.js","assets/emotions-Bk2T6ViW.js","assets/messages-UpVa7nD_.js"])))=>i.map(i=>d[i]); var WA=Object.defineProperty;var XA=(n,e,t)=>e in n?WA(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var fi=(n,e,t)=>XA(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();const $A="modulepreload",qA=function(n){return"/"+n},cv={},ct=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(t.map(l=>{if(l=qA(l),l in cv)return;cv[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":$A,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((d,h)=>{f.addEventListener("load",d),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -3846,11 +3846,11 @@ void main() { * pinia v3.0.1 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let Aw;const Vh=n=>Aw=n,Cw=Symbol();function Hg(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var kl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(kl||(kl={}));function yz(){const n=g0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=M0({install(r){Vh(s),s._a=r,r.provide(Cw,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const Rw=()=>{};function dx(n,e,t,i=Rw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&Xd()&&_0(s),s}function Qo(n,...e){n.slice().forEach(t=>{t(...e)})}const bz=n=>n(),hx=Symbol(),_m=Symbol();function Gg(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];Hg(s)&&Hg(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Cs(i)?n[t]=Gg(s,i):n[t]=i}return n}const xz=Symbol();function Mz(n){return!Hg(n)||!n.hasOwnProperty(xz)}const{assign:er}=Object;function Sz(n){return!!(Pt(n)&&n.effect)}function Ez(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=s?s():{});const u=oS(t.state.value[n]);return er(u,r,Object.keys(o||{}).reduce((f,d)=>(f[d]=M0(Ee(()=>{Vh(t);const h=t._s.get(n);return o[d].call(h,h)})),f),{}))}return l=Pw(n,c,e,t,i,!0),l}function Pw(n,e,t={},i,s,r){let o;const a=er({actions:{}},t),l={deep:!0};let c,u,f=[],d=[],h;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),et({});let _;function g(P){let x;c=u=!1,typeof P=="function"?(P(i.state.value[n]),x={type:kl.patchFunction,storeId:n,events:h}):(Gg(i.state.value[n],P),x={type:kl.patchObject,payload:P,storeId:n,events:h});const M=_=Symbol();Sr().then(()=>{_===M&&(c=!0)}),u=!0,Qo(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(L=>{er(L,M)})}:Rw;function y(){o.stop(),f=[],d=[],i._s.delete(n)}const b=(P,x="")=>{if(hx in P)return P[_m]=x,P;const M=function(){Vh(i);const L=Array.from(arguments),F=[],H=[];function Y(Q){F.push(Q)}function ee(Q){H.push(Q)}Qo(d,{args:L,name:M[_m],store:E,after:Y,onError:ee});let K;try{K=P.apply(this&&this.$id===n?this:E,L)}catch(Q){throw Qo(H,Q),Q}return K instanceof Promise?K.then(Q=>(Qo(F,Q),Q)).catch(Q=>(Qo(H,Q),Promise.reject(Q))):(Qo(F,K),K)};return M[hx]=!0,M[_m]=x,M},v={_p:i,$id:n,$onAction:dx.bind(null,d),$patch:g,$reset:m,$subscribe(P,x={}){const M=dx(f,P,x.detached,()=>L()),L=o.run(()=>$e(()=>i.state.value[n],F=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:kl.direct,events:h},F)},er({},l,x)));return M},$dispose:y},E=bi(v);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||bz)(()=>i._e.run(()=>(o=g0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!Sz(x)||Cs(x))r||(p&&Mz(x)&&(Pt(x)?x.value=p[P]:Gg(x,p[P])),i.state.value[n][P]=x);else if(typeof x=="function"){const M=b(x,P);S[P]=M,a.actions[P]=x}}return er(E,S),er(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{er(x,P)})}}),i._p.forEach(P=>{er(E,o.run(()=>P({store:E,app:i._a,pinia:i,options:a})))}),p&&r&&t.hydrate&&t.hydrate(E.$state,p),c=!0,u=!0,E}/*! #__NO_SIDE_EFFECTS__ */function Tz(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Cc();return o=o||(l?En(Cw,null):null),o&&Vh(o),o=Aw,o._s.has(n)||(s?Pw(n,e,i,o):Ez(n,i,o)),o._s.get(n)}return r.$id=n,r}function wz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Ee({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Cs(s))&&(t[i]=aS(n,i))}return t}const Az=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>ct(()=>import("./default-uUrVtnYd.js"),__vite__mapDeps([0,1,2])),"/src/layouts/stage.vue":()=>ct(()=>import("./stage-BZEQTMlY.js"),[])})).forEach(([s,r])=>{let o=s.replace("/src/layouts/","").replace(".vue","");e[o]=r});function i(s,r=!0){return s.map(o=>{var a,l,c,u,f,d;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),r){if(!o.component&&((l=o.children)==null?void 0:l.find(p=>{var _;return(p.path===""||p.path==="/")&&((_=p.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(d=o.meta)==null?void 0:d.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! + */let Aw;const Vh=n=>Aw=n,Cw=Symbol();function Hg(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var kl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(kl||(kl={}));function yz(){const n=g0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=M0({install(r){Vh(s),s._a=r,r.provide(Cw,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const Rw=()=>{};function dx(n,e,t,i=Rw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&Xd()&&_0(s),s}function Qo(n,...e){n.slice().forEach(t=>{t(...e)})}const bz=n=>n(),hx=Symbol(),_m=Symbol();function Gg(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];Hg(s)&&Hg(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Cs(i)?n[t]=Gg(s,i):n[t]=i}return n}const xz=Symbol();function Mz(n){return!Hg(n)||!n.hasOwnProperty(xz)}const{assign:er}=Object;function Sz(n){return!!(Pt(n)&&n.effect)}function Ez(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=s?s():{});const u=oS(t.state.value[n]);return er(u,r,Object.keys(o||{}).reduce((f,d)=>(f[d]=M0(Ee(()=>{Vh(t);const h=t._s.get(n);return o[d].call(h,h)})),f),{}))}return l=Pw(n,c,e,t,i,!0),l}function Pw(n,e,t={},i,s,r){let o;const a=er({actions:{}},t),l={deep:!0};let c,u,f=[],d=[],h;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),et({});let _;function g(P){let x;c=u=!1,typeof P=="function"?(P(i.state.value[n]),x={type:kl.patchFunction,storeId:n,events:h}):(Gg(i.state.value[n],P),x={type:kl.patchObject,payload:P,storeId:n,events:h});const M=_=Symbol();Sr().then(()=>{_===M&&(c=!0)}),u=!0,Qo(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(L=>{er(L,M)})}:Rw;function y(){o.stop(),f=[],d=[],i._s.delete(n)}const b=(P,x="")=>{if(hx in P)return P[_m]=x,P;const M=function(){Vh(i);const L=Array.from(arguments),F=[],H=[];function Y(Q){F.push(Q)}function ee(Q){H.push(Q)}Qo(d,{args:L,name:M[_m],store:E,after:Y,onError:ee});let K;try{K=P.apply(this&&this.$id===n?this:E,L)}catch(Q){throw Qo(H,Q),Q}return K instanceof Promise?K.then(Q=>(Qo(F,Q),Q)).catch(Q=>(Qo(H,Q),Promise.reject(Q))):(Qo(F,K),K)};return M[hx]=!0,M[_m]=x,M},v={_p:i,$id:n,$onAction:dx.bind(null,d),$patch:g,$reset:m,$subscribe(P,x={}){const M=dx(f,P,x.detached,()=>L()),L=o.run(()=>$e(()=>i.state.value[n],F=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:kl.direct,events:h},F)},er({},l,x)));return M},$dispose:y},E=bi(v);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||bz)(()=>i._e.run(()=>(o=g0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!Sz(x)||Cs(x))r||(p&&Mz(x)&&(Pt(x)?x.value=p[P]:Gg(x,p[P])),i.state.value[n][P]=x);else if(typeof x=="function"){const M=b(x,P);S[P]=M,a.actions[P]=x}}return er(E,S),er(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{er(x,P)})}}),i._p.forEach(P=>{er(E,o.run(()=>P({store:E,app:i._a,pinia:i,options:a})))}),p&&r&&t.hydrate&&t.hydrate(E.$state,p),c=!0,u=!0,E}/*! #__NO_SIDE_EFFECTS__ */function Tz(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Cc();return o=o||(l?En(Cw,null):null),o&&Vh(o),o=Aw,o._s.has(n)||(s?Pw(n,e,i,o):Ez(n,i,o)),o._s.get(n)}return r.$id=n,r}function wz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Ee({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Cs(s))&&(t[i]=aS(n,i))}return t}const Az=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>ct(()=>import("./default-BPwzNWfB.js"),__vite__mapDeps([0,1,2])),"/src/layouts/stage.vue":()=>ct(()=>import("./stage-Bqjk4H4J.js"),[])})).forEach(([s,r])=>{let o=s.replace("/src/layouts/","").replace(".vue","");e[o]=r});function i(s,r=!0){return s.map(o=>{var a,l,c,u,f,d;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),r){if(!o.component&&((l=o.children)==null?void 0:l.find(p=>{var _;return(p.path===""||p.path==="/")&&((_=p.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(d=o.meta)==null?void 0:d.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! * vue-router v4.5.0 * (c) 2024 Eduardo San Martin Morote * @license MIT - */const ta=typeof document<"u";function Iw(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Cz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&Iw(n.default)}const Mt=Object.assign;function vm(n,e){const t={};for(const i in e){const s=e[i];t[i]=Bi(s)?s.map(n):n(s)}return t}const Bl=()=>{},Bi=Array.isArray,Lw=/#/g,Rz=/&/g,Pz=/\//g,Iz=/=/g,Lz=/\?/g,Dw=/\+/g,Dz=/%5B/g,Oz=/%5D/g,Ow=/%5E/g,Nz=/%60/g,Nw=/%7B/g,Uz=/%7C/g,Uw=/%7D/g,Fz=/%20/g;function B_(n){return encodeURI(""+n).replace(Uz,"|").replace(Dz,"[").replace(Oz,"]")}function kz(n){return B_(n).replace(Nw,"{").replace(Uw,"}").replace(Ow,"^")}function Wg(n){return B_(n).replace(Dw,"%2B").replace(Fz,"+").replace(Lw,"%23").replace(Rz,"%26").replace(Nz,"`").replace(Nw,"{").replace(Uw,"}").replace(Ow,"^")}function Bz(n){return Wg(n).replace(Iz,"%3D")}function zz(n){return B_(n).replace(Lw,"%23").replace(Lz,"%3F")}function Vz(n){return n==null?"":zz(n).replace(Pz,"%2F")}function bc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const Hz=/\/$/,Gz=n=>n.replace(Hz,"");function ym(n,e,t="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=n(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=qz(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:bc(o)}}function Wz(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function px(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function Xz(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ca(e.matched[i],t.matched[s])&&Fw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ca(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function Fw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!$z(n[t],e[t]))return!1;return!0}function $z(n,e){return Bi(n)?mx(n,e):Bi(e)?mx(e,n):n===e}function mx(n,e){return Bi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function qz(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=t.length-1,o,a;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const Js={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var xc;(function(n){n.pop="pop",n.push="push"})(xc||(xc={}));var zl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(zl||(zl={}));function Yz(n){if(!n)if(ta){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),Gz(n)}const jz=/^[^#]+#/;function Kz(n,e){return n.replace(jz,"#")+e}function Zz(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const Hh=()=>({left:window.scrollX,top:window.scrollY});function Jz(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=Zz(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function gx(n,e){return(history.state?history.state.position-e:-1)+n}const Xg=new Map;function Qz(n,e){Xg.set(n,e)}function eV(n){const e=Xg.get(n);return Xg.delete(n),e}let tV=()=>location.protocol+"//"+location.host;function kw(n,e){const{pathname:t,search:i,hash:s}=e,r=n.indexOf("#");if(r>-1){let a=s.includes(n.slice(r))?n.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),px(l,"")}return px(t,n)+i+s}function nV(n,e,t,i){let s=[],r=[],o=null;const a=({state:d})=>{const h=kw(n,location),p=t.value,_=e.value;let g=0;if(d){if(t.value=h,e.value=d,o&&o===p){o=null;return}g=_?d.position-_.position:0}else i(h);s.forEach(m=>{m(t.value,p,{delta:g,type:xc.pop,direction:g?g>0?zl.forward:zl.back:zl.unknown})})};function l(){o=t.value}function c(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return r.push(h),h}function u(){const{history:d}=window;d.state&&d.replaceState(Mt({},d.state,{scroll:Hh()}),"")}function f(){for(const d of r)d();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function _x(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?Hh():null}}function iV(n){const{history:e,location:t}=window,i={value:kw(n,t)},s={value:e.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const f=n.indexOf("#"),d=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:tV()+n+l;try{e[u?"replaceState":"pushState"](c,"",d),s.value=c}catch(h){console.error(h),t[u?"replace":"assign"](d)}}function o(l,c){const u=Mt({},e.state,_x(s.value.back,l,s.value.forward,!0),c,{position:s.value.position});r(l,u,!0),i.value=l}function a(l,c){const u=Mt({},s.value,e.state,{forward:l,scroll:Hh()});r(u.current,u,!0);const f=Mt({},_x(i.value,l,null),{position:u.position+1},c);r(l,f,!1),i.value=l}return{location:i,state:s,push:a,replace:o}}function sV(n){n=Yz(n);const e=iV(n),t=nV(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=Mt({location:"",base:n,go:i,createHref:Kz.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function rV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),sV(n)}function oV(n){return typeof n=="string"||n&&typeof n=="object"}function Bw(n){return typeof n=="string"||typeof n=="symbol"}const zw=Symbol("");var vx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(vx||(vx={}));function Ra(n,e){return Mt(new Error,{type:n,[zw]:!0},e)}function gs(n,e){return n instanceof Error&&zw in n&&(e==null||!!(n.type&e))}const yx="[^/]+?",aV={sensitive:!1,strict:!1,start:!0,end:!0},lV=/[.+*?^${}()[\]/\\]/g;function cV(n,e){const t=Mt({},aV,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function Vw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const fV={type:0,value:""},dV=/[a-zA-Z0-9_]/;function hV(n){if(!n)return[[]];if(n==="/")return[[fV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(h){throw new Error(`ERR (${t})/"${c}": ${h}`)}let t=0,i=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let a=0,l,c="",u="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function d(){c+=l}for(;a{o(b)}:Bl}function o(f){if(Bw(f)){const d=i.get(f);d&&(i.delete(f),t.splice(t.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=t.indexOf(f);d>-1&&(t.splice(d,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const d=vV(f,t);t.splice(d,0,f),f.record.name&&!Sx(f)&&i.set(f.record.name,f)}function c(f,d){let h,p={},_,g;if("name"in f&&f.name){if(h=i.get(f.name),!h)throw Ra(1,{location:f});g=h.record.name,p=Mt(xx(d.params,h.keys.filter(b=>!b.optional).concat(h.parent?h.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&xx(f.params,h.keys.map(b=>b.name))),_=h.stringify(p)}else if(f.path!=null)_=f.path,h=t.find(b=>b.re.test(_)),h&&(p=h.parse(_),g=h.record.name);else{if(h=d.name?i.get(d.name):t.find(b=>b.re.test(d.path)),!h)throw Ra(1,{location:f,currentLocation:d});g=h.record.name,p=Mt({},d.params,f.params),_=h.stringify(p)}const m=[];let y=h;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:_V(m)}}n.forEach(f=>r(f));function u(){t.length=0,i.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function xx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Mx(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:gV(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function gV(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function Sx(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function _V(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Ex(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function vV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;Vw(n,e[r])<0?i=r:t=r+1}const s=yV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function yV(n){let e=n;for(;e=e.parent;)if(Hw(e)&&Vw(n,e)===0)return e}function Hw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function bV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Wg(r)):[i&&Wg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function xV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Bi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const MV=Symbol(""),wx=Symbol(""),Gh=Symbol(""),Gw=Symbol(""),$g=Symbol("");function ll(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function or(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=d=>{d===!1?l(Ra(4,{from:t,to:e})):d instanceof Error?l(d):oV(d)?l(Ra(2,{from:e,to:d})):(o&&i.enterCallbacks[s]===o&&typeof d=="function"&&o.push(d),a())},u=r(()=>n.call(i&&i.instances[s],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(d=>l(d))})}function bm(n,e,t,i,s=r=>r()){const r=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(Iw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(or(u,t,i,o,a,s))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Cz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const h=(f.__vccOpts||f)[e];return h&&or(h,t,i,o,a,s)()}))}}return r}function Ax(n){const e=En(Gh),t=En(Gw),i=Ee(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Ee(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const d=f.findIndex(Ca.bind(null,u));if(d>-1)return d;const h=Cx(l[c-2]);return c>1&&Cx(u)===h&&f[f.length-1].path!==h?f.findIndex(Ca.bind(null,l[c-2])):d}),r=Ee(()=>s.value>-1&&AV(t.params,i.value.params)),o=Ee(()=>s.value>-1&&s.value===t.matched.length-1&&Fw(t.params,i.value.params));function a(l={}){if(wV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Bl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Ee(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function SV(n){return n.length===1?n[0]:n}const EV=fn({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"}},useLink:Ax,setup(n,{slots:e}){const t=bi(Ax(n)),{options:i}=En(Gh),s=Ee(()=>({[Rx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Rx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&SV(e.default(t));return n.custom?r:Ls("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),TV=EV;function wV(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function AV(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!Bi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Cx(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Rx=(n,e,t)=>n??e??t,CV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=En($g),s=Ee(()=>n.route||i.value),r=En(wx,0),o=Ee(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Ee(()=>s.value.matched[o.value]);fr(wx,Ee(()=>o.value+1)),fr(MV,a),fr($g,s);const l=et();return $e(()=>[l.value,a.value,n.name],([c,u,f],[d,h,p])=>{u&&(u.instances[f]=c,h&&h!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Ca(u,h)||!d)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,d=f&&f.components[u];if(!d)return Px(t.default,{Component:d,route:c});const h=f.props[u],p=h?h===!0?c.params:typeof h=="function"?h(c):h:null,g=Ls(d,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Px(t.default,{Component:g,route:c})||g}}});function Px(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const Ww=CV;function RV(n){const e=mV(n.routes,n),t=n.parseQuery||bV,i=n.stringifyQuery||Tx,s=n.history,r=ll(),o=ll(),a=ll(),l=De(Js);let c=Js;ta&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=vm.bind(null,X=>""+X),f=vm.bind(null,Vz),d=vm.bind(null,bc);function h(X,ae){let fe,ce;return Bw(X)?(fe=e.getRecordMatcher(X),ce=ae):ce=X,e.addRoute(ce,fe)}function p(X){const ae=e.getRecordMatcher(X);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(X=>X.record)}function g(X){return!!e.getRecordMatcher(X)}function m(X,ae){if(ae=Mt({},ae||l.value),typeof X=="string"){const R=ym(t,X,ae.path),te=e.resolve({path:R.path},ae),G=s.createHref(R.fullPath);return Mt(R,te,{params:d(te.params),hash:bc(R.hash),redirectedFrom:void 0,href:G})}let fe;if(X.path!=null)fe=Mt({},X,{path:ym(t,X.path,ae.path).path});else{const R=Mt({},X.params);for(const te in R)R[te]==null&&delete R[te];fe=Mt({},X,{params:f(R)}),ae.params=f(ae.params)}const ce=e.resolve(fe,ae),Ue=X.hash||"";ce.params=u(d(ce.params));const k=Wz(i,Mt({},X,{hash:kz(Ue),path:ce.path})),z=s.createHref(k);return Mt({fullPath:k,hash:Ue,query:i===Tx?xV(X.query):X.query||{}},ce,{redirectedFrom:void 0,href:z})}function y(X){return typeof X=="string"?ym(t,X,l.value.path):Mt({},X)}function b(X,ae){if(c!==X)return Ra(8,{from:ae,to:X})}function v(X){return S(X)}function E(X){return v(Mt(y(X),{replace:!0}))}function T(X){const ae=X.matched[X.matched.length-1];if(ae&&ae.redirect){const{redirect:fe}=ae;let ce=typeof fe=="function"?fe(X):fe;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Mt({query:X.query,hash:X.hash,params:ce.path!=null?{}:X.params},ce)}}function S(X,ae){const fe=c=m(X),ce=l.value,Ue=X.state,k=X.force,z=X.replace===!0,R=T(fe);if(R)return S(Mt(y(R),{state:typeof R=="object"?Mt({},Ue,R.state):Ue,force:k,replace:z}),ae||fe);const te=fe;te.redirectedFrom=ae;let G;return!k&&Xz(i,ce,fe)&&(G=Ra(16,{to:te,from:ce}),se(ce,ce,!0,!1)),(G?Promise.resolve(G):M(te,ce)).catch(W=>gs(W)?gs(W,2)?W:be(W):Z(W,te,ce)).then(W=>{if(W){if(gs(W,2))return S(Mt({replace:z},y(W.to),{state:typeof W.to=="object"?Mt({},Ue,W.to.state):Ue,force:k}),ae||te)}else W=F(te,ce,!0,z,Ue);return L(te,ce,W),W})}function P(X,ae){const fe=b(X,ae);return fe?Promise.reject(fe):Promise.resolve()}function x(X){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(X):X()}function M(X,ae){let fe;const[ce,Ue,k]=PV(X,ae);fe=bm(ce.reverse(),"beforeRouteLeave",X,ae);for(const R of ce)R.leaveGuards.forEach(te=>{fe.push(or(te,X,ae))});const z=P.bind(null,X,ae);return fe.push(z),xe(fe).then(()=>{fe=[];for(const R of r.list())fe.push(or(R,X,ae));return fe.push(z),xe(fe)}).then(()=>{fe=bm(Ue,"beforeRouteUpdate",X,ae);for(const R of Ue)R.updateGuards.forEach(te=>{fe.push(or(te,X,ae))});return fe.push(z),xe(fe)}).then(()=>{fe=[];for(const R of k)if(R.beforeEnter)if(Bi(R.beforeEnter))for(const te of R.beforeEnter)fe.push(or(te,X,ae));else fe.push(or(R.beforeEnter,X,ae));return fe.push(z),xe(fe)}).then(()=>(X.matched.forEach(R=>R.enterCallbacks={}),fe=bm(k,"beforeRouteEnter",X,ae,x),fe.push(z),xe(fe))).then(()=>{fe=[];for(const R of o.list())fe.push(or(R,X,ae));return fe.push(z),xe(fe)}).catch(R=>gs(R,8)?R:Promise.reject(R))}function L(X,ae,fe){a.list().forEach(ce=>x(()=>ce(X,ae,fe)))}function F(X,ae,fe,ce,Ue){const k=b(X,ae);if(k)return k;const z=ae===Js,R=ta?history.state:{};fe&&(ce||z?s.replace(X.fullPath,Mt({scroll:z&&R&&R.scroll},Ue)):s.push(X.fullPath,Ue)),l.value=X,se(X,ae,fe,z),be()}let H;function Y(){H||(H=s.listen((X,ae,fe)=>{if(!ge.listening)return;const ce=m(X),Ue=T(ce);if(Ue){S(Mt(Ue,{replace:!0,force:!0}),ce).catch(Bl);return}c=ce;const k=l.value;ta&&Qz(gx(k.fullPath,fe.delta),Hh()),M(ce,k).catch(z=>gs(z,12)?z:gs(z,2)?(S(Mt(y(z.to),{force:!0}),ce).then(R=>{gs(R,20)&&!fe.delta&&fe.type===xc.pop&&s.go(-1,!1)}).catch(Bl),Promise.reject()):(fe.delta&&s.go(-fe.delta,!1),Z(z,ce,k))).then(z=>{z=z||F(ce,k,!1),z&&(fe.delta&&!gs(z,8)?s.go(-fe.delta,!1):fe.type===xc.pop&&gs(z,20)&&s.go(-1,!1)),L(ce,k,z)}).catch(Bl)}))}let ee=ll(),K=ll(),Q;function Z(X,ae,fe){be(X);const ce=K.list();return ce.length?ce.forEach(Ue=>Ue(X,ae,fe)):console.error(X),Promise.reject(X)}function he(){return Q&&l.value!==Js?Promise.resolve():new Promise((X,ae)=>{ee.add([X,ae])})}function be(X){return Q||(Q=!X,Y(),ee.list().forEach(([ae,fe])=>X?fe(X):ae()),ee.reset()),X}function se(X,ae,fe,ce){const{scrollBehavior:Ue}=n;if(!ta||!Ue)return Promise.resolve();const k=!fe&&eV(gx(X.fullPath,0))||(ce||!fe)&&history.state&&history.state.scroll||null;return Sr().then(()=>Ue(X,ae,k)).then(z=>z&&Jz(z)).catch(z=>Z(z,X,ae))}const ye=X=>s.go(X);let He;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:K.add,isReady:he,install(X){const ae=this;X.component("RouterLink",TV),X.component("RouterView",Ww),X.config.globalProperties.$router=ae,Object.defineProperty(X.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),ta&&!He&&l.value===Js&&(He=!0,v(s.location).catch(Ue=>{}));const fe={};for(const Ue in Js)Object.defineProperty(fe,Ue,{get:()=>l.value[Ue],enumerable:!0});X.provide(Gh,ae),X.provide(Gw,iS(fe)),X.provide($g,l);const ce=X.unmount;re.add(X),X.unmount=function(){re.delete(X),re.size<1&&(c=Js,H&&H(),H=null,l.value=Js,He=!1,Q=!1),ce()}}};function xe(X){return X.reduce((ae,fe)=>ae.then(()=>x(fe)),Promise.resolve())}return ge}function PV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oCa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ca(c,l))||s.push(l))}return[t,i,s]}function IV(){return En(Gh)}const LV=[{path:"/",name:"/",component:()=>ct(()=>import("./index-BYKB2VRI.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2,14,15,16])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>ct(()=>import("./_...all_-8bDQaOJn.js"),[])},{path:"/audio",name:"/audio",component:()=>ct(()=>import("./audio-Bp2_lULR.js"),[])},{path:"/devtools",children:[{path:"image",name:"/devtools/image",component:()=>ct(()=>import("./image-CEksY4YG.js"),__vite__mapDeps([17,18]))}]},{path:"/queue",name:"/queue",component:()=>ct(()=>import("./queue-BTScdVVl.js"),__vite__mapDeps([19,7]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>ct(()=>import("./index-BQRIrFxp.js"),__vite__mapDeps([20,4,21,15,22])),meta:{stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>ct(()=>import("./index-BQXqZPG9.js"),__vite__mapDeps([23,9,4,10,6,5,24,25,26,27,15])),meta:{stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>ct(()=>import("./CardDetailDialog-CTkvDi54.js"),__vite__mapDeps([28,24,25,26,4,9,10,6,5]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>ct(()=>import("./CardListItem-Yj5o7xqu.js"),__vite__mapDeps([29,27]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>ct(()=>import("./DeleteCardDialog-CzJ6iFuT.js"),__vite__mapDeps([30,25,26]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>ct(()=>import("./index-Cq-dDTsD.js"),__vite__mapDeps([31,21,4,32,13,12,26,33,15,34])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>ct(()=>import("./index-CprOqayC.js"),[])}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>ct(()=>import("./index-CYuYLZwp.js"),__vite__mapDeps([35,21,11,4,32,13,12,26,33,15,36])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>ct(()=>import("./index-Cu67dzFi.js"),__vite__mapDeps([37,4,38,39,21,33,15])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>ct(()=>import("./consciousness-DZJpow8n.js"),__vite__mapDeps([40,41,12,42,43,4,10,6,15])),meta:{stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>ct(()=>import("./memory-long-term-BsSy-hFO.js"),[])},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>ct(()=>import("./memory-short-term-BGN7U3OS.js"),[])},{path:"speech",name:"/settings/modules/speech",component:()=>ct(()=>import("./speech-g41aUB8v.js"),__vite__mapDeps([44,45,46,47,42,41,12,43,4,6,5,15,48])),meta:{stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>ct(()=>import("./index-Dxee_4oE.js"),__vite__mapDeps([49,21,4,6,38,39,33,15])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>ct(()=>import("./anthropic-xuZL6YhP.js"),__vite__mapDeps([50,4,6,51,13,12,47,42,52,53,54]))},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>ct(()=>import("./cloudflare-workers-ai-CtD2Pa0I.js"),__vite__mapDeps([55,4,6,47,42,52,53,54]))},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>ct(()=>import("./deepseek-CWb6iLhX.js"),__vite__mapDeps([56,4,6,51,13,12,47,42,52,53,54]))},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>ct(()=>import("./elevenlabs-DaDbxr9N.js"),__vite__mapDeps([57,4,6,5,58,45,46,51,13,12,47,42,52,53]))},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>ct(()=>import("./fireworks-ai-CiD4t3hx.js"),__vite__mapDeps([59,4,6,51,13,12,47,42,52,53,54]))},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>ct(()=>import("./microsoft-speech-CDHTXaj-.js"),__vite__mapDeps([60,47,42,4,6,5,58,45,46,51,13,12,52,53]))},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>ct(()=>import("./mistral-ai-pL5Kxw61.js"),__vite__mapDeps([61,4,6,51,13,12,47,42,52,53,54]))},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>ct(()=>import("./moonshot-ai-COGUtX1e.js"),__vite__mapDeps([62,4,6,51,13,12,47,42,52,53,54]))},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>ct(()=>import("./novita-ai-CfYWAApi.js"),__vite__mapDeps([63,4,6,51,13,12,47,42,52,53,54]))},{path:"ollama",name:"/settings/providers/ollama",component:()=>ct(()=>import("./ollama-8aEB11fY.js"),__vite__mapDeps([64,42,4,6,51,13,12,47,53,54]))},{path:"openai",name:"/settings/providers/openai",component:()=>ct(()=>import("./openai-CgoRZ1EW.js"),__vite__mapDeps([65,4,6,51,13,12,47,42,52,53,54]))},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>ct(()=>import("./openrouter-ai-Boprybwg.js"),__vite__mapDeps([66,4,6,51,13,12,47,42,52,53,54]))},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>ct(()=>import("./together-ai-Eu2_AJ3V.js"),__vite__mapDeps([67,4,6,51,13,12,47,42,52,53,54]))},{path:"xai",name:"/settings/providers/xai",component:()=>ct(()=>import("./xai-o2OiL_Fi.js"),__vite__mapDeps([68,4,6,51,13,12,47,42,52,53,54]))}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>ct(()=>import("./filter-message-BT9_oUVT.js"),[])},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>ct(()=>import("./delays-Bgq_JgIR.js"),__vite__mapDeps([69,8,4,7,14]))},{path:"emotions",name:"/test/queues/emotions",component:()=>ct(()=>import("./emotions-BY0bSGBW.js"),__vite__mapDeps([70,8,4,7]))},{path:"messages",name:"/test/queues/messages",component:()=>ct(()=>import("./messages-DYJkpUp7.js"),__vite__mapDeps([71,8,4,7]))}]}]}],Xw=(n,e)=>{if(typeof n=="number"){if(e===3)return{mode:"rgb",r:(n>>8&15|n>>4&240)/255,g:(n>>4&15|n&240)/255,b:(n&15|n<<4&240)/255};if(e===4)return{mode:"rgb",r:(n>>12&15|n>>8&240)/255,g:(n>>8&15|n>>4&240)/255,b:(n>>4&15|n&240)/255,alpha:(n&15|n<<4&240)/255};if(e===6)return{mode:"rgb",r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255};if(e===8)return{mode:"rgb",r:(n>>24&255)/255,g:(n>>16&255)/255,b:(n>>8&255)/255,alpha:(n&255)/255}}},DV={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},OV=n=>Xw(DV[n.toLowerCase()],6),NV=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,UV=n=>{let e;return(e=n.match(NV))?Xw(parseInt(e[1],16),e[1].length):void 0},dr="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Vl=`${dr}%`,z_=`(?:${dr}%|${dr})`,FV=`(?:${dr}(deg|grad|rad|turn)|${dr})`,Pa="\\s*,\\s*",kV=new RegExp(`^rgba?\\(\\s*${dr}${Pa}${dr}${Pa}${dr}\\s*(?:,\\s*${z_}\\s*)?\\)$`),BV=new RegExp(`^rgba?\\(\\s*${Vl}${Pa}${Vl}${Pa}${Vl}\\s*(?:,\\s*${z_}\\s*)?\\)$`),zV=n=>{let e={mode:"rgb"},t;if(t=n.match(kV))t[1]!==void 0&&(e.r=t[1]/255),t[2]!==void 0&&(e.g=t[2]/255),t[3]!==void 0&&(e.b=t[3]/255);else if(t=n.match(BV))t[1]!==void 0&&(e.r=t[1]/100),t[2]!==void 0&&(e.g=t[2]/100),t[3]!==void 0&&(e.b=t[3]/100);else return;return t[4]!==void 0?e.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+t[5]))),e},VV=(n,e)=>n===void 0?void 0:typeof n!="object"?ZV(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,$w=(n="rgb")=>e=>(e=VV(e,n))!==void 0?e.mode===n?e:Yi[e.mode][n]?Yi[e.mode][n](e):n==="rgb"?Yi[e.mode].rgb(e):Yi.rgb[n](Yi[e.mode].rgb(e)):void 0,Yi={},qw={},Ld=[],Yw={},HV=n=>n,Et=n=>(Yi[n.mode]={...Yi[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Yi[e]||(Yi[e]={}),Yi[e][n.mode]=n.fromMode[e]}),n.ranges||(n.ranges={}),n.difference||(n.difference={}),n.channels.forEach(e=>{if(n.ranges[e]===void 0&&(n.ranges[e]=[0,1]),!n.interpolate[e])throw new Error(`Missing interpolator for: ${e}`);typeof n.interpolate[e]=="function"&&(n.interpolate[e]={use:n.interpolate[e]}),n.interpolate[e].fixup||(n.interpolate[e].fixup=HV)}),qw[n.mode]=n,(n.parse||[]).forEach(e=>{WV(e,n.mode)}),$w(n.mode)),GV=n=>qw[n],WV=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Yw[n]=e}else typeof n=="function"&&Ld.indexOf(n)<0&&Ld.push(n)},qg=/[^\x00-\x7F]|[a-zA-Z_]/,XV=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let qe=0;function cf(n){let e=n[qe],t=n[qe+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[qe+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Yg(n){if(qe>=n.length)return!1;let e=n[qe];if(qg.test(e))return!0;if(e==="-"){if(n.length-qe<2)return!1;let t=n[qe+1];return!!(t==="-"||qg.test(t))}return!1}const $V={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function cl(n){let e="";if((n[qe]==="-"||n[qe]==="+")&&(e+=n[qe++]),e+=uf(n),n[qe]==="."&&/\d/.test(n[qe+1])&&(e+=n[qe++]+uf(n)),(n[qe]==="e"||n[qe]==="E")&&((n[qe+1]==="-"||n[qe+1]==="+")&&/\d/.test(n[qe+2])?e+=n[qe++]+n[qe++]+uf(n):/\d/.test(n[qe+1])&&(e+=n[qe++]+uf(n))),Yg(n)){let t=Dd(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*$V[t]}:void 0}return n[qe]==="%"?(qe++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function uf(n){let e="";for(;/\d/.test(n[qe]);)e+=n[qe++];return e}function Dd(n){let e="";for(;qe{},Bi=Array.isArray,Lw=/#/g,Rz=/&/g,Pz=/\//g,Iz=/=/g,Lz=/\?/g,Dw=/\+/g,Dz=/%5B/g,Oz=/%5D/g,Ow=/%5E/g,Nz=/%60/g,Nw=/%7B/g,Uz=/%7C/g,Uw=/%7D/g,Fz=/%20/g;function B_(n){return encodeURI(""+n).replace(Uz,"|").replace(Dz,"[").replace(Oz,"]")}function kz(n){return B_(n).replace(Nw,"{").replace(Uw,"}").replace(Ow,"^")}function Wg(n){return B_(n).replace(Dw,"%2B").replace(Fz,"+").replace(Lw,"%23").replace(Rz,"%26").replace(Nz,"`").replace(Nw,"{").replace(Uw,"}").replace(Ow,"^")}function Bz(n){return Wg(n).replace(Iz,"%3D")}function zz(n){return B_(n).replace(Lw,"%23").replace(Lz,"%3F")}function Vz(n){return n==null?"":zz(n).replace(Pz,"%2F")}function bc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const Hz=/\/$/,Gz=n=>n.replace(Hz,"");function ym(n,e,t="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=n(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=qz(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:bc(o)}}function Wz(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function px(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function Xz(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ca(e.matched[i],t.matched[s])&&Fw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ca(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function Fw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!$z(n[t],e[t]))return!1;return!0}function $z(n,e){return Bi(n)?mx(n,e):Bi(e)?mx(e,n):n===e}function mx(n,e){return Bi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function qz(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=t.length-1,o,a;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const Js={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var xc;(function(n){n.pop="pop",n.push="push"})(xc||(xc={}));var zl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(zl||(zl={}));function Yz(n){if(!n)if(ta){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),Gz(n)}const jz=/^[^#]+#/;function Kz(n,e){return n.replace(jz,"#")+e}function Zz(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const Hh=()=>({left:window.scrollX,top:window.scrollY});function Jz(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=Zz(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function gx(n,e){return(history.state?history.state.position-e:-1)+n}const Xg=new Map;function Qz(n,e){Xg.set(n,e)}function eV(n){const e=Xg.get(n);return Xg.delete(n),e}let tV=()=>location.protocol+"//"+location.host;function kw(n,e){const{pathname:t,search:i,hash:s}=e,r=n.indexOf("#");if(r>-1){let a=s.includes(n.slice(r))?n.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),px(l,"")}return px(t,n)+i+s}function nV(n,e,t,i){let s=[],r=[],o=null;const a=({state:d})=>{const h=kw(n,location),p=t.value,_=e.value;let g=0;if(d){if(t.value=h,e.value=d,o&&o===p){o=null;return}g=_?d.position-_.position:0}else i(h);s.forEach(m=>{m(t.value,p,{delta:g,type:xc.pop,direction:g?g>0?zl.forward:zl.back:zl.unknown})})};function l(){o=t.value}function c(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return r.push(h),h}function u(){const{history:d}=window;d.state&&d.replaceState(Mt({},d.state,{scroll:Hh()}),"")}function f(){for(const d of r)d();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function _x(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?Hh():null}}function iV(n){const{history:e,location:t}=window,i={value:kw(n,t)},s={value:e.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const f=n.indexOf("#"),d=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:tV()+n+l;try{e[u?"replaceState":"pushState"](c,"",d),s.value=c}catch(h){console.error(h),t[u?"replace":"assign"](d)}}function o(l,c){const u=Mt({},e.state,_x(s.value.back,l,s.value.forward,!0),c,{position:s.value.position});r(l,u,!0),i.value=l}function a(l,c){const u=Mt({},s.value,e.state,{forward:l,scroll:Hh()});r(u.current,u,!0);const f=Mt({},_x(i.value,l,null),{position:u.position+1},c);r(l,f,!1),i.value=l}return{location:i,state:s,push:a,replace:o}}function sV(n){n=Yz(n);const e=iV(n),t=nV(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=Mt({location:"",base:n,go:i,createHref:Kz.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function rV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),sV(n)}function oV(n){return typeof n=="string"||n&&typeof n=="object"}function Bw(n){return typeof n=="string"||typeof n=="symbol"}const zw=Symbol("");var vx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(vx||(vx={}));function Ra(n,e){return Mt(new Error,{type:n,[zw]:!0},e)}function gs(n,e){return n instanceof Error&&zw in n&&(e==null||!!(n.type&e))}const yx="[^/]+?",aV={sensitive:!1,strict:!1,start:!0,end:!0},lV=/[.+*?^${}()[\]/\\]/g;function cV(n,e){const t=Mt({},aV,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function Vw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const fV={type:0,value:""},dV=/[a-zA-Z0-9_]/;function hV(n){if(!n)return[[]];if(n==="/")return[[fV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(h){throw new Error(`ERR (${t})/"${c}": ${h}`)}let t=0,i=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let a=0,l,c="",u="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function d(){c+=l}for(;a{o(b)}:Bl}function o(f){if(Bw(f)){const d=i.get(f);d&&(i.delete(f),t.splice(t.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=t.indexOf(f);d>-1&&(t.splice(d,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const d=vV(f,t);t.splice(d,0,f),f.record.name&&!Sx(f)&&i.set(f.record.name,f)}function c(f,d){let h,p={},_,g;if("name"in f&&f.name){if(h=i.get(f.name),!h)throw Ra(1,{location:f});g=h.record.name,p=Mt(xx(d.params,h.keys.filter(b=>!b.optional).concat(h.parent?h.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&xx(f.params,h.keys.map(b=>b.name))),_=h.stringify(p)}else if(f.path!=null)_=f.path,h=t.find(b=>b.re.test(_)),h&&(p=h.parse(_),g=h.record.name);else{if(h=d.name?i.get(d.name):t.find(b=>b.re.test(d.path)),!h)throw Ra(1,{location:f,currentLocation:d});g=h.record.name,p=Mt({},d.params,f.params),_=h.stringify(p)}const m=[];let y=h;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:_V(m)}}n.forEach(f=>r(f));function u(){t.length=0,i.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function xx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Mx(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:gV(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function gV(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function Sx(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function _V(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Ex(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function vV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;Vw(n,e[r])<0?i=r:t=r+1}const s=yV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function yV(n){let e=n;for(;e=e.parent;)if(Hw(e)&&Vw(n,e)===0)return e}function Hw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function bV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Wg(r)):[i&&Wg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function xV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Bi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const MV=Symbol(""),wx=Symbol(""),Gh=Symbol(""),Gw=Symbol(""),$g=Symbol("");function ll(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function or(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=d=>{d===!1?l(Ra(4,{from:t,to:e})):d instanceof Error?l(d):oV(d)?l(Ra(2,{from:e,to:d})):(o&&i.enterCallbacks[s]===o&&typeof d=="function"&&o.push(d),a())},u=r(()=>n.call(i&&i.instances[s],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(d=>l(d))})}function bm(n,e,t,i,s=r=>r()){const r=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(Iw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(or(u,t,i,o,a,s))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Cz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const h=(f.__vccOpts||f)[e];return h&&or(h,t,i,o,a,s)()}))}}return r}function Ax(n){const e=En(Gh),t=En(Gw),i=Ee(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Ee(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const d=f.findIndex(Ca.bind(null,u));if(d>-1)return d;const h=Cx(l[c-2]);return c>1&&Cx(u)===h&&f[f.length-1].path!==h?f.findIndex(Ca.bind(null,l[c-2])):d}),r=Ee(()=>s.value>-1&&AV(t.params,i.value.params)),o=Ee(()=>s.value>-1&&s.value===t.matched.length-1&&Fw(t.params,i.value.params));function a(l={}){if(wV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Bl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Ee(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function SV(n){return n.length===1?n[0]:n}const EV=fn({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"}},useLink:Ax,setup(n,{slots:e}){const t=bi(Ax(n)),{options:i}=En(Gh),s=Ee(()=>({[Rx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Rx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&SV(e.default(t));return n.custom?r:Ls("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),TV=EV;function wV(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function AV(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!Bi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Cx(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Rx=(n,e,t)=>n??e??t,CV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=En($g),s=Ee(()=>n.route||i.value),r=En(wx,0),o=Ee(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Ee(()=>s.value.matched[o.value]);fr(wx,Ee(()=>o.value+1)),fr(MV,a),fr($g,s);const l=et();return $e(()=>[l.value,a.value,n.name],([c,u,f],[d,h,p])=>{u&&(u.instances[f]=c,h&&h!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Ca(u,h)||!d)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,d=f&&f.components[u];if(!d)return Px(t.default,{Component:d,route:c});const h=f.props[u],p=h?h===!0?c.params:typeof h=="function"?h(c):h:null,g=Ls(d,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Px(t.default,{Component:g,route:c})||g}}});function Px(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const Ww=CV;function RV(n){const e=mV(n.routes,n),t=n.parseQuery||bV,i=n.stringifyQuery||Tx,s=n.history,r=ll(),o=ll(),a=ll(),l=De(Js);let c=Js;ta&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=vm.bind(null,X=>""+X),f=vm.bind(null,Vz),d=vm.bind(null,bc);function h(X,ae){let fe,ce;return Bw(X)?(fe=e.getRecordMatcher(X),ce=ae):ce=X,e.addRoute(ce,fe)}function p(X){const ae=e.getRecordMatcher(X);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(X=>X.record)}function g(X){return!!e.getRecordMatcher(X)}function m(X,ae){if(ae=Mt({},ae||l.value),typeof X=="string"){const R=ym(t,X,ae.path),te=e.resolve({path:R.path},ae),G=s.createHref(R.fullPath);return Mt(R,te,{params:d(te.params),hash:bc(R.hash),redirectedFrom:void 0,href:G})}let fe;if(X.path!=null)fe=Mt({},X,{path:ym(t,X.path,ae.path).path});else{const R=Mt({},X.params);for(const te in R)R[te]==null&&delete R[te];fe=Mt({},X,{params:f(R)}),ae.params=f(ae.params)}const ce=e.resolve(fe,ae),Ue=X.hash||"";ce.params=u(d(ce.params));const k=Wz(i,Mt({},X,{hash:kz(Ue),path:ce.path})),z=s.createHref(k);return Mt({fullPath:k,hash:Ue,query:i===Tx?xV(X.query):X.query||{}},ce,{redirectedFrom:void 0,href:z})}function y(X){return typeof X=="string"?ym(t,X,l.value.path):Mt({},X)}function b(X,ae){if(c!==X)return Ra(8,{from:ae,to:X})}function v(X){return S(X)}function E(X){return v(Mt(y(X),{replace:!0}))}function T(X){const ae=X.matched[X.matched.length-1];if(ae&&ae.redirect){const{redirect:fe}=ae;let ce=typeof fe=="function"?fe(X):fe;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Mt({query:X.query,hash:X.hash,params:ce.path!=null?{}:X.params},ce)}}function S(X,ae){const fe=c=m(X),ce=l.value,Ue=X.state,k=X.force,z=X.replace===!0,R=T(fe);if(R)return S(Mt(y(R),{state:typeof R=="object"?Mt({},Ue,R.state):Ue,force:k,replace:z}),ae||fe);const te=fe;te.redirectedFrom=ae;let G;return!k&&Xz(i,ce,fe)&&(G=Ra(16,{to:te,from:ce}),se(ce,ce,!0,!1)),(G?Promise.resolve(G):M(te,ce)).catch(W=>gs(W)?gs(W,2)?W:be(W):Z(W,te,ce)).then(W=>{if(W){if(gs(W,2))return S(Mt({replace:z},y(W.to),{state:typeof W.to=="object"?Mt({},Ue,W.to.state):Ue,force:k}),ae||te)}else W=F(te,ce,!0,z,Ue);return L(te,ce,W),W})}function P(X,ae){const fe=b(X,ae);return fe?Promise.reject(fe):Promise.resolve()}function x(X){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(X):X()}function M(X,ae){let fe;const[ce,Ue,k]=PV(X,ae);fe=bm(ce.reverse(),"beforeRouteLeave",X,ae);for(const R of ce)R.leaveGuards.forEach(te=>{fe.push(or(te,X,ae))});const z=P.bind(null,X,ae);return fe.push(z),xe(fe).then(()=>{fe=[];for(const R of r.list())fe.push(or(R,X,ae));return fe.push(z),xe(fe)}).then(()=>{fe=bm(Ue,"beforeRouteUpdate",X,ae);for(const R of Ue)R.updateGuards.forEach(te=>{fe.push(or(te,X,ae))});return fe.push(z),xe(fe)}).then(()=>{fe=[];for(const R of k)if(R.beforeEnter)if(Bi(R.beforeEnter))for(const te of R.beforeEnter)fe.push(or(te,X,ae));else fe.push(or(R.beforeEnter,X,ae));return fe.push(z),xe(fe)}).then(()=>(X.matched.forEach(R=>R.enterCallbacks={}),fe=bm(k,"beforeRouteEnter",X,ae,x),fe.push(z),xe(fe))).then(()=>{fe=[];for(const R of o.list())fe.push(or(R,X,ae));return fe.push(z),xe(fe)}).catch(R=>gs(R,8)?R:Promise.reject(R))}function L(X,ae,fe){a.list().forEach(ce=>x(()=>ce(X,ae,fe)))}function F(X,ae,fe,ce,Ue){const k=b(X,ae);if(k)return k;const z=ae===Js,R=ta?history.state:{};fe&&(ce||z?s.replace(X.fullPath,Mt({scroll:z&&R&&R.scroll},Ue)):s.push(X.fullPath,Ue)),l.value=X,se(X,ae,fe,z),be()}let H;function Y(){H||(H=s.listen((X,ae,fe)=>{if(!ge.listening)return;const ce=m(X),Ue=T(ce);if(Ue){S(Mt(Ue,{replace:!0,force:!0}),ce).catch(Bl);return}c=ce;const k=l.value;ta&&Qz(gx(k.fullPath,fe.delta),Hh()),M(ce,k).catch(z=>gs(z,12)?z:gs(z,2)?(S(Mt(y(z.to),{force:!0}),ce).then(R=>{gs(R,20)&&!fe.delta&&fe.type===xc.pop&&s.go(-1,!1)}).catch(Bl),Promise.reject()):(fe.delta&&s.go(-fe.delta,!1),Z(z,ce,k))).then(z=>{z=z||F(ce,k,!1),z&&(fe.delta&&!gs(z,8)?s.go(-fe.delta,!1):fe.type===xc.pop&&gs(z,20)&&s.go(-1,!1)),L(ce,k,z)}).catch(Bl)}))}let ee=ll(),K=ll(),Q;function Z(X,ae,fe){be(X);const ce=K.list();return ce.length?ce.forEach(Ue=>Ue(X,ae,fe)):console.error(X),Promise.reject(X)}function he(){return Q&&l.value!==Js?Promise.resolve():new Promise((X,ae)=>{ee.add([X,ae])})}function be(X){return Q||(Q=!X,Y(),ee.list().forEach(([ae,fe])=>X?fe(X):ae()),ee.reset()),X}function se(X,ae,fe,ce){const{scrollBehavior:Ue}=n;if(!ta||!Ue)return Promise.resolve();const k=!fe&&eV(gx(X.fullPath,0))||(ce||!fe)&&history.state&&history.state.scroll||null;return Sr().then(()=>Ue(X,ae,k)).then(z=>z&&Jz(z)).catch(z=>Z(z,X,ae))}const ye=X=>s.go(X);let He;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:K.add,isReady:he,install(X){const ae=this;X.component("RouterLink",TV),X.component("RouterView",Ww),X.config.globalProperties.$router=ae,Object.defineProperty(X.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),ta&&!He&&l.value===Js&&(He=!0,v(s.location).catch(Ue=>{}));const fe={};for(const Ue in Js)Object.defineProperty(fe,Ue,{get:()=>l.value[Ue],enumerable:!0});X.provide(Gh,ae),X.provide(Gw,iS(fe)),X.provide($g,l);const ce=X.unmount;re.add(X),X.unmount=function(){re.delete(X),re.size<1&&(c=Js,H&&H(),H=null,l.value=Js,He=!1,Q=!1),ce()}}};function xe(X){return X.reduce((ae,fe)=>ae.then(()=>x(fe)),Promise.resolve())}return ge}function PV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oCa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ca(c,l))||s.push(l))}return[t,i,s]}function IV(){return En(Gh)}const LV=[{path:"/",name:"/",component:()=>ct(()=>import("./index-NSbcQ-qE.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2,14,15,16])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>ct(()=>import("./_...all_-CSvu3bhX.js"),[])},{path:"/audio",name:"/audio",component:()=>ct(()=>import("./audio-C8wXhwK7.js"),[])},{path:"/devtools",children:[{path:"image",name:"/devtools/image",component:()=>ct(()=>import("./image-CcWmIr03.js"),__vite__mapDeps([17,18]))}]},{path:"/queue",name:"/queue",component:()=>ct(()=>import("./queue-DOUpDv6R.js"),__vite__mapDeps([19,7]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>ct(()=>import("./index-C7IMxg5Y.js"),__vite__mapDeps([20,4,21,15,22])),meta:{stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>ct(()=>import("./index-BedZtR3C.js"),__vite__mapDeps([23,9,4,10,6,5,24,25,26,27,15])),meta:{stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>ct(()=>import("./CardDetailDialog-0JP7S-1I.js"),__vite__mapDeps([28,24,25,26,4,9,10,6,5]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>ct(()=>import("./CardListItem-DjCvxPQ0.js"),__vite__mapDeps([29,27]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>ct(()=>import("./DeleteCardDialog-B93IlDSL.js"),__vite__mapDeps([30,25,26]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>ct(()=>import("./index-CkYx69fn.js"),__vite__mapDeps([31,21,4,32,13,12,26,33,15,34])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>ct(()=>import("./index-DY0WpASX.js"),[])}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>ct(()=>import("./index-Bs3BUlfx.js"),__vite__mapDeps([35,21,11,4,32,13,12,26,33,15,36])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>ct(()=>import("./index-Di3jPqPB.js"),__vite__mapDeps([37,4,38,39,21,33,15])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>ct(()=>import("./consciousness-CJCDq3tD.js"),__vite__mapDeps([40,41,12,42,43,4,10,6,15])),meta:{stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>ct(()=>import("./memory-long-term-fZZgaXdh.js"),[])},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>ct(()=>import("./memory-short-term-Pucm6_ta.js"),[])},{path:"speech",name:"/settings/modules/speech",component:()=>ct(()=>import("./speech-DqVeJv2L.js"),__vite__mapDeps([44,45,46,47,42,41,12,43,4,6,5,15,48])),meta:{stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>ct(()=>import("./index-CjikULv_.js"),__vite__mapDeps([49,21,4,6,38,39,33,15])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>ct(()=>import("./anthropic-Dr4rn0dD.js"),__vite__mapDeps([50,4,6,51,13,12,47,42,52,53,54]))},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>ct(()=>import("./cloudflare-workers-ai-BYCqyq2S.js"),__vite__mapDeps([55,4,6,47,42,52,53,54]))},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>ct(()=>import("./deepseek-CROYIRyB.js"),__vite__mapDeps([56,4,6,51,13,12,47,42,52,53,54]))},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>ct(()=>import("./elevenlabs-BKBDCaFN.js"),__vite__mapDeps([57,4,6,5,58,45,46,51,13,12,47,42,52,53]))},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>ct(()=>import("./featherless-ai-PxI_AzkK.js"),__vite__mapDeps([59,4,6,51,13,12,47,42,52,53,54]))},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>ct(()=>import("./fireworks-ai-CmtwbW1h.js"),__vite__mapDeps([60,4,6,51,13,12,47,42,52,53,54]))},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>ct(()=>import("./microsoft-speech-Cf4yrOLH.js"),__vite__mapDeps([61,47,42,4,6,5,58,45,46,51,13,12,52,53]))},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>ct(()=>import("./mistral-ai-Cjk87FuW.js"),__vite__mapDeps([62,4,6,51,13,12,47,42,52,53,54]))},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>ct(()=>import("./moonshot-ai-B8RKb1HT.js"),__vite__mapDeps([63,4,6,51,13,12,47,42,52,53,54]))},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>ct(()=>import("./novita-ai-CVRJyGOQ.js"),__vite__mapDeps([64,4,6,51,13,12,47,42,52,53,54]))},{path:"ollama",name:"/settings/providers/ollama",component:()=>ct(()=>import("./ollama-BNerp7db.js"),__vite__mapDeps([65,42,4,6,51,13,12,47,53,54]))},{path:"openai",name:"/settings/providers/openai",component:()=>ct(()=>import("./openai-CFF4hUNa.js"),__vite__mapDeps([66,4,6,51,13,12,47,42,52,53,54]))},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>ct(()=>import("./openrouter-ai-4M13n7g5.js"),__vite__mapDeps([67,4,6,51,13,12,47,42,52,53,54]))},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>ct(()=>import("./together-ai-DeW9vX9c.js"),__vite__mapDeps([68,4,6,51,13,12,47,42,52,53,54]))},{path:"xai",name:"/settings/providers/xai",component:()=>ct(()=>import("./xai-hZPT-RIL.js"),__vite__mapDeps([69,4,6,51,13,12,47,42,52,53,54]))}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>ct(()=>import("./filter-message-CX1l3MTd.js"),[])},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>ct(()=>import("./delays-DYQGGjQG.js"),__vite__mapDeps([70,8,4,7,14]))},{path:"emotions",name:"/test/queues/emotions",component:()=>ct(()=>import("./emotions-Bk2T6ViW.js"),__vite__mapDeps([71,8,4,7]))},{path:"messages",name:"/test/queues/messages",component:()=>ct(()=>import("./messages-UpVa7nD_.js"),__vite__mapDeps([72,8,4,7]))}]}]}],Xw=(n,e)=>{if(typeof n=="number"){if(e===3)return{mode:"rgb",r:(n>>8&15|n>>4&240)/255,g:(n>>4&15|n&240)/255,b:(n&15|n<<4&240)/255};if(e===4)return{mode:"rgb",r:(n>>12&15|n>>8&240)/255,g:(n>>8&15|n>>4&240)/255,b:(n>>4&15|n&240)/255,alpha:(n&15|n<<4&240)/255};if(e===6)return{mode:"rgb",r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255};if(e===8)return{mode:"rgb",r:(n>>24&255)/255,g:(n>>16&255)/255,b:(n>>8&255)/255,alpha:(n&255)/255}}},DV={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},OV=n=>Xw(DV[n.toLowerCase()],6),NV=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,UV=n=>{let e;return(e=n.match(NV))?Xw(parseInt(e[1],16),e[1].length):void 0},dr="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Vl=`${dr}%`,z_=`(?:${dr}%|${dr})`,FV=`(?:${dr}(deg|grad|rad|turn)|${dr})`,Pa="\\s*,\\s*",kV=new RegExp(`^rgba?\\(\\s*${dr}${Pa}${dr}${Pa}${dr}\\s*(?:,\\s*${z_}\\s*)?\\)$`),BV=new RegExp(`^rgba?\\(\\s*${Vl}${Pa}${Vl}${Pa}${Vl}\\s*(?:,\\s*${z_}\\s*)?\\)$`),zV=n=>{let e={mode:"rgb"},t;if(t=n.match(kV))t[1]!==void 0&&(e.r=t[1]/255),t[2]!==void 0&&(e.g=t[2]/255),t[3]!==void 0&&(e.b=t[3]/255);else if(t=n.match(BV))t[1]!==void 0&&(e.r=t[1]/100),t[2]!==void 0&&(e.g=t[2]/100),t[3]!==void 0&&(e.b=t[3]/100);else return;return t[4]!==void 0?e.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+t[5]))),e},VV=(n,e)=>n===void 0?void 0:typeof n!="object"?ZV(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,$w=(n="rgb")=>e=>(e=VV(e,n))!==void 0?e.mode===n?e:Yi[e.mode][n]?Yi[e.mode][n](e):n==="rgb"?Yi[e.mode].rgb(e):Yi.rgb[n](Yi[e.mode].rgb(e)):void 0,Yi={},qw={},Ld=[],Yw={},HV=n=>n,Et=n=>(Yi[n.mode]={...Yi[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Yi[e]||(Yi[e]={}),Yi[e][n.mode]=n.fromMode[e]}),n.ranges||(n.ranges={}),n.difference||(n.difference={}),n.channels.forEach(e=>{if(n.ranges[e]===void 0&&(n.ranges[e]=[0,1]),!n.interpolate[e])throw new Error(`Missing interpolator for: ${e}`);typeof n.interpolate[e]=="function"&&(n.interpolate[e]={use:n.interpolate[e]}),n.interpolate[e].fixup||(n.interpolate[e].fixup=HV)}),qw[n.mode]=n,(n.parse||[]).forEach(e=>{WV(e,n.mode)}),$w(n.mode)),GV=n=>qw[n],WV=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Yw[n]=e}else typeof n=="function"&&Ld.indexOf(n)<0&&Ld.push(n)},qg=/[^\x00-\x7F]|[a-zA-Z_]/,XV=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let qe=0;function cf(n){let e=n[qe],t=n[qe+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[qe+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Yg(n){if(qe>=n.length)return!1;let e=n[qe];if(qg.test(e))return!0;if(e==="-"){if(n.length-qe<2)return!1;let t=n[qe+1];return!!(t==="-"||qg.test(t))}return!1}const $V={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function cl(n){let e="";if((n[qe]==="-"||n[qe]==="+")&&(e+=n[qe++]),e+=uf(n),n[qe]==="."&&/\d/.test(n[qe+1])&&(e+=n[qe++]+uf(n)),(n[qe]==="e"||n[qe]==="E")&&((n[qe+1]==="-"||n[qe+1]==="+")&&/\d/.test(n[qe+2])?e+=n[qe++]+n[qe++]+uf(n):/\d/.test(n[qe+1])&&(e+=n[qe++]+uf(n))),Yg(n)){let t=Dd(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*$V[t]}:void 0}return n[qe]==="%"?(qe++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function uf(n){let e="";for(;/\d/.test(n[qe]);)e+=n[qe++];return e}function Dd(n){let e="";for(;qe4)){if(t.length===4){if(t[3].type!==_e.Alpha)return;t[3]=t[3].value}return t.length===3&&t.push({type:_e.None,value:void 0}),t.every(s=>s.type!==_e.Alpha)?t:void 0}}function KV(n,e){n._i=0;let t=n[n._i++];if(!t||t.type!==_e.Function)return;let i=jw(n,e);if(i)return i.unshift(t.value),i}const ZV=n=>{if(typeof n!="string")return;const e=YV(n),t=e?KV(e,!0):void 0;let i,s=0,r=Ld.length;for(;sn==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,e6=(n,e,t)=>n+t*(e-n),t6=n=>{let e=[];for(let t=0;te=>{let t=t6(e);return i=>{let s=i*t.length,r=i>=1?t.length-1:Math.max(Math.floor(s),0),o=t[r];return o===void 0?void 0:n(o[0],o[1],s-r)}},Ae=n6(e6),on=n=>{let e=!1,t=n.map(i=>i!==void 0?(e=!0,i):1);return e?t:n},Ha={mode:"rgb",channels:["r","g","b","alpha"],parse:[JV,UV,zV,OV,QV,"srgb"],serialize:"srgb",interpolate:{r:Ae,g:Ae,b:Ae,alpha:{use:Ae,fixup:on}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},xm=(n=0)=>Math.pow(Math.abs(n),563/256)*Math.sign(n),Ix=n=>{let e=xm(n.r),t=xm(n.g),i=xm(n.b),s={mode:"xyz65",x:.5766690429101305*e+.1855582379065463*t+.1882286462349947*i,y:.297344975250536*e+.6273635662554661*t+.0752914584939979*i,z:.0270313613864123*e+.0706888525358272*t+.9913375368376386*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},Mm=n=>Math.pow(Math.abs(n),256/563)*Math.sign(n),Lx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"a98",r:Mm(n*2.0415879038107465-e*.5650069742788597-.3447313507783297*t),g:Mm(n*-.9692436362808798+e*1.8759675015077206+.0415550574071756*t),b:Mm(n*.0134442806320312-e*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(s.alpha=i),s},Sm=(n=0)=>{const e=Math.abs(n);return e<=.04045?n/12.92:(Math.sign(n)||1)*Math.pow((e+.055)/1.055,2.4)},Ga=({r:n,g:e,b:t,alpha:i})=>{let s={mode:"lrgb",r:Sm(n),g:Sm(e),b:Sm(t)};return i!==void 0&&(s.alpha=i),s},Po=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz65",x:.4123907992659593*e+.357584339383878*t+.1804807884018343*i,y:.2126390058715102*e+.715168678767756*t+.0721923153607337*i,z:.0193308187155918*e+.119194779794626*t+.9505321522496607*i};return s!==void 0&&(r.alpha=s),r},Em=(n=0)=>{const e=Math.abs(n);return e>.0031308?(Math.sign(n)||1)*(1.055*Math.pow(e,1/2.4)-.055):n*12.92},Wa=({r:n,g:e,b:t,alpha:i},s="rgb")=>{let r={mode:s,r:Em(n),g:Em(e),b:Em(t)};return i!==void 0&&(r.alpha=i),r},Io=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*3.2409699419045226-e*1.537383177570094-.4986107602930034*t,g:n*-.9692436362808796+e*1.8759675015077204+.0415550574071756*t,b:n*.0556300796969936-e*.2039769588889765+1.0569715142428784*t});return i!==void 0&&(s.alpha=i),s},i6={...Ha,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:n=>Lx(Po(n)),xyz65:Lx},toMode:{rgb:n=>Io(Ix(n)),xyz65:Ix}},_n=n=>(n=n%360)<0?n+360:n,s6=(n,e)=>n.map((t,i,s)=>{if(t===void 0)return t;let r=_n(t);return i===0||n[i-1]===void 0?r:e(r-_n(s[i-1]))}).reduce((t,i)=>!t.length||i===void 0||t[t.length-1]===void 0?(t.push(i),t):(t.push(i+t[t.length-1]),t),[]),Hs=n=>s6(n,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),ln=[-.14861,1.78277,-.29227,-.90649,1.97294,0],r6=Math.PI/180,o6=180/Math.PI;let Dx=ln[3]*ln[4],Ox=ln[1]*ln[4],Nx=ln[1]*ln[2]-ln[0]*ln[3];const a6=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(Nx*t+n*Dx-e*Ox)/(Nx+Dx-Ox),r=t-s,o=(ln[4]*(e-s)-ln[2]*r)/ln[3],a={mode:"cubehelix",l:s,s:s===0||s===1?void 0:Math.sqrt(r*r+o*o)/(ln[4]*s*(1-s))};return a.s&&(a.h=Math.atan2(o,r)*o6-120),i!==void 0&&(a.alpha=i),a},l6=({h:n,s:e,l:t,alpha:i})=>{let s={mode:"rgb"};n=(n===void 0?0:n+120)*r6,t===void 0&&(t=0);let r=e===void 0?0:e*t*(1-t),o=Math.cos(n),a=Math.sin(n);return s.r=t+r*(ln[0]*o+ln[1]*a),s.g=t+r*(ln[2]*o+ln[3]*a),s.b=t+r*(ln[4]*o+ln[5]*a),i!==void 0&&(s.alpha=i),s},Wh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.s||!e.s)return 0;let t=_n(n.h),i=_n(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.s*e.s)*s},c6=(n,e)=>{if(n.h===void 0||e.h===void 0)return 0;let t=_n(n.h),i=_n(e.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},Xh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.c||!e.c)return 0;let t=_n(n.h),i=_n(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.c*e.c)*s},Gs=n=>{let e=n.reduce((i,s)=>{if(s!==void 0){let r=s*Math.PI/180;i.sin+=Math.sin(r),i.cos+=Math.cos(r)}return i},{sin:0,cos:0}),t=Math.atan2(e.sin,e.cos)*180/Math.PI;return t<0?360+t:t},u6={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:a6},toMode:{rgb:l6},interpolate:{h:{use:Ae,fixup:Hs},s:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Wh},average:{h:Gs}},yr=({l:n,a:e,b:t,alpha:i},s="lch")=>{e===void 0&&(e=0),t===void 0&&(t=0);let r=Math.sqrt(e*e+t*t),o={mode:s,l:n,c:r};return r&&(o.h=_n(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(o.alpha=i),o},br=({l:n,c:e,h:t,alpha:i},s="lab")=>{t===void 0&&(t=0);let r={mode:s,l:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Kw=Math.pow(29,3)/Math.pow(3,3),Zw=Math.pow(6,3)/Math.pow(29,3),Jt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},pa={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Tm=n=>Math.pow(n,3)>Zw?Math.pow(n,3):(116*n-16)/Kw;const Jw=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz65",x:Tm(r)*pa.X,y:Tm(s)*pa.Y,z:Tm(o)*pa.Z};return i!==void 0&&(a.alpha=i),a},$h=n=>Io(Jw(n)),wm=n=>n>Zw?Math.cbrt(n):(Kw*n+16)/116,Qw=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=wm(n/pa.X),r=wm(e/pa.Y),o=wm(t/pa.Z),a={mode:"lab65",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},qh=n=>{let e=Qw(Po(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Od=1,eA=1,Mc=26/180*Math.PI,Nd=Math.cos(Mc),Ud=Math.sin(Mc),tA=100/Math.log(139/100),jg=({l:n,c:e,h:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"lab65",l:(Math.exp(n*Od/tA)-1)/.0039},r=(Math.exp(.0435*e*eA*Od)-1)/.075,o=r*Math.cos(t/180*Math.PI-Mc),a=r*Math.sin(t/180*Math.PI-Mc);return s.a=o*Nd-a/.83*Ud,s.b=o*Ud+a/.83*Nd,i!==void 0&&(s.alpha=i),s},Kg=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=e*Nd+t*Ud,r=.83*(t*Nd-e*Ud),o=Math.sqrt(s*s+r*r),a={mode:"dlch",l:tA/Od*Math.log(1+.0039*n),c:Math.log(1+.075*o)/(.0435*eA*Od)};return a.c&&(a.h=_n((Math.atan2(r,s)+Mc)/Math.PI*180)),i!==void 0&&(a.alpha=i),a},Ux=n=>jg(yr(n,"dlch")),Fx=n=>br(Kg(n),"dlab"),f6={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Ux,rgb:n=>$h(Ux(n))},fromMode:{lab65:Fx,rgb:n=>Fx(qh(n))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},d6={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:jg,dlab:n=>br(n,"dlab"),rgb:n=>$h(jg(n))},fromMode:{lab65:Kg,dlab:n=>yr(n,"dlch"),rgb:n=>Kg(qh(n))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Ae,c:Ae,h:{use:Ae,fixup:Hs},alpha:{use:Ae,fixup:on}},difference:{h:Xh},average:{h:Gs}};function h6({h:n,s:e,i:t,alpha:i}){n=_n(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1-e)};break;case 1:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1+e*(3/(2-s)-1)),b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t*(1+e*(3/(2-s)-1)),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;case 3:r={r:t*(1-e),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1+e*(3/(2-s)-1))};break;case 4:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3/(2-s)-1))};break;case 5:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function p6({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsi",s:n+e+t===0?0:1-3*r/(n+e+t),i:(n+e+t)/3};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e{switch(e){case"deg":return+n;case"rad":return n/Math.PI*180;case"grad":return n/10*9;case"turn":return n*360}},y6=new RegExp(`^hsla?\\(\\s*${FV}${Pa}${Vl}${Pa}${Vl}\\s*(?:,\\s*${z_}\\s*)?\\)$`),b6=n=>{let e=n.match(y6);if(!e)return;let t={mode:"hsl"};return e[3]!==void 0?t.h=+e[3]:e[1]!==void 0&&e[2]!==void 0&&(t.h=v6(e[1],e[2])),e[4]!==void 0&&(t.s=Math.min(Math.max(0,e[4]/100),1)),e[5]!==void 0&&(t.l=Math.min(Math.max(0,e[5]/100),1)),e[6]!==void 0?t.alpha=Math.max(0,Math.min(1,e[6]/100)):e[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+e[7]))),t};function x6(n,e){if(!e||e[0]!=="hsl"&&e[0]!=="hsla")return;const t={mode:"hsl"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.s=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.l=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const nA={mode:"hsl",toMode:{rgb:g6},fromMode:{rgb:_6},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[x6,b6],serialize:n=>`hsl(${n.h!==void 0?n.h:"none"} ${n.s!==void 0?n.s*100+"%":"none"} ${n.l!==void 0?n.l*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Hs},s:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Wh},average:{h:Gs}};function iA({h:n,s:e,v:t,alpha:i}){n=_n(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t,g:t*(1-e*s),b:t*(1-e)};break;case 1:r={r:t*(1-e*s),g:t,b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t,b:t*(1-e*s)};break;case 3:r={r:t*(1-e),g:t*(1-e*s),b:t};break;case 4:r={r:t*(1-e*s),g:t*(1-e),b:t};break;case 5:r={r:t,g:t*(1-e),b:t*(1-e*s)};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function sA({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsv",s:s===0?0:1-r/s,v:s};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e1){let s=e+t;e/=s,t/=s}return iA({h:n,s:t===1?1:1-e/(1-t),v:1-t,alpha:i})}function S6(n){let e=sA(n);if(e===void 0)return;let t=e.s!==void 0?e.s:0,i=e.v!==void 0?e.v:0,s={mode:"hwb",w:(1-t)*i,b:1-i};return e.h!==void 0&&(s.h=e.h),e.alpha!==void 0&&(s.alpha=e.alpha),s}function E6(n,e){if(!e||e[0]!=="hwb")return;const t={mode:"hwb"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.w=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.b=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const T6={mode:"hwb",toMode:{rgb:M6},fromMode:{rgb:S6},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[E6],serialize:n=>`hwb(${n.h!==void 0?n.h:"none"} ${n.w!==void 0?n.w*100+"%":"none"} ${n.b!==void 0?n.b*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Hs},w:Ae,b:Ae,alpha:{use:Ae,fixup:on}},difference:{h:c6},average:{h:Gs}},oA=203,Yh=.1593017578125,aA=78.84375,jh=.8359375,Kh=18.8515625,Zh=18.6875;function Am(n){if(n<0)return 0;const e=Math.pow(n,1/aA);return 1e4*Math.pow(Math.max(0,e-jh)/(Kh-Zh*e),1/Yh)}function Cm(n){if(n<0)return 0;const e=Math.pow(n/1e4,Yh);return Math.pow((jh+Kh*e)/(1+Zh*e),aA)}const Rm=n=>Math.max(n/oA,0),kx=({i:n,t:e,p:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Am(n+.008609037037932761*e+.11102962500302593*t),r=Am(n-.00860903703793275*e-.11102962500302599*t),o=Am(n+.5600313357106791*e-.32062717498731885*t),a={mode:"xyz65",x:Rm(2.070152218389422*s-1.3263473389671556*r+.2066510476294051*o),y:Rm(.3647385209748074*s+.680566024947227*r-.0453045459220346*o),z:Rm(-.049747207535812*s-.0492609666966138*r+1.1880659249923042*o)};return i!==void 0&&(a.alpha=i),a},Pm=(n=0)=>Math.max(n*oA,0),Bx=({x:n,y:e,z:t,alpha:i})=>{const s=Pm(n),r=Pm(e),o=Pm(t),a=Cm(.3592832590121217*s+.6976051147779502*r-.0358915932320289*o),l=Cm(-.1920808463704995*s+1.1004767970374323*r+.0753748658519118*o),c=Cm(.0070797844607477*s+.0748396662186366*r+.8433265453898765*o),u=.5*a+.5*l,f=1.61376953125*a-3.323486328125*l+1.709716796875*c,d=4.378173828125*a-4.24560546875*l-.132568359375*c,h={mode:"itp",i:u,t:f,p:d};return i!==void 0&&(h.alpha=i),h},w6={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:kx,rgb:n=>Io(kx(n))},fromMode:{xyz65:Bx,rgb:n=>Bx(Po(n))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:Ae,t:Ae,p:Ae,alpha:{use:Ae,fixup:on}}},A6=134.03437499999998,C6=16295499532821565e-27,Im=n=>{if(n<0)return 0;let e=Math.pow(n/1e4,Yh);return Math.pow((jh+Kh*e)/(1+Zh*e),A6)},Lm=(n=0)=>Math.max(n*203,0),lA=({x:n,y:e,z:t,alpha:i})=>{n=Lm(n),e=Lm(e),t=Lm(t);let s=1.15*n-.15*t,r=.66*e+.34*n,o=Im(.41478972*s+.579999*r+.014648*t),a=Im(-.20151*s+1.120649*r+.0531008*t),l=Im(-.0166008*s+.2648*r+.6684799*t),c=(o+a)/2,u={mode:"jab",j:.44*c/(1-.56*c)-C6,a:3.524*o-4.066708*a+.542708*l,b:.199076*o+1.096799*a-1.295875*l};return i!==void 0&&(u.alpha=i),u},R6=134.03437499999998,zx=16295499532821565e-27,Dm=n=>{if(n<0)return 0;let e=Math.pow(n,1/R6);return 1e4*Math.pow((jh-e)/(Zh*e-Kh),1/Yh)},Om=n=>n/203,cA=({j:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+zx)/(.44+.56*(n+zx)),r=Dm(s+.13860504*e+.058047316*t),o=Dm(s-.13860504*e-.058047316*t),a=Dm(s-.096019242*e-.8118919*t),l={mode:"xyz65",x:Om(1.661373024652174*r-.914523081304348*o+.23136208173913045*a),y:Om(-.3250758611844533*r+1.571847026732543*o-.21825383453227928*a),z:Om(-.090982811*r-.31272829*o+1.5227666*a)};return i!==void 0&&(l.alpha=i),l},uA=n=>{let e=lA(Po(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},fA=n=>Io(cA(n)),P6={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:uA,xyz65:lA},toMode:{rgb:fA,xyz65:cA},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},Vx=({j:n,a:e,b:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"jch",j:n,c:s};return s&&(r.h=_n(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},Hx=({j:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"jab",j:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},I6={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Hx,rgb:n=>fA(Hx(n))},fromMode:{rgb:n=>Vx(uA(n)),jab:Vx},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:Ae,fixup:Hs},c:Ae,j:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xh},average:{h:Gs}},Jh=Math.pow(29,3)/Math.pow(3,3),V_=Math.pow(6,3)/Math.pow(29,3);let Nm=n=>Math.pow(n,3)>V_?Math.pow(n,3):(116*n-16)/Jh;const H_=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz50",x:Nm(r)*Jt.X,y:Nm(s)*Jt.Y,z:Nm(o)*Jt.Z};return i!==void 0&&(a.alpha=i),a},Kc=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*3.1341359569958707-e*1.6173863321612538-.4906619460083532*t,g:n*-.978795502912089+e*1.916254567259524+.03344273116131949*t,b:n*.07195537988411677-e*.2289768264158322+1.405386058324125*t});return i!==void 0&&(s.alpha=i),s},dA=n=>Kc(H_(n)),Zc=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz50",x:.436065742824811*e+.3851514688337912*t+.14307845442264197*i,y:.22249319175623702*e+.7168870538238823*t+.06061979053616537*i,z:.013923904500943465*e+.09708128566574634*t+.7140993584005155*i};return s!==void 0&&(r.alpha=s),r},Um=n=>n>V_?Math.cbrt(n):(Jh*n+16)/116,G_=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Um(n/Jt.X),r=Um(e/Jt.Y),o=Um(t/Jt.Z),a={mode:"lab",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},hA=n=>{let e=G_(Zc(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e};function L6(n,e){if(!e||e[0]!=="lab")return;const t={mode:"lab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.value),100)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*125/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*125/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const W_={mode:"lab",toMode:{xyz50:H_,rgb:dA},fromMode:{xyz50:G_,rgb:hA},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[L6],serialize:n=>`lab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{l:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},D6={...W_,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Jw,rgb:$h},fromMode:{xyz65:Qw,rgb:qh},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function O6(n,e){if(!e||e[0]!=="lch")return;const t={mode:"lch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.value),100)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*150/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const X_={mode:"lch",toMode:{lab:br,rgb:n=>dA(br(n))},fromMode:{rgb:n=>yr(hA(n)),lab:yr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[O6],serialize:n=>`lch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Hs},c:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xh},average:{h:Gs}},N6={...X_,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:n=>br(n,"lab65"),rgb:n=>$h(br(n,"lab65"))},fromMode:{rgb:n=>yr(qh(n),"lch65"),lab65:n=>yr(n,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},pA=({l:n,u:e,v:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"lchuv",l:n,c:s};return s&&(r.h=_n(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},mA=({l:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"luv",l:n,u:e?e*Math.cos(t/180*Math.PI):0,v:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},gA=(n,e,t)=>4*n/(n+15*e+3*t),_A=(n,e,t)=>9*e/(n+15*e+3*t),U6=gA(Jt.X,Jt.Y,Jt.Z),F6=_A(Jt.X,Jt.Y,Jt.Z),k6=n=>n<=V_?Jh*n:116*Math.cbrt(n)-16,Zg=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=k6(e/Jt.Y),r=gA(n,e,t),o=_A(n,e,t);!isFinite(r)||!isFinite(o)?s=r=o=0:(r=13*s*(r-U6),o=13*s*(o-F6));let a={mode:"luv",l:s,u:r,v:o};return i!==void 0&&(a.alpha=i),a},B6=(n,e,t)=>4*n/(n+15*e+3*t),z6=(n,e,t)=>9*e/(n+15*e+3*t),V6=B6(Jt.X,Jt.Y,Jt.Z),H6=z6(Jt.X,Jt.Y,Jt.Z),Jg=({l:n,u:e,v:t,alpha:i})=>{if(n===void 0&&(n=0),n===0)return{mode:"xyz50",x:0,y:0,z:0};e===void 0&&(e=0),t===void 0&&(t=0);let s=e/(13*n)+V6,r=t/(13*n)+H6,o=Jt.Y*(n<=8?n/Jh:Math.pow((n+16)/116,3)),a=o*(9*s)/(4*r),l=o*(12-3*s-20*r)/(4*r),c={mode:"xyz50",x:a,y:o,z:l};return i!==void 0&&(c.alpha=i),c},G6=n=>pA(Zg(Zc(n))),W6=n=>Kc(Jg(mA(n))),X6={mode:"lchuv",toMode:{luv:mA,rgb:W6},fromMode:{rgb:G6,luv:pA},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Ae,fixup:Hs},c:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xh},average:{h:Gs}},$6={...Ha,mode:"lrgb",toMode:{rgb:Wa},fromMode:{rgb:Ga},parse:["srgb-linear"],serialize:"srgb-linear"},q6={mode:"luv",toMode:{xyz50:Jg,rgb:n=>Kc(Jg(n))},fromMode:{xyz50:Zg,rgb:n=>Zg(Zc(n))},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:Ae,u:Ae,v:Ae,alpha:{use:Ae,fixup:on}}},vA=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.cbrt(.41222147079999993*n+.5363325363*e+.0514459929*t),r=Math.cbrt(.2119034981999999*n+.6806995450999999*e+.1073969566*t),o=Math.cbrt(.08830246189999998*n+.2817188376*e+.6299787005000002*t),a={mode:"oklab",l:.2104542553*s+.793617785*r-.0040720468*o,a:1.9779984951*s-2.428592205*r+.4505937099*o,b:.0259040371*s+.7827717662*r-.808675766*o};return i!==void 0&&(a.alpha=i),a},Qh=n=>{let e=vA(Ga(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Jc=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.pow(n*.9999999984505198+.39633779217376786*e+.2158037580607588*t,3),r=Math.pow(n*1.0000000088817609-.10556134232365635*e-.06385417477170591*t,3),o=Math.pow(n*1.0000000546724108-.08948418209496575*e-1.2914855378640917*t,3),a={mode:"lrgb",r:4.076741661347994*s-3.307711590408193*r+.230969928729428*o,g:-1.2684380040921763*s+2.6097574006633715*r-.3413193963102197*o,b:-.004196086541837188*s-.7034186144594493*r+1.7076147009309444*o};return i!==void 0&&(a.alpha=i),a},ep=n=>Wa(Jc(n));function Qg(n){const i=1.170873786407767;return .5*(i*n-.206+Math.sqrt((i*n-.206)*(i*n-.206)+4*.03*i*n))}function Fd(n){return(n*n+.206*n)/(1.170873786407767*(n+.03))}function Y6(n,e){let t,i,s,r,o,a,l,c;-1.88170328*n-.80936493*e>1?(t=1.19086277,i=1.76576728,s=.59662641,r=.75515197,o=.56771245,a=4.0767416621,l=-3.3077115913,c=.2309699292):1.81444104*n-1.19445276*e>1?(t=.73956515,i=-.45954404,s=.08285427,r=.1254107,o=.14503204,a=-1.2684380046,l=2.6097574011,c=-.3413193965):(t=1.35733652,i=-.00915799,s=-1.1513021,r=-.50559606,o=.00692167,a=-.0041960863,l=-.7034186147,c=1.707614701);let u=t+i*n+s*e+r*n*n+o*n*e,f=.3963377774*n+.2158037573*e,d=-.1055613458*n-.0638541728*e,h=-.0894841775*n-1.291485548*e;{let p=1+u*f,_=1+u*d,g=1+u*h,m=p*p*p,y=_*_*_,b=g*g*g,v=3*f*p*p,E=3*d*_*_,T=3*h*g*g,S=6*f*f*p,P=6*d*d*_,x=6*h*h*g,M=a*m+l*y+c*b,L=a*v+l*E+c*T,F=a*S+l*P+c*x;u=u-M*L/(L*L-.5*M*F)}return u}function $_(n,e){let t=Y6(n,e),i=Jc({l:1,a:t*n,b:t*e}),s=Math.cbrt(1/Math.max(i.r,i.g,i.b)),r=s*t;return[s,r]}function j6(n,e,t,i,s,r=null){r||(r=$_(n,e));let o;if((t-s)*r[1]-(r[0]-s)*i<=0)o=r[1]*s/(i*r[0]+r[1]*(s-t));else{o=r[1]*(s-1)/(i*(r[0]-1)+r[1]*(s-t));{let a=t-s,l=i,c=.3963377774*n+.2158037573*e,u=-.1055613458*n-.0638541728*e,f=-.0894841775*n-1.291485548*e,d=a+l*c,h=a+l*u,p=a+l*f;{let _=s*(1-o)+o*t,g=o*i,m=_+g*c,y=_+g*u,b=_+g*f,v=m*m*m,E=y*y*y,T=b*b*b,S=3*d*m*m,P=3*h*y*y,x=3*p*b*b,M=6*d*d*m,L=6*h*h*y,F=6*p*p*b,H=4.0767416621*v-3.3077115913*E+.2309699292*T-1,Y=4.0767416621*S-3.3077115913*P+.2309699292*x,ee=4.0767416621*M-3.3077115913*L+.2309699292*F,K=Y/(Y*Y-.5*H*ee),Q=-H*K,Z=-1.2684380046*v+2.6097574011*E-.3413193965*T-1,he=-1.2684380046*S+2.6097574011*P-.3413193965*x,be=-1.2684380046*M+2.6097574011*L-.3413193965*F,se=he/(he*he-.5*Z*be),ye=-Z*se,He=-.0041960863*v-.7034186147*E+1.707614701*T-1,re=-.0041960863*S-.7034186147*P+1.707614701*x,ge=-.0041960863*M-.7034186147*L+1.707614701*F,xe=re/(re*re-.5*He*ge),X=-He*xe;Q=K>=0?Q:1e6,ye=se>=0?ye:1e6,X=xe>=0?X:1e6,o+=Math.min(Q,Math.min(ye,X))}}}return o}function q_(n,e,t=null){t||(t=$_(n,e));let i=t[0],s=t[1];return[s/i,s/(1-i)]}function yA(n,e,t){let i=$_(e,t),s=j6(e,t,n,1,n,i),r=q_(e,t,i),o=.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),a=.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e)))),l=s/Math.min(n*r[0],(1-n)*r[1]),c=n*o,u=(1-n)*a,f=.9*l*Math.sqrt(Math.sqrt(1/(1/(c*c*c*c)+1/(u*u*u*u))));return c=n*.4,u=(1-n)*.8,[Math.sqrt(1/(1/(c*c)+1/(u*u))),f,s]}function Gx(n){const e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s={mode:"okhsl",l:Qg(e)};n.alpha!==void 0&&(s.alpha=n.alpha);let r=Math.sqrt(t*t+i*i);if(!r)return s.s=0,s;let[o,a,l]=yA(e,t/r,i/r),c;if(rGx(Qh(n))},toMode:{oklab:Wx,rgb:n=>ep(Wx(n))}};function Xx(n){let e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s=Math.sqrt(t*t+i*i),r=s?t/s:1,o=s?i/s:1,[a,l]=q_(r,o),c=.5,u=1-c/a,f=l/(s+e*l),d=f*e,h=f*s,p=Fd(d),_=h*p/d,g=Jc({l:p,a:r*_,b:o*_}),m=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));e=e/m,s=s/m*Qg(e)/e,e=Qg(e);const y={mode:"okhsv",s:s?(c+l)*h/(l*c+l*u*h):0,v:e?e/d:0};return y.s&&(y.h=_n(Math.atan2(i,t)*180/Math.PI)),n.alpha!==void 0&&(y.alpha=n.alpha),y}function $x(n){const e={mode:"oklab"};n.alpha!==void 0&&(e.alpha=n.alpha);const t=n.h!==void 0?n.h:0,i=n.s!==void 0?n.s:0,s=n.v!==void 0?n.v:0,r=Math.cos(t/180*Math.PI),o=Math.sin(t/180*Math.PI),[a,l]=q_(r,o),c=.5,u=1-c/a,f=1-i*c/(c+l-l*u*i),d=i*l*c/(c+l-l*u*i),h=Fd(f),p=d*h/f,_=Jc({l:h,a:r*p,b:o*p}),g=Math.cbrt(1/Math.max(_.r,_.g,_.b,0)),m=Fd(s*f),y=d*m/f;return e.l=m*g,e.a=y*r*g,e.b=y*o*g,e}const Z6={...rA,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Xx,rgb:n=>Xx(Qh(n))},toMode:{oklab:$x,rgb:n=>ep($x(n))}};function J6(n,e){if(!e||e[0]!=="oklab")return;const t={mode:"oklab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*.4/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*.4/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const Q6={...W_,mode:"oklab",toMode:{lrgb:Jc,rgb:ep},fromMode:{lrgb:vA,rgb:Qh},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[J6],serialize:n=>`oklab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`};function eH(n,e){if(!e||e[0]!=="oklch")return;const t={mode:"oklch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*.4/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const tH={...X_,mode:"oklch",toMode:{oklab:n=>br(n,"oklab"),rgb:n=>ep(br(n,"oklab"))},fromMode:{rgb:n=>yr(Qh(n),"oklch"),oklab:n=>yr(n,"oklch")},parse:[eH],serialize:n=>`oklch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},qx=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz65",x:.486570948648216*e+.265667693169093*t+.1982172852343625*i,y:.2289745640697487*e+.6917385218365062*t+.079286914093745*i,z:0*e+.0451133818589026*t+1.043944368900976*i};return s!==void 0&&(r.alpha=s),r},Yx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*2.4934969119414263-e*.9313836179191242-.402710784450717*t,g:n*-.8294889695615749+e*1.7626640603183465+.0236246858419436*t,b:n*.0358458302437845-e*.0761723892680418+.9568845240076871*t},"p3");return i!==void 0&&(s.alpha=i),s},nH={...Ha,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:n=>Yx(Po(n)),xyz65:Yx},toMode:{rgb:n=>Io(qx(n)),xyz65:qx}},Fm=n=>{let e=Math.abs(n);return e>=1/512?Math.sign(n)*Math.pow(e,1/1.8):16*n},jx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"prophoto",r:Fm(n*1.3457868816471585-e*.2555720873797946-.0511018649755453*t),g:Fm(n*-.5446307051249019+e*1.5082477428451466+.0205274474364214*t),b:Fm(n*0+e*0+1.2119675456389452*t)};return i!==void 0&&(s.alpha=i),s},km=(n=0)=>{let e=Math.abs(n);return e>=16/512?Math.sign(n)*Math.pow(e,1.8):n/16},Kx=n=>{let e=km(n.r),t=km(n.g),i=km(n.b),s={mode:"xyz50",x:.7977666449006423*e+.1351812974005331*t+.0313477341283922*i,y:.2880748288194013*e+.7118352342418731*t+899369387256e-16*i,z:0*e+0*t+.8251046025104602*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},iH={...Ha,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:jx,rgb:n=>jx(Zc(n))},toMode:{xyz50:Kx,rgb:n=>Kc(Kx(n))}},Zx=1.09929682680944,sH=.018053968510807,Bm=n=>{const e=Math.abs(n);return e>sH?(Math.sign(n)||1)*(Zx*Math.pow(e,.45)-(Zx-1)):4.5*n},Jx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"rec2020",r:Bm(n*1.7166511879712683-e*.3556707837763925-.2533662813736599*t),g:Bm(n*-.6666843518324893+e*1.6164812366349395+.0157685458139111*t),b:Bm(n*.0176398574453108-e*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(s.alpha=i),s},Qx=1.09929682680944,rH=.018053968510807,zm=(n=0)=>{let e=Math.abs(n);return e{let e=zm(n.r),t=zm(n.g),i=zm(n.b),s={mode:"xyz65",x:.6369580483012911*e+.1446169035862083*t+.1688809751641721*i,y:.262700212011267*e+.6779980715188708*t+.059301716469862*i,z:0*e+.0280726930490874*t+1.0609850577107909*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},oH={...Ha,mode:"rec2020",fromMode:{xyz65:Jx,rgb:n=>Jx(Po(n))},toMode:{xyz65:eM,rgb:n=>Io(eM(n))},parse:["rec2020"],serialize:"rec2020"},go=.0037930732552754493,bA=Math.cbrt(go),Vm=n=>Math.cbrt(n)-bA,aH=n=>{const{r:e,g:t,b:i,alpha:s}=Ga(n),r=Vm(.3*e+.622*t+.078*i+go),o=Vm(.23*e+.692*t+.078*i+go),a=Vm(.2434226892454782*e+.2047674442449682*t+.5518098665095535*i+go),l={mode:"xyb",x:(r-o)/2,y:(r+o)/2,b:a-(r+o)/2};return s!==void 0&&(l.alpha=s),l},Hm=n=>Math.pow(n+bA,3),lH=({x:n,y:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Hm(n+e)-go,r=Hm(e-n)-go,o=Hm(t+e)-go,a=Wa({r:11.031566904639861*s-9.866943908131562*r-.16462299650829934*o,g:-3.2541473810744237*s+4.418770377582723*r-.16462299650829934*o,b:-3.6588512867136815*s+2.7129230459360922*r+1.9459282407775895*o});return i!==void 0&&(a.alpha=i),a},cH={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:lH},fromMode:{rgb:aH},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:Ae,y:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},uH={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Kc,lab:G_},fromMode:{rgb:Zc,lab:H_},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:Ae,y:Ae,z:Ae,alpha:{use:Ae,fixup:on}}},fH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz50",x:1.0479298208405488*e+.0229467933410191*t-.0501922295431356*i,y:.0296278156881593*e+.990434484573249*t-.0170738250293851*i,z:-.0092430581525912*e+.0150551448965779*t+.7518742899580008*i};return s!==void 0&&(r.alpha=s),r},dH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz65",x:.9554734527042182*e-.0230985368742614*t+.0632593086610217*i,y:-.0283697069632081*e+1.0099954580058226*t+.021041398966943*i,z:.0123140016883199*e-.0205076964334779*t+1.3303659366080753*i};return s!==void 0&&(r.alpha=s),r},hH={mode:"xyz65",toMode:{rgb:Io,xyz50:fH},fromMode:{rgb:Po,xyz50:dH},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:Ae,y:Ae,z:Ae,alpha:{use:Ae,fixup:on}}},pH=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"yiq",y:.29889531*n+.58662247*e+.11448223*t,i:.59597799*n-.2741761*e-.32180189*t,q:.21147017*n-.52261711*e+.31114694*t};return i!==void 0&&(s.alpha=i),s},mH=({y:n,i:e,q:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"rgb",r:n+.95608445*e+.6208885*t,g:n-.27137664*e-.6486059*t,b:n-1.10561724*e+1.70250126*t};return i!==void 0&&(s.alpha=i),s},gH={mode:"yiq",toMode:{rgb:mH},fromMode:{rgb:pH},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:Ae,i:Ae,q:Ae,alpha:{use:Ae,fixup:on}}};Et(i6);Et(u6);Et(f6);Et(d6);Et(m6);Et(nA);Et(rA);Et(T6);Et(w6);Et(P6);Et(I6);Et(W_);Et(D6);Et(X_);Et(N6);Et(X6);Et($6);Et(q6);Et(K6);Et(Z6);Et(Q6);Et(tH);Et(nH);Et(iH);Et(oH);Et(Ha);Et(cH);Et(uH);Et(hH);Et(gH);const e0=178.17,_H=$w("oklch"),tM=n=>{var e;return n?(e=_H(n))==null?void 0:e.h:e0},vH=Tz("settings",()=>{const n=et(),e=ms("settings/language","en-US"),t=ms("settings/stage/view/model-renderer","2d"),i=ms("settings/audio/input","true"),s=Ee(()=>{var E;return(E=n.value)==null?void 0:E.deviceId}),{audioInputs:r}=RB({constraints:{audio:!0},requestPermissions:!0}),o=et(),a=et("/assets/live2d/models/hiyori_pro_zh.zip"),l=et("url"),c=et(!1),u=ms("settings/live2d/position",{x:0,y:0}),f=et({group:"Idle",index:0}),d=et([]),h=ms("settings/live2d/motion-map",{}),p=ms("settings/disable-transitions",!0),_=ms("settings/use-page-specific-transitions",!0),g=ms("settings/theme/colors/hue",e0),m=ms("settings/theme/colors/hue-dynamic",!1);function y(E=e0){g.value=E,m.value=!1}function b(E){y(tM(E))}function v(E){if(m.value)return!1;const T=tM(E);if(!T)return!1;const S=Math.abs(T-g.value);return S<.01||S>359.99}return $e(i,E=>{E==="false"&&(n.value=void 0),E==="true"&&(n.value=r.value[0])}),$e(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])},{immediate:!0}),{live2dModelFile:o,live2dModelUrl:a,live2dLoadSource:l,live2dCurrentMotion:f,live2dPosition:u,availableLive2dMotions:d,live2dMotionMap:h,loadingLive2dModel:c,disableTransitions:p,usePageSpecificTransitions:_,language:e,stageView:t,themeColorsHue:g,themeColorsHueDynamic:m,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s,setThemeColorsHue:y,applyPrimaryColorFrom:b,isColorSelectedForPrimary:v}}),yH=fn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>t.value.primaryColor||"#666"),s=Ee(()=>t.value.secondaryColor||"#ccc");return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-3-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-3-overlay-color-2",s.value)}),(r,o)=>(mn(),vi("div",{class:"stage-transition-3",style:Si({zIndex:t.value.zIndex||100})},null,4))}}),Lo=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},bH=Lo(yH,[["__scopeId","data-v-df576df0"]]),xH=fn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return Hn(()=>{var i,s;document.documentElement.style.setProperty("--circle-expansion-delay",`${((i=e.stageTransition)==null?void 0:i.delay)||0}s`),document.documentElement.style.setProperty("--circle-expansion-duration",`${((s=e.stageTransition)==null?void 0:s.duration)||.4}s`),t.value.forEach((r,o)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${o+1}`,r)})}),(i,s)=>{var r;return mn(),vi("div",{class:"circle-expansion-transition",style:Si({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(mn(!0),vi(jt,null,t2(t.value,(o,a)=>(mn(),vi("div",{key:a}))),128))],4)}}}),MH=Lo(xH,[["__scopeId","data-v-0c29056c"]]),SH=fn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Ee(()=>`fantasy-fall-${t.value}`);return Hn(()=>{var s,r,o,a,l,c,u,f,d;document.documentElement.style.setProperty("--fantasy-fall-color",((s=e.stageTransition)==null?void 0:s.primaryColor)||"#eee"),document.documentElement.style.setProperty("--fantasy-fall-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--fantasy-fall-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--fantasy-fall-radius-sm",`${((l=(a=e.stageTransition)==null?void 0:a.borderRadius)==null?void 0:l.sm)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-md",`${((u=(c=e.stageTransition)==null?void 0:c.borderRadius)==null?void 0:u.md)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-lg",`${((d=(f=e.stageTransition)==null?void 0:f.borderRadius)==null?void 0:d.lg)||"50%"}`)}),(s,r)=>{var o;return mn(),vi("div",{class:Oa(["fantasy-fall-transition",i.value]),style:Si({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),EH=Lo(SH,[["__scopeId","data-v-e62bf496"]]),TH=fn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-4-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-4-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),vi("div",{class:"stage-transition-4",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[O2('
',5)]),4)}}}),wH=Lo(TH,[["__scopeId","data-v-6d1179fc"]]),AH=fn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return $e([t,i,s],()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),Hn(()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),vi("div",{class:"stage-transition-1",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),CH=Lo(AH,[["__scopeId","data-v-bf1d1566"]]),RH=fn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)??"#ccc"});return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-2-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-2-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),vi("div",{class:"stage-transition-2",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),PH=Lo(RH,[["__scopeId","data-v-8ff7120f"]]),IH=fn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return Hn(()=>{var t,i,s,r,o,a,l;document.documentElement.style.setProperty("--rectangle-rotate-1-color",((t=e.stageTransition)==null?void 0:t.primaryColor)||"#ebcb8b"),document.documentElement.style.setProperty("--rectangle-rotate-2-color",((i=e.stageTransition)==null?void 0:i.secondaryColor)||"#c56370"),document.documentElement.style.setProperty("--rectangle-rotate-3-color",((s=e.stageTransition)==null?void 0:s.tertiaryColor)||"#43445b"),document.documentElement.style.setProperty("--rectangle-rotate-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--rectangle-rotate-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--rectangle-rotate-stagger",`${((a=e.stageTransition)==null?void 0:a.staggerDelay)||.1}s`),document.documentElement.style.setProperty("--rectangle-rotate-rotation",`${((l=e.stageTransition)==null?void 0:l.rotation)||270}deg`)}),(t,i)=>{var s;return mn(),vi("div",{class:"rectangle-rotate-transition",style:Si({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[ir("div",{class:"rectangle rectangle-rotate-1"},[ir("div")],-1),ir("div",{class:"rectangle rectangle-rotate-2"},[ir("div")],-1),ir("div",{class:"rectangle rectangle-rotate-3"},[ir("div")],-1)]),4)}}}),LH=Lo(IH,[["__scopeId","data-v-f4b1dc64"]]),DH=fn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(n){const e=n,t=IV(),i=et(!1),s=et(),r=et(""),o=et(),a=De({slide:{component:CH,duration:2700},"slope-slide":{component:PH,duration:2700},arrow:{component:bH,duration:2700},"multiple-blocks-reveal":{component:wH,duration:2800},"fantasy-fall":{component:EH,duration:2700},"rectangles-rotate":{component:LH,duration:2700},"bubble-wave-out":{component:MH,duration:1e3}}),l=et([]);function c(h){return l.value.push(h),()=>{const p=l.value.indexOf(h);p>=0&&l.value.splice(p,1)}}async function u(h,p={}){s.value=h;for(const _ of l.value)try{await Promise.resolve(_(h,p))}catch(g){console.error(`Error in transition hook at stage "${h}":`,g)}}async function f(h,p,_){if(h.name==="none"||!h.name){p(),_();return}const g=a.value[h.name];if(!g){console.error(`Transition ${h.name} not found`),p(),_();return}const m=g.nextDelay!==void 0?g.nextDelay:g.duration/3;let y=!1;const v=c(E=>{E==="navigation"&&!y&&(y=!0,p())});try{await u("before-enter",{transitionName:h.name}),i.value&&(await u("before-leave",{transitionName:r.value}),r.value="",o.value=void 0,i.value=!1,await u("after-leave",{transitionName:r.value}),await new Promise(T=>setTimeout(T,50))),r.value=h.name,o.value=h,i.value=!0,await u("enter-active",{transitionName:name}),setTimeout(async()=>{await u("navigation",{transitionName:h.name,config:g}),y||(y=!0,p())},m),setTimeout(async()=>{await u("after-enter",{transitionName:h.name})},g.duration),setTimeout(async()=>{await u("before-leave",{transitionName:h.name})},g.duration+10),setTimeout(async()=>{await u("leave-active",{transitionName:h.name})},g.duration+20);const E=g.exitDuration??0;setTimeout(async()=>{i.value=!1,r.value="",o.value=void 0,await u("after-leave",{transitionName:h.name}),_()},g.duration+E)}catch(E){console.error(E)}finally{v(),setTimeout(()=>{y||(y=!0,p())},g.duration*2)}}function d(h,p){return new Promise(_=>{f(h,p,_)})}return t.beforeEach((h,p,_)=>{if(e.disableTransitions){_();return}if(typeof h.meta.stageTransition!="object"){_();return}const g=h.meta.stageTransition;if(e.usePageSpecificTransitions&&g.pageSpecificAvailable){_();return}typeof e.primaryColor<"u"&&(g.primaryColor=e.primaryColor),typeof e.secondaryColor<"u"&&(g.secondaryColor=e.secondaryColor),typeof e.tertiaryColor<"u"&&(g.tertiaryColor=e.tertiaryColor),typeof e.colors<"u"&&(g.colors=e.colors),typeof e.zIndex<"u"&&(g.zIndex=e.zIndex),d(g,_)}),(h,p)=>(mn(),vi(jt,null,[n2(h.$slots,"default"),i.value?(mn(),vi(jt,{key:0},[a.value[r.value]?(mn(),Yl(e2(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Cv("",!0)],64)):Cv("",!0)],64))}});/*! diff --git a/assets/index-Dxee_4oE.js b/assets/index-CjikULv_.js similarity index 86% rename from assets/index-Dxee_4oE.js rename to assets/index-CjikULv_.js index dae4a04477ff13dd86daad5eda61c1f4ae84e86a..2adb5fa5300595e0b9965b510356e5eb6d8c9e94 100644 --- a/assets/index-Dxee_4oE.js +++ b/assets/index-CjikULv_.js @@ -1 +1 @@ -import{_ as w}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js";import"./live2d-zip-loader-CvpgOHsT.js";import{d as S,q as h,bE as z,s as A,v as C,bw as D,c as s,o as n,A as l,a as o,x as d,C as u,e,D as m,bx as p,by as B}from"./index-BYewP6KR.js";import{u as N}from"./providers-CFIOZO6n.js";import{I as P}from"./IconStatusItem-DXrpg97R.js";import{u as $}from"./useIconAnimation-B3hjTK1u.js";import{b as f}from"./route-block-B_A1xBdJ.js";const E={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},R={relative:""},T={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},V={text:"neutral-300 dark:neutral-500","text-nowrap":""},q={"text-nowrap":"","text-3xl":"","font-semibold":""},F={grid:"~ cols-2 gap-4"},L={key:1,text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},M=S({__name:"index",setup(j){const{t:a}=h(),x=z(),_=N(),{allProvidersMetadata:g}=A(_),v=C(),{iconAnimationStarted:y,showIconAnimation:b,animationIcon:k}=$("i-lucide:brain");return(G,i)=>{const I=w,r=D("motion");return n(),s(p,null,[l((n(),s("div",E,[o("button",{onClick:i[0]||(i[0]=t=>e(x).back())},i[1]||(i[1]=[o("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),o("h1",R,[o("div",T,[o("span",V,m(e(a)("settings.title")),1)]),o("div",q,m(e(a)("settings.pages.providers.title")),1)])])),[[r]]),o("div",F,[(n(!0),s(p,null,B(e(g),(t,c)=>l((n(),d(e(P),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+c*10,delay:c*50,title:t.localizedName,description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),e(b)?(n(),d(I,{key:0,"z-index":-1,icon:e(k),"icon-size":12,duration:1e3,started:e(y),"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"])):u("",!0),e(v).usePageSpecificTransitions?u("",!0):(n(),s("div",L,i[2]||(i[2]=[o("div",{text:"40","i-lucide:brain":""},null,-1)])))],64)}}});typeof f=="function"&&f(M);export{M as default}; +import{_ as w}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js";import"./live2d-zip-loader-DFrBymqv.js";import{d as S,q as h,bE as z,s as A,v as C,bw as D,c as s,o as n,A as l,a as o,x as d,C as u,e,D as m,bx as p,by as B}from"./index-CL4rmUJ-.js";import{u as N}from"./providers-BHCrT0RZ.js";import{I as P}from"./IconStatusItem-CKiy6LHl.js";import{u as $}from"./useIconAnimation-D_Q3CYV7.js";import{b as f}from"./route-block-B_A1xBdJ.js";const E={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},R={relative:""},T={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},V={text:"neutral-300 dark:neutral-500","text-nowrap":""},q={"text-nowrap":"","text-3xl":"","font-semibold":""},F={grid:"~ cols-2 gap-4"},L={key:1,text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},M=S({__name:"index",setup(j){const{t:a}=h(),x=z(),_=N(),{allProvidersMetadata:g}=A(_),v=C(),{iconAnimationStarted:y,showIconAnimation:b,animationIcon:k}=$("i-lucide:brain");return(G,i)=>{const I=w,r=D("motion");return n(),s(p,null,[l((n(),s("div",E,[o("button",{onClick:i[0]||(i[0]=t=>e(x).back())},i[1]||(i[1]=[o("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),o("h1",R,[o("div",T,[o("span",V,m(e(a)("settings.title")),1)]),o("div",q,m(e(a)("settings.pages.providers.title")),1)])])),[[r]]),o("div",F,[(n(!0),s(p,null,B(e(g),(t,c)=>l((n(),d(e(P),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+c*10,delay:c*50,title:t.localizedName,description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),e(b)?(n(),d(I,{key:0,"z-index":-1,icon:e(k),"icon-size":12,duration:1e3,started:e(y),"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"])):u("",!0),e(v).usePageSpecificTransitions?u("",!0):(n(),s("div",L,i[2]||(i[2]=[o("div",{text:"40","i-lucide:brain":""},null,-1)])))],64)}}});typeof f=="function"&&f(M);export{M as default}; diff --git a/assets/index-Cq-dDTsD.js b/assets/index-CkYx69fn.js similarity index 95% rename from assets/index-Cq-dDTsD.js rename to assets/index-CkYx69fn.js index 8262d5bcd7de6b4ac2123f1067ec1c3a4f682238..5cf0c0f5287bec4e585cd45003c5ea4ea604e886 100644 --- a/assets/index-Cq-dDTsD.js +++ b/assets/index-CkYx69fn.js @@ -1 +1 @@ -import{_ as z}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js";import{d as D,bK as M,bL as O,c as d,o as l,A as c,a as e,b as r,B as A,bH as v,C as h,D as a,bB as P,y as g,z as x,bE as I,v as N,bC as j,g as R,w as L,bw as G,x as K,e as n,ad as q,bG as J,bF as Q,bx as B,by as W,bn as X}from"./index-BYewP6KR.js";import"./live2d-zip-loader-CvpgOHsT.js";import{_ as f,a as Y}from"./ColorPalette.vue_vue_type_script_setup_true_lang-EIEI_2Ix.js";import{u as Z}from"./useIconAnimation-B3hjTK1u.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./index-C4TaASqf.js";const ee={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"},te=["aria-checked"],ne={key:0,text:"sm neutral-500"},y=D({__name:"CheckBar",props:M({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(u){const p=O(u,"modelValue");return(s,m)=>(l(),d("label",ee,[c(e("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>p.value=b),"aria-checked":p.value,type:"checkbox",hidden:""},null,8,te),[[A,p.value]]),e("div",null,[v(a(s.$t(u.text))+" ",1),u.description?(l(),d("div",ne,a(s.$t(u.description)),1)):h("",!0)]),r(P,{name:"slide-away",mode:"out-in"},{default:g(()=>[p.value?(l(),d("div",{key:0,class:x(u.iconOn),transition:"all ease-in-out duration-250"},null,2)):(l(),d("div",{key:1,class:x(u.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),se=[[],["#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"]],oe={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},ie={relative:""},ae={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},le={text:"neutral-300 dark:neutral-500","text-nowrap":""},re={"text-nowrap":"","text-3xl":"","font-semibold":""},de={class:"w-full flex 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"},ue={value:"en-US"},pe={value:"zh-CN"},me={flex:"","items-center":"","justify-between":""},ce={"text-lg":"","font-semibold":""},ge={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},be=["disabled"],fe={"font-medium":""},ye={text:"sm neutral-500"},ve={key:1,text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},w=D({__name:"index",setup(u){const p=I(),s=N(),m=j(),b=R(!1),{iconAnimationStarted:_,showIconAnimation:$,animationIcon:V}=Z("i-lucide:paintbrush");return L(()=>[s.usePageSpecificTransitions,s.disableTransitions],()=>{b.value=!0}),(i,t)=>{const E=z,S=G("motion");return l(),d(B,null,[c((l(),d("div",oe,[e("button",{onClick:t[0]||(t[0]=o=>n(p).back())},t[7]||(t[7]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),e("h1",ie,[e("div",ae,[e("span",le,a(i.$t("settings.title")),1)]),e("div",re,a(i.$t("settings.pages.themes.title")),1)])])),[[S]]),r(n(f),{title:"settings.sections.section.general.title",icon:"i-solar:filters-bold-duotone"},{default:g(()=>[r(y,{modelValue:n(m),"onUpdate:modelValue":t[1]||(t[1]=o=>q(m)?m.value=o:null),"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme"},null,8,["modelValue"]),e("div",de,[v(a(i.$t("settings.language.title"))+" ",1),c(e("select",{"onUpdate:modelValue":t[2]||(t[2]=o=>n(s).language=o),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[e("option",ue,a(i.$t("settings.language.english")),1),e("option",pe,a(i.$t("settings.language.chinese")),1)],512),[[J,n(s).language]])])]),_:1}),r(n(f),{title:"settings.pages.themes.sections.section.custom-color.title",icon:"i-solar:pallete-2-bold-duotone"},{default:g(()=>[e("div",me,[e("span",ce,a(i.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ge,[c(e("input",{"onUpdate:modelValue":t[3]||(t[3]=o=>n(s).themeColorsHueDynamic=o),type:"checkbox",class:"peer sr-only"},null,512),[[A,n(s).themeColorsHueDynamic]]),t[8]||(t[8]=e("div",{class:"peer-checked:bg-primary-500 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 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),v(" "+a(i.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])]),c(e("input",{"onUpdate:modelValue":t[4]||(t[4]=o=>n(s).themeColorsHue=o),type:"range",min:"0",max:"360",step:"0.01",class:x(["theme-hue-slider",n(s).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:n(s).themeColorsHueDynamic},null,10,be),[[Q,n(s).themeColorsHue]]),t[9]||(t[9]=e("div",{class:"color-bar"},[e("span",{"bg-primary-50":""},"50"),e("span",{"bg-primary-100":""},"100"),e("span",{"bg-primary-200":""},"200"),e("span",{"bg-primary-300":""},"300"),e("span",{"bg-primary-400":""},"400"),e("span",{"bg-primary-500":""},"500"),e("div",{"text-white":""},[e("span",{"bg-primary-600":""},"600"),e("span",{"bg-primary-700":""},"700"),e("span",{"bg-primary-800":""},"800"),e("span",{"bg-primary-900":""},"900"),e("span",{"bg-primary-950":""},"950")])],-1)),t[10]||(t[10]=e("div",{class:"color-bar transparency-grid"},[e("span",{bg:"primary-500/5"},"500/5"),e("span",{bg:"primary-500/10"},"500/10"),e("span",{bg:"primary-500/20"},"500/20"),e("span",{bg:"primary-500/30"},"500/30"),e("span",{bg:"primary-500/40"},"500/40"),e("span",{bg:"primary-500/50"},"500/50"),e("span",{bg:"primary-500/60"},"500/60"),e("span",{bg:"primary-500/70"},"500/70"),e("span",{bg:"primary-500/80"},"500/80"),e("span",{bg:"primary-500/90"},"500/90"),e("span",{bg:"primary-500"},"500")],-1))]),_:1}),r(n(f),{title:"settings.pages.themes.sections.section.theme-presets.title",icon:"i-solar:magic-stick-2-bold-duotone"},{default:g(()=>[(l(!0),d(B,null,W(i.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:o,description:T,colors:F},C)=>(l(),d("div",{key:C,class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700"},[e("div",null,[e("span",fe,a(i.$rt(o)),1),e("div",ye,a(i.$rt(T)),1)]),r(Y,{colors:F.map((U,H)=>({hex:n(se)[C][H],name:i.$rt(U)}))},null,8,["colors"])]))),128))]),_:1}),r(n(f),{title:"settings.pages.themes.sections.section.developer.title",icon:"i-solar:code-bold-duotone"},{default:g(()=>[r(y,{modelValue:n(s).disableTransitions,"onUpdate:modelValue":t[5]||(t[5]=o=>n(s).disableTransitions=o),"icon-on":"i-solar:people-nearby-bold-duotone","icon-off":"i-solar:running-2-line-duotone",text:"settings.animations.stage-transitions.title"},null,8,["modelValue"]),r(y,{modelValue:n(s).usePageSpecificTransitions,"onUpdate:modelValue":t[6]||(t[6]=o=>n(s).usePageSpecificTransitions=o),disabled:n(s).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"},null,8,["modelValue","disabled"])]),_:1}),n($)&&!b.value?(l(),K(E,{key:0,"z-index":-1,duration:1e3,started:n(_),"is-reverse":!0,icon:n(V),"icon-size":12,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["started","icon"])):h("",!0),n(s).usePageSpecificTransitions?h("",!0):(l(),d("div",ve,t[11]||(t[11]=[e("div",{text:"40","i-lucide:paintbrush":""},null,-1)])))],64)}}});typeof k=="function"&&k(w);const $e=X(w,[["__scopeId","data-v-de07a969"]]);export{$e as default}; +import{_ as z}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js";import{d as D,bK as M,bL as O,c as d,o as l,A as c,a as e,b as r,B as A,bH as v,C as h,D as a,bB as P,y as g,z as x,bE as I,v as N,bC as j,g as R,w as L,bw as G,x as K,e as n,ad as q,bG as J,bF as Q,bx as B,by as W,bn as X}from"./index-CL4rmUJ-.js";import"./live2d-zip-loader-DFrBymqv.js";import{_ as f,a as Y}from"./ColorPalette.vue_vue_type_script_setup_true_lang-CzX7Yr-T.js";import{u as Z}from"./useIconAnimation-D_Q3CYV7.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./index-CDeQ6Zfm.js";const ee={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"},te=["aria-checked"],ne={key:0,text:"sm neutral-500"},y=D({__name:"CheckBar",props:M({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(u){const p=O(u,"modelValue");return(s,m)=>(l(),d("label",ee,[c(e("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>p.value=b),"aria-checked":p.value,type:"checkbox",hidden:""},null,8,te),[[A,p.value]]),e("div",null,[v(a(s.$t(u.text))+" ",1),u.description?(l(),d("div",ne,a(s.$t(u.description)),1)):h("",!0)]),r(P,{name:"slide-away",mode:"out-in"},{default:g(()=>[p.value?(l(),d("div",{key:0,class:x(u.iconOn),transition:"all ease-in-out duration-250"},null,2)):(l(),d("div",{key:1,class:x(u.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),se=[[],["#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"]],oe={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},ie={relative:""},ae={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},le={text:"neutral-300 dark:neutral-500","text-nowrap":""},re={"text-nowrap":"","text-3xl":"","font-semibold":""},de={class:"w-full flex 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"},ue={value:"en-US"},pe={value:"zh-CN"},me={flex:"","items-center":"","justify-between":""},ce={"text-lg":"","font-semibold":""},ge={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},be=["disabled"],fe={"font-medium":""},ye={text:"sm neutral-500"},ve={key:1,text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},w=D({__name:"index",setup(u){const p=I(),s=N(),m=j(),b=R(!1),{iconAnimationStarted:_,showIconAnimation:$,animationIcon:V}=Z("i-lucide:paintbrush");return L(()=>[s.usePageSpecificTransitions,s.disableTransitions],()=>{b.value=!0}),(i,t)=>{const E=z,S=G("motion");return l(),d(B,null,[c((l(),d("div",oe,[e("button",{onClick:t[0]||(t[0]=o=>n(p).back())},t[7]||(t[7]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),e("h1",ie,[e("div",ae,[e("span",le,a(i.$t("settings.title")),1)]),e("div",re,a(i.$t("settings.pages.themes.title")),1)])])),[[S]]),r(n(f),{title:"settings.sections.section.general.title",icon:"i-solar:filters-bold-duotone"},{default:g(()=>[r(y,{modelValue:n(m),"onUpdate:modelValue":t[1]||(t[1]=o=>q(m)?m.value=o:null),"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme"},null,8,["modelValue"]),e("div",de,[v(a(i.$t("settings.language.title"))+" ",1),c(e("select",{"onUpdate:modelValue":t[2]||(t[2]=o=>n(s).language=o),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[e("option",ue,a(i.$t("settings.language.english")),1),e("option",pe,a(i.$t("settings.language.chinese")),1)],512),[[J,n(s).language]])])]),_:1}),r(n(f),{title:"settings.pages.themes.sections.section.custom-color.title",icon:"i-solar:pallete-2-bold-duotone"},{default:g(()=>[e("div",me,[e("span",ce,a(i.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ge,[c(e("input",{"onUpdate:modelValue":t[3]||(t[3]=o=>n(s).themeColorsHueDynamic=o),type:"checkbox",class:"peer sr-only"},null,512),[[A,n(s).themeColorsHueDynamic]]),t[8]||(t[8]=e("div",{class:"peer-checked:bg-primary-500 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 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),v(" "+a(i.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])]),c(e("input",{"onUpdate:modelValue":t[4]||(t[4]=o=>n(s).themeColorsHue=o),type:"range",min:"0",max:"360",step:"0.01",class:x(["theme-hue-slider",n(s).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:n(s).themeColorsHueDynamic},null,10,be),[[Q,n(s).themeColorsHue]]),t[9]||(t[9]=e("div",{class:"color-bar"},[e("span",{"bg-primary-50":""},"50"),e("span",{"bg-primary-100":""},"100"),e("span",{"bg-primary-200":""},"200"),e("span",{"bg-primary-300":""},"300"),e("span",{"bg-primary-400":""},"400"),e("span",{"bg-primary-500":""},"500"),e("div",{"text-white":""},[e("span",{"bg-primary-600":""},"600"),e("span",{"bg-primary-700":""},"700"),e("span",{"bg-primary-800":""},"800"),e("span",{"bg-primary-900":""},"900"),e("span",{"bg-primary-950":""},"950")])],-1)),t[10]||(t[10]=e("div",{class:"color-bar transparency-grid"},[e("span",{bg:"primary-500/5"},"500/5"),e("span",{bg:"primary-500/10"},"500/10"),e("span",{bg:"primary-500/20"},"500/20"),e("span",{bg:"primary-500/30"},"500/30"),e("span",{bg:"primary-500/40"},"500/40"),e("span",{bg:"primary-500/50"},"500/50"),e("span",{bg:"primary-500/60"},"500/60"),e("span",{bg:"primary-500/70"},"500/70"),e("span",{bg:"primary-500/80"},"500/80"),e("span",{bg:"primary-500/90"},"500/90"),e("span",{bg:"primary-500"},"500")],-1))]),_:1}),r(n(f),{title:"settings.pages.themes.sections.section.theme-presets.title",icon:"i-solar:magic-stick-2-bold-duotone"},{default:g(()=>[(l(!0),d(B,null,W(i.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:o,description:T,colors:F},C)=>(l(),d("div",{key:C,class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700"},[e("div",null,[e("span",fe,a(i.$rt(o)),1),e("div",ye,a(i.$rt(T)),1)]),r(Y,{colors:F.map((U,H)=>({hex:n(se)[C][H],name:i.$rt(U)}))},null,8,["colors"])]))),128))]),_:1}),r(n(f),{title:"settings.pages.themes.sections.section.developer.title",icon:"i-solar:code-bold-duotone"},{default:g(()=>[r(y,{modelValue:n(s).disableTransitions,"onUpdate:modelValue":t[5]||(t[5]=o=>n(s).disableTransitions=o),"icon-on":"i-solar:people-nearby-bold-duotone","icon-off":"i-solar:running-2-line-duotone",text:"settings.animations.stage-transitions.title"},null,8,["modelValue"]),r(y,{modelValue:n(s).usePageSpecificTransitions,"onUpdate:modelValue":t[6]||(t[6]=o=>n(s).usePageSpecificTransitions=o),disabled:n(s).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"},null,8,["modelValue","disabled"])]),_:1}),n($)&&!b.value?(l(),K(E,{key:0,"z-index":-1,duration:1e3,started:n(_),"is-reverse":!0,icon:n(V),"icon-size":12,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["started","icon"])):h("",!0),n(s).usePageSpecificTransitions?h("",!0):(l(),d("div",ve,t[11]||(t[11]=[e("div",{text:"40","i-lucide:paintbrush":""},null,-1)])))],64)}}});typeof k=="function"&&k(w);const $e=X(w,[["__scopeId","data-v-de07a969"]]);export{$e as default}; diff --git a/assets/index-CBPLaxd6.js b/assets/index-D7ZJqxUE.js similarity index 99% rename from assets/index-CBPLaxd6.js rename to assets/index-D7ZJqxUE.js index abbf617d4be76ff83c26b93d4face00caa2e2d7d..81572f60269a527c2bc3b9fbe6f0865396a37408 100644 --- a/assets/index-CBPLaxd6.js +++ b/assets/index-D7ZJqxUE.js @@ -1,4 +1,4 @@ -import{cq as getAugmentedNamespace}from"./index-BYewP6KR.js";var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(D,u,b)=>{if(u&&typeof u.init=="function"&&typeof u.createSessionHandler=="function"){const g=backends[D];if(g===void 0)backends[D]={backend:u,priority:b};else{if(g.priority>b)return;if(g.priority===b&&g.backend!==u)throw new Error(`cannot register backend "${D}" using priority ${b}`)}if(b>=0){const p=backendsSortedByPriority.indexOf(D);p!==-1&&backendsSortedByPriority.splice(p,1);for(let h=0;h{const u=D.length===0?backendsSortedByPriority:D,b=[];for(const g of u){const p=backends[g];if(p){if(p.initialized)return p.backend;if(p.aborted)continue;const h=!!p.initPromise;try{return h||(p.initPromise=p.backend.init()),await p.initPromise,p.initialized=!0,p.backend}catch(o){h||b.push({name:g,err:o}),p.aborted=!0}finally{delete p.initPromise}}}throw new Error(`no available backend found. ERR: ${b.map(g=>`[${g.name}] ${g.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(u){if(u!==void 0){if(typeof u!="string"||["verbose","info","warning","error","fatal"].indexOf(u)===-1)throw new Error(`Unsupported logging level: ${u}`);this.logLevelInternal=u}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=D=>{let u=1;for(let b=0;b{const t=document.createElement("canvas"),e=t.getContext("2d");if(!u||!e)return i();const n=new Image;n.crossOrigin="Anonymous",n.src=u,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const r=e.getImageData(0,0,t.width,t.height);if(b!==void 0){if(b.height!==void 0&&b.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(f.height=t.height,b.width!==void 0&&b.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");f.width=t.width}else f.height=t.height,f.width=t.width;s(at.bufferToTensor(r.data,f))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return at.bufferToTensor(c,f);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(u){var b,g;const p=document.createElement("canvas").getContext("2d");let h;if(p!=null){const o=this.dims[3],c=this.dims[2],f=this.dims[1],s=u!==void 0&&u.format!==void 0?u.format:"RGB",i=u!==void 0&&((b=u.norm)===null||b===void 0?void 0:b.mean)!==void 0?u.norm.mean:255,t=u!==void 0&&((g=u.norm)===null||g===void 0?void 0:g.bias)!==void 0?u.norm.bias:0,e=c*o;if(u!==void 0){if(u.height!==void 0&&u.height!==c)throw new Error("Image output config height doesn't match tensor height");if(u.width!==void 0&&u.width!==o)throw new Error("Image output config width doesn't match tensor width");if(u.format!==void 0&&f===4&&u.format!=="RGBA"||f===3&&u.format!=="RGB"&&u.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let r=0,a=1,l=2,d=3,m=0,y=e,v=e*2,_=-1;s==="RGBA"?(m=0,y=e,v=e*2,_=e*3):s==="RGB"?(m=0,y=e,v=e*2):s==="RBG"&&(m=0,v=e,y=e*2),h=p.createImageData(o,c);for(let T=0;T"u")throw new Error(`input '${s}' is missing in 'feeds'.`);if(o)for(const s of this.outputNames)p[s]=null;const c=await this.handler.run(u,p,h),f={};for(const s in c)Object.hasOwnProperty.call(c,s)&&(f[s]=new Tensor(c[s].type,c[s].data,c[s].dims));return f}static async create(u,b,g,p){let h,o={};if(typeof u=="string"){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof Uint8Array){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer){const t=u;let e=0,n=u.byteLength;if(typeof b=="object"&&b!==null)o=b;else if(typeof b=="number"){if(e=b,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=u.byteLength-e,typeof g=="number"){if(n=g,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof p=="object"&&p!==null)o=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof g<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof b<"u")throw new TypeError("'options' must be an object.");h=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const f=(o.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),i=await(await resolveBackend(f)).createSessionHandler(h,o);return new cn(i)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! +import{cq as getAugmentedNamespace}from"./index-CL4rmUJ-.js";var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(D,u,b)=>{if(u&&typeof u.init=="function"&&typeof u.createSessionHandler=="function"){const g=backends[D];if(g===void 0)backends[D]={backend:u,priority:b};else{if(g.priority>b)return;if(g.priority===b&&g.backend!==u)throw new Error(`cannot register backend "${D}" using priority ${b}`)}if(b>=0){const p=backendsSortedByPriority.indexOf(D);p!==-1&&backendsSortedByPriority.splice(p,1);for(let h=0;h{const u=D.length===0?backendsSortedByPriority:D,b=[];for(const g of u){const p=backends[g];if(p){if(p.initialized)return p.backend;if(p.aborted)continue;const h=!!p.initPromise;try{return h||(p.initPromise=p.backend.init()),await p.initPromise,p.initialized=!0,p.backend}catch(o){h||b.push({name:g,err:o}),p.aborted=!0}finally{delete p.initPromise}}}throw new Error(`no available backend found. ERR: ${b.map(g=>`[${g.name}] ${g.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(u){if(u!==void 0){if(typeof u!="string"||["verbose","info","warning","error","fatal"].indexOf(u)===-1)throw new Error(`Unsupported logging level: ${u}`);this.logLevelInternal=u}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=D=>{let u=1;for(let b=0;b{const t=document.createElement("canvas"),e=t.getContext("2d");if(!u||!e)return i();const n=new Image;n.crossOrigin="Anonymous",n.src=u,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const r=e.getImageData(0,0,t.width,t.height);if(b!==void 0){if(b.height!==void 0&&b.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(f.height=t.height,b.width!==void 0&&b.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");f.width=t.width}else f.height=t.height,f.width=t.width;s(at.bufferToTensor(r.data,f))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return at.bufferToTensor(c,f);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(u){var b,g;const p=document.createElement("canvas").getContext("2d");let h;if(p!=null){const o=this.dims[3],c=this.dims[2],f=this.dims[1],s=u!==void 0&&u.format!==void 0?u.format:"RGB",i=u!==void 0&&((b=u.norm)===null||b===void 0?void 0:b.mean)!==void 0?u.norm.mean:255,t=u!==void 0&&((g=u.norm)===null||g===void 0?void 0:g.bias)!==void 0?u.norm.bias:0,e=c*o;if(u!==void 0){if(u.height!==void 0&&u.height!==c)throw new Error("Image output config height doesn't match tensor height");if(u.width!==void 0&&u.width!==o)throw new Error("Image output config width doesn't match tensor width");if(u.format!==void 0&&f===4&&u.format!=="RGBA"||f===3&&u.format!=="RGB"&&u.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let r=0,a=1,l=2,d=3,m=0,y=e,v=e*2,_=-1;s==="RGBA"?(m=0,y=e,v=e*2,_=e*3):s==="RGB"?(m=0,y=e,v=e*2):s==="RBG"&&(m=0,v=e,y=e*2),h=p.createImageData(o,c);for(let T=0;T"u")throw new Error(`input '${s}' is missing in 'feeds'.`);if(o)for(const s of this.outputNames)p[s]=null;const c=await this.handler.run(u,p,h),f={};for(const s in c)Object.hasOwnProperty.call(c,s)&&(f[s]=new Tensor(c[s].type,c[s].data,c[s].dims));return f}static async create(u,b,g,p){let h,o={};if(typeof u=="string"){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof Uint8Array){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer){const t=u;let e=0,n=u.byteLength;if(typeof b=="object"&&b!==null)o=b;else if(typeof b=="number"){if(e=b,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=u.byteLength-e,typeof g=="number"){if(n=g,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof p=="object"&&p!==null)o=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof g<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof b<"u")throw new TypeError("'options' must be an object.");h=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const f=(o.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),i=await(await resolveBackend(f)).createSessionHandler(h,o);return new cn(i)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! * ONNX Runtime Web v1.14.0 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. diff --git a/assets/index-CprOqayC.js b/assets/index-DY0WpASX.js similarity index 92% rename from assets/index-CprOqayC.js rename to assets/index-DY0WpASX.js index f034c7649ff0541774e5c7f8028521f54e8998ef..0a7a23f14866f297d810279b3418f6aba8057836 100644 --- a/assets/index-CprOqayC.js +++ b/assets/index-DY0WpASX.js @@ -1 +1 @@ -import{d as r,bE as l,q as c,bw as d,A as p,o as u,c as _,a as t,e as o,D as n}from"./index-BYewP6KR.js";const x={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},m={relative:""},v={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},f={text:"neutral-300 dark:neutral-500","text-nowrap":""},b={"text-nowrap":"","text-3xl":"","font-semibold":""},h=r({__name:"index",setup(w){const i=l(),{t:s}=c();return(y,e)=>{const a=d("motion");return p((u(),_("div",x,[t("button",{onClick:e[0]||(e[0]=g=>o(i).back())},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",m,[t("div",v,[t("span",f,n(o(s)("settings.title")),1)]),t("div",b,n(o(s)("settings.pages.memory.title")),1)])])),[[a]])}}});export{h as default}; +import{d as r,bE as l,q as c,bw as d,A as p,o as u,c as _,a as t,e as o,D as n}from"./index-CL4rmUJ-.js";const x={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},m={relative:""},v={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},f={text:"neutral-300 dark:neutral-500","text-nowrap":""},b={"text-nowrap":"","text-3xl":"","font-semibold":""},h=r({__name:"index",setup(w){const i=l(),{t:s}=c();return(y,e)=>{const a=d("motion");return p((u(),_("div",x,[t("button",{onClick:e[0]||(e[0]=g=>o(i).back())},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",m,[t("div",v,[t("span",f,n(o(s)("settings.title")),1)]),t("div",b,n(o(s)("settings.pages.memory.title")),1)])])),[[a]])}}});export{h as default}; diff --git a/assets/index-Cu67dzFi.js b/assets/index-Di3jPqPB.js similarity index 92% rename from assets/index-Cu67dzFi.js rename to assets/index-Di3jPqPB.js index 8754ceb1bf04a474c923b38939c7589e4961696e..bedf54207d541fa1c75eed4b1c8d99ac069aad66 100644 --- a/assets/index-Cu67dzFi.js +++ b/assets/index-Di3jPqPB.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as k,bE as b,q as I,v as w,h as C,bw as S,c as r,o as n,A as d,a as i,x as l,C as m,e as s,D as g,bx as u,by as A}from"./index-BYewP6KR.js";import{I as B}from"./IconStatusItem-DXrpg97R.js";import{_ as D}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Bm3hGrtj.js";import{u as z}from"./useIconAnimation-B3hjTK1u.js";import{b as p}from"./route-block-B_A1xBdJ.js";const E={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},L={relative:""},N={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},V={text:"neutral-300 dark:neutral-500","text-nowrap":""},$={"text-nowrap":"","text-3xl":"","font-semibold":""},q={grid:"~ cols-1 sm:cols-2 gap-4"},F={key:1,text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},P=k({__name:"index",setup(R){const f=b(),{t:e}=I(),y=w(),x=C(()=>[{id:"consciousness",name:e("settings.pages.modules.consciousness.title"),description:e("settings.pages.modules.consciousness.description"),icon:"i-lucide:ghost",to:"/settings/modules/consciousness",configured:!1},{id:"speech",name:e("settings.pages.modules.speech.title"),description:e("settings.pages.modules.speech.description"),icon:"i-lucide:mic",to:"/settings/modules/speech",configured:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-lucide:ear",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-lucide:eye",to:"",configured:!1},{id:"memory-short-term",name:e("settings.pages.modules.memory-short-term.title"),description:e("settings.pages.modules.memory-short-term.description"),icon:"i-lucide:book",to:"/settings/modules/memory-short-term",configured:!1},{id:"memory-long-term",name:e("settings.pages.modules.memory-long-term.title"),description:e("settings.pages.modules.memory-long-term.description"),icon:"i-lucide:book-copy",to:"/settings/modules/memory-long-term",configured:!1},{id:"messaging-discord",name:e("settings.pages.modules.messaging-discord.title"),description:e("settings.pages.modules.messaging-discord.description"),icon:"i-simple-icons:discord",to:"",configured:!1},{id:"x",name:e("settings.pages.modules.x.title"),description:e("settings.pages.modules.x.description"),icon:"i-simple-icons:x",to:"",configured:!1},{id:"game-minecraft",name:e("settings.pages.modules.gaming-minecraft.title"),description:e("settings.pages.modules.gaming-minecraft.description"),iconColor:"i-vscode-icons:file-type-minecraft",to:"",configured:!1},{id:"game-factorio",name:e("settings.pages.modules.gaming-factorio.title"),description:e("settings.pages.modules.gaming-factorio.description"),iconImage:"",to:"",configured:!1}]),{iconAnimationStarted:v,showIconAnimation:_,animationIcon:h}=z("i-lucide:blocks");return(T,o)=>{const a=S("motion");return n(),r(u,null,[d((n(),r("div",E,[i("button",{onClick:o[0]||(o[0]=t=>s(f).back())},o[1]||(o[1]=[i("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),i("h1",L,[i("div",N,[i("span",V,g(s(e)("settings.title")),1)]),i("div",$,g(s(e)("settings.pages.modules.title")),1)])])),[[a]]),i("div",q,[(n(!0),r(u,null,A(x.value,(t,c)=>d((n(),l(s(B),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+c*10,delay:c*50,title:t.name,description:t.description,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:t.to,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),s(_)?(n(),l(D,{key:0,icon:s(h),"icon-size":12,duration:1e3,started:s(v),"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"])):m("",!0),s(y).usePageSpecificTransitions?m("",!0):(n(),r("div",F,o[2]||(o[2]=[i("div",{text:"40","i-lucide:blocks":""},null,-1)])))],64)}}});typeof p=="function"&&p(P);export{P as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as k,bE as b,q as I,v as w,h as C,bw as S,c as r,o as n,A as d,a as i,x as l,C as m,e as s,D as g,bx as u,by as A}from"./index-CL4rmUJ-.js";import{I as B}from"./IconStatusItem-CKiy6LHl.js";import{_ as D}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Cz87WWfY.js";import{u as z}from"./useIconAnimation-D_Q3CYV7.js";import{b as p}from"./route-block-B_A1xBdJ.js";const E={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},L={relative:""},N={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},V={text:"neutral-300 dark:neutral-500","text-nowrap":""},$={"text-nowrap":"","text-3xl":"","font-semibold":""},q={grid:"~ cols-1 sm:cols-2 gap-4"},F={key:1,text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},P=k({__name:"index",setup(R){const f=b(),{t:e}=I(),y=w(),x=C(()=>[{id:"consciousness",name:e("settings.pages.modules.consciousness.title"),description:e("settings.pages.modules.consciousness.description"),icon:"i-lucide:ghost",to:"/settings/modules/consciousness",configured:!1},{id:"speech",name:e("settings.pages.modules.speech.title"),description:e("settings.pages.modules.speech.description"),icon:"i-lucide:mic",to:"/settings/modules/speech",configured:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-lucide:ear",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-lucide:eye",to:"",configured:!1},{id:"memory-short-term",name:e("settings.pages.modules.memory-short-term.title"),description:e("settings.pages.modules.memory-short-term.description"),icon:"i-lucide:book",to:"/settings/modules/memory-short-term",configured:!1},{id:"memory-long-term",name:e("settings.pages.modules.memory-long-term.title"),description:e("settings.pages.modules.memory-long-term.description"),icon:"i-lucide:book-copy",to:"/settings/modules/memory-long-term",configured:!1},{id:"messaging-discord",name:e("settings.pages.modules.messaging-discord.title"),description:e("settings.pages.modules.messaging-discord.description"),icon:"i-simple-icons:discord",to:"",configured:!1},{id:"x",name:e("settings.pages.modules.x.title"),description:e("settings.pages.modules.x.description"),icon:"i-simple-icons:x",to:"",configured:!1},{id:"game-minecraft",name:e("settings.pages.modules.gaming-minecraft.title"),description:e("settings.pages.modules.gaming-minecraft.description"),iconColor:"i-vscode-icons:file-type-minecraft",to:"",configured:!1},{id:"game-factorio",name:e("settings.pages.modules.gaming-factorio.title"),description:e("settings.pages.modules.gaming-factorio.description"),iconImage:"",to:"",configured:!1}]),{iconAnimationStarted:v,showIconAnimation:_,animationIcon:h}=z("i-lucide:blocks");return(T,o)=>{const a=S("motion");return n(),r(u,null,[d((n(),r("div",E,[i("button",{onClick:o[0]||(o[0]=t=>s(f).back())},o[1]||(o[1]=[i("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),i("h1",L,[i("div",N,[i("span",V,g(s(e)("settings.title")),1)]),i("div",$,g(s(e)("settings.pages.modules.title")),1)])])),[[a]]),i("div",q,[(n(!0),r(u,null,A(x.value,(t,c)=>d((n(),l(s(B),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+c*10,delay:c*50,title:t.name,description:t.description,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:t.to,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),s(_)?(n(),l(D,{key:0,icon:s(h),"icon-size":12,duration:1e3,started:s(v),"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"])):m("",!0),s(y).usePageSpecificTransitions?m("",!0):(n(),r("div",F,o[2]||(o[2]=[i("div",{text:"40","i-lucide:blocks":""},null,-1)])))],64)}}});typeof p=="function"&&p(P);export{P as default}; diff --git a/assets/index-BYKB2VRI.js b/assets/index-NSbcQ-qE.js similarity index 84% rename from assets/index-BYKB2VRI.js rename to assets/index-NSbcQ-qE.js index 7702db882abc59b6804d62a1ec83db1202c9ec3c..d34e6d27fe440739b41555040c79451968c0d280 100644 --- a/assets/index-BYKB2VRI.js +++ b/assets/index-NSbcQ-qE.js @@ -1,5 +1,5 @@ -var Ta=Object.defineProperty;var ka=(t,e,n)=>e in t?Ta(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Mi=(t,e,n)=>ka(t,typeof e!="symbol"?e+"":e,n);import{V as _a,a as Aa,c as Ea,r as Ma,b as Nr,d as Sa,E as Si,e as Ia,f as Ra,g as Ca,s as Na,h as La,i as Pa}from"./live2d-zip-loader-CvpgOHsT.js";import{f as $n,g as W,h as Ue,s as Ye,t as Da,d as ze,i as Oa,j as za,k as Zr,w as je,l as pn,c as ie,o as ee,m as gn,p as Fa,q as Qt,v as Wt,x as Xt,y as Be,b as ke,a as z,z as at,A as At,B as Jr,C as it,D as ge,e as H,M as yt,T as _t,E as ei,F as qn,G as Wo,Z as On,H as Ot,I as Ba,V as se,S as Ii,Q as zn,O as Gt,J as Pe,P as Et,K as Ua,L as Xo,N as hn,U as ti,W as Fe,X as Qo,Y as Zo,_ as ni,$ as yn,a0 as ja,a1 as ri,a2 as Va,a3 as Jo,a4 as xt,a5 as ii,a6 as Mt,a7 as Ha,a8 as es,a9 as Dt,aa as ts,ab as Ga,ac as $a,ad as qa,ae as Ya,af as ns,ag as Yn,ah as Ka,ai as Wa,aj as Xa,ak as Pt,al as Qa,am as Za,an as Ja,ao as el,ap as er,aq as Fn,ar as Lr,as as Nt,at as rs,au as Pr,av as Vt,aw as Ri,ax as Lt,ay as Ht,az as tr,aA as tl,aB as nl,aC as rl,aD as il,aE as is,aF as os,aG as Bn,aH as ss,aI as oi,aJ as Un,aK as as,aL as ol,n as Dr,aM as sl,aN as Or,aO as ls,aP as al,aQ as cn,aR as us,aS as ft,aT as vt,aU as mn,aV as ll,aW as ul,aX as cl,aY as fl,aZ as dl,a_ as si,a$ as pl,b0 as hl,b1 as ml,b2 as nr,b3 as gl,b4 as cs,b5 as yl,b6 as xl,b7 as vl,b8 as bl,b9 as wl,ba as rr,bb as Tl,bc as kl,bd as _l,be as Ci,bf as Ni,bg as Li,bh as Pi,bi as Al,bj as El,bk as Ml,bl as Sl,bm as Il,bn as Kn,bo as Rl,bp as fs,bq as Cl,br as Nl,bs as Ll,bt as Pl,bu as ds,bv as jn,bw as ps,bx as ai,by as li,bz as Dl,bA as ir,bB as Ol,bC as zl}from"./index-BYewP6KR.js";import{s as $t,c as Di,u as Fl,g as Bl}from"./speech-CLmksxkl.js";import{u as or}from"./queue-DRKK1rL_.js";import{u as Ul,a as jl,b as Vl,l as Hl,_ as hs}from"./queues-Cj51JWdx.js";import{r as Gl,a as $l,b as ql,c as Yl,d as Kl,l as Wl,u as ui}from"./providers-CFIOZO6n.js";import{u as Xl}from"./airi-card-BM-9G8yH.js";import{_ as Ql,a as Zl,r as on}from"./Model.vue_vue_type_script_setup_true_lang-CvOp1AJu.js";import{_ as ci}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import{_ as Oi}from"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import{H as Jl}from"./HeaderLink-7ZfdE9hW.js";import{u as ms}from"./consciousness-MUz60a06.js";import{d as zi}from"./index-CBPLaxd6.js";import{b as Fi}from"./route-block-B_A1xBdJ.js";async function*eu(t,e){const n=t.getReader();try{for(;;){const{done:r,value:i}=await n.read();if(r)return;yield e(i)}}finally{n.releaseLock()}}function tu(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let i=0;i<700;i+=80)n.push(e[i]);return e.map(i=>i**1.2).map(i=>i*1.2).reduce((i,o)=>i+o,0)/e.length/100}function nu(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let u=0;u<700;u+=80)n.push(e[u]);const r=e.map(u=>u**1.5),i=Math.min(...r),s=Math.max(...r)-i;let a;return s===0?a=r.map(()=>0):a=r.map(u=>(u-i)/s),a.reduce((u,c)=>u+c,0)/e.length}function ru(t,e="linear"){switch(e){case"linear":return tu(t);case"minmax":return nu(t)}}const gs=$n("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:ru})),iu=$n("SpeakingStore",()=>{const n=W(0),r=W(!1),i=Ue(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function _n(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function ou(t){let e="literal",n="";return{async consume(r){var i,o,s;for(let a=0;a"?(l+=_n(r,a,1),u="literal",a++):l==="<"?u="special":l===">"&&(u="literal"),e==="literal"&&u==="special"?n!==""&&(await((i=t.onLiteral)==null?void 0:i.call(t,n)),n=""):e==="special"&&u==="literal"&&n!==""&&(n+=l,await((o=t.onSpecial)==null?void 0:o.call(t,n)),n=""),e==="literal"&&u==="literal"?(await((s=t.onLiteral)==null?void 0:s.call(t,l)),n=""):e==="special"&&u==="literal"?n="":n+=l,e=u}},async end(){var r,i;n!==""&&(e==="literal"?await((r=t.onLiteral)==null?void 0:r.call(t,n)):n.endsWith("|>")&&await((i=t.onSpecial)==null?void 0:i.call(t,n)))}}}const su=async t=>{var e;return(t.fetch??globalThis.fetch)(Gl("chat/completions",t.baseURL),{body:ql({...t,tools:(e=t.tools)==null?void 0:e.map(n=>({function:Yl({...n.function,returns:void 0}),type:"function"}))}),headers:$l({"Content-Type":"application/json",...t.headers},t.apiKey),method:"POST",signal:t.abortSignal}).then(Kl)},au=({finishReason:t,maxSteps:e,stepsLength:n,toolCallsLength:r})=>{if(n===0)return"initial";if(n0&&t==="tool_calls")return"tool-result";if(!["error","length"].includes(t))return"continue"}return"done"},lu=t=>typeof t=="string"||Array.isArray(t)&&t.every(e=>!!(typeof e=="object"&&"type"in e&&["audio","image","text"].includes(e.type)))?t:JSON.stringify(t),uu=async({abortSignal:t,messages:e,toolCall:n,tools:r})=>{const i=r==null?void 0:r.find(a=>a.function.name===n.function.name);if(!i){const a=r==null?void 0:r.map(u=>u.function.name),l=a==null||a.length===0?"No tools are available.":`Available tools: ${a.join(", ")}.`;throw new Error(`Model tried to call unavailable tool '${n.function.name}. ${l}.`)}const o=JSON.parse(n.function.arguments),s=lu(await i.execute(o,{abortSignal:t,messages:e,toolCallId:n.id}));return{parsedArgs:o,result:s,toolName:n.function.name}};class sr extends Error{constructor(n,r){super(n);Mi(this,"response");this.name="XSAIError",this.response=r}}const Bi="data:",cu=t=>{if(!t||!t.startsWith(Bi))return[void 0,!1];const e=t.slice(Bi.length),n=e.startsWith(" ")?e.slice(1):e;if(n==="[DONE]")return[void 0,!0];if(n.startsWith("{")&&n.includes('"error":'))throw new Error(`Error from server: ${n}`);return[JSON.parse(n),!1]},fu=async t=>{let e,n,r;const i=new ReadableStream({start(p){e=p}}),o=new ReadableStream({start(p){n=p}}),s=new ReadableStream({start(p){r=p}}),a=t.maxSteps??1,l=new TextDecoder,u=[],c=async p=>{var I,A,C;const d={choices:[],finishReason:"error",messages:structuredClone(p.messages),stepType:"initial",toolCalls:[],toolResults:[]},b={};let x="",v=!0;const T=(P,h)=>{P.endedToolCallIDs.has(h)||(P.endedToolCallIDs.add(h),P.currentToolID=null)};if(await su({...p,stream:!0}).then(async P=>P.body.pipeThrough(new TransformStream({transform:async(h,S)=>{const y=l.decode(h,{stream:!0});x+=y;const g=x.split(` -`);x=g.pop()??"";for(const m of g)try{const[k,E]=cu(m);if(E)break;k&&S.enqueue(k)}catch(k){S.error(k)}}})).pipeTo(new WritableStream({abort:h=>{e.error(h),n.error(h),r.error(h)},write:async h=>{var Q,_,te;(Q=p.onChunk)==null||Q.call(p,h),e.enqueue(h);const S=h.choices[0];if(!S)throw new sr("no choice found");S.delta.tool_calls&&(v=!1);const{delta:y,finish_reason:g,index:m,...k}=S,E=(_=d.choices)[m]??(_[m]={finish_reason:g,index:m,message:{role:"assistant"}});if(g!==void 0){if(d.finishReason=g,E.finish_reason=g,g==="length")throw new sr("length exceeded");if(g==="content_filter")throw new sr("content filter")}Object.assign(E,k);const{content:O,refusal:F,tool_calls:D,...B}=y,X=E.message;Object.assign(X,B),F!==void 0&&(X.refusal=(X.refusal||"")+F),O!==void 0&&(X.content=(X.content||"")+O,v&&(r==null||r.enqueue(O)));for(const{function:ce,id:R,type:pe}of D||[]){X.tool_calls??(X.tool_calls={});const ye=(te=X.tool_calls)[R]??(te[R]={function:{arguments:"",name:ce.name,parsed_arguments:{}},id:R,type:pe});ye.function.arguments+=ce.arguments}const Z=b[m]??(b[m]={calledToolCallIDs:new Set,currentToolID:null,endedToolCallIDs:new Set,index:m,toolCallErrors:{},toolCallResults:{}});g&&Z.currentToolID!==null&&T(Z,Z.currentToolID);for(const ce of y.tool_calls||[])Z.currentToolID!==null&&Z.currentToolID!==ce.id&&T(Z,Z.currentToolID),Z.calledToolCallIDs.add(ce.id),Z.currentToolID=ce.id}}))),d.messages.push({content:((I=d.choices[0])==null?void 0:I.message.content)??"",refusal:(A=d.choices[0])==null?void 0:A.message.refusal,role:"assistant"}),await Promise.allSettled(d.choices.map(async P=>{const h=b[P.index];return Promise.allSettled([...h.endedToolCallIDs].map(async S=>{const y=P.message.tool_calls[S];if(d.toolCalls.push({args:y.function.arguments,toolCallId:S,toolCallType:"function",toolName:y.function.name}),!h.toolCallResults[S])try{const{parsedArgs:g,result:m,toolName:k}=await uu({abortSignal:p.abortSignal,messages:p.messages,toolCall:y,tools:p.tools});y.function.parsed_arguments=g,h.toolCallResults[S]=m,d.messages.push({content:m,role:"tool",tool_call_id:S}),d.toolResults.push({args:g,result:m,toolCallId:S,toolName:k})}catch(g){h.toolCallErrors[S]=g}}))})),d.stepType=au({finishReason:d.finishReason,maxSteps:a,stepsLength:u.length,toolCallsLength:d.toolCalls.length}),u.push(d),n.enqueue(d),(C=p.onStepFinish)==null||C.call(p,d),!v)return async()=>c({...p,messages:d.messages})};return(async()=>{var d;let p=await c(t);for(;typeof p=="function"&&u.length{e.error(p),n.error(p),r.error(p)}),Promise.resolve({chunkStream:i,stepStream:o,textStream:s})},du=$n("llm",()=>{async function t(n,r,i,o){const s=o==null?void 0:o.headers;return await fu({...r.chat(n),messages:i,headers:s})}async function e(n,r){if(n==="")return[];try{return await Wl({baseURL:n.endsWith("/")?n:`${n}/`,apiKey:r})}catch(i){if(String(i).includes("Failed to construct 'URL': Invalid URL"))return[];throw i}}return{models:e,stream:t}}),St=$n("chat",()=>{const{stream:t}=du(),{systemPrompt:e}=Ye(Xl()),n=W(!1),r=W([]),i=W([]),o=W([]),s=W([]),a=W([]),l=W([]),u=W([]),c=W([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function b(h){s.value.push(h)}function x(h){a.value.push(h)}function v(h){l.value.push(h)}function T(h){u.value.push(h)}function I(h){c.value.push(h)}const A=W([{role:"system",content:e.value}]),C=W({role:"assistant",content:""});async function P(h,S){var y;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);C.value={role:"assistant",content:""},A.value.push({role:"user",content:h}),A.value.push(C.value);const g=A.value.slice(0,A.value.length-1).map(D=>Da(D));for(const D of i.value)await D(h);for(const D of o.value)await D(h);const m=(y=S.providerConfig)==null?void 0:y.headers,k=m==null?void 0:m.filter(D=>D.key&&D.value).reduce((D,B)=>(D[B.key]=B.value,D),{}),E=await t(S.model,S.chatProvider,g,{headers:k});for(const D of s.value)await D(h);let O="";const F=ou({onLiteral:async D=>{for(const B of a.value)await B(D);C.value.content+=D},onSpecial:async D=>{for(const B of l.value)await B(D)}});for await(const D of eu(E.textStream,async B=>B))O+=D,await F.consume(D);await F.end();for(const D of u.value)await D();for(const D of c.value)await D(O);console.debug("LLM output:",O)}finally{n.value=!1}}return{sending:n,messages:A,streamingMessage:C,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:b,onTokenLiteral:x,onTokenSpecial:v,onStreamEnd:T,onAssistantResponseEnd:I}}),ys=ze({__name:"Screen",setup(t){const e=W(),n=Oa(Fa),{width:r,height:i}=za(),o=Zr(e,{immediate:!0,windowResize:!0,reset:!0}),s=Ue(()=>n.between("sm","md").value||n.smaller("sm").value),a=Ue(()=>n.between("md","lg").value),l=Ue(()=>n.greaterOrEqual("lg").value),u=Ue(()=>l.value?o.width.value:s.value||a.value?r.value-16:o.width.value),c=W(0);return je([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||s.value||a.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),je([o.width,o.height],()=>{l.value||s.value||a.value?c.value=o.height.value:c.value=600}),pn(async()=>{e.value&&o.update()}),(f,p)=>(ee(),ie("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),pu={absolute:"",bottom:"3",right:"3"},hu={flex:"~ row","cursor-pointer":""},mu=["checked","aria-checked"],gu={key:0,"min-w":"50vw",z:"(ee(),Xt(ys,{relative:""},{default:Be(({width:s,height:a})=>[ke(Zl,{width:s,height:a},{default:Be(({app:l})=>[ke(Ql,{app:l,"mouth-open-size":t.mouthOpenSize,width:s,height:a,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),z("div",pu,[z("div",hu,[z("label",{class:at([n.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(z("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,mu),[[Jr,n.value]]),o[8]||(o[8]=z("div",{"select-none":""},[z("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(ci,null,{default:Be(()=>[n.value?(ee(),ie("div",gu,[z("div",yu,[z("div",xu,[z("span",null,ge(H(e)("stage.viewers.debug-menu.emotions")),1)]),z("div",vu,[z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.question")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):it("",!0)]),_:1})])]),_:1}))}});var wu=Object.defineProperty,Tu=(t,e,n)=>e in t?wu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ku=(t,e,n)=>Tu(t,e+"",n);function _u(t){return Ka()?(Wa(t),!0):!1}function xs(t){return typeof t=="function"?t():H(t)}const Au=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Eu=Object.prototype.toString,Mu=t=>Eu.call(t)==="[object Object]",Su=()=>{},Iu=Au?window:void 0;function Ru(t){var e;const n=xs(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ar(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=Iu):[e,n,r,i]=t,!e)return Su;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},a=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=je(()=>[Ru(e),xs(i)],([c,f])=>{if(s(),!c)return;const p=Mu(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(b=>a(c,d,b,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return _u(u),u}function vs(t,e,n,r){const i=class extends yn{constructor(o={}){const s=Object.entries(t);super({uniforms:s.reduce((a,[l,u])=>{const c=ri.clone({[l]:{value:u}});return{...a,...c}},{}),vertexShader:e,fragmentShader:n}),ku(this,"key",""),s.forEach(([a])=>Object.defineProperty(this,a,{get:()=>this.uniforms[a].value,set:l=>this.uniforms[a].value=l})),Object.assign(this,o)}};return i.key=Dt.generateUUID(),i}vs({color:new Fe("white"),scale:new Pe(1,1),imageBounds:new Pe(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` +var Ta=Object.defineProperty;var ka=(t,e,n)=>e in t?Ta(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Mi=(t,e,n)=>ka(t,typeof e!="symbol"?e+"":e,n);import{V as _a,a as Aa,c as Ea,r as Ma,b as Nr,d as Sa,E as Si,e as Ia,f as Ra,g as Ca,s as Na,h as La,i as Pa}from"./live2d-zip-loader-DFrBymqv.js";import{f as $n,g as W,h as Ue,s as Ye,t as Da,d as ze,i as Oa,j as za,k as Qr,w as je,l as pn,c as ie,o as ee,m as gn,p as Fa,q as Zt,v as Wt,x as Xt,y as Be,b as ke,a as z,z as at,A as At,B as Jr,C as it,D as ge,e as H,M as yt,T as _t,E as ei,F as qn,G as Wo,Z as On,H as Ot,I as Ba,V as se,S as Ii,Q as zn,O as Gt,J as Pe,P as Et,K as Ua,L as Xo,N as hn,U as ti,W as Fe,X as Zo,Y as Qo,_ as ni,$ as yn,a0 as ja,a1 as ri,a2 as Va,a3 as Jo,a4 as xt,a5 as ii,a6 as Mt,a7 as Ha,a8 as es,a9 as Dt,aa as ts,ab as Ga,ac as $a,ad as qa,ae as Ya,af as ns,ag as Yn,ah as Ka,ai as Wa,aj as Xa,ak as Pt,al as Za,am as Qa,an as Ja,ao as el,ap as er,aq as Fn,ar as Lr,as as Nt,at as rs,au as Pr,av as Vt,aw as Ri,ax as Lt,ay as Ht,az as tr,aA as tl,aB as nl,aC as rl,aD as il,aE as is,aF as os,aG as Bn,aH as ss,aI as oi,aJ as Un,aK as as,aL as ol,n as Dr,aM as sl,aN as Or,aO as ls,aP as al,aQ as cn,aR as us,aS as ft,aT as vt,aU as mn,aV as ll,aW as ul,aX as cl,aY as fl,aZ as dl,a_ as si,a$ as pl,b0 as hl,b1 as ml,b2 as nr,b3 as gl,b4 as cs,b5 as yl,b6 as xl,b7 as vl,b8 as bl,b9 as wl,ba as rr,bb as Tl,bc as kl,bd as _l,be as Ci,bf as Ni,bg as Li,bh as Pi,bi as Al,bj as El,bk as Ml,bl as Sl,bm as Il,bn as Kn,bo as Rl,bp as fs,bq as Cl,br as Nl,bs as Ll,bt as Pl,bu as ds,bv as jn,bw as ps,bx as ai,by as li,bz as Dl,bA as ir,bB as Ol,bC as zl}from"./index-CL4rmUJ-.js";import{s as $t,c as Di,u as Fl,g as Bl}from"./speech-Ae5ywnpY.js";import{u as or}from"./queue-DCQeV-U1.js";import{u as Ul,a as jl,b as Vl,l as Hl,_ as hs}from"./queues-D3Ic2N1b.js";import{r as Gl,a as $l,b as ql,c as Yl,d as Kl,l as Wl,u as ui}from"./providers-BHCrT0RZ.js";import{u as Xl}from"./airi-card-CWMQJScT.js";import{_ as Zl,a as Ql,r as on}from"./Model.vue_vue_type_script_setup_true_lang-CuI1gVrl.js";import{_ as ci}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import{_ as Oi}from"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import{H as Jl}from"./HeaderLink-ByYQsQjF.js";import{u as ms}from"./consciousness-nHboP4iV.js";import{d as zi}from"./index-D7ZJqxUE.js";import{b as Fi}from"./route-block-B_A1xBdJ.js";async function*eu(t,e){const n=t.getReader();try{for(;;){const{done:r,value:i}=await n.read();if(r)return;yield e(i)}}finally{n.releaseLock()}}function tu(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let i=0;i<700;i+=80)n.push(e[i]);return e.map(i=>i**1.2).map(i=>i*1.2).reduce((i,o)=>i+o,0)/e.length/100}function nu(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let u=0;u<700;u+=80)n.push(e[u]);const r=e.map(u=>u**1.5),i=Math.min(...r),s=Math.max(...r)-i;let a;return s===0?a=r.map(()=>0):a=r.map(u=>(u-i)/s),a.reduce((u,c)=>u+c,0)/e.length}function ru(t,e="linear"){switch(e){case"linear":return tu(t);case"minmax":return nu(t)}}const gs=$n("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:ru})),iu=$n("SpeakingStore",()=>{const n=W(0),r=W(!1),i=Ue(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function _n(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function ou(t){let e="literal",n="";return{async consume(r){var i,o,s;for(let a=0;a"?(l+=_n(r,a,1),u="literal",a++):l==="<"?u="special":l===">"&&(u="literal"),e==="literal"&&u==="special"?n!==""&&(await((i=t.onLiteral)==null?void 0:i.call(t,n)),n=""):e==="special"&&u==="literal"&&n!==""&&(n+=l,await((o=t.onSpecial)==null?void 0:o.call(t,n)),n=""),e==="literal"&&u==="literal"?(await((s=t.onLiteral)==null?void 0:s.call(t,l)),n=""):e==="special"&&u==="literal"?n="":n+=l,e=u}},async end(){var r,i;n!==""&&(e==="literal"?await((r=t.onLiteral)==null?void 0:r.call(t,n)):n.endsWith("|>")&&await((i=t.onSpecial)==null?void 0:i.call(t,n)))}}}const su=async t=>{var e;return(t.fetch??globalThis.fetch)(Gl("chat/completions",t.baseURL),{body:ql({...t,tools:(e=t.tools)==null?void 0:e.map(n=>({function:Yl({...n.function,returns:void 0}),type:"function"}))}),headers:$l({"Content-Type":"application/json",...t.headers},t.apiKey),method:"POST",signal:t.abortSignal}).then(Kl)},au=({finishReason:t,maxSteps:e,stepsLength:n,toolCallsLength:r})=>{if(n===0)return"initial";if(n0&&t==="tool_calls")return"tool-result";if(!["error","length"].includes(t))return"continue"}return"done"},lu=t=>typeof t=="string"||Array.isArray(t)&&t.every(e=>!!(typeof e=="object"&&"type"in e&&["audio","image","text"].includes(e.type)))?t:JSON.stringify(t),uu=async({abortSignal:t,messages:e,toolCall:n,tools:r})=>{const i=r==null?void 0:r.find(a=>a.function.name===n.function.name);if(!i){const a=r==null?void 0:r.map(u=>u.function.name),l=a==null||a.length===0?"No tools are available.":`Available tools: ${a.join(", ")}.`;throw new Error(`Model tried to call unavailable tool '${n.function.name}. ${l}.`)}const o=JSON.parse(n.function.arguments),s=lu(await i.execute(o,{abortSignal:t,messages:e,toolCallId:n.id}));return{parsedArgs:o,result:s,toolName:n.function.name}};class sr extends Error{constructor(n,r){super(n);Mi(this,"response");this.name="XSAIError",this.response=r}}const cu=t=>t.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),fu=t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[cu(e),n])),Bi="data:",du=t=>{if(!t||!t.startsWith(Bi))return[void 0,!1];const e=t.slice(Bi.length),n=e.startsWith(" ")?e.slice(1):e;if(n==="[DONE]")return[void 0,!0];if(n.startsWith("{")&&n.includes('"error":'))throw new Error(`Error from server: ${n}`);return[JSON.parse(n),!1]},pu=async t=>{let e,n,r;const i=new ReadableStream({start(p){e=p}}),o=new ReadableStream({start(p){n=p}}),s=new ReadableStream({start(p){r=p}}),a=t.maxSteps??1,l=new TextDecoder,u=[],c=async p=>{var I,A,C;const d={choices:[],finishReason:"error",messages:structuredClone(p.messages),stepType:"initial",toolCalls:[],toolResults:[]},b={};let x="",v=!0;const T=(P,h)=>{P.endedToolCallIDs.has(h)||(P.endedToolCallIDs.add(h),P.currentToolID=null)};if(await su({...p,stream:!0,streamOptions:p.streamOptions!=null?fu(p.streamOptions):void 0}).then(async P=>P.body.pipeThrough(new TransformStream({transform:async(h,S)=>{const y=l.decode(h,{stream:!0});x+=y;const g=x.split(` +`);x=g.pop()??"";for(const m of g)try{const[k,E]=du(m);if(E)break;k&&S.enqueue(k)}catch(k){S.error(k)}}})).pipeTo(new WritableStream({abort:h=>{e.error(h),n.error(h),r.error(h)},write:async h=>{var Z,_,te;(Z=p.onChunk)==null||Z.call(p,h),e.enqueue(h);const S=h.choices[0];if(!S)throw new sr("no choice found");S.delta.tool_calls&&(v=!1);const{delta:y,finish_reason:g,index:m,...k}=S,E=(_=d.choices)[m]??(_[m]={finish_reason:g,index:m,message:{role:"assistant"}});if(g!==void 0){if(d.finishReason=g,E.finish_reason=g,g==="length")throw new sr("length exceeded");if(g==="content_filter")throw new sr("content filter")}Object.assign(E,k);const{content:O,refusal:F,tool_calls:D,...B}=y,X=E.message;Object.assign(X,B),F!==void 0&&(X.refusal=(X.refusal||"")+F),O!==void 0&&(X.content=(X.content||"")+O,v&&(r==null||r.enqueue(O)));for(const{function:ce,id:R,type:pe}of D||[]){X.tool_calls??(X.tool_calls={});const ye=(te=X.tool_calls)[R]??(te[R]={function:{arguments:"",name:ce.name,parsed_arguments:{}},id:R,type:pe});ye.function.arguments+=ce.arguments}const Q=b[m]??(b[m]={calledToolCallIDs:new Set,currentToolID:null,endedToolCallIDs:new Set,index:m,toolCallErrors:{},toolCallResults:{}});g&&Q.currentToolID!==null&&T(Q,Q.currentToolID);for(const ce of y.tool_calls||[])Q.currentToolID!==null&&Q.currentToolID!==ce.id&&T(Q,Q.currentToolID),Q.calledToolCallIDs.add(ce.id),Q.currentToolID=ce.id}}))),d.messages.push({content:((I=d.choices[0])==null?void 0:I.message.content)??"",refusal:(A=d.choices[0])==null?void 0:A.message.refusal,role:"assistant"}),await Promise.allSettled(d.choices.map(async P=>{const h=b[P.index];return Promise.allSettled([...h.endedToolCallIDs].map(async S=>{const y=P.message.tool_calls[S];if(d.toolCalls.push({args:y.function.arguments,toolCallId:S,toolCallType:"function",toolName:y.function.name}),!h.toolCallResults[S])try{const{parsedArgs:g,result:m,toolName:k}=await uu({abortSignal:p.abortSignal,messages:p.messages,toolCall:y,tools:p.tools});y.function.parsed_arguments=g,h.toolCallResults[S]=m,d.messages.push({content:m,role:"tool",tool_call_id:S}),d.toolResults.push({args:g,result:m,toolCallId:S,toolName:k})}catch(g){h.toolCallErrors[S]=g}}))})),d.stepType=au({finishReason:d.finishReason,maxSteps:a,stepsLength:u.length,toolCallsLength:d.toolCalls.length}),u.push(d),n.enqueue(d),(C=p.onStepFinish)==null||C.call(p,d),!v)return async()=>c({...p,messages:d.messages})};return(async()=>{var d;let p=await c(t);for(;typeof p=="function"&&u.length{e.error(p),n.error(p),r.error(p)}),Promise.resolve({chunkStream:i,stepStream:o,textStream:s})},hu=$n("llm",()=>{async function t(n,r,i,o){const s=o==null?void 0:o.headers;return await pu({...r.chat(n),messages:i,headers:s})}async function e(n,r){if(n==="")return[];try{return await Wl({baseURL:n.endsWith("/")?n:`${n}/`,apiKey:r})}catch(i){if(String(i).includes("Failed to construct 'URL': Invalid URL"))return[];throw i}}return{models:e,stream:t}}),St=$n("chat",()=>{const{stream:t}=hu(),{systemPrompt:e}=Ye(Xl()),n=W(!1),r=W([]),i=W([]),o=W([]),s=W([]),a=W([]),l=W([]),u=W([]),c=W([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function b(h){s.value.push(h)}function x(h){a.value.push(h)}function v(h){l.value.push(h)}function T(h){u.value.push(h)}function I(h){c.value.push(h)}const A=W([{role:"system",content:e.value}]),C=W({role:"assistant",content:""});async function P(h,S){var y;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);C.value={role:"assistant",content:""},A.value.push({role:"user",content:h}),A.value.push(C.value);const g=A.value.slice(0,A.value.length-1).map(D=>Da(D));for(const D of i.value)await D(h);for(const D of o.value)await D(h);const m=(y=S.providerConfig)==null?void 0:y.headers,k=m==null?void 0:m.filter(D=>D.key&&D.value).reduce((D,B)=>(D[B.key]=B.value,D),{}),E=await t(S.model,S.chatProvider,g,{headers:k});for(const D of s.value)await D(h);let O="";const F=ou({onLiteral:async D=>{for(const B of a.value)await B(D);C.value.content+=D},onSpecial:async D=>{for(const B of l.value)await B(D)}});for await(const D of eu(E.textStream,async B=>B))O+=D,await F.consume(D);await F.end();for(const D of u.value)await D();for(const D of c.value)await D(O);console.debug("LLM output:",O)}finally{n.value=!1}}return{sending:n,messages:A,streamingMessage:C,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:b,onTokenLiteral:x,onTokenSpecial:v,onStreamEnd:T,onAssistantResponseEnd:I}}),ys=ze({__name:"Screen",setup(t){const e=W(),n=Oa(Fa),{width:r,height:i}=za(),o=Qr(e,{immediate:!0,windowResize:!0,reset:!0}),s=Ue(()=>n.between("sm","md").value||n.smaller("sm").value),a=Ue(()=>n.between("md","lg").value),l=Ue(()=>n.greaterOrEqual("lg").value),u=Ue(()=>l.value?o.width.value:s.value||a.value?r.value-16:o.width.value),c=W(0);return je([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||s.value||a.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),je([o.width,o.height],()=>{l.value||s.value||a.value?c.value=o.height.value:c.value=600}),pn(async()=>{e.value&&o.update()}),(f,p)=>(ee(),ie("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),mu={absolute:"",bottom:"3",right:"3"},gu={flex:"~ row","cursor-pointer":""},yu=["checked","aria-checked"],xu={key:0,"min-w":"50vw",z:"(ee(),Xt(ys,{relative:""},{default:Be(({width:s,height:a})=>[ke(Ql,{width:s,height:a},{default:Be(({app:l})=>[ke(Zl,{app:l,"mouth-open-size":t.mouthOpenSize,width:s,height:a,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),z("div",mu,[z("div",gu,[z("label",{class:at([n.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(z("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,yu),[[Jr,n.value]]),o[8]||(o[8]=z("div",{"select-none":""},[z("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(ci,null,{default:Be(()=>[n.value?(ee(),ie("div",xu,[z("div",vu,[z("div",bu,[z("span",null,ge(H(e)("stage.viewers.debug-menu.emotions")),1)]),z("div",wu,[z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.question")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},ge(H(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):it("",!0)]),_:1})])]),_:1}))}});var ku=Object.defineProperty,_u=(t,e,n)=>e in t?ku(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Au=(t,e,n)=>_u(t,e+"",n);function Eu(t){return Ka()?(Wa(t),!0):!1}function xs(t){return typeof t=="function"?t():H(t)}const Mu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Su=Object.prototype.toString,Iu=t=>Su.call(t)==="[object Object]",Ru=()=>{},Cu=Mu?window:void 0;function Nu(t){var e;const n=xs(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ar(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=Cu):[e,n,r,i]=t,!e)return Ru;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},a=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=je(()=>[Nu(e),xs(i)],([c,f])=>{if(s(),!c)return;const p=Iu(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(b=>a(c,d,b,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Eu(u),u}function vs(t,e,n,r){const i=class extends yn{constructor(o={}){const s=Object.entries(t);super({uniforms:s.reduce((a,[l,u])=>{const c=ri.clone({[l]:{value:u}});return{...a,...c}},{}),vertexShader:e,fragmentShader:n}),Au(this,"key",""),s.forEach(([a])=>Object.defineProperty(this,a,{get:()=>this.uniforms[a].value,set:l=>this.uniforms[a].value=l})),Object.assign(this,o)}};return i.key=Dt.generateUUID(),i}vs({color:new Fe("white"),scale:new Pe(1,1),imageBounds:new Pe(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` varying vec2 vUv; varying vec2 vPos; void main() { @@ -54,7 +54,7 @@ var Ta=Object.defineProperty;var ka=(t,e,n)=>e in t?Ta(t,e,{enumerable:!0,config #include #include } - `);const fi=parseInt(Xa.replace(/\D+/g,""));var Cu=Object.defineProperty,Nu=(t,e,n)=>e in t?Cu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Lu=(t,e,n)=>(Nu(t,e+"",n),n);async function Ui(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let An,lr,Ft,En;function ur(t,e=1/0,n=null){lr||(lr=new ts(2,2,1,1)),Ft||(Ft=new yn({uniforms:{blitTexture:new rl(t)},vertexShader:` + `);const fi=parseInt(Xa.replace(/\D+/g,""));var Lu=Object.defineProperty,Pu=(t,e,n)=>e in t?Lu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Du=(t,e,n)=>(Pu(t,e+"",n),n);async function Ui(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let An,lr,Ft,En;function ur(t,e=1/0,n=null){lr||(lr=new ts(2,2,1,1)),Ft||(Ft=new yn({uniforms:{blitTexture:new rl(t)},vertexShader:` varying vec2 vUv; void main(){ vUv = uv; @@ -73,7 +73,7 @@ var Ta=Object.defineProperty;var ka=(t,e,n)=>e in t?Ta(t,e,{enumerable:!0,config gl_FragColor = texture2D( blitTexture, vUv); #endif } - `})),Ft.uniforms.blitTexture.value=t,Ft.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,Ft.needsUpdate=!0,En||(En=new Pt(lr,Ft),En.frustrumCulled=!1);const r=new Et,i=new Pr;i.add(En),n||(n=An=new il({antialias:!1})),n.setSize(Math.min(t.image.width,e),Math.min(t.image.height,e)),n.clear(),n.render(i,r);const o=new Fn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,An&&(An.dispose(),An=null),o}const ji={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class bs{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Hu(e)}),this.register(function(e){return new Gu(e)}),this.register(function(e){return new Yu(e)}),this.register(function(e){return new Ku(e)}),this.register(function(e){return new Wu(e)}),this.register(function(e){return new Xu(e)}),this.register(function(e){return new $u(e)}),this.register(function(e){return new qu(e)}),this.register(function(e){return new Qu(e)}),this.register(function(e){return new Zu(e)}),this.register(function(e){return new Ju(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){const o=new Vu,s=[];for(let a=0,l=this.pluginCallbacks.length;at.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-e)<.001)return t.times.length-1;r[r.length-1]=e,r.set(t.times,0),i.set(t.values,0),i.set(o.evaluate(e),t.values.length),s=r.length-1}else for(let a=0;ae){r.set(t.times.slice(0,a+1),0),r[a+1]=e,r.set(t.times.slice(a+1),a+2),i.set(t.values.slice(0,(a+1)*n),0),i.set(o.evaluate(e),(a+1)*n),i.set(t.values.slice((a+1)*n),(a+2)*n),s=a+1;break}}return t.times=r,t.values=i,s},mergeMorphTargetTracks:function(t,e){const n=[],r={},i=t.tracks;for(let o=0;o4?s=t.array[i*t.itemSize+o]:(o===0?s=t.getX(i):o===1?s=t.getY(i):o===2?s=t.getZ(i):o===3&&(s=t.getW(i)),t.normalized===!0&&(s=Dt.normalize(s,t.array))),r.min[o]=Math.min(r.min[o],s),r.max[o]=Math.max(r.max[o],s)}return r}function ws(t){return Math.ceil(t/4)*4}function fr(t,e=0){const n=ws(t.byteLength);if(n!==t.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(t)),e!==0)for(let i=t.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function qi(t,e){if(t.toBlob!==void 0)return new Promise(r=>t.toBlob(r,e));let n;return e==="image/jpeg"?n=.92:e==="image/webp"&&(n=.8),t.convertToBlob({type:e,quality:n})}class Vu{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,n,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,o=i.buffers,s=i.json;r=i.options;const a=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(a),f=Object.keys(l);c.length>0&&(s.extensionsUsed=c),f.length>0&&(s.extensionsRequired=f),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=fr(p),b=new DataView(new ArrayBuffer(Gi));b.setUint32(0,d.byteLength,!0),b.setUint32(4,Fu,!0);const x=fr(Bu(JSON.stringify(s)),32),v=new DataView(new ArrayBuffer(Gi));v.setUint32(0,x.byteLength,!0),v.setUint32(4,zu,!0);const T=new ArrayBuffer(Hi),I=new DataView(T);I.setUint32(0,Du,!0),I.setUint32(4,Ou,!0);const A=Hi+v.byteLength+x.byteLength+b.byteLength+d.byteLength;I.setUint32(8,A,!0),new Blob([T,v,x,b,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):s.buffers&&s.buffers.length>0?Ui(u).then(p=>{s.buffers[0].uri=p,n(s)}):n(s)}serializeUserData(e,n){if(Object.keys(e.userData).length===0)return;const r=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&o.gltfExtensions){n.extensions===void 0&&(n.extensions={});for(const s in o.gltfExtensions)n.extensions[s]=o.gltfExtensions[s],i[s]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(n.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(e,n=!1){if(this.uids.has(e)===!1){const r=new Map;r.set(!0,this.uid++),r.set(!1,this.uid++),this.uids.set(e,r)}return this.uids.get(e).get(n)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const n=new se;for(let r=0,i=e.count;r5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const n=this.cache;if(n.attributesNormalized.has(e))return n.attributesNormalized.get(e);const r=e.clone(),i=new se;for(let o=0,s=r.count;o4?b=e.array[p*e.itemSize+d]:(d===0?b=e.getX(p):d===1?b=e.getY(p):d===2?b=e.getZ(p):d===3&&(b=e.getW(p)),e.normalized===!0&&(b=Dt.normalize(b,e.array))),n===me.FLOAT?u.setFloat32(c,b,!0):n===me.INT?u.setInt32(c,b,!0):n===me.UNSIGNED_INT?u.setUint32(c,b,!0):n===me.SHORT?u.setInt16(c,b,!0):n===me.UNSIGNED_SHORT?u.setUint16(c,b,!0):n===me.BYTE?u.setInt8(c,b):n===me.UNSIGNED_BYTE&&u.setUint8(c,b),c+=a}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===me.ARRAY_BUFFER&&(f.byteStride=e.itemSize*a),this.byteOffset+=l,s.bufferViews.push(f),{id:s.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const n=this,r=n.json;return r.bufferViews||(r.bufferViews=[]),e.arrayBuffer().then(i=>{const o=fr(i),s={buffer:n.processBuffer(o),byteOffset:n.byteOffset,byteLength:o.byteLength};return n.byteOffset+=o.byteLength,r.bufferViews.push(s)-1})}processAccessor(e,n,r,i){const o=this.json,s={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let a;if(e.array.constructor===Float32Array)a=me.FLOAT;else if(e.array.constructor===Int32Array)a=me.INT;else if(e.array.constructor===Uint32Array)a=me.UNSIGNED_INT;else if(e.array.constructor===Int16Array)a=me.SHORT;else if(e.array.constructor===Uint16Array)a=me.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)a=me.BYTE;else if(e.array.constructor===Uint8Array)a=me.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),i===void 0&&(i=e.count),i===0)return null;const l=ju(e,r,i);let u;n!==void 0&&(u=e===n.index?me.ELEMENT_ARRAY_BUFFER:me.ARRAY_BUFFER);const c=this.processBufferView(e,a,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:a,count:i,max:l.max,min:l.min,type:s[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-1}processImage(e,n,r,i="image/png"){if(e!==null){const o=this,s=o.cache,a=o.json,l=o.options,u=o.pending;s.images.has(e)||s.images.set(e,{});const c=s.images.get(e),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];a.images||(a.images=[]);const p={mimeType:i},d=$i();d.width=Math.min(e.width,l.maxTextureSize),d.height=Math.min(e.height,l.maxTextureSize);const b=d.getContext("2d");if(r===!0&&(b.translate(0,d.height),b.scale(1,-1)),e.data!==void 0){n!==Lr&&console.error("GLTFExporter: Only RGBAFormat is supported.",n),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const v=new Uint8ClampedArray(e.height*e.width*4);for(let T=0;To.processBufferViewImage(v)).then(v=>{p.bufferView=v})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(qi(d,i).then(Ui).then(v=>{p.uri=v}));const x=a.images.push(p)-1;return c[f]=x,x}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const n=this.json;n.samplers||(n.samplers=[]);const r={magFilter:Je[e.magFilter],minFilter:Je[e.minFilter],wrapS:Je[e.wrapS],wrapT:Je[e.wrapT]};return n.samplers.push(r)-1}processTexture(e){const n=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof er&&(e=ur(e,n.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");const s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(s.name=e.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(e,s)});const a=i.textures.push(s)-1;return r.textures.set(e,a),a}processMaterial(e){const n=this.cache,r=this.json;if(n.materials.has(e))return n.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=e.color.toArray().concat([e.opacity]);if(un(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const a=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),l={index:this.processTexture(a),channel:a.channel};this.applyTextureTransform(l,a),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const a={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(a,e.map),i.pbrMetallicRoughness.baseColorTexture=a}if(e.emissive){const a=e.emissive;if(Math.max(a.r,a.g,a.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap){const a={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){const a={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Yn&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});const s=r.materials.push(i)-1;return n.materials.set(e,s),s}processMesh(e){const n=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let A=0,C=e.material.length;A=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=s.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),s.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let b=null;for(let A in s.attributes){if(A.slice(0,5)==="morph")continue;const C=s.attributes[A];if(A=p[A]||A.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(A)||(A="_"+A),n.attributes.has(this.getUID(C))){u[A]=n.attributes.get(this.getUID(C));continue}b=null;const P=C.array;A==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),b=new Nt(new Uint16Array(P),C.itemSize,C.normalized));const h=this.processAccessor(b||C,s);h!==null&&(A.startsWith("_")||this.detectMeshQuantization(A,C),u[A]=h,n.attributes.set(this.getUID(C),h))}if(d!==void 0&&s.setAttribute("normal",d),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const A=[],C=[],P={};if(e.morphTargetDictionary!==void 0)for(const h in e.morphTargetDictionary)P[e.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=C)}const x=Array.isArray(e.material);if(x&&s.groups.length===0)return null;const v=x?e.material:[e.material],T=x?s.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let A=0,C=T.length;A0&&(P.targets=f),s.index!==null){let S=this.getUID(s.index);(T[A].start!==void 0||T[A].count!==void 0)&&(S+=":"+T[A].start+":"+T[A].count),n.attributes.has(S)?P.indices=n.attributes.get(S):(P.indices=this.processAccessor(s.index,s,T[A].start,T[A].count),n.attributes.set(S,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(v[T[A].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(A){A.writeMesh&&A.writeMesh(e,l)});const I=r.meshes.push(l)-1;return n.meshes.set(o,I),I}detectMeshQuantization(e,n){if(this.extensionsUsed[cr])return;let r;switch(n.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}n.normalized&&(r+=" normalized");const i=e.split("_",1)[0];ji[i]&&ji[i].includes(r)&&(this.extensionsUsed[cr]=!0,this.extensionsRequired[cr]=!0)}processCamera(e){const n=this.json;n.cameras||(n.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Dt.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),n.cameras.push(i)-1}processAnimation(e,n){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]),e=bs.Utils.mergeMorphTargetTracks(e.clone(),n);const o=e.tracks,s=[],a=[];for(let l=0;l0){const a=[];for(let l=0,u=e.children.length;l0&&(o.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,o)});const s=n.nodes.push(o)-1;return i.set(e,s),s}processScene(e){const n=this.json,r=this.options;n.scenes||(n.scenes=[],n.scene=0);const i={};e.name!==""&&(i.name=e.name),n.scenes.push(i);const o=[];for(let s=0,a=e.children.length;s0&&(i.nodes=o),this.serializeUserData(e,i)}processObjects(e){const n=new Pr;n.name="AuxScene";for(let r=0;r0&&this.processObjects(r);for(let i=0;i0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,s.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const a=i.extensions[this.name].lights;a.push(s),n.extensions=n.extensions||{},n.extensions[this.name]={light:a.length-1}}}let Gu=class{constructor(t){this.writer=t,this.name="KHR_materials_unlit"}writeMaterial(t,e){if(!t.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;e.extensions=e.extensions||{},e.extensions[this.name]={},n[this.name]=!0,e.pbrMetallicRoughness.metallicFactor=0,e.pbrMetallicRoughness.roughnessFactor=.9}},$u=class{constructor(t){this.writer=t,this.name="KHR_materials_clearcoat"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.clearcoat===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=t.clearcoat,t.clearcoatMap){const o={index:n.processTexture(t.clearcoatMap),texCoord:t.clearcoatMap.channel};n.applyTextureTransform(o,t.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=t.clearcoatRoughness,t.clearcoatRoughnessMap){const o={index:n.processTexture(t.clearcoatRoughnessMap),texCoord:t.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,t.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(t.clearcoatNormalMap){const o={index:n.processTexture(t.clearcoatNormalMap),texCoord:t.clearcoatNormalMap.channel};n.applyTextureTransform(o,t.clearcoatNormalMap),i.clearcoatNormalTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},qu=class{constructor(t){this.writer=t,this.name="KHR_materials_iridescence"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.iridescence===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=t.iridescence,t.iridescenceMap){const o={index:n.processTexture(t.iridescenceMap),texCoord:t.iridescenceMap.channel};n.applyTextureTransform(o,t.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=t.iridescenceIOR,i.iridescenceThicknessMinimum=t.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=t.iridescenceThicknessRange[1],t.iridescenceThicknessMap){const o={index:n.processTexture(t.iridescenceThicknessMap),texCoord:t.iridescenceThicknessMap.channel};n.applyTextureTransform(o,t.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Yu=class{constructor(t){this.writer=t,this.name="KHR_materials_transmission"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=t.transmission,t.transmissionMap){const o={index:n.processTexture(t.transmissionMap),texCoord:t.transmissionMap.channel};n.applyTextureTransform(o,t.transmissionMap),i.transmissionTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Ku=class{constructor(t){this.writer=t,this.name="KHR_materials_volume"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=t.thickness,t.thicknessMap){const o={index:n.processTexture(t.thicknessMap),texCoord:t.thicknessMap.channel};n.applyTextureTransform(o,t.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=t.attenuationDistance,i.attenuationColor=t.attenuationColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Wu=class{constructor(t){this.writer=t,this.name="KHR_materials_ior"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.ior===1.5)return;const n=this.writer.extensionsUsed,r={};r.ior=t.ior,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}},Xu=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(Pu)&&!t.specularIntensityMap&&!t.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.specularIntensityMap){const o={index:n.processTexture(t.specularIntensityMap),texCoord:t.specularIntensityMap.channel};n.applyTextureTransform(o,t.specularIntensityMap),i.specularTexture=o}if(t.specularColorMap){const o={index:n.processTexture(t.specularColorMap),texCoord:t.specularColorMap.channel};n.applyTextureTransform(o,t.specularColorMap),i.specularColorTexture=o}i.specularFactor=t.specularIntensity,i.specularColorFactor=t.specularColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Qu=class{constructor(t){this.writer=t,this.name="KHR_materials_sheen"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.sheenRoughnessMap){const o={index:n.processTexture(t.sheenRoughnessMap),texCoord:t.sheenRoughnessMap.channel};n.applyTextureTransform(o,t.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(t.sheenColorMap){const o={index:n.processTexture(t.sheenColorMap),texCoord:t.sheenColorMap.channel};n.applyTextureTransform(o,t.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=t.sheenRoughness,i.sheenColorFactor=t.sheenColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Zu=class{constructor(t){this.writer=t,this.name="KHR_materials_anisotropy"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.anisotropy==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.anisotropyMap){const o={index:n.processTexture(t.anisotropyMap)};n.applyTextureTransform(o,t.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=t.anisotropy,i.anisotropyRotation=t.anisotropyRotation,e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Ju=class{constructor(t){this.writer=t,this.name="KHR_materials_emissive_strength"}writeMaterial(t,e){if(!t.isMeshStandardMaterial||t.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=t.emissiveIntensity,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}};var xn=Uint8Array,Ts=Uint16Array,ec=Uint32Array,tc=new xn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nc=new xn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ks=function(t,e){for(var n=new Ts(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;wt=(wt&52428)>>>2|(wt&13107)<<2,wt=(wt&61680)>>>4|(wt&3855)<<4,oc[Ne]=((wt&65280)>>>8|(wt&255)<<8)>>>1}var Wn=new xn(288);for(var Ne=0;Ne<144;++Ne)Wn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Wn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Wn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Wn[Ne]=8;var sc=new xn(32);for(var Ne=0;Ne<32;++Ne)sc[Ne]=5;var ac=new xn(0),lc=typeof TextDecoder<"u"&&new TextDecoder,uc=0;try{lc.decode(ac,{stream:!0}),uc=1}catch{}var cc=Object.defineProperty,fc=(t,e,n)=>e in t?cc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,dc=(t,e,n)=>(fc(t,e+"",n),n);const As=class extends Pt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new Et;const n=this,r=e.color!==void 0?new Fe(e.color):new Fe(8355711),i=e.textureWidth||512,o=e.textureHeight||512,s=e.clipBias||0,a=e.shader||As.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new Xo,c=new se,f=new se,p=new se,d=new xt,b=new se(0,0,-1),x=new Mt,v=new se,T=new se,I=new Mt,A=new xt,C=this.camera,P=new Za(i,o,{samples:l,type:Ja}),h=new yn({uniforms:ri.clone(a.uniforms),fragmentShader:a.fragmentShader,vertexShader:a.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=A,this.material=h,this.onBeforeRender=function(S,y,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),v.subVectors(f,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(f),d.extractRotation(g.matrixWorld),b.set(0,0,-1),b.applyMatrix4(d),b.add(p),T.subVectors(f,b),T.reflect(c).negate(),T.add(f),C.position.copy(v),C.up.set(0,1,0),C.up.applyMatrix4(d),C.up.reflect(c),C.lookAt(T),C.far=g.far,C.updateMatrixWorld(),C.projectionMatrix.copy(g.projectionMatrix),A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),A.multiply(C.projectionMatrix),A.multiply(C.matrixWorldInverse),A.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(C.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=C.projectionMatrix;I.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],I.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],I.z=-1,I.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(I)),m.elements[2]=x.x,m.elements[6]=x.y,m.elements[10]=x.z+1-s,m.elements[14]=x.w,n.visible=!1;const k=S.getRenderTarget(),E=S.xr.enabled,O=S.shadowMap.autoUpdate,F=S.toneMapping;let D=!1;"outputColorSpace"in S?D=S.outputColorSpace==="srgb":D=S.outputEncoding===3001,S.xr.enabled=!1,S.shadowMap.autoUpdate=!1,"outputColorSpace"in S?S.outputColorSpace="srgb-linear":S.outputEncoding=3e3,S.toneMapping=el,S.setRenderTarget(P),S.state.buffers.depth.setMask(!0),S.autoClear===!1&&S.clear(),S.render(y,C),S.xr.enabled=E,S.shadowMap.autoUpdate=O,S.toneMapping=F,"outputColorSpace"in S?S.outputColorSpace=D?"srgb":"srgb-linear":S.outputEncoding=D?3001:3e3,S.setRenderTarget(k);const B=g.viewport;B!==void 0&&S.state.viewport(B),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let zr=As;dc(zr,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + `})),Ft.uniforms.blitTexture.value=t,Ft.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,Ft.needsUpdate=!0,En||(En=new Pt(lr,Ft),En.frustrumCulled=!1);const r=new Et,i=new Pr;i.add(En),n||(n=An=new il({antialias:!1})),n.setSize(Math.min(t.image.width,e),Math.min(t.image.height,e)),n.clear(),n.render(i,r);const o=new Fn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,An&&(An.dispose(),An=null),o}const ji={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class bs{constructor(){this.pluginCallbacks=[],this.register(function(e){return new $u(e)}),this.register(function(e){return new qu(e)}),this.register(function(e){return new Wu(e)}),this.register(function(e){return new Xu(e)}),this.register(function(e){return new Zu(e)}),this.register(function(e){return new Qu(e)}),this.register(function(e){return new Yu(e)}),this.register(function(e){return new Ku(e)}),this.register(function(e){return new Ju(e)}),this.register(function(e){return new ec(e)}),this.register(function(e){return new tc(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){const o=new Gu,s=[];for(let a=0,l=this.pluginCallbacks.length;at.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-e)<.001)return t.times.length-1;r[r.length-1]=e,r.set(t.times,0),i.set(t.values,0),i.set(o.evaluate(e),t.values.length),s=r.length-1}else for(let a=0;ae){r.set(t.times.slice(0,a+1),0),r[a+1]=e,r.set(t.times.slice(a+1),a+2),i.set(t.values.slice(0,(a+1)*n),0),i.set(o.evaluate(e),(a+1)*n),i.set(t.values.slice((a+1)*n),(a+2)*n),s=a+1;break}}return t.times=r,t.values=i,s},mergeMorphTargetTracks:function(t,e){const n=[],r={},i=t.tracks;for(let o=0;o4?s=t.array[i*t.itemSize+o]:(o===0?s=t.getX(i):o===1?s=t.getY(i):o===2?s=t.getZ(i):o===3&&(s=t.getW(i)),t.normalized===!0&&(s=Dt.normalize(s,t.array))),r.min[o]=Math.min(r.min[o],s),r.max[o]=Math.max(r.max[o],s)}return r}function ws(t){return Math.ceil(t/4)*4}function fr(t,e=0){const n=ws(t.byteLength);if(n!==t.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(t)),e!==0)for(let i=t.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function qi(t,e){if(t.toBlob!==void 0)return new Promise(r=>t.toBlob(r,e));let n;return e==="image/jpeg"?n=.92:e==="image/webp"&&(n=.8),t.convertToBlob({type:e,quality:n})}class Gu{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,n,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,o=i.buffers,s=i.json;r=i.options;const a=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(a),f=Object.keys(l);c.length>0&&(s.extensionsUsed=c),f.length>0&&(s.extensionsRequired=f),s.buffers&&s.buffers.length>0&&(s.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=fr(p),b=new DataView(new ArrayBuffer(Gi));b.setUint32(0,d.byteLength,!0),b.setUint32(4,Uu,!0);const x=fr(ju(JSON.stringify(s)),32),v=new DataView(new ArrayBuffer(Gi));v.setUint32(0,x.byteLength,!0),v.setUint32(4,Bu,!0);const T=new ArrayBuffer(Hi),I=new DataView(T);I.setUint32(0,zu,!0),I.setUint32(4,Fu,!0);const A=Hi+v.byteLength+x.byteLength+b.byteLength+d.byteLength;I.setUint32(8,A,!0),new Blob([T,v,x,b,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):s.buffers&&s.buffers.length>0?Ui(u).then(p=>{s.buffers[0].uri=p,n(s)}):n(s)}serializeUserData(e,n){if(Object.keys(e.userData).length===0)return;const r=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&o.gltfExtensions){n.extensions===void 0&&(n.extensions={});for(const s in o.gltfExtensions)n.extensions[s]=o.gltfExtensions[s],i[s]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(n.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(e,n=!1){if(this.uids.has(e)===!1){const r=new Map;r.set(!0,this.uid++),r.set(!1,this.uid++),this.uids.set(e,r)}return this.uids.get(e).get(n)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const n=new se;for(let r=0,i=e.count;r5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const n=this.cache;if(n.attributesNormalized.has(e))return n.attributesNormalized.get(e);const r=e.clone(),i=new se;for(let o=0,s=r.count;o4?b=e.array[p*e.itemSize+d]:(d===0?b=e.getX(p):d===1?b=e.getY(p):d===2?b=e.getZ(p):d===3&&(b=e.getW(p)),e.normalized===!0&&(b=Dt.normalize(b,e.array))),n===me.FLOAT?u.setFloat32(c,b,!0):n===me.INT?u.setInt32(c,b,!0):n===me.UNSIGNED_INT?u.setUint32(c,b,!0):n===me.SHORT?u.setInt16(c,b,!0):n===me.UNSIGNED_SHORT?u.setUint16(c,b,!0):n===me.BYTE?u.setInt8(c,b):n===me.UNSIGNED_BYTE&&u.setUint8(c,b),c+=a}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===me.ARRAY_BUFFER&&(f.byteStride=e.itemSize*a),this.byteOffset+=l,s.bufferViews.push(f),{id:s.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const n=this,r=n.json;return r.bufferViews||(r.bufferViews=[]),e.arrayBuffer().then(i=>{const o=fr(i),s={buffer:n.processBuffer(o),byteOffset:n.byteOffset,byteLength:o.byteLength};return n.byteOffset+=o.byteLength,r.bufferViews.push(s)-1})}processAccessor(e,n,r,i){const o=this.json,s={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let a;if(e.array.constructor===Float32Array)a=me.FLOAT;else if(e.array.constructor===Int32Array)a=me.INT;else if(e.array.constructor===Uint32Array)a=me.UNSIGNED_INT;else if(e.array.constructor===Int16Array)a=me.SHORT;else if(e.array.constructor===Uint16Array)a=me.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)a=me.BYTE;else if(e.array.constructor===Uint8Array)a=me.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),i===void 0&&(i=e.count),i===0)return null;const l=Hu(e,r,i);let u;n!==void 0&&(u=e===n.index?me.ELEMENT_ARRAY_BUFFER:me.ARRAY_BUFFER);const c=this.processBufferView(e,a,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:a,count:i,max:l.max,min:l.min,type:s[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-1}processImage(e,n,r,i="image/png"){if(e!==null){const o=this,s=o.cache,a=o.json,l=o.options,u=o.pending;s.images.has(e)||s.images.set(e,{});const c=s.images.get(e),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];a.images||(a.images=[]);const p={mimeType:i},d=$i();d.width=Math.min(e.width,l.maxTextureSize),d.height=Math.min(e.height,l.maxTextureSize);const b=d.getContext("2d");if(r===!0&&(b.translate(0,d.height),b.scale(1,-1)),e.data!==void 0){n!==Lr&&console.error("GLTFExporter: Only RGBAFormat is supported.",n),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const v=new Uint8ClampedArray(e.height*e.width*4);for(let T=0;To.processBufferViewImage(v)).then(v=>{p.bufferView=v})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(qi(d,i).then(Ui).then(v=>{p.uri=v}));const x=a.images.push(p)-1;return c[f]=x,x}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const n=this.json;n.samplers||(n.samplers=[]);const r={magFilter:Je[e.magFilter],minFilter:Je[e.minFilter],wrapS:Je[e.wrapS],wrapT:Je[e.wrapT]};return n.samplers.push(r)-1}processTexture(e){const n=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof er&&(e=ur(e,n.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");const s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(s.name=e.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(e,s)});const a=i.textures.push(s)-1;return r.textures.set(e,a),a}processMaterial(e){const n=this.cache,r=this.json;if(n.materials.has(e))return n.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=e.color.toArray().concat([e.opacity]);if(un(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const a=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),l={index:this.processTexture(a),channel:a.channel};this.applyTextureTransform(l,a),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const a={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(a,e.map),i.pbrMetallicRoughness.baseColorTexture=a}if(e.emissive){const a=e.emissive;if(Math.max(a.r,a.g,a.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap){const a={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(a.scale=e.normalScale.x),this.applyTextureTransform(a,e.normalMap),i.normalTexture=a}if(e.aoMap){const a={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(a.strength=e.aoMapIntensity),this.applyTextureTransform(a,e.aoMap),i.occlusionTexture=a}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Yn&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(a){a.writeMaterial&&a.writeMaterial(e,i)});const s=r.materials.push(i)-1;return n.materials.set(e,s),s}processMesh(e){const n=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let A=0,C=e.material.length;A=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=s.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),s.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let b=null;for(let A in s.attributes){if(A.slice(0,5)==="morph")continue;const C=s.attributes[A];if(A=p[A]||A.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(A)||(A="_"+A),n.attributes.has(this.getUID(C))){u[A]=n.attributes.get(this.getUID(C));continue}b=null;const P=C.array;A==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),b=new Nt(new Uint16Array(P),C.itemSize,C.normalized));const h=this.processAccessor(b||C,s);h!==null&&(A.startsWith("_")||this.detectMeshQuantization(A,C),u[A]=h,n.attributes.set(this.getUID(C),h))}if(d!==void 0&&s.setAttribute("normal",d),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const A=[],C=[],P={};if(e.morphTargetDictionary!==void 0)for(const h in e.morphTargetDictionary)P[e.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=C)}const x=Array.isArray(e.material);if(x&&s.groups.length===0)return null;const v=x?e.material:[e.material],T=x?s.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let A=0,C=T.length;A0&&(P.targets=f),s.index!==null){let S=this.getUID(s.index);(T[A].start!==void 0||T[A].count!==void 0)&&(S+=":"+T[A].start+":"+T[A].count),n.attributes.has(S)?P.indices=n.attributes.get(S):(P.indices=this.processAccessor(s.index,s,T[A].start,T[A].count),n.attributes.set(S,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(v[T[A].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(A){A.writeMesh&&A.writeMesh(e,l)});const I=r.meshes.push(l)-1;return n.meshes.set(o,I),I}detectMeshQuantization(e,n){if(this.extensionsUsed[cr])return;let r;switch(n.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}n.normalized&&(r+=" normalized");const i=e.split("_",1)[0];ji[i]&&ji[i].includes(r)&&(this.extensionsUsed[cr]=!0,this.extensionsRequired[cr]=!0)}processCamera(e){const n=this.json;n.cameras||(n.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Dt.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),n.cameras.push(i)-1}processAnimation(e,n){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]),e=bs.Utils.mergeMorphTargetTracks(e.clone(),n);const o=e.tracks,s=[],a=[];for(let l=0;l0){const a=[];for(let l=0,u=e.children.length;l0&&(o.children=a)}this._invokeAll(function(a){a.writeNode&&a.writeNode(e,o)});const s=n.nodes.push(o)-1;return i.set(e,s),s}processScene(e){const n=this.json,r=this.options;n.scenes||(n.scenes=[],n.scene=0);const i={};e.name!==""&&(i.name=e.name),n.scenes.push(i);const o=[];for(let s=0,a=e.children.length;s0&&(i.nodes=o),this.serializeUserData(e,i)}processObjects(e){const n=new Pr;n.name="AuxScene";for(let r=0;r0&&this.processObjects(r);for(let i=0;i0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,s.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const a=i.extensions[this.name].lights;a.push(s),n.extensions=n.extensions||{},n.extensions[this.name]={light:a.length-1}}}let qu=class{constructor(t){this.writer=t,this.name="KHR_materials_unlit"}writeMaterial(t,e){if(!t.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;e.extensions=e.extensions||{},e.extensions[this.name]={},n[this.name]=!0,e.pbrMetallicRoughness.metallicFactor=0,e.pbrMetallicRoughness.roughnessFactor=.9}},Yu=class{constructor(t){this.writer=t,this.name="KHR_materials_clearcoat"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.clearcoat===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=t.clearcoat,t.clearcoatMap){const o={index:n.processTexture(t.clearcoatMap),texCoord:t.clearcoatMap.channel};n.applyTextureTransform(o,t.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=t.clearcoatRoughness,t.clearcoatRoughnessMap){const o={index:n.processTexture(t.clearcoatRoughnessMap),texCoord:t.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,t.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(t.clearcoatNormalMap){const o={index:n.processTexture(t.clearcoatNormalMap),texCoord:t.clearcoatNormalMap.channel};n.applyTextureTransform(o,t.clearcoatNormalMap),i.clearcoatNormalTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Ku=class{constructor(t){this.writer=t,this.name="KHR_materials_iridescence"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.iridescence===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=t.iridescence,t.iridescenceMap){const o={index:n.processTexture(t.iridescenceMap),texCoord:t.iridescenceMap.channel};n.applyTextureTransform(o,t.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=t.iridescenceIOR,i.iridescenceThicknessMinimum=t.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=t.iridescenceThicknessRange[1],t.iridescenceThicknessMap){const o={index:n.processTexture(t.iridescenceThicknessMap),texCoord:t.iridescenceThicknessMap.channel};n.applyTextureTransform(o,t.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Wu=class{constructor(t){this.writer=t,this.name="KHR_materials_transmission"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=t.transmission,t.transmissionMap){const o={index:n.processTexture(t.transmissionMap),texCoord:t.transmissionMap.channel};n.applyTextureTransform(o,t.transmissionMap),i.transmissionTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Xu=class{constructor(t){this.writer=t,this.name="KHR_materials_volume"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=t.thickness,t.thicknessMap){const o={index:n.processTexture(t.thicknessMap),texCoord:t.thicknessMap.channel};n.applyTextureTransform(o,t.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=t.attenuationDistance,i.attenuationColor=t.attenuationColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Zu=class{constructor(t){this.writer=t,this.name="KHR_materials_ior"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.ior===1.5)return;const n=this.writer.extensionsUsed,r={};r.ior=t.ior,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}},Qu=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(Ou)&&!t.specularIntensityMap&&!t.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.specularIntensityMap){const o={index:n.processTexture(t.specularIntensityMap),texCoord:t.specularIntensityMap.channel};n.applyTextureTransform(o,t.specularIntensityMap),i.specularTexture=o}if(t.specularColorMap){const o={index:n.processTexture(t.specularColorMap),texCoord:t.specularColorMap.channel};n.applyTextureTransform(o,t.specularColorMap),i.specularColorTexture=o}i.specularFactor=t.specularIntensity,i.specularColorFactor=t.specularColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Ju=class{constructor(t){this.writer=t,this.name="KHR_materials_sheen"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.sheenRoughnessMap){const o={index:n.processTexture(t.sheenRoughnessMap),texCoord:t.sheenRoughnessMap.channel};n.applyTextureTransform(o,t.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(t.sheenColorMap){const o={index:n.processTexture(t.sheenColorMap),texCoord:t.sheenColorMap.channel};n.applyTextureTransform(o,t.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=t.sheenRoughness,i.sheenColorFactor=t.sheenColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},ec=class{constructor(t){this.writer=t,this.name="KHR_materials_anisotropy"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.anisotropy==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.anisotropyMap){const o={index:n.processTexture(t.anisotropyMap)};n.applyTextureTransform(o,t.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=t.anisotropy,i.anisotropyRotation=t.anisotropyRotation,e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},tc=class{constructor(t){this.writer=t,this.name="KHR_materials_emissive_strength"}writeMaterial(t,e){if(!t.isMeshStandardMaterial||t.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=t.emissiveIntensity,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}};var xn=Uint8Array,Ts=Uint16Array,nc=Uint32Array,rc=new xn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ic=new xn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ks=function(t,e){for(var n=new Ts(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;wt=(wt&52428)>>>2|(wt&13107)<<2,wt=(wt&61680)>>>4|(wt&3855)<<4,ac[Ne]=((wt&65280)>>>8|(wt&255)<<8)>>>1}var Wn=new xn(288);for(var Ne=0;Ne<144;++Ne)Wn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Wn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Wn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Wn[Ne]=8;var lc=new xn(32);for(var Ne=0;Ne<32;++Ne)lc[Ne]=5;var uc=new xn(0),cc=typeof TextDecoder<"u"&&new TextDecoder,fc=0;try{cc.decode(uc,{stream:!0}),fc=1}catch{}var dc=Object.defineProperty,pc=(t,e,n)=>e in t?dc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,hc=(t,e,n)=>(pc(t,e+"",n),n);const As=class extends Pt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new Et;const n=this,r=e.color!==void 0?new Fe(e.color):new Fe(8355711),i=e.textureWidth||512,o=e.textureHeight||512,s=e.clipBias||0,a=e.shader||As.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new Xo,c=new se,f=new se,p=new se,d=new xt,b=new se(0,0,-1),x=new Mt,v=new se,T=new se,I=new Mt,A=new xt,C=this.camera,P=new Qa(i,o,{samples:l,type:Ja}),h=new yn({uniforms:ri.clone(a.uniforms),fragmentShader:a.fragmentShader,vertexShader:a.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=A,this.material=h,this.onBeforeRender=function(S,y,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),v.subVectors(f,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(f),d.extractRotation(g.matrixWorld),b.set(0,0,-1),b.applyMatrix4(d),b.add(p),T.subVectors(f,b),T.reflect(c).negate(),T.add(f),C.position.copy(v),C.up.set(0,1,0),C.up.applyMatrix4(d),C.up.reflect(c),C.lookAt(T),C.far=g.far,C.updateMatrixWorld(),C.projectionMatrix.copy(g.projectionMatrix),A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),A.multiply(C.projectionMatrix),A.multiply(C.matrixWorldInverse),A.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(C.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=C.projectionMatrix;I.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],I.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],I.z=-1,I.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(I)),m.elements[2]=x.x,m.elements[6]=x.y,m.elements[10]=x.z+1-s,m.elements[14]=x.w,n.visible=!1;const k=S.getRenderTarget(),E=S.xr.enabled,O=S.shadowMap.autoUpdate,F=S.toneMapping;let D=!1;"outputColorSpace"in S?D=S.outputColorSpace==="srgb":D=S.outputEncoding===3001,S.xr.enabled=!1,S.shadowMap.autoUpdate=!1,"outputColorSpace"in S?S.outputColorSpace="srgb-linear":S.outputEncoding=3e3,S.toneMapping=el,S.setRenderTarget(P),S.state.buffers.depth.setMask(!0),S.autoClear===!1&&S.clear(),S.render(y,C),S.xr.enabled=E,S.shadowMap.autoUpdate=O,S.toneMapping=F,"outputColorSpace"in S?S.outputColorSpace=D?"srgb":"srgb-linear":S.outputEncoding=D?3001:3e3,S.setRenderTarget(k);const B=g.viewport;B!==void 0&&S.state.viewport(B),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let zr=As;hc(zr,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` uniform mat4 textureMatrix; varying vec4 vUv; @@ -117,7 +117,7 @@ var Ta=Object.defineProperty;var ka=(t,e,n)=>e in t?Ta(t,e,{enumerable:!0,config #include #include <${fi>=154?"colorspace_fragment":"encodings_fragment"}> - }`});var pc=Object.defineProperty,hc=(t,e,n)=>e in t?pc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Es=(t,e,n)=>(hc(t,typeof e!="symbol"?e+"":e,n),n);const Xn=new Qo,mc=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),Ms=new Zo(mc,5);Xn.setIndex([0,1,2,0,2,3]);Xn.setAttribute("position",new ni(Ms,3,0,!1));Xn.setAttribute("uv",new ni(Ms,2,3,!1));const Fr=class extends Pt{constructor(){super(Fr.Geometry,new Vt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new se,e=new se,n=new Ri(new Uint8Array(16*16*3),16,16,Lr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Ht,n.wrapT=Ht;const r=new Ri(new Uint8Array(16*16*3),16,16,Lr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Ht,r.wrapT=Ht;const i=Fr.Geometry,o=new tr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + }`});var mc=Object.defineProperty,gc=(t,e,n)=>e in t?mc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Es=(t,e,n)=>(gc(t,typeof e!="symbol"?e+"":e,n),n);const Xn=new Zo,yc=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),Ms=new Qo(yc,5);Xn.setIndex([0,1,2,0,2,3]);Xn.setAttribute("position",new ni(Ms,3,0,!1));Xn.setAttribute("uv",new ni(Ms,2,3,!1));const Fr=class extends Pt{constructor(){super(Fr.Geometry,new Vt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new se,e=new se,n=new Ri(new Uint8Array(16*16*3),16,16,Lr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Ht,n.wrapT=Ht;const r=new Ri(new Uint8Array(16*16*3),16,16,Lr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Ht,r.wrapT=Ht;const i=Fr.Geometry,o=new tr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` precision highp float; @@ -168,7 +168,7 @@ var Ta=Object.defineProperty;var ka=(t,e,n)=>e in t?Ta(t,e,{enumerable:!0,config gl_FragColor = texture2D( map, vUV ); - }`,depthTest:!1,depthWrite:!1,transparent:!1}),a=new Pt(i,o),l=[],u=Ss.Shader,c=new tr({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new Fe(16777215)},scale:{value:new Pe},screenPosition:{value:new se}},vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,blending:tl,transparent:!0,depthWrite:!1}),f=new Pt(i,c);this.addElement=function(v){l.push(v)};const p=new Pe,d=new Pe,b=new nl,x=new Mt;this.onBeforeRender=function(v,T,I){v.getCurrentViewport(x);const A=x.w/x.z,C=x.z/2,P=x.w/2;let h=16/x.w;if(p.set(h*A,h),b.min.set(x.x,x.y),b.max.set(x.x+(x.z-16),x.y+(x.w-16)),e.setFromMatrixPosition(this.matrixWorld),e.applyMatrix4(I.matrixWorldInverse),!(e.z>0)&&(t.copy(e).applyMatrix4(I.projectionMatrix),d.x=x.x+t.x*C+C-8,d.y=x.y+t.y*P+P-8,b.containsPoint(d))){v.copyFramebufferToTexture(d,n);let S=o.uniforms;S.scale.value=p,S.screenPosition.value=t,v.renderBufferDirect(I,null,i,o,a,null),v.copyFramebufferToTexture(d,r),S=s.uniforms,S.scale.value=p,S.screenPosition.value=t,v.renderBufferDirect(I,null,i,s,a,null);const y=-t.x*2,g=-t.y*2;for(let m=0,k=l.length;m0)&&(t.copy(e).applyMatrix4(I.projectionMatrix),d.x=x.x+t.x*C+C-8,d.y=x.y+t.y*P+P-8,b.containsPoint(d))){v.copyFramebufferToTexture(d,n);let S=o.uniforms;S.scale.value=p,S.screenPosition.value=t,v.renderBufferDirect(I,null,i,o,a,null),v.copyFramebufferToTexture(d,r),S=s.uniforms,S.scale.value=p,S.screenPosition.value=t,v.renderBufferDirect(I,null,i,s,a,null);const y=-t.x*2,g=-t.y*2;for(let m=0,k=l.length;me in t?Ta(t,e,{enumerable:!0,config gl_FragColor = texture; gl_FragColor.rgb *= color; - }`});var yc=Object.defineProperty,xc=(t,e,n)=>e in t?yc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Is=(t,e,n)=>(xc(t,typeof e!="symbol"?e+"":e,n),n);const Pn={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new se},up:{value:new se(0,1,0)}},vertexShader:` + }`});var vc=Object.defineProperty,bc=(t,e,n)=>e in t?vc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Is=(t,e,n)=>(bc(t,typeof e!="symbol"?e+"":e,n),n);const Pn={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new se},up:{value:new se(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -379,8 +379,8 @@ var Ta=Object.defineProperty;var ka=(t,e,n)=>e in t?Ta(t,e,{enumerable:!0,config #include <${fi>=154?"colorspace_fragment":"encodings_fragment"}> } - `},Rs=new yn({name:"SkyShader",fragmentShader:Pn.fragmentShader,vertexShader:Pn.vertexShader,uniforms:ri.clone(Pn.uniforms),side:ja,depthWrite:!1});class Cs extends Pt{constructor(){super(new Qa(1,1,1),Rs)}}Is(Cs,"SkyShader",Pn);Is(Cs,"material",Rs);new Va;new se;new Jo(0,0,0,"YXZ");new se;var vc=Object.defineProperty,bc=(t,e,n)=>e in t?vc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,re=(t,e,n)=>(bc(t,typeof e!="symbol"?e+"":e,n),n);const Mn=new Ua,Yi=new Xo,wc=Math.cos(70*(Math.PI/180)),Ki=(t,e)=>(t%e+e)%e;class Tc extends Ba{constructor(e,n){super(),re(this,"object"),re(this,"domElement"),re(this,"enabled",!0),re(this,"target",new se),re(this,"minDistance",0),re(this,"maxDistance",1/0),re(this,"minZoom",0),re(this,"maxZoom",1/0),re(this,"minPolarAngle",0),re(this,"maxPolarAngle",Math.PI),re(this,"minAzimuthAngle",-1/0),re(this,"maxAzimuthAngle",1/0),re(this,"enableDamping",!1),re(this,"dampingFactor",.05),re(this,"enableZoom",!0),re(this,"zoomSpeed",1),re(this,"enableRotate",!0),re(this,"rotateSpeed",1),re(this,"enablePan",!0),re(this,"panSpeed",1),re(this,"screenSpacePanning",!0),re(this,"keyPanSpeed",7),re(this,"zoomToCursor",!1),re(this,"autoRotate",!1),re(this,"autoRotateSpeed",2),re(this,"reverseOrbit",!1),re(this,"reverseHorizontalOrbit",!1),re(this,"reverseVerticalOrbit",!1),re(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),re(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),re(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),re(this,"target0"),re(this,"position0"),re(this,"zoom0"),re(this,"_domElementKeyEvents",null),re(this,"getPolarAngle"),re(this,"getAzimuthalAngle"),re(this,"setPolarAngle"),re(this,"setAzimuthalAngle"),re(this,"getDistance"),re(this,"getZoomScale"),re(this,"listenToKeyEvents"),re(this,"stopListenToKeyEvents"),re(this,"saveState"),re(this,"reset"),re(this,"update"),re(this,"connect"),re(this,"dispose"),re(this,"dollyIn"),re(this,"dollyOut"),re(this,"getScale"),re(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=L=>{let q=Ki(L,2*Math.PI),J=c.phi;J<0&&(J+=2*Math.PI),q<0&&(q+=2*Math.PI);let Ee=Math.abs(q-J);2*Math.PI-Ee{let q=Ki(L,2*Math.PI),J=c.theta;J<0&&(J+=2*Math.PI),q<0&&(q+=2*Math.PI);let Ee=Math.abs(q-J);2*Math.PI-Eer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",oe),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",oe),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=a.NONE},this.update=(()=>{const L=new se,q=new se(0,1,0),J=new zn().setFromUnitVectors(e.up,q),Ee=J.clone().invert(),Qe=new se,st=new zn,Tn=2*Math.PI;return function(){const Ei=r.object.position;J.setFromUnitVectors(e.up,q),Ee.copy(J).invert(),L.copy(Ei).sub(r.target),L.applyQuaternion(J),c.setFromVector3(L),r.autoRotate&&l===a.NONE&&F(E()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let ht=r.minAzimuthAngle,mt=r.maxAzimuthAngle;isFinite(ht)&&isFinite(mt)&&(ht<-Math.PI?ht+=Tn:ht>Math.PI&&(ht-=Tn),mt<-Math.PI?mt+=Tn:mt>Math.PI&&(mt-=Tn),ht<=mt?c.theta=Math.max(ht,Math.min(mt,c.theta)):c.theta=c.theta>(ht+mt)/2?Math.max(ht,c.theta):Math.min(mt,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&g||r.object.isOrthographicCamera?c.radius=R(c.radius):c.radius=R(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Ee),Ei.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let tn=!1;if(r.zoomToCursor&&g){let nn=null;if(r.object instanceof Et&&r.object.isPerspectiveCamera){const rn=L.length();nn=R(rn*p);const kn=rn-nn;r.object.position.addScaledVector(S,kn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new se(y.x,y.y,0);rn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),tn=!0;const kn=new se(y.x,y.y,0);kn.unproject(r.object),r.object.position.sub(kn).add(rn),r.object.updateMatrixWorld(),nn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;nn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(nn).add(r.object.position):(Mn.origin.copy(r.object.position),Mn.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Mn.direction))u||8*(1-st.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Qe.copy(r.object.position),st.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",He),r.domElement.addEventListener("pointerdown",Me),r.domElement.addEventListener("pointercancel",tt),r.domElement.addEventListener("wheel",K)},this.dispose=()=>{var L,q,J,Ee,Qe,st;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",He),(q=r.domElement)==null||q.removeEventListener("pointerdown",Me),(J=r.domElement)==null||J.removeEventListener("pointercancel",tt),(Ee=r.domElement)==null||Ee.removeEventListener("wheel",K),(Qe=r.domElement)==null||Qe.ownerDocument.removeEventListener("pointermove",Ve),(st=r.domElement)==null||st.ownerDocument.removeEventListener("pointerup",tt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",oe)};const r=this,i={type:"change"},o={type:"start"},s={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,c=new Ii,f=new Ii;let p=1;const d=new se,b=new Pe,x=new Pe,v=new Pe,T=new Pe,I=new Pe,A=new Pe,C=new Pe,P=new Pe,h=new Pe,S=new se,y=new Pe;let g=!1;const m=[],k={};function E(){return 2*Math.PI/60/60*r.autoRotateSpeed}function O(){return Math.pow(.95,r.zoomSpeed)}function F(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function D(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const B=(()=>{const L=new se;return function(q,J){L.setFromMatrixColumn(J,0),L.multiplyScalar(-q),d.add(L)}})(),X=(()=>{const L=new se;return function(q,J){r.screenSpacePanning===!0?L.setFromMatrixColumn(J,1):(L.setFromMatrixColumn(J,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(q),d.add(L)}})(),Z=(()=>{const L=new se;return function(q,J){const Ee=r.domElement;if(Ee&&r.object instanceof Et&&r.object.isPerspectiveCamera){const Qe=r.object.position;L.copy(Qe).sub(r.target);let st=L.length();st*=Math.tan(r.object.fov/2*Math.PI/180),B(2*q*st/Ee.clientHeight,r.object.matrix),X(2*J*st/Ee.clientHeight,r.object.matrix)}else Ee&&r.object instanceof Gt&&r.object.isOrthographicCamera?(B(q*(r.object.right-r.object.left)/r.object.zoom/Ee.clientWidth,r.object.matrix),X(J*(r.object.top-r.object.bottom)/r.object.zoom/Ee.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function Q(L){r.object instanceof Et&&r.object.isPerspectiveCamera||r.object instanceof Gt&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _(L){Q(p/L)}function te(L){Q(p*L)}function ce(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const q=r.domElement.getBoundingClientRect(),J=L.clientX-q.left,Ee=L.clientY-q.top,Qe=q.width,st=q.height;y.x=J/Qe*2-1,y.y=-(Ee/st)*2+1,S.set(y.x,y.y,1).unproject(r.object).sub(r.object.position).normalize()}function R(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function pe(L){b.set(L.clientX,L.clientY)}function ye(L){ce(L),C.set(L.clientX,L.clientY)}function xe(L){T.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),v.subVectors(x,b).multiplyScalar(r.rotateSpeed);const q=r.domElement;q&&(F(2*Math.PI*v.x/q.clientHeight),D(2*Math.PI*v.y/q.clientHeight)),b.copy(x),r.update()}function G(L){P.set(L.clientX,L.clientY),h.subVectors(P,C),h.y>0?_(O()):h.y<0&&te(O()),C.copy(P),r.update()}function w(L){I.set(L.clientX,L.clientY),A.subVectors(I,T).multiplyScalar(r.panSpeed),Z(A.x,A.y),T.copy(I),r.update()}function M(L){ce(L),L.deltaY<0?te(O()):L.deltaY>0&&_(O()),r.update()}function N(L){let q=!1;switch(L.code){case r.keys.UP:Z(0,r.keyPanSpeed),q=!0;break;case r.keys.BOTTOM:Z(0,-r.keyPanSpeed),q=!0;break;case r.keys.LEFT:Z(r.keyPanSpeed,0),q=!0;break;case r.keys.RIGHT:Z(-r.keyPanSpeed,0),q=!0;break}q&&(L.preventDefault(),r.update())}function V(){if(m.length==1)b.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),q=.5*(m[0].pageY+m[1].pageY);b.set(L,q)}}function U(){if(m.length==1)T.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),q=.5*(m[0].pageY+m[1].pageY);T.set(L,q)}}function Y(){const L=m[0].pageX-m[1].pageX,q=m[0].pageY-m[1].pageY,J=Math.sqrt(L*L+q*q);C.set(0,J)}function ne(){r.enableZoom&&Y(),r.enablePan&&U()}function ve(){r.enableZoom&&Y(),r.enableRotate&&V()}function _e(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const J=pt(L),Ee=.5*(L.pageX+J.x),Qe=.5*(L.pageY+J.y);x.set(Ee,Qe)}v.subVectors(x,b).multiplyScalar(r.rotateSpeed);const q=r.domElement;q&&(F(2*Math.PI*v.x/q.clientHeight),D(2*Math.PI*v.y/q.clientHeight)),b.copy(x)}function de(L){if(m.length==1)I.set(L.pageX,L.pageY);else{const q=pt(L),J=.5*(L.pageX+q.x),Ee=.5*(L.pageY+q.y);I.set(J,Ee)}A.subVectors(I,T).multiplyScalar(r.panSpeed),Z(A.x,A.y),T.copy(I)}function be(L){const q=pt(L),J=L.pageX-q.x,Ee=L.pageY-q.y,Qe=Math.sqrt(J*J+Ee*Ee);P.set(0,Qe),h.set(0,Math.pow(P.y/C.y,r.zoomSpeed)),_(h.y),C.copy(P)}function Ie(L){r.enableZoom&&be(L),r.enablePan&&de(L)}function Te(L){r.enableZoom&&be(L),r.enableRotate&&_e(L)}function Me(L){var q,J;r.enabled!==!1&&(m.length===0&&((q=r.domElement)==null||q.ownerDocument.addEventListener("pointermove",Ve),(J=r.domElement)==null||J.ownerDocument.addEventListener("pointerup",tt)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function Ve(L){r.enabled!==!1&&(L.pointerType==="touch"?we(L):j(L))}function tt(L){var q,J,Ee;ot(L),m.length===0&&((q=r.domElement)==null||q.releasePointerCapture(L.pointerId),(J=r.domElement)==null||J.ownerDocument.removeEventListener("pointermove",Ve),(Ee=r.domElement)==null||Ee.ownerDocument.removeEventListener("pointerup",tt)),r.dispatchEvent(s),l=a.NONE}function en(L){let q;switch(L.button){case 0:q=r.mouseButtons.LEFT;break;case 1:q=r.mouseButtons.MIDDLE;break;case 2:q=r.mouseButtons.RIGHT;break;default:q=-1}switch(q){case yt.DOLLY:if(r.enableZoom===!1)return;ye(L),l=a.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;xe(L),l=a.PAN}else{if(r.enableRotate===!1)return;pe(L),l=a.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;pe(L),l=a.ROTATE}else{if(r.enablePan===!1)return;xe(L),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(o)}function j(L){if(r.enabled!==!1)switch(l){case a.ROTATE:if(r.enableRotate===!1)return;Oe(L);break;case a.DOLLY:if(r.enableZoom===!1)return;G(L);break;case a.PAN:if(r.enablePan===!1)return;w(L);break}}function K(L){r.enabled===!1||r.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(L.preventDefault(),r.dispatchEvent(o),M(L),r.dispatchEvent(s))}function oe(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(bt(L),m.length){case 1:switch(r.touches.ONE){case _t.ROTATE:if(r.enableRotate===!1)return;V(),l=a.TOUCH_ROTATE;break;case _t.PAN:if(r.enablePan===!1)return;U(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(r.touches.TWO){case _t.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ne(),l=a.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ve(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(o)}function we(L){switch(bt(L),l){case a.TOUCH_ROTATE:if(r.enableRotate===!1)return;_e(L),r.update();break;case a.TOUCH_PAN:if(r.enablePan===!1)return;de(L),r.update();break;case a.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case a.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Te(L),r.update();break;default:l=a.NONE}}function He(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function ot(L){delete k[L.pointerId];for(let q=0;q{te(L),r.update()},this.dollyOut=(L=O())=>{_(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Q(L),r.update()},this.getZoomScale=()=>O(),n!==void 0&&this.connect(n),this.update()}}new xt;new se;new Jo;new se;var kc=Object.defineProperty,_c=(t,e,n)=>e in t?kc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,di=(t,e,n)=>(_c(t,typeof e!="symbol"?e+"":e,n),n);class Ns{constructor(e){di(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},s=Ac(e,n,this.data,o);for(let a=0,l=s.length;a + `},Rs=new yn({name:"SkyShader",fragmentShader:Pn.fragmentShader,vertexShader:Pn.vertexShader,uniforms:ri.clone(Pn.uniforms),side:ja,depthWrite:!1});class Cs extends Pt{constructor(){super(new Za(1,1,1),Rs)}}Is(Cs,"SkyShader",Pn);Is(Cs,"material",Rs);new Va;new se;new Jo(0,0,0,"YXZ");new se;var wc=Object.defineProperty,Tc=(t,e,n)=>e in t?wc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,re=(t,e,n)=>(Tc(t,typeof e!="symbol"?e+"":e,n),n);const Mn=new Ua,Yi=new Xo,kc=Math.cos(70*(Math.PI/180)),Ki=(t,e)=>(t%e+e)%e;class _c extends Ba{constructor(e,n){super(),re(this,"object"),re(this,"domElement"),re(this,"enabled",!0),re(this,"target",new se),re(this,"minDistance",0),re(this,"maxDistance",1/0),re(this,"minZoom",0),re(this,"maxZoom",1/0),re(this,"minPolarAngle",0),re(this,"maxPolarAngle",Math.PI),re(this,"minAzimuthAngle",-1/0),re(this,"maxAzimuthAngle",1/0),re(this,"enableDamping",!1),re(this,"dampingFactor",.05),re(this,"enableZoom",!0),re(this,"zoomSpeed",1),re(this,"enableRotate",!0),re(this,"rotateSpeed",1),re(this,"enablePan",!0),re(this,"panSpeed",1),re(this,"screenSpacePanning",!0),re(this,"keyPanSpeed",7),re(this,"zoomToCursor",!1),re(this,"autoRotate",!1),re(this,"autoRotateSpeed",2),re(this,"reverseOrbit",!1),re(this,"reverseHorizontalOrbit",!1),re(this,"reverseVerticalOrbit",!1),re(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),re(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),re(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),re(this,"target0"),re(this,"position0"),re(this,"zoom0"),re(this,"_domElementKeyEvents",null),re(this,"getPolarAngle"),re(this,"getAzimuthalAngle"),re(this,"setPolarAngle"),re(this,"setAzimuthalAngle"),re(this,"getDistance"),re(this,"getZoomScale"),re(this,"listenToKeyEvents"),re(this,"stopListenToKeyEvents"),re(this,"saveState"),re(this,"reset"),re(this,"update"),re(this,"connect"),re(this,"dispose"),re(this,"dollyIn"),re(this,"dollyOut"),re(this,"getScale"),re(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=L=>{let q=Ki(L,2*Math.PI),J=c.phi;J<0&&(J+=2*Math.PI),q<0&&(q+=2*Math.PI);let Ee=Math.abs(q-J);2*Math.PI-Ee{let q=Ki(L,2*Math.PI),J=c.theta;J<0&&(J+=2*Math.PI),q<0&&(q+=2*Math.PI);let Ee=Math.abs(q-J);2*Math.PI-Eer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",oe),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",oe),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=a.NONE},this.update=(()=>{const L=new se,q=new se(0,1,0),J=new zn().setFromUnitVectors(e.up,q),Ee=J.clone().invert(),Ze=new se,st=new zn,Tn=2*Math.PI;return function(){const Ei=r.object.position;J.setFromUnitVectors(e.up,q),Ee.copy(J).invert(),L.copy(Ei).sub(r.target),L.applyQuaternion(J),c.setFromVector3(L),r.autoRotate&&l===a.NONE&&F(E()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let ht=r.minAzimuthAngle,mt=r.maxAzimuthAngle;isFinite(ht)&&isFinite(mt)&&(ht<-Math.PI?ht+=Tn:ht>Math.PI&&(ht-=Tn),mt<-Math.PI?mt+=Tn:mt>Math.PI&&(mt-=Tn),ht<=mt?c.theta=Math.max(ht,Math.min(mt,c.theta)):c.theta=c.theta>(ht+mt)/2?Math.max(ht,c.theta):Math.min(mt,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&g||r.object.isOrthographicCamera?c.radius=R(c.radius):c.radius=R(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Ee),Ei.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let tn=!1;if(r.zoomToCursor&&g){let nn=null;if(r.object instanceof Et&&r.object.isPerspectiveCamera){const rn=L.length();nn=R(rn*p);const kn=rn-nn;r.object.position.addScaledVector(S,kn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new se(y.x,y.y,0);rn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),tn=!0;const kn=new se(y.x,y.y,0);kn.unproject(r.object),r.object.position.sub(kn).add(rn),r.object.updateMatrixWorld(),nn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;nn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(nn).add(r.object.position):(Mn.origin.copy(r.object.position),Mn.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Mn.direction))u||8*(1-st.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Ze.copy(r.object.position),st.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",He),r.domElement.addEventListener("pointerdown",Me),r.domElement.addEventListener("pointercancel",tt),r.domElement.addEventListener("wheel",K)},this.dispose=()=>{var L,q,J,Ee,Ze,st;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",He),(q=r.domElement)==null||q.removeEventListener("pointerdown",Me),(J=r.domElement)==null||J.removeEventListener("pointercancel",tt),(Ee=r.domElement)==null||Ee.removeEventListener("wheel",K),(Ze=r.domElement)==null||Ze.ownerDocument.removeEventListener("pointermove",Ve),(st=r.domElement)==null||st.ownerDocument.removeEventListener("pointerup",tt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",oe)};const r=this,i={type:"change"},o={type:"start"},s={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,c=new Ii,f=new Ii;let p=1;const d=new se,b=new Pe,x=new Pe,v=new Pe,T=new Pe,I=new Pe,A=new Pe,C=new Pe,P=new Pe,h=new Pe,S=new se,y=new Pe;let g=!1;const m=[],k={};function E(){return 2*Math.PI/60/60*r.autoRotateSpeed}function O(){return Math.pow(.95,r.zoomSpeed)}function F(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function D(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const B=(()=>{const L=new se;return function(q,J){L.setFromMatrixColumn(J,0),L.multiplyScalar(-q),d.add(L)}})(),X=(()=>{const L=new se;return function(q,J){r.screenSpacePanning===!0?L.setFromMatrixColumn(J,1):(L.setFromMatrixColumn(J,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(q),d.add(L)}})(),Q=(()=>{const L=new se;return function(q,J){const Ee=r.domElement;if(Ee&&r.object instanceof Et&&r.object.isPerspectiveCamera){const Ze=r.object.position;L.copy(Ze).sub(r.target);let st=L.length();st*=Math.tan(r.object.fov/2*Math.PI/180),B(2*q*st/Ee.clientHeight,r.object.matrix),X(2*J*st/Ee.clientHeight,r.object.matrix)}else Ee&&r.object instanceof Gt&&r.object.isOrthographicCamera?(B(q*(r.object.right-r.object.left)/r.object.zoom/Ee.clientWidth,r.object.matrix),X(J*(r.object.top-r.object.bottom)/r.object.zoom/Ee.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function Z(L){r.object instanceof Et&&r.object.isPerspectiveCamera||r.object instanceof Gt&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _(L){Z(p/L)}function te(L){Z(p*L)}function ce(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const q=r.domElement.getBoundingClientRect(),J=L.clientX-q.left,Ee=L.clientY-q.top,Ze=q.width,st=q.height;y.x=J/Ze*2-1,y.y=-(Ee/st)*2+1,S.set(y.x,y.y,1).unproject(r.object).sub(r.object.position).normalize()}function R(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function pe(L){b.set(L.clientX,L.clientY)}function ye(L){ce(L),C.set(L.clientX,L.clientY)}function xe(L){T.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),v.subVectors(x,b).multiplyScalar(r.rotateSpeed);const q=r.domElement;q&&(F(2*Math.PI*v.x/q.clientHeight),D(2*Math.PI*v.y/q.clientHeight)),b.copy(x),r.update()}function G(L){P.set(L.clientX,L.clientY),h.subVectors(P,C),h.y>0?_(O()):h.y<0&&te(O()),C.copy(P),r.update()}function w(L){I.set(L.clientX,L.clientY),A.subVectors(I,T).multiplyScalar(r.panSpeed),Q(A.x,A.y),T.copy(I),r.update()}function M(L){ce(L),L.deltaY<0?te(O()):L.deltaY>0&&_(O()),r.update()}function N(L){let q=!1;switch(L.code){case r.keys.UP:Q(0,r.keyPanSpeed),q=!0;break;case r.keys.BOTTOM:Q(0,-r.keyPanSpeed),q=!0;break;case r.keys.LEFT:Q(r.keyPanSpeed,0),q=!0;break;case r.keys.RIGHT:Q(-r.keyPanSpeed,0),q=!0;break}q&&(L.preventDefault(),r.update())}function V(){if(m.length==1)b.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),q=.5*(m[0].pageY+m[1].pageY);b.set(L,q)}}function U(){if(m.length==1)T.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),q=.5*(m[0].pageY+m[1].pageY);T.set(L,q)}}function Y(){const L=m[0].pageX-m[1].pageX,q=m[0].pageY-m[1].pageY,J=Math.sqrt(L*L+q*q);C.set(0,J)}function ne(){r.enableZoom&&Y(),r.enablePan&&U()}function ve(){r.enableZoom&&Y(),r.enableRotate&&V()}function _e(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const J=pt(L),Ee=.5*(L.pageX+J.x),Ze=.5*(L.pageY+J.y);x.set(Ee,Ze)}v.subVectors(x,b).multiplyScalar(r.rotateSpeed);const q=r.domElement;q&&(F(2*Math.PI*v.x/q.clientHeight),D(2*Math.PI*v.y/q.clientHeight)),b.copy(x)}function de(L){if(m.length==1)I.set(L.pageX,L.pageY);else{const q=pt(L),J=.5*(L.pageX+q.x),Ee=.5*(L.pageY+q.y);I.set(J,Ee)}A.subVectors(I,T).multiplyScalar(r.panSpeed),Q(A.x,A.y),T.copy(I)}function be(L){const q=pt(L),J=L.pageX-q.x,Ee=L.pageY-q.y,Ze=Math.sqrt(J*J+Ee*Ee);P.set(0,Ze),h.set(0,Math.pow(P.y/C.y,r.zoomSpeed)),_(h.y),C.copy(P)}function Ie(L){r.enableZoom&&be(L),r.enablePan&&de(L)}function Te(L){r.enableZoom&&be(L),r.enableRotate&&_e(L)}function Me(L){var q,J;r.enabled!==!1&&(m.length===0&&((q=r.domElement)==null||q.ownerDocument.addEventListener("pointermove",Ve),(J=r.domElement)==null||J.ownerDocument.addEventListener("pointerup",tt)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function Ve(L){r.enabled!==!1&&(L.pointerType==="touch"?we(L):j(L))}function tt(L){var q,J,Ee;ot(L),m.length===0&&((q=r.domElement)==null||q.releasePointerCapture(L.pointerId),(J=r.domElement)==null||J.ownerDocument.removeEventListener("pointermove",Ve),(Ee=r.domElement)==null||Ee.ownerDocument.removeEventListener("pointerup",tt)),r.dispatchEvent(s),l=a.NONE}function en(L){let q;switch(L.button){case 0:q=r.mouseButtons.LEFT;break;case 1:q=r.mouseButtons.MIDDLE;break;case 2:q=r.mouseButtons.RIGHT;break;default:q=-1}switch(q){case yt.DOLLY:if(r.enableZoom===!1)return;ye(L),l=a.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;xe(L),l=a.PAN}else{if(r.enableRotate===!1)return;pe(L),l=a.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;pe(L),l=a.ROTATE}else{if(r.enablePan===!1)return;xe(L),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(o)}function j(L){if(r.enabled!==!1)switch(l){case a.ROTATE:if(r.enableRotate===!1)return;Oe(L);break;case a.DOLLY:if(r.enableZoom===!1)return;G(L);break;case a.PAN:if(r.enablePan===!1)return;w(L);break}}function K(L){r.enabled===!1||r.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(L.preventDefault(),r.dispatchEvent(o),M(L),r.dispatchEvent(s))}function oe(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(bt(L),m.length){case 1:switch(r.touches.ONE){case _t.ROTATE:if(r.enableRotate===!1)return;V(),l=a.TOUCH_ROTATE;break;case _t.PAN:if(r.enablePan===!1)return;U(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(r.touches.TWO){case _t.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ne(),l=a.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ve(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&r.dispatchEvent(o)}function we(L){switch(bt(L),l){case a.TOUCH_ROTATE:if(r.enableRotate===!1)return;_e(L),r.update();break;case a.TOUCH_PAN:if(r.enablePan===!1)return;de(L),r.update();break;case a.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case a.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Te(L),r.update();break;default:l=a.NONE}}function He(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function ot(L){delete k[L.pointerId];for(let q=0;q{te(L),r.update()},this.dollyOut=(L=O())=>{_(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Z(L),r.update()},this.getZoomScale=()=>O(),n!==void 0&&this.connect(n),this.update()}}new xt;new se;new Jo;new se;var Ac=Object.defineProperty,Ec=(t,e,n)=>e in t?Ac(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,di=(t,e,n)=>(Ec(t,typeof e!="symbol"?e+"":e,n),n);class Ns{constructor(e){di(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},s=Mc(e,n,this.data,o);for(let a=0,l=s.length;a #include #include uniform float thickness; @@ -420,15 +420,15 @@ var Ta=Object.defineProperty;var ka=(t,e,n)=>e in t?Ta(t,e,{enumerable:!0,config gl_FragColor = vec4(color, opacity); #include #include - }`);const Mc=["args","material-uniforms-color-value"];zr.ReflectorShader;new se;new se;new se;var dr;/Mac/.test((dr=globalThis==null?void 0:globalThis.navigator)===null||dr===void 0?void 0:dr.platform);const Sc=["target","auto-rotate","auto-rotate-speed","enable-damping","damping-factor","enable-pan","key-pan-speed","keys","max-azimuth-angle","min-azimuth-angle","max-polar-angle","min-polar-angle","min-distance","max-distance","min-zoom","max-zoom","touches","enable-zoom","zoom-speed","enable-rotate","rotate-speed","mouse-buttons","args"],Ic=ze({__name:"OrbitControls",props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:_t.ROTATE,TWO:_t.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN})}},emits:["change","start","end"],setup(t,{expose:e,emit:n}){const r=t,i=n,{makeDefault:o,autoRotate:s,autoRotateSpeed:a,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:b,minPolarAngle:x,minDistance:v,maxDistance:T,minZoom:I,maxZoom:A,enableZoom:C,zoomSpeed:P,enableRotate:h,touches:S,rotateSpeed:y,target:g,mouseButtons:m}=ei(r),{camera:k,renderer:E,extend:O,controls:F,invalidate:D}=qn(),B=Wo(null);O({OrbitControls:Tc}),je(B,Q=>{X(),Q&&o.value?F.value=Q:F.value=null});function X(){ar(B.value,"change",()=>{i("change",B.value),D()}),ar(B.value,"start",()=>i("start",B.value)),ar(B.value,"end",()=>i("end",B.value))}const{onBeforeRender:Z}=On();return Z(({invalidate:Q})=>{B.value&&(l.value||s.value)&&(B.value.update(),s.value&&Q())}),Ot(()=>{B.value&&B.value.dispose()}),e({instance:B}),(Q,_)=>(Q.camera||H(k))&&(Q.domElement||H(E))?(ee(),ie("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:B,target:H(g),"auto-rotate":H(s),"auto-rotate-speed":H(a),"enable-damping":H(l),"damping-factor":H(u),"enable-pan":H(c),"key-pan-speed":H(f),keys:Q.keys,"max-azimuth-angle":H(p),"min-azimuth-angle":H(d),"max-polar-angle":H(b),"min-polar-angle":H(x),"min-distance":H(v),"max-distance":H(T),"min-zoom":H(I),"max-zoom":H(A),touches:H(S),"enable-zoom":H(C),"zoom-speed":H(P),"enable-rotate":H(h),"rotate-speed":H(y),"mouse-buttons":H(m),args:[Q.camera||H(k),Q.domElement||H(E).domElement]},null,8,Sc)):it("",!0)}});function Sn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Wi={exports:{}},Xi;function Rc(){return Xi||(Xi=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function s(u,c){if(!i[u]){if(!r[u]){var f=typeof Sn=="function"&&Sn;if(!c&&f)return f(u,!0);if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},r[u][0].call(c.exports,function(p){var d=r[u][1][p];return s(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var a=typeof Sn=="function"&&Sn,l=0;l[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:_t.ROTATE,TWO:_t.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN})}},emits:["change","start","end"],setup(t,{expose:e,emit:n}){const r=t,i=n,{makeDefault:o,autoRotate:s,autoRotateSpeed:a,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:b,minPolarAngle:x,minDistance:v,maxDistance:T,minZoom:I,maxZoom:A,enableZoom:C,zoomSpeed:P,enableRotate:h,touches:S,rotateSpeed:y,target:g,mouseButtons:m}=ei(r),{camera:k,renderer:E,extend:O,controls:F,invalidate:D}=qn(),B=Wo(null);O({OrbitControls:_c}),je(B,Z=>{X(),Z&&o.value?F.value=Z:F.value=null});function X(){ar(B.value,"change",()=>{i("change",B.value),D()}),ar(B.value,"start",()=>i("start",B.value)),ar(B.value,"end",()=>i("end",B.value))}const{onBeforeRender:Q}=On();return Q(({invalidate:Z})=>{B.value&&(l.value||s.value)&&(B.value.update(),s.value&&Z())}),Ot(()=>{B.value&&B.value.dispose()}),e({instance:B}),(Z,_)=>(Z.camera||H(k))&&(Z.domElement||H(E))?(ee(),ie("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:B,target:H(g),"auto-rotate":H(s),"auto-rotate-speed":H(a),"enable-damping":H(l),"damping-factor":H(u),"enable-pan":H(c),"key-pan-speed":H(f),keys:Z.keys,"max-azimuth-angle":H(p),"min-azimuth-angle":H(d),"max-polar-angle":H(b),"min-polar-angle":H(x),"min-distance":H(v),"max-distance":H(T),"min-zoom":H(I),"max-zoom":H(A),touches:H(S),"enable-zoom":H(C),"zoom-speed":H(P),"enable-rotate":H(h),"rotate-speed":H(y),"mouse-buttons":H(m),args:[Z.camera||H(k),Z.domElement||H(E).domElement]},null,8,Rc)):it("",!0)}});function Sn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Wi={exports:{}},Xi;function Nc(){return Xi||(Xi=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function s(u,c){if(!i[u]){if(!r[u]){var f=typeof Sn=="function"&&Sn;if(!c&&f)return f(u,!0);if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},r[u][0].call(c.exports,function(p){var d=r[u][1][p];return s(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var a=typeof Sn=="function"&&Sn,l=0;l>16),D((65280&m)>>8),D(255&m);return k==2?D(255&(m=S(y.charAt(g))<<2|S(y.charAt(g+1))>>4)):k==1&&(D((m=S(y.charAt(g))<<10|S(y.charAt(g+1))<<4|S(y.charAt(g+2))>>2)>>8&255),D(255&m)),E},b.fromByteArray=function(y){var g,m,k,E,O=y.length%3,F="";function D(B){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(B)}for(g=0,k=y.length-O;g>18&63)+D(E>>12&63)+D(E>>6&63)+D(63&E);switch(O){case 1:F=(F+=D((m=y[y.length-1])>>2))+D(m<<4&63)+"==";break;case 2:F=(F=(F+=D((m=(y[y.length-2]<<8)+y[y.length-1])>>10))+D(m>>4&63))+D(m<<2&63)+"="}return F}})(i===void 0?this.base64js={}:i)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,i){(function(o,s,v,l,u,c,f,p,d){var b=n("base64-js"),x=n("ieee754");function v(w,M,N){if(!(this instanceof v))return new v(w,M,N);var V,U,Y,ne,ve=typeof w;if(M==="base64"&&ve=="string")for(w=(ne=w).trim?ne.trim():ne.replace(/^\s+|\s+$/g,"");w.length%4!=0;)w+="=";if(ve=="number")V=Z(w);else if(ve=="string")V=v.byteLength(w,M);else{if(ve!="object")throw new Error("First argument needs to be a number, array or string.");V=Z(w.length)}if(v._useTypedArrays?U=v._augment(new Uint8Array(V)):((U=this).length=V,U._isBuffer=!0),v._useTypedArrays&&typeof w.byteLength=="number")U._set(w);else if(Q(ne=w)||v.isBuffer(ne)||ne&&typeof ne=="object"&&typeof ne.length=="number")for(Y=0;Y>8,ne=ne%256,ve.push(ne),ve.push(Y);return ve}(M),w,N,V)}function A(w,M,N){var V="";N=Math.min(w.length,N);for(var U=M;U>>0)):(M+1>>0),U}function h(w,M,N,V){if(V||(G(typeof N=="boolean","missing or invalid endian"),G(M!=null,"missing offset"),G(M+1>>8*(V?Y:1-Y)}function k(w,M,N,V,U){if(U||(G(M!=null,"missing value"),G(typeof V=="boolean","missing or invalid endian"),G(N!=null,"missing offset"),G(N+3>>8*(V?Y:3-Y)&255}function E(w,M,N,V,U){U||(G(M!=null,"missing value"),G(typeof V=="boolean","missing or invalid endian"),G(N!=null,"missing offset"),G(N+1this.length&&(V=this.length);var U=(V=w.length-M=this.length))return this[w]},v.prototype.readUInt16LE=function(w,M){return C(this,w,!0,M)},v.prototype.readUInt16BE=function(w,M){return C(this,w,!1,M)},v.prototype.readUInt32LE=function(w,M){return P(this,w,!0,M)},v.prototype.readUInt32BE=function(w,M){return P(this,w,!1,M)},v.prototype.readInt8=function(w,M){if(M||(G(w!=null,"missing offset"),G(w=this.length))return 128&this[w]?-1*(255-this[w]+1):this[w]},v.prototype.readInt16LE=function(w,M){return h(this,w,!0,M)},v.prototype.readInt16BE=function(w,M){return h(this,w,!1,M)},v.prototype.readInt32LE=function(w,M){return S(this,w,!0,M)},v.prototype.readInt32BE=function(w,M){return S(this,w,!1,M)},v.prototype.readFloatLE=function(w,M){return y(this,w,!0,M)},v.prototype.readFloatBE=function(w,M){return y(this,w,!1,M)},v.prototype.readDoubleLE=function(w,M){return g(this,w,!0,M)},v.prototype.readDoubleBE=function(w,M){return g(this,w,!1,M)},v.prototype.writeUInt8=function(w,M,N){N||(G(w!=null,"missing value"),G(M!=null,"missing offset"),G(M=this.length||(this[M]=w)},v.prototype.writeUInt16LE=function(w,M,N){m(this,w,M,!0,N)},v.prototype.writeUInt16BE=function(w,M,N){m(this,w,M,!1,N)},v.prototype.writeUInt32LE=function(w,M,N){k(this,w,M,!0,N)},v.prototype.writeUInt32BE=function(w,M,N){k(this,w,M,!1,N)},v.prototype.writeInt8=function(w,M,N){N||(G(w!=null,"missing value"),G(M!=null,"missing offset"),G(M=this.length||(0<=w?this.writeUInt8(w,M,N):this.writeUInt8(255+w+1,M,N))},v.prototype.writeInt16LE=function(w,M,N){E(this,w,M,!0,N)},v.prototype.writeInt16BE=function(w,M,N){E(this,w,M,!1,N)},v.prototype.writeInt32LE=function(w,M,N){O(this,w,M,!0,N)},v.prototype.writeInt32BE=function(w,M,N){O(this,w,M,!1,N)},v.prototype.writeFloatLE=function(w,M,N){F(this,w,M,!0,N)},v.prototype.writeFloatBE=function(w,M,N){F(this,w,M,!1,N)},v.prototype.writeDoubleLE=function(w,M,N){D(this,w,M,!0,N)},v.prototype.writeDoubleBE=function(w,M,N){D(this,w,M,!1,N)},v.prototype.fill=function(w,M,N){if(M=M||0,N=N||this.length,G(typeof(w=typeof(w=w||0)=="string"?w.charCodeAt(0):w)=="number"&&!isNaN(w),"value is not a number"),G(M<=N,"end < start"),N!==M&&this.length!==0){G(0<=M&&M"},v.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(v._useTypedArrays)return new v(this).buffer;for(var w=new Uint8Array(this.length),M=0,N=w.length;M=M.length||U>=w.length);U++)M[U+N]=w[U];return U}function pe(w){try{return decodeURIComponent(w)}catch{return"�"}}function ye(w,M){G(typeof w=="number","cannot write a non-number as a number"),G(0<=w,"specified a negative value for writing an unsigned value"),G(w<=M,"value is larger than maximum value for type"),G(Math.floor(w)===w,"value has a fractional component")}function xe(w,M,N){G(typeof w=="number","cannot write a non-number as a number"),G(w<=M,"value larger than maximum allowed value"),G(N<=w,"value smaller than minimum allowed value"),G(Math.floor(w)===w,"value has a fractional component")}function Oe(w,M,N){G(typeof w=="number","cannot write a non-number as a number"),G(w<=M,"value larger than maximum allowed value"),G(N<=w,"value smaller than minimum allowed value")}function G(w,M){if(!w)throw new Error(M||"Failed assertion")}v._augment=function(w){return w._isBuffer=!0,w._get=w.get,w._set=w.set,w.get=B.get,w.set=B.set,w.write=B.write,w.toString=B.toString,w.toLocaleString=B.toString,w.toJSON=B.toJSON,w.copy=B.copy,w.slice=B.slice,w.readUInt8=B.readUInt8,w.readUInt16LE=B.readUInt16LE,w.readUInt16BE=B.readUInt16BE,w.readUInt32LE=B.readUInt32LE,w.readUInt32BE=B.readUInt32BE,w.readInt8=B.readInt8,w.readInt16LE=B.readInt16LE,w.readInt16BE=B.readInt16BE,w.readInt32LE=B.readInt32LE,w.readInt32BE=B.readInt32BE,w.readFloatLE=B.readFloatLE,w.readFloatBE=B.readFloatBE,w.readDoubleLE=B.readDoubleLE,w.readDoubleBE=B.readDoubleBE,w.writeUInt8=B.writeUInt8,w.writeUInt16LE=B.writeUInt16LE,w.writeUInt16BE=B.writeUInt16BE,w.writeUInt32LE=B.writeUInt32LE,w.writeUInt32BE=B.writeUInt32BE,w.writeInt8=B.writeInt8,w.writeInt16LE=B.writeInt16LE,w.writeInt16BE=B.writeInt16BE,w.writeInt32LE=B.writeInt32LE,w.writeInt32BE=B.writeInt32BE,w.writeFloatLE=B.writeFloatLE,w.writeFloatBE=B.writeFloatBE,w.writeDoubleLE=B.writeDoubleLE,w.writeDoubleBE=B.writeDoubleBE,w.fill=B.fill,w.inspect=B.inspect,w.toArrayBuffer=B.toArrayBuffer,w}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,i){(function(o,s,b,l,u,c,f,p,d){var b=n("buffer").Buffer,x=4,v=new b(x);v.fill(0),r.exports={hash:function(T,I,A,C){for(var P=I(function(m,k){m.length%x!=0&&(E=m.length+(x-m.length%x),m=b.concat([m,v],E));for(var E,O=[],F=k?m.readInt32BE:m.readInt32LE,D=0;DA?X=B(X):X.length>5]|=128<>>9<<4)]=S;for(var y=1732584193,g=-271733879,m=-1732584194,k=271733878,E=0;E>>32-m,y)}function T(h,S,y,g,m,k,E){return v(S&y|~S&g,h,S,m,k,E)}function I(h,S,y,g,m,k,E){return v(S&g|y&~g,h,S,m,k,E)}function A(h,S,y,g,m,k,E){return v(S^y^g,h,S,m,k,E)}function C(h,S,y,g,m,k,E){return v(y^(S|~g),h,S,m,k,E)}function P(h,S){var y=(65535&h)+(65535&S);return(h>>16)+(S>>16)+(y>>16)<<16|65535&y}r.exports=function(h){return b.hash(h,x,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){r.exports=function(b){for(var x,v=new Array(b),T=0;T>>((3&T)<<3)&255;return v}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){var b=n("./helpers");function x(I,A){I[A>>5]|=128<<24-A%32,I[15+(A+64>>9<<4)]=A;for(var C,P,h,S=Array(80),y=1732584193,g=-271733879,m=-1732584194,k=271733878,E=-1009589776,O=0;O>16)+(A>>16)+(C>>16)<<16|65535&C}function T(I,A){return I<>>32-A}r.exports=function(I){return b.hash(I,x,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){function b(A,C){var P=(65535&A)+(65535&C);return(A>>16)+(C>>16)+(P>>16)<<16|65535&P}function x(A,C){var P,h=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),S=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),y=new Array(64);A[C>>5]|=128<<24-C%32,A[15+(C+64>>9<<4)]=C;for(var g,m,k=0;k>>C|A<<32-C},I=function(A,C){return A>>>C};r.exports=function(A){return v.hash(A,x,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){i.read=function(b,x,v,T,k){var A,C,P=8*k-T-1,h=(1<>1,y=-7,g=v?k-1:0,m=v?-1:1,k=b[x+g];for(g+=m,A=k&(1<<-y)-1,k>>=-y,y+=P;0>=-y,y+=T;0>1,g=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=T?0:E-1,k=T?1:-1,E=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,C=S):(C=Math.floor(Math.log(x)/Math.LN2),x*(T=Math.pow(2,-C))<1&&(C--,T*=2),2<=(x+=1<=C+y?g/T:g*Math.pow(2,1-y))*T&&(C++,T/=2),S<=C+y?(P=0,C=S):1<=C+y?(P=(x*T-1)*Math.pow(2,I),C+=y):(P=x*Math.pow(2,y-1)*Math.pow(2,I),C=0));8<=I;b[v+m]=255&P,m+=k,P/=256,I-=8);for(C=C<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Ji}var to,no;function Ps(){return no||(no=1,to=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),to}var pr,ro;function Nc(){if(ro)return pr;ro=1;var t=Ls();return pr=t.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),pr}var hr,io;function Lc(){if(io)return hr;io=1;var t=Ps();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),hr=t.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),hr}var mr,oo;function Pc(){if(oo)return mr;oo=1,mr=C;var t=Ls(),e=Cc(),n=Ps(),r=Nc(),i=Lc(),o=999,s=9999,a=0,l=1,u=2,c=3,f=4,p=5,d=6,b=7,x=8,v=9,T=10,I=11,A=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function C(P){var h=0,S=0,y=o,g,m,k=[],E=[],O=1,F=0,D=0,B=!1,X=!1,Z="",Q;P=P||{};var _=n,te=t;P.version==="300 es"&&(_=i,te=r);for(var ce={},R={},h=0;h<_.length;h++)ce[_[h]]=!0;for(var h=0;h0)continue;Te=de.slice(0,1).join("")}return pe(Te),D+=Te.length,k=k.slice(Te.length),k.length}while(!0)}function Y(){return/[^a-fA-F0-9]/.test(g)?(pe(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function ne(){return g==="."||/[eE]/.test(g)?(k.push(g),y=p,m=g,h+1):g==="x"&&k.length===1&&k[0]==="0"?(y=I,k.push(g),m=g,h+1):/[^\d]/.test(g)?(pe(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function ve(){return g==="f"&&(k.push(g),m=g,h+=1),/[eE]/.test(g)||(g==="-"||g==="+")&&/[eE]/.test(m)?(k.push(g),m=g,h+1):/[^\d]/.test(g)?(pe(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function _e(){if(/[^\d\w_]/.test(g)){var de=k.join("");return R[de]?y=x:ce[de]?y=b:y=d,pe(k.join("")),y=o,h}return k.push(g),m=g,h+1}}return mr}var gr,so;function Dc(){if(so)return gr;so=1;var t=Pc();gr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return gr}Dc();function Oc(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function zc(t){var e=Oc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=zc(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},Ge,Bt;Ge={},Se(Ge,"".concat(le.normal),{"#include ":` +`)},_domwindow:function(){return g("domwindow")},_bigint:function(m){return g("bigint:"+m.toString())},_process:function(){return g("process")},_timer:function(){return g("timer")},_pipe:function(){return g("pipe")},_tcp:function(){return g("tcp")},_udp:function(){return g("udp")},_tty:function(){return g("tty")},_statwatcher:function(){return g("statwatcher")},_securecontext:function(){return g("securecontext")},_connection:function(){return g("connection")},_zlib:function(){return g("zlib")},_context:function(){return g("context")},_nodescript:function(){return g("nodescript")},_httpparser:function(){return g("httpparser")},_dataview:function(){return g("dataview")},_signal:function(){return g("signal")},_fsevent:function(){return g("fsevent")},_tlswrap:function(){return g("tlswrap")}}}function P(){return{buf:"",write:function(h){this.buf+=h},end:function(h){this.buf+=h},read:function(){return this.buf}}}i.writeToStream=function(h,S,y){return y===void 0&&(y=S,S={}),C(S=I(h,S),y).dispatch(h)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){(function(b){var x=typeof Uint8Array<"u"?Uint8Array:Array,v=43,T=47,I=48,A=97,C=65,P=45,h=95;function S(y){return y=y.charCodeAt(0),y===v||y===P?62:y===T||y===h?63:y>16),D((65280&m)>>8),D(255&m);return k==2?D(255&(m=S(y.charAt(g))<<2|S(y.charAt(g+1))>>4)):k==1&&(D((m=S(y.charAt(g))<<10|S(y.charAt(g+1))<<4|S(y.charAt(g+2))>>2)>>8&255),D(255&m)),E},b.fromByteArray=function(y){var g,m,k,E,O=y.length%3,F="";function D(B){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(B)}for(g=0,k=y.length-O;g>18&63)+D(E>>12&63)+D(E>>6&63)+D(63&E);switch(O){case 1:F=(F+=D((m=y[y.length-1])>>2))+D(m<<4&63)+"==";break;case 2:F=(F=(F+=D((m=(y[y.length-2]<<8)+y[y.length-1])>>10))+D(m>>4&63))+D(m<<2&63)+"="}return F}})(i===void 0?this.base64js={}:i)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,i){(function(o,s,v,l,u,c,f,p,d){var b=n("base64-js"),x=n("ieee754");function v(w,M,N){if(!(this instanceof v))return new v(w,M,N);var V,U,Y,ne,ve=typeof w;if(M==="base64"&&ve=="string")for(w=(ne=w).trim?ne.trim():ne.replace(/^\s+|\s+$/g,"");w.length%4!=0;)w+="=";if(ve=="number")V=Q(w);else if(ve=="string")V=v.byteLength(w,M);else{if(ve!="object")throw new Error("First argument needs to be a number, array or string.");V=Q(w.length)}if(v._useTypedArrays?U=v._augment(new Uint8Array(V)):((U=this).length=V,U._isBuffer=!0),v._useTypedArrays&&typeof w.byteLength=="number")U._set(w);else if(Z(ne=w)||v.isBuffer(ne)||ne&&typeof ne=="object"&&typeof ne.length=="number")for(Y=0;Y>8,ne=ne%256,ve.push(ne),ve.push(Y);return ve}(M),w,N,V)}function A(w,M,N){var V="";N=Math.min(w.length,N);for(var U=M;U>>0)):(M+1>>0),U}function h(w,M,N,V){if(V||(G(typeof N=="boolean","missing or invalid endian"),G(M!=null,"missing offset"),G(M+1>>8*(V?Y:1-Y)}function k(w,M,N,V,U){if(U||(G(M!=null,"missing value"),G(typeof V=="boolean","missing or invalid endian"),G(N!=null,"missing offset"),G(N+3>>8*(V?Y:3-Y)&255}function E(w,M,N,V,U){U||(G(M!=null,"missing value"),G(typeof V=="boolean","missing or invalid endian"),G(N!=null,"missing offset"),G(N+1this.length&&(V=this.length);var U=(V=w.length-M=this.length))return this[w]},v.prototype.readUInt16LE=function(w,M){return C(this,w,!0,M)},v.prototype.readUInt16BE=function(w,M){return C(this,w,!1,M)},v.prototype.readUInt32LE=function(w,M){return P(this,w,!0,M)},v.prototype.readUInt32BE=function(w,M){return P(this,w,!1,M)},v.prototype.readInt8=function(w,M){if(M||(G(w!=null,"missing offset"),G(w=this.length))return 128&this[w]?-1*(255-this[w]+1):this[w]},v.prototype.readInt16LE=function(w,M){return h(this,w,!0,M)},v.prototype.readInt16BE=function(w,M){return h(this,w,!1,M)},v.prototype.readInt32LE=function(w,M){return S(this,w,!0,M)},v.prototype.readInt32BE=function(w,M){return S(this,w,!1,M)},v.prototype.readFloatLE=function(w,M){return y(this,w,!0,M)},v.prototype.readFloatBE=function(w,M){return y(this,w,!1,M)},v.prototype.readDoubleLE=function(w,M){return g(this,w,!0,M)},v.prototype.readDoubleBE=function(w,M){return g(this,w,!1,M)},v.prototype.writeUInt8=function(w,M,N){N||(G(w!=null,"missing value"),G(M!=null,"missing offset"),G(M=this.length||(this[M]=w)},v.prototype.writeUInt16LE=function(w,M,N){m(this,w,M,!0,N)},v.prototype.writeUInt16BE=function(w,M,N){m(this,w,M,!1,N)},v.prototype.writeUInt32LE=function(w,M,N){k(this,w,M,!0,N)},v.prototype.writeUInt32BE=function(w,M,N){k(this,w,M,!1,N)},v.prototype.writeInt8=function(w,M,N){N||(G(w!=null,"missing value"),G(M!=null,"missing offset"),G(M=this.length||(0<=w?this.writeUInt8(w,M,N):this.writeUInt8(255+w+1,M,N))},v.prototype.writeInt16LE=function(w,M,N){E(this,w,M,!0,N)},v.prototype.writeInt16BE=function(w,M,N){E(this,w,M,!1,N)},v.prototype.writeInt32LE=function(w,M,N){O(this,w,M,!0,N)},v.prototype.writeInt32BE=function(w,M,N){O(this,w,M,!1,N)},v.prototype.writeFloatLE=function(w,M,N){F(this,w,M,!0,N)},v.prototype.writeFloatBE=function(w,M,N){F(this,w,M,!1,N)},v.prototype.writeDoubleLE=function(w,M,N){D(this,w,M,!0,N)},v.prototype.writeDoubleBE=function(w,M,N){D(this,w,M,!1,N)},v.prototype.fill=function(w,M,N){if(M=M||0,N=N||this.length,G(typeof(w=typeof(w=w||0)=="string"?w.charCodeAt(0):w)=="number"&&!isNaN(w),"value is not a number"),G(M<=N,"end < start"),N!==M&&this.length!==0){G(0<=M&&M"},v.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(v._useTypedArrays)return new v(this).buffer;for(var w=new Uint8Array(this.length),M=0,N=w.length;M=M.length||U>=w.length);U++)M[U+N]=w[U];return U}function pe(w){try{return decodeURIComponent(w)}catch{return"�"}}function ye(w,M){G(typeof w=="number","cannot write a non-number as a number"),G(0<=w,"specified a negative value for writing an unsigned value"),G(w<=M,"value is larger than maximum value for type"),G(Math.floor(w)===w,"value has a fractional component")}function xe(w,M,N){G(typeof w=="number","cannot write a non-number as a number"),G(w<=M,"value larger than maximum allowed value"),G(N<=w,"value smaller than minimum allowed value"),G(Math.floor(w)===w,"value has a fractional component")}function Oe(w,M,N){G(typeof w=="number","cannot write a non-number as a number"),G(w<=M,"value larger than maximum allowed value"),G(N<=w,"value smaller than minimum allowed value")}function G(w,M){if(!w)throw new Error(M||"Failed assertion")}v._augment=function(w){return w._isBuffer=!0,w._get=w.get,w._set=w.set,w.get=B.get,w.set=B.set,w.write=B.write,w.toString=B.toString,w.toLocaleString=B.toString,w.toJSON=B.toJSON,w.copy=B.copy,w.slice=B.slice,w.readUInt8=B.readUInt8,w.readUInt16LE=B.readUInt16LE,w.readUInt16BE=B.readUInt16BE,w.readUInt32LE=B.readUInt32LE,w.readUInt32BE=B.readUInt32BE,w.readInt8=B.readInt8,w.readInt16LE=B.readInt16LE,w.readInt16BE=B.readInt16BE,w.readInt32LE=B.readInt32LE,w.readInt32BE=B.readInt32BE,w.readFloatLE=B.readFloatLE,w.readFloatBE=B.readFloatBE,w.readDoubleLE=B.readDoubleLE,w.readDoubleBE=B.readDoubleBE,w.writeUInt8=B.writeUInt8,w.writeUInt16LE=B.writeUInt16LE,w.writeUInt16BE=B.writeUInt16BE,w.writeUInt32LE=B.writeUInt32LE,w.writeUInt32BE=B.writeUInt32BE,w.writeInt8=B.writeInt8,w.writeInt16LE=B.writeInt16LE,w.writeInt16BE=B.writeInt16BE,w.writeInt32LE=B.writeInt32LE,w.writeInt32BE=B.writeInt32BE,w.writeFloatLE=B.writeFloatLE,w.writeFloatBE=B.writeFloatBE,w.writeDoubleLE=B.writeDoubleLE,w.writeDoubleBE=B.writeDoubleBE,w.fill=B.fill,w.inspect=B.inspect,w.toArrayBuffer=B.toArrayBuffer,w}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,i){(function(o,s,b,l,u,c,f,p,d){var b=n("buffer").Buffer,x=4,v=new b(x);v.fill(0),r.exports={hash:function(T,I,A,C){for(var P=I(function(m,k){m.length%x!=0&&(E=m.length+(x-m.length%x),m=b.concat([m,v],E));for(var E,O=[],F=k?m.readInt32BE:m.readInt32LE,D=0;DA?X=B(X):X.length>5]|=128<>>9<<4)]=S;for(var y=1732584193,g=-271733879,m=-1732584194,k=271733878,E=0;E>>32-m,y)}function T(h,S,y,g,m,k,E){return v(S&y|~S&g,h,S,m,k,E)}function I(h,S,y,g,m,k,E){return v(S&g|y&~g,h,S,m,k,E)}function A(h,S,y,g,m,k,E){return v(S^y^g,h,S,m,k,E)}function C(h,S,y,g,m,k,E){return v(y^(S|~g),h,S,m,k,E)}function P(h,S){var y=(65535&h)+(65535&S);return(h>>16)+(S>>16)+(y>>16)<<16|65535&y}r.exports=function(h){return b.hash(h,x,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){r.exports=function(b){for(var x,v=new Array(b),T=0;T>>((3&T)<<3)&255;return v}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){var b=n("./helpers");function x(I,A){I[A>>5]|=128<<24-A%32,I[15+(A+64>>9<<4)]=A;for(var C,P,h,S=Array(80),y=1732584193,g=-271733879,m=-1732584194,k=271733878,E=-1009589776,O=0;O>16)+(A>>16)+(C>>16)<<16|65535&C}function T(I,A){return I<>>32-A}r.exports=function(I){return b.hash(I,x,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){function b(A,C){var P=(65535&A)+(65535&C);return(A>>16)+(C>>16)+(P>>16)<<16|65535&P}function x(A,C){var P,h=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),S=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),y=new Array(64);A[C>>5]|=128<<24-C%32,A[15+(C+64>>9<<4)]=C;for(var g,m,k=0;k>>C|A<<32-C},I=function(A,C){return A>>>C};r.exports=function(A){return v.hash(A,x,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,i){(function(o,s,a,l,u,c,f,p,d){i.read=function(b,x,v,T,k){var A,C,P=8*k-T-1,h=(1<>1,y=-7,g=v?k-1:0,m=v?-1:1,k=b[x+g];for(g+=m,A=k&(1<<-y)-1,k>>=-y,y+=P;0>=-y,y+=T;0>1,g=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=T?0:E-1,k=T?1:-1,E=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,C=S):(C=Math.floor(Math.log(x)/Math.LN2),x*(T=Math.pow(2,-C))<1&&(C--,T*=2),2<=(x+=1<=C+y?g/T:g*Math.pow(2,1-y))*T&&(C++,T/=2),S<=C+y?(P=0,C=S):1<=C+y?(P=(x*T-1)*Math.pow(2,I),C+=y):(P=x*Math.pow(2,y-1)*Math.pow(2,I),C=0));8<=I;b[v+m]=255&P,m+=k,P/=256,I-=8);for(C=C<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Ji}var to,no;function Ps(){return no||(no=1,to=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),to}var pr,ro;function Pc(){if(ro)return pr;ro=1;var t=Ls();return pr=t.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),pr}var hr,io;function Dc(){if(io)return hr;io=1;var t=Ps();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),hr=t.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),hr}var mr,oo;function Oc(){if(oo)return mr;oo=1,mr=C;var t=Ls(),e=Lc(),n=Ps(),r=Pc(),i=Dc(),o=999,s=9999,a=0,l=1,u=2,c=3,f=4,p=5,d=6,b=7,x=8,v=9,T=10,I=11,A=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function C(P){var h=0,S=0,y=o,g,m,k=[],E=[],O=1,F=0,D=0,B=!1,X=!1,Q="",Z;P=P||{};var _=n,te=t;P.version==="300 es"&&(_=i,te=r);for(var ce={},R={},h=0;h<_.length;h++)ce[_[h]]=!0;for(var h=0;h0)continue;Te=de.slice(0,1).join("")}return pe(Te),D+=Te.length,k=k.slice(Te.length),k.length}while(!0)}function Y(){return/[^a-fA-F0-9]/.test(g)?(pe(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function ne(){return g==="."||/[eE]/.test(g)?(k.push(g),y=p,m=g,h+1):g==="x"&&k.length===1&&k[0]==="0"?(y=I,k.push(g),m=g,h+1):/[^\d]/.test(g)?(pe(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function ve(){return g==="f"&&(k.push(g),m=g,h+=1),/[eE]/.test(g)||(g==="-"||g==="+")&&/[eE]/.test(m)?(k.push(g),m=g,h+1):/[^\d]/.test(g)?(pe(k.join("")),y=o,h):(k.push(g),m=g,h+1)}function _e(){if(/[^\d\w_]/.test(g)){var de=k.join("");return R[de]?y=x:ce[de]?y=b:y=d,pe(k.join("")),y=o,h}return k.push(g),m=g,h+1}}return mr}var gr,so;function zc(){if(so)return gr;so=1;var t=Oc();gr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return gr}zc();function Fc(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Bc(t){var e=Fc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=Bc(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},Ge,Bt;Ge={},Se(Ge,"".concat(le.normal),{"#include ":` vec3 objectNormal = `.concat(le.normal,`; #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); @@ -481,9 +481,9 @@ list should be an Array.`),w.length===0)return new v(0);if(w.length===1)return w gl_FragColor = `.concat(le.diffuseColor,`; `)}),Se(Bt,"".concat(le.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` gl_FragColor = `.concat(le.fragColor,`; - `)});var $e;$e={},Se($e,"".concat(le.position),"*"),Se($e,"".concat(le.positionRaw),"*"),Se($e,"".concat(le.normal),"*"),Se($e,"".concat(le.pointSize),["PointsMaterial"]),Se($e,"".concat(le.diffuseColor),"*"),Se($e,"".concat(le.fragColor),"*"),Se($e,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se($e,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se($e,"".concat(le.depthAlpha),"*");var Fc=`void main() { + `)});var $e;$e={},Se($e,"".concat(le.position),"*"),Se($e,"".concat(le.positionRaw),"*"),Se($e,"".concat(le.normal),"*"),Se($e,"".concat(le.pointSize),["PointsMaterial"]),Se($e,"".concat(le.diffuseColor),"*"),Se($e,"".concat(le.fragColor),"*"),Se($e,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se($e,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se($e,"".concat(le.depthAlpha),"*");var Uc=`void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -}`,Bc=`#include +}`,jc=`#include void main() { vec2 center = vec2(0., 1.); @@ -508,7 +508,7 @@ void main() { mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; -}`;const vn=new se(0,0,0),pi=new se(0,0,0),Uc=new se(0,0,0);function ao(t,e,n){const r=vn.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o,r.z]}function jc(t,e){const n=vn.setFromMatrixPosition(t.matrixWorld),r=pi.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(Uc);return i.angleTo(o)>Math.PI/2}function Vc(t,e,n,r){const i=vn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Pe(o.x,o.y),e);const s=n.intersectObjects(r,!0);if(s.length>0){const a=s[0].distance;return i.distanceTo(n.ray.origin)Math.abs(t)<1e-10?0:t;function Ds(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Br(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const $c=(t=>e=>Ds(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),qc=(t=>(e,n)=>Ds(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]),Yc=["geometry","material"];new ts;var Ur={exports:{}},Kc=Ur.exports,lo;function Wc(){return lo||(lo=1,function(t,e){(function(n,r){t.exports=r()})(Kc,function(){var n=function(){function r(d){return s.appendChild(d.dom),d}function i(d){for(var b=0;bl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var b=performance.memory;p.update(b.usedJSHeapSize/1048576,b.jsHeapSizeLimit/1048576)}return d},update:function(){a=this.end()},domElement:s,setMode:i}};return n.Panel=function(r,i,o){var s=1/0,a=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,f=48*u,p=3*u,d=2*u,b=3*u,x=15*u,v=74*u,T=30*u,I=document.createElement("canvas");I.width=c,I.height=f,I.style.cssText="width:80px;height:48px";var A=I.getContext("2d");return A.font="bold "+9*u+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=o,A.fillRect(0,0,c,f),A.fillStyle=i,A.fillText(r,p,d),A.fillRect(b,x,v,T),A.fillStyle=o,A.globalAlpha=.9,A.fillRect(b,x,v,T),{dom:I,update:function(C,P){s=Math.min(s,C),a=Math.max(a,C),A.fillStyle=o,A.globalAlpha=1,A.fillRect(0,0,c,x),A.fillStyle=i,A.fillText(l(C)+" "+r+" ("+l(s)+"-"+l(a)+")",p,d),A.drawImage(I,b+u,x,v-u,T,b,x,v-u,T),A.fillRect(b+v-u,x,u,T),A.fillStyle=o,A.globalAlpha=.9,A.fillRect(b+v-u,x,u,l((1-C/P)*T))}}},n})}(Ur)),Ur.exports}Wc();const Xc={key:0,args:[0,1,64]},Qc={key:1,args:[.5,1,64]},Zc={key:2},Jc=["tone-mapped","map","side","color"];new Fe(16777215);const Ut=ze({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","mousedown"],setup(t,{emit:e}){const n=t,r=e,i=W(null);function o(b,x,v){return Math.min(Math.max(b,x),v)}function s(b){const x=b.toString();return x.includes("e-")?Number.parseInt(x.split("e-")[1],10):x.includes(".")?x.split(".")[1].length:0}function a(b,x){const v=s(x),T=10**(v+3);return Number.parseFloat((b*T/T).toFixed(v))}const l=Ue(()=>a(o(n.modelValue,n.min,n.max),n.step)),u=Ue(()=>{const b=(l.value-n.min)/(n.max-n.min)*100;return{width:`${b}%`,backgroundSize:`${b}% 100%`}});function c(b){if(!i.value)return l.value;const x=i.value.getBoundingClientRect(),T=(b.clientX-x.left)/x.width,I=n.max-n.min,A=n.min+I*T,C=Math.round(A/n.step)*n.step;return Math.min(Math.max(C,n.min),n.max)}function f(b){if(n.disabled)return;const x=c(b);r("update:modelValue",x)}function p(b){if(n.disabled)return;b.preventDefault();const x=c(b);r("update:modelValue",x),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(b){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Ot(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(b,x)=>(ee(),ie("span",{ref_key:"sliderRef",ref:i,class:at(["range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50",{disabled:t.disabled}]),bg:"[#e6e1fc] dark:[#676085]","touch-action-none":"",relative:"","inline-block":"","w-full":"","cursor-ew-resize":"","rounded-sm":"",onMousedown:p},[z("span",{style:Dr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),z("span",{role:"slider",class:"slider-thumb",style:Dr({left:`${(l.value-t.min)/(t.max-t.min)*100}%`}),absolute:"","rounded-sm":"",w:"[1px]",h:"[14px]",bg:"zinc-100 dark:zinc-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function uo(t,e){if(e===sl)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Or||e===ls){let n=t.getIndex();if(n===null){const s=[],a=t.getAttribute("position");if(a!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new Pf(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&a[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}u.setExtensions(s),u.setPlugins(a),u.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function tf(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const he={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"};class nf{constructor(e){this.parser=e,this.name=he.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,s)}}class yf{constructor(e){this.parser=e,this.name=he.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const s=o.extensions[n],a=i.images[s.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class xf{constructor(e){this.parser=e,this.name=he.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const s=o.extensions[n],a=i.images[s.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class vf{constructor(e){this.name=he.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(a){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,p=new Uint8Array(a,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(c*f);return s.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class bf{constructor(e){this.name=he.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==nt.TRIANGLES&&u.mode!==nt.TRIANGLE_STRIP&&u.mode!==nt.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,a=[],l={};for(const u in s)a.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const b of f){const x=new xt,v=new se,T=new zn,I=new se(1,1,1),A=new fl(b.geometry,b.material,p);for(let C=0;C0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Lf=new xt;class Pf{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new tf,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 r=!1,i=-1,o=!1,s=-1;if(typeof navigator<"u"){const a=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=a.indexOf("Firefox")>-1,s=o?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&s<98?this.textureLoader=new pl(this.options.manager):this.textureLoader=new hl(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new us(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const a={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return Rt(o,a,i),gt(a,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(s);l!=null&&this.associations.set(a,l);for(const[u,c]of s.children.entries())o(c,a.children[u])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(g,h[S*l+1]),l>=3&&v.setZ(g,h[S*l+2]),l>=4&&v.setW(g,h[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=b}return v})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,s=n.images[o];let a=this.textureLoader;if(s.uri){const l=r.manager.getHandler(s.uri);l!==null&&(a=l)}return this.loadTextureImage(e,o,a)}loadTextureImage(e,n,r){const i=this,o=this.json,s=o.textures[e],a=o.images[n],l=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=s.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const p=(o.samplers||{})[s.sampler]||{};return c.magFilter=fo[p.magFilter]||Bn,c.minFilter=fo[p.minFilter]||oi,c.wrapS=po[p.wrapS]||Un,c.wrapT=po[p.wrapT]||Un,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==Bn,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const s=i.images[e],a=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=r.getDependency("bufferView",s.bufferView).then(function(f){u=!0;const p=new Blob([f],{type:s.mimeType});return l=a.createObjectURL(p),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(p,d){let b=p;n.isImageBitmapLoader===!0&&(b=function(x){const v=new Fn(x);v.needsUpdate=!0,p(v)}),n.load(cn.resolveURL(f,o.path),b,void 0,d)})}).then(function(f){return u===!0&&a.revokeObjectURL(l),gt(f,s),f.userData.mimeType=s.mimeType||Nf(s.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),o.extensions[he.KHR_TEXTURE_TRANSFORM]){const a=r.extensions!==void 0?r.extensions[he.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=o.associations.get(s);s=o.extensions[he.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),o.associations.set(s,l)}}return i!==void 0&&(s.colorSpace=i),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new ml,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(a,l)),r=l}else if(e.isLine){const a="LineBasicMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new gl,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(a,l)),r=l}if(i||o||s){let a="ClonedMaterial:"+r.uuid+":";i&&(a+="derivative-tangents:"),o&&(a+="vertex-colors:"),s&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=r.clone(),o&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return cs}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let s;const a={},l=o.extensions||{},u=[];if(l[he.KHR_MATERIALS_UNLIT]){const f=i[he.KHR_MATERIALS_UNLIT];s=f.getMaterialType(),u.push(f.extendParams(a,o,n))}else{const f=o.pbrMetallicRoughness||{};if(a.color=new Fe(1,1,1),a.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;a.color.setRGB(p[0],p[1],p[2],vt),a.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(a,"map",f.baseColorTexture,mn)),a.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,a.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(a,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(a,"roughnessMap",f.metallicRoughnessTexture))),s=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}o.doubleSided===!0&&(a.side=Yn);const c=o.alphaMode||xr.OPAQUE;if(c===xr.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===xr.MASK&&(a.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==Vt&&(u.push(n.assignTexture(a,"normalMap",o.normalTexture)),a.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;a.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&s!==Vt&&(u.push(n.assignTexture(a,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==Vt){const f=o.emissiveFactor;a.emissive=new Fe().setRGB(f[0],f[1],f[2],vt)}return o.emissiveTexture!==void 0&&s!==Vt&&u.push(n.assignTexture(a,"emissiveMap",o.emissiveTexture,mn)),Promise.all(u).then(function(){const f=new s(a);return o.name&&(f.name=o.name),gt(f,o),n.associations.set(f,{materials:e}),o.extensions&&Rt(i,f,o),f})}createUniqueName(e){const n=hn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(a){return r[he.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,n).then(function(l){return ho(l,a,n)})}const s=[];for(let a=0,l=e.length;a0&&Rf(T,o),T.name=n.createUniqueName(o.name||"mesh_"+e),gt(T,o),v.extensions&&Rt(i,T,v),n.assignFinalMaterial(T),f.push(T)}for(let d=0,b=f.length;d1?c=new rr:u.length===1?c=u[0]:c=new si,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof nr||p instanceof Fn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const s=[],a=e.name?e.name:e.uuid,l=[];Tt[o.path]===Tt.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(a);let u;switch(Tt[o.path]){case Tt.weights:u=Ni;break;case Tt.rotation:u=Li;break;case Tt.translation:case Tt.scale:u=Ci;break;default:switch(r.itemSize){case 1:u=Ni;break;case 2:case 3:default:u=Ci;break}break}const c=i.interpolation!==void 0?Mf[i.interpolation]:ti,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew _a(t)),Ct.register(t=>new Aa(t)),Ct)}async function Of(t){const r=(await Fs().loadAsync(t)).userData;if(!r.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(r.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return r.vrmAnimations[0]}async function zf(t,e){if(!t){console.warn("No VRM found");return}if(e)return Ea(e,t)}function Ff(){const t=W(!1),e=W(0),n=W(0),r=.2,i=1,o=6,s=W(Math.random()*(o-i)+i);function a(l,u){if(l!=null&&l.expressionManager&&(n.value+=u,!t.value&&n.value>=s.value&&(t.value=!0,e.value=0),t.value)){e.value+=u/r;const c=Math.sin(Math.PI*e.value);l.expressionManager.setValue("blink",c),e.value>=1&&(t.value=!1,n.value=0,l.expressionManager.setValue("blink",0),s.value=Math.random()*(o-i)+i)}}return{update:a}}function Bf(){let t=-1,e,n=0;function r(){e?e.set(on(-.25,.25),on(-.2,.15),-.65):e=new se(on(-.25,.25),on(-.2,.15),-.65)}function i(o,s){var a;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=Ma()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new si),o.lookAt.target.position.lerp(e,on(.2,.5)),(a=o.lookAt)==null||a.update(s),n+=s)}return{update:i}}async function Uf(t,e){const i=(await Fs().loadAsync(t,s=>{var a;return(a=e==null?void 0:e.onProgress)==null?void 0:a.call(e,s)})).userData;if(!i.vrm)return;const o=i.vrm;if(Nr.removeUnnecessaryVertices(o.scene),Nr.combineSkeletons(o.scene),o.scene.traverse(s=>{s.frustumCulled=!1}),o.lookAt){const s=new Sa(o.lookAt);s.name="lookAtQuaternionProxy",o.scene.add(s)}return e!=null&&e.scene&&e.scene.add(o.scene),e!=null&&e.position&&o.scene.position.set(...e.position),o}function jf(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),s=W(),a=(T,I,A)=>T+(I-T)*A,l=T=>T<.5?4*T*T*T:1-(-2*T+2)**3/2,u=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}]]),c=()=>{s.value&&(clearTimeout(s.value),s.value=void 0)},f=T=>{var A;if(c(),!u.has(T)){console.warn(`Emotion ${T} not found`);return}const I=u.get(T);if(e.value=T,n.value=!0,r.value=0,t.expressionManager){const C=Object.keys(t.expressionManager.expressionMap);for(const P of C)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const C of I.expression||[]){const P=((A=t.expressionManager)==null?void 0:A.getValue(C.name))||0;i.value.set(C.name,P),o.value.set(C.name,C.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(T,I)=>{c(),f(T),s.value=setTimeout(()=>{f("neutral"),s.value=void 0},I)},update:T=>{var C;if(!n.value||!e.value)return;const A=u.get(e.value).blendDuration||.3;r.value+=T/A,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const S=i.value.get(P)||0,y=a(S,h,l(r.value));(C=t.expressionManager)==null||C.setValue(P,y)}},addEmotionState:(T,I)=>{u.set(T,I)},removeEmotionState:T=>{u.delete(T)},dispose:()=>{c()}}}const Vf=ze({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const s=W(),a=W(),{scene:l}=qn(),{onBeforeRender:u}=On(),c=Ff(),f=Bf(),p=W();je(()=>r.position,([x,v,T])=>{s.value&&s.value.scene.position.set(x,v,T)}),pn(async()=>{if(l.value)try{const x=await Uf(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:I=>i("loadModelProgress",Number.parseFloat((100*(I.loaded/I.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const v=await Of(r.idleAnimation),T=await zf(x,v);if(!T){console.warn("No VRM animation loaded");return}a.value=new Ml(x.scene),a.value.clipAction(T).play(),p.value=jf(x),s.value=x,o=u(({delta:I})=>{var A,C,P;(A=a.value)==null||A.update(I),(C=s.value)==null||C.update(I),c.update(s.value,I),f.update(s.value,I),(P=p.value)==null||P.update(I)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),s.value&&(s.value.scene.removeFromParent(),Nr.deepDispose(s.value.scene))}),e({setExpression(x){var v;(v=p.value)==null||v.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:b}=On();return je(()=>r.paused,x=>{x?d():b()}),(x,v)=>gn(x.$slots,"default")}}),Hf=["position"],Gf={absolute:"",bottom:"3",right:"3"},$f={flex:"~ row","cursor-pointer":""},qf=["checked","aria-checked"],Yf={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(b)}}),(b,x)=>(ee(),Xt(ys,{relative:""},{default:Be(({height:v,width:T})=>[ke(H(Sl),{alpha:!0,antialias:!0,width:T,height:v},{default:Be(()=>[ke(H(Ic)),z("TresPerspectiveCamera",{position:[s.value,a.value,l.value]},null,8,Hf),x[14]||(x[14]=z("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=z("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),ke(Vf,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:x[0]||(x[0]=I=>i("loadModelProgress",I)),onError:x[1]||(x[1]=I=>i("error",I))},null,8,["model","idle-animation","position","paused"])]),_:2},1032,["width","height"]),z("div",Gf,[z("div",$f,[z("label",{class:at([o.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(z("input",{"onUpdate:modelValue":x[2]||(x[2]=I=>o.value=I),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,qf),[[Jr,o.value]]),x[16]||(x[16]=z("div",{"select-none":""},[z("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(ci,null,{default:Be(()=>[o.value?(ee(),ie("div",Yf,[z("div",Kf,[z("div",Wf,[z("span",null,ge(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),ke(Oi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Be(()=>[z("span",Xf,ge(H(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Be(()=>[z("div",Qf,[x[17]||(x[17]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"X")],-1)),z("label",Zf,[ke(Ut,{modelValue:s.value,"onUpdate:modelValue":x[3]||(x[3]=I=>s.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",Jf,[z("span",null,ge(s.value),1)]),x[18]||(x[18]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"Y")],-1)),z("label",ed,[ke(Ut,{modelValue:a.value,"onUpdate:modelValue":x[4]||(x[4]=I=>a.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",td,[z("span",null,ge(a.value),1)]),x[19]||(x[19]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"Z")],-1)),z("label",nd,[ke(Ut,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=I=>l.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",rd,[z("span",null,ge(l.value),1)])])]),_:1}),ke(Oi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Be(()=>[z("span",id,ge(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Be(()=>[z("div",od,[x[20]||(x[20]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"X")],-1)),z("label",sd,[ke(Ut,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=I=>u.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",ad,[z("span",null,ge(u.value),1)]),x[21]||(x[21]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"Y")],-1)),z("label",ld,[ke(Ut,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=I=>c.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",ud,[z("span",null,ge(c.value),1)]),x[22]||(x[22]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"Z")],-1)),z("label",cd,[ke(Ut,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=I=>f.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",fd,[z("span",null,ge(f.value),1)])])]),_:1}),z("div",dd,[z("span",null,ge(H(d)("stage.viewers.debug-menu.emotions")),1)]),z("div",pd,[z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("neutral")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("surprised")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("sad")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("angry")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("happy")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):it("",!0)]),_:1})])]),_:1}))}}),md=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class bn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}bn.prototype.normal={};bn.prototype.property={};bn.prototype.space=void 0;function Bs(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new bn(n,r,e)}function Hr(t){return t.toLowerCase()}class We{constructor(e,n){this.attribute=n,this.property=e}}We.prototype.attribute="";We.prototype.booleanish=!1;We.prototype.boolean=!1;We.prototype.commaOrSpaceSeparated=!1;We.prototype.commaSeparated=!1;We.prototype.defined=!1;We.prototype.mustUseProperty=!1;We.prototype.number=!1;We.prototype.overloadedBoolean=!1;We.prototype.property="";We.prototype.spaceSeparated=!1;We.prototype.space=void 0;let gd=0;const fe=zt(),Le=zt(),Us=zt(),$=zt(),Re=zt(),Yt=zt(),Ze=zt();function zt(){return 2**++gd}const Gr=Object.freeze(Object.defineProperty({__proto__:null,boolean:fe,booleanish:Le,commaOrSpaceSeparated:Ze,commaSeparated:Yt,number:$,overloadedBoolean:Us,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),br=Object.keys(Gr);class hi extends We{constructor(e,n,r,i){let o=-1;if(super(e,n),mo(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&bd.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(go,kd);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!go.test(o)){let s=o.replace(vd,Td);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=hi}return new i(r,e)}function Td(t){return"-"+t.toLowerCase()}function kd(t){return t.charAt(1).toUpperCase()}const _d=Bs([js,yd,Gs,$s,qs],"html"),Ys=Bs([js,xd,Gs,$s,qs],"svg"),yo={}.hasOwnProperty;function Ad(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&yo.call(i,t)){const l=String(i[t]);s=yo.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Ed=/^>|^->||--!>|"],Sd=["<",">"];function Id(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return $t(o,Object.assign({},r.settings.characterReferences,{subset:Sd}))}}function Rd(t,e,n,r){return""}function Cd(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Nd(t){return t.join(" ").trim()}const Ld=/[ \t\n\f\r]/g;function mi(t){return typeof t=="object"?t.type==="text"?xo(t.value):!1:xo(t)}function xo(t){return t.replace(Ld,"")===""}const De=Ws(1),Ks=Ws(-1),Pd=[];function Ws(t){return e;function e(n,r,i){const o=n?n.children:Pd;let s=(r||0)+t,a=o[s];if(!i)for(;a&&mi(a);)s+=t,a=o[s];return a}}const Dd={}.hasOwnProperty;function Xs(t){return e;function e(n,r,i){return Dd.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const gi=Xs({body:zd,caption:wr,colgroup:wr,dd:jd,dt:Ud,head:wr,html:Od,li:Bd,optgroup:Vd,option:Hd,p:Fd,rp:vo,rt:vo,tbody:$d,td:bo,tfoot:qd,th:bo,thead:Gd,tr:Yd});function wr(t,e,n){const r=De(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&mi(r.value.charAt(0)))}function Od(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function zd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function Fd(t,e,n){const r=De(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Bd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Ud(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function jd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function vo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Vd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Hd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Gd(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function $d(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function qd(t,e,n){return!De(n,e)}function Yd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function bo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Kd=Xs({body:Qd,colgroup:Zd,head:Xd,html:Wd,tbody:Jd});function Wd(t){const e=De(t,-1);return!e||e.type!=="comment"}function Xd(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function Qd(t){const e=De(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&mi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Zd(t,e,n){const r=Ks(n,e),i=De(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&gi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Jd(t,e,n){const r=Ks(n,e),i=De(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&gi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const In={name:[[` +}`;const vn=new se(0,0,0),pi=new se(0,0,0),Vc=new se(0,0,0);function ao(t,e,n){const r=vn.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o,r.z]}function Hc(t,e){const n=vn.setFromMatrixPosition(t.matrixWorld),r=pi.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(Vc);return i.angleTo(o)>Math.PI/2}function Gc(t,e,n,r){const i=vn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Pe(o.x,o.y),e);const s=n.intersectObjects(r,!0);if(s.length>0){const a=s[0].distance;return i.distanceTo(n.ray.origin)Math.abs(t)<1e-10?0:t;function Ds(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Br(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const Yc=(t=>e=>Ds(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Kc=(t=>(e,n)=>Ds(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]),Wc=["geometry","material"];new ts;var Ur={exports:{}},Xc=Ur.exports,lo;function Zc(){return lo||(lo=1,function(t,e){(function(n,r){t.exports=r()})(Xc,function(){var n=function(){function r(d){return s.appendChild(d.dom),d}function i(d){for(var b=0;bl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var b=performance.memory;p.update(b.usedJSHeapSize/1048576,b.jsHeapSizeLimit/1048576)}return d},update:function(){a=this.end()},domElement:s,setMode:i}};return n.Panel=function(r,i,o){var s=1/0,a=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,f=48*u,p=3*u,d=2*u,b=3*u,x=15*u,v=74*u,T=30*u,I=document.createElement("canvas");I.width=c,I.height=f,I.style.cssText="width:80px;height:48px";var A=I.getContext("2d");return A.font="bold "+9*u+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=o,A.fillRect(0,0,c,f),A.fillStyle=i,A.fillText(r,p,d),A.fillRect(b,x,v,T),A.fillStyle=o,A.globalAlpha=.9,A.fillRect(b,x,v,T),{dom:I,update:function(C,P){s=Math.min(s,C),a=Math.max(a,C),A.fillStyle=o,A.globalAlpha=1,A.fillRect(0,0,c,x),A.fillStyle=i,A.fillText(l(C)+" "+r+" ("+l(s)+"-"+l(a)+")",p,d),A.drawImage(I,b+u,x,v-u,T,b,x,v-u,T),A.fillRect(b+v-u,x,u,T),A.fillStyle=o,A.globalAlpha=.9,A.fillRect(b+v-u,x,u,l((1-C/P)*T))}}},n})}(Ur)),Ur.exports}Zc();const Qc={key:0,args:[0,1,64]},Jc={key:1,args:[.5,1,64]},ef={key:2},tf=["tone-mapped","map","side","color"];new Fe(16777215);const Ut=ze({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","mousedown"],setup(t,{emit:e}){const n=t,r=e,i=W(null);function o(b,x,v){return Math.min(Math.max(b,x),v)}function s(b){const x=b.toString();return x.includes("e-")?Number.parseInt(x.split("e-")[1],10):x.includes(".")?x.split(".")[1].length:0}function a(b,x){const v=s(x),T=10**(v+3);return Number.parseFloat((b*T/T).toFixed(v))}const l=Ue(()=>a(o(n.modelValue,n.min,n.max),n.step)),u=Ue(()=>{const b=(l.value-n.min)/(n.max-n.min)*100;return{width:`${b}%`,backgroundSize:`${b}% 100%`}});function c(b){if(!i.value)return l.value;const x=i.value.getBoundingClientRect(),T=(b.clientX-x.left)/x.width,I=n.max-n.min,A=n.min+I*T,C=Math.round(A/n.step)*n.step;return Math.min(Math.max(C,n.min),n.max)}function f(b){if(n.disabled)return;const x=c(b);r("update:modelValue",x)}function p(b){if(n.disabled)return;b.preventDefault();const x=c(b);r("update:modelValue",x),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(b){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Ot(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(b,x)=>(ee(),ie("span",{ref_key:"sliderRef",ref:i,class:at(["range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50",{disabled:t.disabled}]),bg:"[#e6e1fc] dark:[#676085]","touch-action-none":"",relative:"","inline-block":"","w-full":"","cursor-ew-resize":"","rounded-sm":"",onMousedown:p},[z("span",{style:Dr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),z("span",{role:"slider",class:"slider-thumb",style:Dr({left:`${(l.value-t.min)/(t.max-t.min)*100}%`}),absolute:"","rounded-sm":"",w:"[1px]",h:"[14px]",bg:"zinc-100 dark:zinc-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function uo(t,e){if(e===sl)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Or||e===ls){let n=t.getIndex();if(n===null){const s=[],a=t.getAttribute("position");if(a!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new Of(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&a[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}u.setExtensions(s),u.setPlugins(a),u.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function rf(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const he={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"};class of{constructor(e){this.parser=e,this.name=he.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,s)}}class vf{constructor(e){this.parser=e,this.name=he.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const s=o.extensions[n],a=i.images[s.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class bf{constructor(e){this.parser=e,this.name=he.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const s=o.extensions[n],a=i.images[s.source];let l=r.textureLoader;if(a.uri){const u=r.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,s.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class wf{constructor(e){this.name=he.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(a){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,p=new Uint8Array(a,l,u);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):s.ready.then(function(){const d=new ArrayBuffer(c*f);return s.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class Tf{constructor(e){this.name=he.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==nt.TRIANGLES&&u.mode!==nt.TRIANGLE_STRIP&&u.mode!==nt.TRIANGLE_FAN&&u.mode!==void 0)return null;const s=r.extensions[this.name].attributes,a=[],l={};for(const u in s)a.push(this.parser.getDependency("accessor",s[u]).then(c=>(l[u]=c,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const b of f){const x=new xt,v=new se,T=new zn,I=new se(1,1,1),A=new fl(b.geometry,b.material,p);for(let C=0;C0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const Df=new xt;class Of{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new rf,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 r=!1,i=-1,o=!1,s=-1;if(typeof navigator<"u"){const a=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(a)===!0;const l=a.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=a.indexOf("Firefox")>-1,s=o?a.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&s<98?this.textureLoader=new pl(this.options.manager):this.textureLoader=new hl(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new us(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(s){const a={scene:s[0][i.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:i.asset,parser:r,userData:{}};return Rt(o,a,i),gt(a,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(s);l!=null&&this.associations.set(a,l);for(const[u,c]of s.children.entries())o(c,a.children[u])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(g,h[S*l+1]),l>=3&&v.setZ(g,h[S*l+2]),l>=4&&v.setW(g,h[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=b}return v})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,s=n.images[o];let a=this.textureLoader;if(s.uri){const l=r.manager.getHandler(s.uri);l!==null&&(a=l)}return this.loadTextureImage(e,o,a)}loadTextureImage(e,n,r){const i=this,o=this.json,s=o.textures[e],a=o.images[n],l=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=s.name||a.name||"",c.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(c.name=a.uri);const p=(o.samplers||{})[s.sampler]||{};return c.magFilter=fo[p.magFilter]||Bn,c.minFilter=fo[p.minFilter]||oi,c.wrapS=po[p.wrapS]||Un,c.wrapT=po[p.wrapT]||Un,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==Bn,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const s=i.images[e],a=self.URL||self.webkitURL;let l=s.uri||"",u=!1;if(s.bufferView!==void 0)l=r.getDependency("bufferView",s.bufferView).then(function(f){u=!0;const p=new Blob([f],{type:s.mimeType});return l=a.createObjectURL(p),l});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(p,d){let b=p;n.isImageBitmapLoader===!0&&(b=function(x){const v=new Fn(x);v.needsUpdate=!0,p(v)}),n.load(cn.resolveURL(f,o.path),b,void 0,d)})}).then(function(f){return u===!0&&a.revokeObjectURL(l),gt(f,s),f.userData.mimeType=s.mimeType||Pf(s.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(s){if(!s)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(s=s.clone(),s.channel=r.texCoord),o.extensions[he.KHR_TEXTURE_TRANSFORM]){const a=r.extensions!==void 0?r.extensions[he.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=o.associations.get(s);s=o.extensions[he.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),o.associations.set(s,l)}}return i!==void 0&&(s.colorSpace=i),e[n]=s,s})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,s=n.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new ml,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(a,l)),r=l}else if(e.isLine){const a="LineBasicMaterial:"+r.uuid;let l=this.cache.get(a);l||(l=new gl,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(a,l)),r=l}if(i||o||s){let a="ClonedMaterial:"+r.uuid+":";i&&(a+="derivative-tangents:"),o&&(a+="vertex-colors:"),s&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=r.clone(),o&&(l.vertexColors=!0),s&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return cs}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let s;const a={},l=o.extensions||{},u=[];if(l[he.KHR_MATERIALS_UNLIT]){const f=i[he.KHR_MATERIALS_UNLIT];s=f.getMaterialType(),u.push(f.extendParams(a,o,n))}else{const f=o.pbrMetallicRoughness||{};if(a.color=new Fe(1,1,1),a.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;a.color.setRGB(p[0],p[1],p[2],vt),a.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(a,"map",f.baseColorTexture,mn)),a.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,a.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(a,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(a,"roughnessMap",f.metallicRoughnessTexture))),s=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}o.doubleSided===!0&&(a.side=Yn);const c=o.alphaMode||xr.OPAQUE;if(c===xr.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===xr.MASK&&(a.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&s!==Vt&&(u.push(n.assignTexture(a,"normalMap",o.normalTexture)),a.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;a.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&s!==Vt&&(u.push(n.assignTexture(a,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&s!==Vt){const f=o.emissiveFactor;a.emissive=new Fe().setRGB(f[0],f[1],f[2],vt)}return o.emissiveTexture!==void 0&&s!==Vt&&u.push(n.assignTexture(a,"emissiveMap",o.emissiveTexture,mn)),Promise.all(u).then(function(){const f=new s(a);return o.name&&(f.name=o.name),gt(f,o),n.associations.set(f,{materials:e}),o.extensions&&Rt(i,f,o),f})}createUniqueName(e){const n=hn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(a){return r[he.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,n).then(function(l){return ho(l,a,n)})}const s=[];for(let a=0,l=e.length;a0&&Nf(T,o),T.name=n.createUniqueName(o.name||"mesh_"+e),gt(T,o),v.extensions&&Rt(i,T,v),n.assignFinalMaterial(T),f.push(T)}for(let d=0,b=f.length;d1?c=new rr:u.length===1?c=u[0]:c=new si,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof nr||p instanceof Fn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const s=[],a=e.name?e.name:e.uuid,l=[];Tt[o.path]===Tt.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(a);let u;switch(Tt[o.path]){case Tt.weights:u=Ni;break;case Tt.rotation:u=Li;break;case Tt.translation:case Tt.scale:u=Ci;break;default:switch(r.itemSize){case 1:u=Ni;break;case 2:case 3:default:u=Ci;break}break}const c=i.interpolation!==void 0?If[i.interpolation]:ti,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew _a(t)),Ct.register(t=>new Aa(t)),Ct)}async function Ff(t){const r=(await Fs().loadAsync(t)).userData;if(!r.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(r.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return r.vrmAnimations[0]}async function Bf(t,e){if(!t){console.warn("No VRM found");return}if(e)return Ea(e,t)}function Uf(){const t=W(!1),e=W(0),n=W(0),r=.2,i=1,o=6,s=W(Math.random()*(o-i)+i);function a(l,u){if(l!=null&&l.expressionManager&&(n.value+=u,!t.value&&n.value>=s.value&&(t.value=!0,e.value=0),t.value)){e.value+=u/r;const c=Math.sin(Math.PI*e.value);l.expressionManager.setValue("blink",c),e.value>=1&&(t.value=!1,n.value=0,l.expressionManager.setValue("blink",0),s.value=Math.random()*(o-i)+i)}}return{update:a}}function jf(){let t=-1,e,n=0;function r(){e?e.set(on(-.25,.25),on(-.2,.15),-.65):e=new se(on(-.25,.25),on(-.2,.15),-.65)}function i(o,s){var a;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=Ma()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new si),o.lookAt.target.position.lerp(e,on(.2,.5)),(a=o.lookAt)==null||a.update(s),n+=s)}return{update:i}}async function Vf(t,e){const i=(await Fs().loadAsync(t,s=>{var a;return(a=e==null?void 0:e.onProgress)==null?void 0:a.call(e,s)})).userData;if(!i.vrm)return;const o=i.vrm;if(Nr.removeUnnecessaryVertices(o.scene),Nr.combineSkeletons(o.scene),o.scene.traverse(s=>{s.frustumCulled=!1}),o.lookAt){const s=new Sa(o.lookAt);s.name="lookAtQuaternionProxy",o.scene.add(s)}return e!=null&&e.scene&&e.scene.add(o.scene),e!=null&&e.position&&o.scene.position.set(...e.position),o}function Hf(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),s=W(),a=(T,I,A)=>T+(I-T)*A,l=T=>T<.5?4*T*T*T:1-(-2*T+2)**3/2,u=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}]]),c=()=>{s.value&&(clearTimeout(s.value),s.value=void 0)},f=T=>{var A;if(c(),!u.has(T)){console.warn(`Emotion ${T} not found`);return}const I=u.get(T);if(e.value=T,n.value=!0,r.value=0,t.expressionManager){const C=Object.keys(t.expressionManager.expressionMap);for(const P of C)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const C of I.expression||[]){const P=((A=t.expressionManager)==null?void 0:A.getValue(C.name))||0;i.value.set(C.name,P),o.value.set(C.name,C.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(T,I)=>{c(),f(T),s.value=setTimeout(()=>{f("neutral"),s.value=void 0},I)},update:T=>{var C;if(!n.value||!e.value)return;const A=u.get(e.value).blendDuration||.3;r.value+=T/A,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const S=i.value.get(P)||0,y=a(S,h,l(r.value));(C=t.expressionManager)==null||C.setValue(P,y)}},addEmotionState:(T,I)=>{u.set(T,I)},removeEmotionState:T=>{u.delete(T)},dispose:()=>{c()}}}const Gf=ze({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const s=W(),a=W(),{scene:l}=qn(),{onBeforeRender:u}=On(),c=Uf(),f=jf(),p=W();je(()=>r.position,([x,v,T])=>{s.value&&s.value.scene.position.set(x,v,T)}),pn(async()=>{if(l.value)try{const x=await Vf(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:I=>i("loadModelProgress",Number.parseFloat((100*(I.loaded/I.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const v=await Ff(r.idleAnimation),T=await Bf(x,v);if(!T){console.warn("No VRM animation loaded");return}a.value=new Ml(x.scene),a.value.clipAction(T).play(),p.value=Hf(x),s.value=x,o=u(({delta:I})=>{var A,C,P;(A=a.value)==null||A.update(I),(C=s.value)==null||C.update(I),c.update(s.value,I),f.update(s.value,I),(P=p.value)==null||P.update(I)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),s.value&&(s.value.scene.removeFromParent(),Nr.deepDispose(s.value.scene))}),e({setExpression(x){var v;(v=p.value)==null||v.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:b}=On();return je(()=>r.paused,x=>{x?d():b()}),(x,v)=>gn(x.$slots,"default")}}),$f=["position"],qf={absolute:"",bottom:"3",right:"3"},Yf={flex:"~ row","cursor-pointer":""},Kf=["checked","aria-checked"],Wf={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(b)}}),(b,x)=>(ee(),Xt(ys,{relative:""},{default:Be(({height:v,width:T})=>[ke(H(Sl),{alpha:!0,antialias:!0,width:T,height:v},{default:Be(()=>[ke(H(Cc)),z("TresPerspectiveCamera",{position:[s.value,a.value,l.value]},null,8,$f),x[14]||(x[14]=z("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=z("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),ke(Gf,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:x[0]||(x[0]=I=>i("loadModelProgress",I)),onError:x[1]||(x[1]=I=>i("error",I))},null,8,["model","idle-animation","position","paused"])]),_:2},1032,["width","height"]),z("div",qf,[z("div",Yf,[z("label",{class:at([o.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(z("input",{"onUpdate:modelValue":x[2]||(x[2]=I=>o.value=I),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,Kf),[[Jr,o.value]]),x[16]||(x[16]=z("div",{"select-none":""},[z("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(ci,null,{default:Be(()=>[o.value?(ee(),ie("div",Wf,[z("div",Xf,[z("div",Zf,[z("span",null,ge(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),ke(Oi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Be(()=>[z("span",Qf,ge(H(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Be(()=>[z("div",Jf,[x[17]||(x[17]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"X")],-1)),z("label",ed,[ke(Ut,{modelValue:s.value,"onUpdate:modelValue":x[3]||(x[3]=I=>s.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",td,[z("span",null,ge(s.value),1)]),x[18]||(x[18]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"Y")],-1)),z("label",nd,[ke(Ut,{modelValue:a.value,"onUpdate:modelValue":x[4]||(x[4]=I=>a.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",rd,[z("span",null,ge(a.value),1)]),x[19]||(x[19]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"Z")],-1)),z("label",id,[ke(Ut,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=I=>l.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",od,[z("span",null,ge(l.value),1)])])]),_:1}),ke(Oi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Be(()=>[z("span",sd,ge(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Be(()=>[z("div",ad,[x[20]||(x[20]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"X")],-1)),z("label",ld,[ke(Ut,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=I=>u.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",ud,[z("span",null,ge(u.value),1)]),x[21]||(x[21]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"Y")],-1)),z("label",cd,[ke(Ut,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=I=>c.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",fd,[z("span",null,ge(c.value),1)]),x[22]||(x[22]=z("div",{text:"zinc-400 dark:zinc-500"},[z("span",null,"Z")],-1)),z("label",dd,[ke(Ut,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=I=>f.value=I),min:-10,max:10,step:.01},null,8,["modelValue"])]),z("div",pd,[z("span",null,ge(f.value),1)])])]),_:1}),z("div",hd,[z("span",null,ge(H(d)("stage.viewers.debug-menu.emotions")),1)]),z("div",md,[z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("neutral")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("surprised")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("sad")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("angry")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),z("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=I=>{var A;return(A=p.value)==null?void 0:A.setExpression("happy")})},ge(H(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):it("",!0)]),_:1})])]),_:1}))}}),yd=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class bn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}bn.prototype.normal={};bn.prototype.property={};bn.prototype.space=void 0;function Bs(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new bn(n,r,e)}function Hr(t){return t.toLowerCase()}class We{constructor(e,n){this.attribute=n,this.property=e}}We.prototype.attribute="";We.prototype.booleanish=!1;We.prototype.boolean=!1;We.prototype.commaOrSpaceSeparated=!1;We.prototype.commaSeparated=!1;We.prototype.defined=!1;We.prototype.mustUseProperty=!1;We.prototype.number=!1;We.prototype.overloadedBoolean=!1;We.prototype.property="";We.prototype.spaceSeparated=!1;We.prototype.space=void 0;let xd=0;const fe=zt(),Le=zt(),Us=zt(),$=zt(),Re=zt(),Yt=zt(),Qe=zt();function zt(){return 2**++xd}const Gr=Object.freeze(Object.defineProperty({__proto__:null,boolean:fe,booleanish:Le,commaOrSpaceSeparated:Qe,commaSeparated:Yt,number:$,overloadedBoolean:Us,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),br=Object.keys(Gr);class hi extends We{constructor(e,n,r,i){let o=-1;if(super(e,n),mo(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Td.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(go,Ad);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!go.test(o)){let s=o.replace(wd,_d);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=hi}return new i(r,e)}function _d(t){return"-"+t.toLowerCase()}function Ad(t){return t.charAt(1).toUpperCase()}const Ed=Bs([js,vd,Gs,$s,qs],"html"),Ys=Bs([js,bd,Gs,$s,qs],"svg"),yo={}.hasOwnProperty;function Md(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&yo.call(i,t)){const l=String(i[t]);s=yo.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Sd=/^>|^->||--!>|"],Rd=["<",">"];function Cd(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return $t(o,Object.assign({},r.settings.characterReferences,{subset:Rd}))}}function Nd(t,e,n,r){return""}function Ld(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Pd(t){return t.join(" ").trim()}const Dd=/[ \t\n\f\r]/g;function mi(t){return typeof t=="object"?t.type==="text"?xo(t.value):!1:xo(t)}function xo(t){return t.replace(Dd,"")===""}const De=Ws(1),Ks=Ws(-1),Od=[];function Ws(t){return e;function e(n,r,i){const o=n?n.children:Od;let s=(r||0)+t,a=o[s];if(!i)for(;a&&mi(a);)s+=t,a=o[s];return a}}const zd={}.hasOwnProperty;function Xs(t){return e;function e(n,r,i){return zd.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const gi=Xs({body:Bd,caption:wr,colgroup:wr,dd:Hd,dt:Vd,head:wr,html:Fd,li:jd,optgroup:Gd,option:$d,p:Ud,rp:vo,rt:vo,tbody:Yd,td:bo,tfoot:Kd,th:bo,thead:qd,tr:Wd});function wr(t,e,n){const r=De(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&mi(r.value.charAt(0)))}function Fd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function Bd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function Ud(t,e,n){const r=De(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function jd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Vd(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Hd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function vo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Gd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function $d(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function qd(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Yd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Kd(t,e,n){return!De(n,e)}function Wd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function bo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Xd=Xs({body:Jd,colgroup:ep,head:Qd,html:Zd,tbody:tp});function Zd(t){const e=De(t,-1);return!e||e.type!=="comment"}function Qd(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function Jd(t){const e=De(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&mi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function ep(t,e,n){const r=Ks(n,e),i=De(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&gi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function tp(t,e,n){const r=Ks(n,e),i=De(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&gi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const In={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -516,18 +516,18 @@ void main() { \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ep(t,e,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=Ys);const u=tp(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(s=!1),(u||!o||!Kd(t,e,n))&&(a.push("<",t.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!o||!gi(t,e,n))&&a.push(""),a.join("")}function tp(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=np(t,i,e[i]);o&&n.push(o)}}for(;++rDi(n,t.alternative)&&(s=t.alternative),a=s+$t(n,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?In.single:In.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const rp=["<","&"];function Qs(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:$t(t.value,Object.assign({},r.settings.characterReferences,{subset:rp}))}function ip(t,e,n,r){return r.settings.allowDangerousHtml?t.value:Qs(t,e,n,r)}function op(t,e,n,r){return r.all(t)}const sp=Ad("type",{invalid:ap,unknown:lp,handlers:{comment:Id,doctype:Rd,element:ep,raw:ip,root:op,text:Qs}});function ap(t){throw new Error("Expected node, not `"+t+"`")}function lp(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const up={},cp={},fp=[];function dp(t,e){const n=e||up,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:pp,all:hp,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||md,characterReferences:n.characterReferences||cp,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Ys:_d,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function pp(t,e,n){return sp(t,e,n,this)}function hp(t){const e=[],n=t&&t.children||fp;let r=-1;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o0?(ct(t,t.length,0,e),t):e}const ko={}.hasOwnProperty;function vp(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Kt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ut=It(/[A-Za-z]/),et=It(/[\dA-Za-z]/),Tp=It(/[#-'*+\--9=?A-Z^-~]/);function $r(t){return t!==null&&(t<32||t===127)}const qr=It(/\d/),kp=It(/[\dA-Fa-f]/),_p=It(/[!-/:-@[-`{-~]/);function ae(t){return t!==null&&t<-2}function Ke(t){return t!==null&&(t<0||t===32)}function Ae(t){return t===-2||t===-1||t===32}const Ap=It(new RegExp("\\p{P}|\\p{S}","u")),Ep=It(/\s/);function It(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Jt(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ce(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Ae(l)?(t.enter(n),a(l)):e(l)}function a(l){return Ae(l)&&o++s))return;const S=e.events.length;let y=S,g,m;for(;y--;)if(e.events[y][0]==="exit"&&e.events[y][1].type==="chunkFlow"){if(g){m=e.events[y][1].end;break}g=!0}for(T(r),h=S;hA;){const P=n[C];e.containerState=P[1],P[0].exit.call(e,t)}n.length=A}function I(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Cp(t,e,n){return Ce(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ao(t){if(t===null||Ke(t)||Ep(t))return 1;if(Ap(t))return 2}function xi(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Eo(f,-l),Eo(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[r][1].end={...s.start},t[n][1].start={...a.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=rt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=rt(u,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),u=rt(u,xi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=rt(u,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=rt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,ct(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Ae(h)?Ce(t,I,"linePrefix",o+1)(h):I(h)}function I(h){return h===null||ae(h)?t.check(Mo,x,C)(h):(t.enter("codeFlowValue"),A(h))}function A(h){return h===null||ae(h)?(t.exit("codeFlowValue"),I(h)):(t.consume(h),A)}function C(h){return t.exit("codeFenced"),e(h)}function P(h,S,y){let g=0;return m;function m(D){return h.enter("lineEnding"),h.consume(D),h.exit("lineEnding"),k}function k(D){return h.enter("codeFencedFence"),Ae(D)?Ce(h,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):E(D)}function E(D){return D===a?(h.enter("codeFencedFenceSequence"),O(D)):y(D)}function O(D){return D===a?(g++,h.consume(D),O):g>=s?(h.exit("codeFencedFenceSequence"),Ae(D)?Ce(h,F,"whitespace")(D):F(D)):y(D)}function F(D){return D===null||ae(D)?(h.exit("codeFencedFence"),S(D)):y(D)}}}function Hp(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const Tr={name:"codeIndented",tokenize:$p},Gp={partial:!0,tokenize:qp};function $p(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Ce(t,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ae(u)?t.attempt(Gp,s,l)(u):(t.enter("codeFlowValue"),a(u))}function a(u){return u===null||ae(u)?(t.exit("codeFlowValue"),s(u)):(t.consume(u),a)}function l(u){return t.exit("codeIndented"),e(u)}}function qp(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ae(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Ce(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):ae(s)?i(s):n(s)}}const Yp={name:"codeText",previous:Wp,resolve:Kp,tokenize:Xp};function Kp(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();const i=this.left.slice(e);return i.push(...this.right.slice(this.right.length-r+this.left.length).reverse()),i}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&an(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),an(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),an(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function ia(t,e,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(T){return T===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(T),t.exit(o),p):T===null||T===32||T===41||$r(T)?n(T):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),x(T))}function p(T){return T===62?(t.enter(o),t.consume(T),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(T))}function d(T){return T===62?(t.exit("chunkString"),t.exit(a),p(T)):T===null||T===60||ae(T)?n(T):(t.consume(T),T===92?b:d)}function b(T){return T===60||T===62||T===92?(t.consume(T),d):d(T)}function x(T){return!c&&(T===null||T===41||Ke(T))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(T)):c999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):ae(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||ae(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),l||(l=!Ae(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function sa(t,e,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,l):n(p)}function l(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(o),u(p))}function u(p){return p===s?(t.exit(o),l(s)):p===null?n(p):ae(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ce(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||ae(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function fn(t,e){let n;return r;function r(i){return ae(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ae(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const ih={name:"definition",tokenize:sh},oh={partial:!0,tokenize:ah};function sh(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return oa.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Kt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return Ke(d)?fn(t,u)(d):u(d)}function u(d){return ia(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(oh,f,f)(d)}function f(d){return Ae(d)?Ce(t,p,"whitespace")(d):p(d)}function p(d){return d===null||ae(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function ah(t,e,n){return r;function r(a){return Ke(a)?fn(t,i)(a):n(a)}function i(a){return sa(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ae(a)?Ce(t,s,"whitespace")(a):s(a)}function s(a){return a===null||ae(a)?e(a):n(a)}}const lh={name:"hardBreakEscape",tokenize:uh};function uh(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return ae(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const ch={name:"headingAtx",resolve:fh,tokenize:dh};function fh(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ct(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function dh(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(t.consume(c),s):c===null||Ke(c)?(t.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||ae(c)?(t.exit("atxHeading"),e(c)):Ae(c)?Ce(t,a,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Ke(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),u)}}const ph=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Io=["pre","script","style","textarea"],hh={concrete:!0,name:"htmlFlow",resolveTo:yh,tokenize:xh},mh={partial:!0,tokenize:bh},gh={partial:!0,tokenize:vh};function yh(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function xh(t,e,n){const r=this;let i,o,s,a,l;return u;function u(R){return c(R)}function c(R){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(R),f}function f(R){return R===33?(t.consume(R),p):R===47?(t.consume(R),o=!0,x):R===63?(t.consume(R),i=3,r.interrupt?e:_):ut(R)?(t.consume(R),s=String.fromCharCode(R),v):n(R)}function p(R){return R===45?(t.consume(R),i=2,d):R===91?(t.consume(R),i=5,a=0,b):ut(R)?(t.consume(R),i=4,r.interrupt?e:_):n(R)}function d(R){return R===45?(t.consume(R),r.interrupt?e:_):n(R)}function b(R){const pe="CDATA[";return R===pe.charCodeAt(a++)?(t.consume(R),a===pe.length?r.interrupt?e:E:b):n(R)}function x(R){return ut(R)?(t.consume(R),s=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||Ke(R)){const pe=R===47,ye=s.toLowerCase();return!pe&&!o&&Io.includes(ye)?(i=1,r.interrupt?e(R):E(R)):ph.includes(s.toLowerCase())?(i=6,pe?(t.consume(R),T):r.interrupt?e(R):E(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?I(R):A(R))}return R===45||et(R)?(t.consume(R),s+=String.fromCharCode(R),v):n(R)}function T(R){return R===62?(t.consume(R),r.interrupt?e:E):n(R)}function I(R){return Ae(R)?(t.consume(R),I):m(R)}function A(R){return R===47?(t.consume(R),m):R===58||R===95||ut(R)?(t.consume(R),C):Ae(R)?(t.consume(R),A):m(R)}function C(R){return R===45||R===46||R===58||R===95||et(R)?(t.consume(R),C):P(R)}function P(R){return R===61?(t.consume(R),h):Ae(R)?(t.consume(R),P):A(R)}function h(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),l=R,S):Ae(R)?(t.consume(R),h):y(R)}function S(R){return R===l?(t.consume(R),l=null,g):R===null||ae(R)?n(R):(t.consume(R),S)}function y(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||Ke(R)?P(R):(t.consume(R),y)}function g(R){return R===47||R===62||Ae(R)?A(R):n(R)}function m(R){return R===62?(t.consume(R),k):n(R)}function k(R){return R===null||ae(R)?E(R):Ae(R)?(t.consume(R),k):n(R)}function E(R){return R===45&&i===2?(t.consume(R),B):R===60&&i===1?(t.consume(R),X):R===62&&i===4?(t.consume(R),te):R===63&&i===3?(t.consume(R),_):R===93&&i===5?(t.consume(R),Q):ae(R)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(mh,ce,O)(R)):R===null||ae(R)?(t.exit("htmlFlowData"),O(R)):(t.consume(R),E)}function O(R){return t.check(gh,F,ce)(R)}function F(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),D}function D(R){return R===null||ae(R)?O(R):(t.enter("htmlFlowData"),E(R))}function B(R){return R===45?(t.consume(R),_):E(R)}function X(R){return R===47?(t.consume(R),s="",Z):E(R)}function Z(R){if(R===62){const pe=s.toLowerCase();return Io.includes(pe)?(t.consume(R),te):E(R)}return ut(R)&&s.length<8?(t.consume(R),s+=String.fromCharCode(R),Z):E(R)}function Q(R){return R===93?(t.consume(R),_):E(R)}function _(R){return R===62?(t.consume(R),te):R===45&&i===2?(t.consume(R),_):E(R)}function te(R){return R===null||ae(R)?(t.exit("htmlFlowData"),ce(R)):(t.consume(R),te)}function ce(R){return t.exit("htmlFlow"),e(R)}}function vh(t,e,n){const r=this;return i;function i(s){return ae(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function bh(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Qn,e,n)}}const wh={name:"htmlText",tokenize:Th};function Th(t,e,n){const r=this;let i,o,s;return a;function a(_){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(_),l}function l(_){return _===33?(t.consume(_),u):_===47?(t.consume(_),P):_===63?(t.consume(_),A):ut(_)?(t.consume(_),y):n(_)}function u(_){return _===45?(t.consume(_),c):_===91?(t.consume(_),o=0,b):ut(_)?(t.consume(_),I):n(_)}function c(_){return _===45?(t.consume(_),d):n(_)}function f(_){return _===null?n(_):_===45?(t.consume(_),p):ae(_)?(s=f,X(_)):(t.consume(_),f)}function p(_){return _===45?(t.consume(_),d):f(_)}function d(_){return _===62?B(_):_===45?p(_):f(_)}function b(_){const te="CDATA[";return _===te.charCodeAt(o++)?(t.consume(_),o===te.length?x:b):n(_)}function x(_){return _===null?n(_):_===93?(t.consume(_),v):ae(_)?(s=x,X(_)):(t.consume(_),x)}function v(_){return _===93?(t.consume(_),T):x(_)}function T(_){return _===62?B(_):_===93?(t.consume(_),T):x(_)}function I(_){return _===null||_===62?B(_):ae(_)?(s=I,X(_)):(t.consume(_),I)}function A(_){return _===null?n(_):_===63?(t.consume(_),C):ae(_)?(s=A,X(_)):(t.consume(_),A)}function C(_){return _===62?B(_):A(_)}function P(_){return ut(_)?(t.consume(_),h):n(_)}function h(_){return _===45||et(_)?(t.consume(_),h):S(_)}function S(_){return ae(_)?(s=S,X(_)):Ae(_)?(t.consume(_),S):B(_)}function y(_){return _===45||et(_)?(t.consume(_),y):_===47||_===62||Ke(_)?g(_):n(_)}function g(_){return _===47?(t.consume(_),B):_===58||_===95||ut(_)?(t.consume(_),m):ae(_)?(s=g,X(_)):Ae(_)?(t.consume(_),g):B(_)}function m(_){return _===45||_===46||_===58||_===95||et(_)?(t.consume(_),m):k(_)}function k(_){return _===61?(t.consume(_),E):ae(_)?(s=k,X(_)):Ae(_)?(t.consume(_),k):g(_)}function E(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(t.consume(_),i=_,O):ae(_)?(s=E,X(_)):Ae(_)?(t.consume(_),E):(t.consume(_),F)}function O(_){return _===i?(t.consume(_),i=void 0,D):_===null?n(_):ae(_)?(s=O,X(_)):(t.consume(_),O)}function F(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Ke(_)?g(_):(t.consume(_),F)}function D(_){return _===47||_===62||Ke(_)?g(_):n(_)}function B(_){return _===62?(t.consume(_),t.exit("htmlTextData"),t.exit("htmlText"),e):n(_)}function X(_){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),Z}function Z(_){return Ae(_)?Ce(t,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Q(_)}function Q(_){return t.enter("htmlTextData"),s(_)}}const vi={name:"labelEnd",resolveAll:Eh,resolveTo:Mh,tokenize:Sh},kh={tokenize:Ih},_h={tokenize:Rh},Ah={tokenize:Ch};function Eh(t){let e=-1;const n=[];for(;++e=3&&(u===null||ae(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Ae(u)?Ce(t,a,"whitespace")(u):a(u))}}const qe={continuation:{tokenize:jh},exit:Hh,name:"list",tokenize:Uh},Fh={partial:!0,tokenize:Gh},Bh={partial:!0,tokenize:Vh};function Uh(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const b=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:qr(d)){if(r.containerState.type||(r.containerState.type=b,t.enter(b,{_container:!0})),b==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Dn,n,u)(d):u(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return qr(d)&&++s<10?(t.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),u(d)):n(d)}function u(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(Qn,r.interrupt?n:c,t.attempt(Fh,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return Ae(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function jh(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Qn,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Bh,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(qe,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Vh(t,e,n){const r=this;return Ce(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function Hh(t){t.exit(this.containerState.type)}function Gh(t,e,n){const r=this;return Ce(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Ae(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Ro={name:"setextUnderline",resolveTo:$h,tokenize:qh};function $h(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function qh(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return t.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(t.consume(u),a):(t.exit("setextHeadingLineSequence"),Ae(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ae(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Yh={tokenize:Kh};function Kh(t){const e=this,n=t.attempt(Qn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Jp,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Wh={resolveAll:la()},Xh=aa("string"),Qh=aa("text");function aa(t){return{resolveAll:la(t==="text"?Zh:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function fm(t,e){let n=-1;const r=[];let i;for(;++n\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function np(t,e,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=Ys);const u=rp(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(s=!1),(u||!o||!Xd(t,e,n))&&(a.push("<",t.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!o||!gi(t,e,n))&&a.push(""),a.join("")}function rp(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=ip(t,i,e[i]);o&&n.push(o)}}for(;++rDi(n,t.alternative)&&(s=t.alternative),a=s+$t(n,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?In.single:In.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const op=["<","&"];function Zs(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:$t(t.value,Object.assign({},r.settings.characterReferences,{subset:op}))}function sp(t,e,n,r){return r.settings.allowDangerousHtml?t.value:Zs(t,e,n,r)}function ap(t,e,n,r){return r.all(t)}const lp=Md("type",{invalid:up,unknown:cp,handlers:{comment:Cd,doctype:Nd,element:np,raw:sp,root:ap,text:Zs}});function up(t){throw new Error("Expected node, not `"+t+"`")}function cp(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const fp={},dp={},pp=[];function hp(t,e){const n=e||fp,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:mp,all:gp,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||yd,characterReferences:n.characterReferences||dp,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Ys:Ed,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function mp(t,e,n){return lp(t,e,n,this)}function gp(t){const e=[],n=t&&t.children||pp;let r=-1;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(e,n),t.splice(...s);else for(n&&t.splice(e,n);o0?(ct(t,t.length,0,e),t):e}const ko={}.hasOwnProperty;function wp(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Kt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ut=It(/[A-Za-z]/),et=It(/[\dA-Za-z]/),_p=It(/[#-'*+\--9=?A-Z^-~]/);function $r(t){return t!==null&&(t<32||t===127)}const qr=It(/\d/),Ap=It(/[\dA-Fa-f]/),Ep=It(/[!-/:-@[-`{-~]/);function ae(t){return t!==null&&t<-2}function Ke(t){return t!==null&&(t<0||t===32)}function Ae(t){return t===-2||t===-1||t===32}const Mp=It(new RegExp("\\p{P}|\\p{S}","u")),Sp=It(/\s/);function It(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Jt(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=t.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(e.push(t.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ce(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Ae(l)?(t.enter(n),a(l)):e(l)}function a(l){return Ae(l)&&o++s))return;const S=e.events.length;let y=S,g,m;for(;y--;)if(e.events[y][0]==="exit"&&e.events[y][1].type==="chunkFlow"){if(g){m=e.events[y][1].end;break}g=!0}for(T(r),h=S;hA;){const P=n[C];e.containerState=P[1],P[0].exit.call(e,t)}n.length=A}function I(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Lp(t,e,n){return Ce(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ao(t){if(t===null||Ke(t)||Sp(t))return 1;if(Mp(t))return 2}function xi(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Eo(f,-l),Eo(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[r][1].end={...s.start},t[n][1].start={...a.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=rt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=rt(u,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),u=rt(u,xi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=rt(u,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=rt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,ct(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Ae(h)?Ce(t,I,"linePrefix",o+1)(h):I(h)}function I(h){return h===null||ae(h)?t.check(Mo,x,C)(h):(t.enter("codeFlowValue"),A(h))}function A(h){return h===null||ae(h)?(t.exit("codeFlowValue"),I(h)):(t.consume(h),A)}function C(h){return t.exit("codeFenced"),e(h)}function P(h,S,y){let g=0;return m;function m(D){return h.enter("lineEnding"),h.consume(D),h.exit("lineEnding"),k}function k(D){return h.enter("codeFencedFence"),Ae(D)?Ce(h,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):E(D)}function E(D){return D===a?(h.enter("codeFencedFenceSequence"),O(D)):y(D)}function O(D){return D===a?(g++,h.consume(D),O):g>=s?(h.exit("codeFencedFenceSequence"),Ae(D)?Ce(h,F,"whitespace")(D):F(D)):y(D)}function F(D){return D===null||ae(D)?(h.exit("codeFencedFence"),S(D)):y(D)}}}function $p(t,e,n){const r=this;return i;function i(s){return s===null?n(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}const Tr={name:"codeIndented",tokenize:Yp},qp={partial:!0,tokenize:Kp};function Yp(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Ce(t,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ae(u)?t.attempt(qp,s,l)(u):(t.enter("codeFlowValue"),a(u))}function a(u){return u===null||ae(u)?(t.exit("codeFlowValue"),s(u)):(t.consume(u),a)}function l(u){return t.exit("codeIndented"),e(u)}}function Kp(t,e,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ae(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):Ce(t,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):ae(s)?i(s):n(s)}}const Wp={name:"codeText",previous:Zp,resolve:Xp,tokenize:Qp};function Xp(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();const i=this.left.slice(e);return i.push(...this.right.slice(this.right.length-r+this.left.length).reverse()),i}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&an(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),an(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),an(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(s):t.interrupt(r.parser.constructs.flow,n,e)(s)}}function ia(t,e,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(T){return T===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(T),t.exit(o),p):T===null||T===32||T===41||$r(T)?n(T):(t.enter(r),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),x(T))}function p(T){return T===62?(t.enter(o),t.consume(T),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(T))}function d(T){return T===62?(t.exit("chunkString"),t.exit(a),p(T)):T===null||T===60||ae(T)?n(T):(t.consume(T),T===92?b:d)}function b(T){return T===60||T===62||T===92?(t.consume(T),d):d(T)}function x(T){return!c&&(T===null||T===41||Ke(T))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(r),e(T)):c999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):ae(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||ae(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),l||(l=!Ae(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function sa(t,e,n,r,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,l):n(p)}function l(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(o),u(p))}function u(p){return p===s?(t.exit(o),l(s)):p===null?n(p):ae(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ce(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||ae(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function fn(t,e){let n;return r;function r(i){return ae(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ae(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const sh={name:"definition",tokenize:lh},ah={partial:!0,tokenize:uh};function lh(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return oa.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Kt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return Ke(d)?fn(t,u)(d):u(d)}function u(d){return ia(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(ah,f,f)(d)}function f(d){return Ae(d)?Ce(t,p,"whitespace")(d):p(d)}function p(d){return d===null||ae(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function uh(t,e,n){return r;function r(a){return Ke(a)?fn(t,i)(a):n(a)}function i(a){return sa(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ae(a)?Ce(t,s,"whitespace")(a):s(a)}function s(a){return a===null||ae(a)?e(a):n(a)}}const ch={name:"hardBreakEscape",tokenize:fh};function fh(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return ae(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const dh={name:"headingAtx",resolve:ph,tokenize:hh};function ph(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ct(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function hh(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(t.consume(c),s):c===null||Ke(c)?(t.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||ae(c)?(t.exit("atxHeading"),e(c)):Ae(c)?Ce(t,a,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Ke(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),u)}}const mh=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Io=["pre","script","style","textarea"],gh={concrete:!0,name:"htmlFlow",resolveTo:vh,tokenize:bh},yh={partial:!0,tokenize:Th},xh={partial:!0,tokenize:wh};function vh(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function bh(t,e,n){const r=this;let i,o,s,a,l;return u;function u(R){return c(R)}function c(R){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(R),f}function f(R){return R===33?(t.consume(R),p):R===47?(t.consume(R),o=!0,x):R===63?(t.consume(R),i=3,r.interrupt?e:_):ut(R)?(t.consume(R),s=String.fromCharCode(R),v):n(R)}function p(R){return R===45?(t.consume(R),i=2,d):R===91?(t.consume(R),i=5,a=0,b):ut(R)?(t.consume(R),i=4,r.interrupt?e:_):n(R)}function d(R){return R===45?(t.consume(R),r.interrupt?e:_):n(R)}function b(R){const pe="CDATA[";return R===pe.charCodeAt(a++)?(t.consume(R),a===pe.length?r.interrupt?e:E:b):n(R)}function x(R){return ut(R)?(t.consume(R),s=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||Ke(R)){const pe=R===47,ye=s.toLowerCase();return!pe&&!o&&Io.includes(ye)?(i=1,r.interrupt?e(R):E(R)):mh.includes(s.toLowerCase())?(i=6,pe?(t.consume(R),T):r.interrupt?e(R):E(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?I(R):A(R))}return R===45||et(R)?(t.consume(R),s+=String.fromCharCode(R),v):n(R)}function T(R){return R===62?(t.consume(R),r.interrupt?e:E):n(R)}function I(R){return Ae(R)?(t.consume(R),I):m(R)}function A(R){return R===47?(t.consume(R),m):R===58||R===95||ut(R)?(t.consume(R),C):Ae(R)?(t.consume(R),A):m(R)}function C(R){return R===45||R===46||R===58||R===95||et(R)?(t.consume(R),C):P(R)}function P(R){return R===61?(t.consume(R),h):Ae(R)?(t.consume(R),P):A(R)}function h(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),l=R,S):Ae(R)?(t.consume(R),h):y(R)}function S(R){return R===l?(t.consume(R),l=null,g):R===null||ae(R)?n(R):(t.consume(R),S)}function y(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||Ke(R)?P(R):(t.consume(R),y)}function g(R){return R===47||R===62||Ae(R)?A(R):n(R)}function m(R){return R===62?(t.consume(R),k):n(R)}function k(R){return R===null||ae(R)?E(R):Ae(R)?(t.consume(R),k):n(R)}function E(R){return R===45&&i===2?(t.consume(R),B):R===60&&i===1?(t.consume(R),X):R===62&&i===4?(t.consume(R),te):R===63&&i===3?(t.consume(R),_):R===93&&i===5?(t.consume(R),Z):ae(R)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(yh,ce,O)(R)):R===null||ae(R)?(t.exit("htmlFlowData"),O(R)):(t.consume(R),E)}function O(R){return t.check(xh,F,ce)(R)}function F(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),D}function D(R){return R===null||ae(R)?O(R):(t.enter("htmlFlowData"),E(R))}function B(R){return R===45?(t.consume(R),_):E(R)}function X(R){return R===47?(t.consume(R),s="",Q):E(R)}function Q(R){if(R===62){const pe=s.toLowerCase();return Io.includes(pe)?(t.consume(R),te):E(R)}return ut(R)&&s.length<8?(t.consume(R),s+=String.fromCharCode(R),Q):E(R)}function Z(R){return R===93?(t.consume(R),_):E(R)}function _(R){return R===62?(t.consume(R),te):R===45&&i===2?(t.consume(R),_):E(R)}function te(R){return R===null||ae(R)?(t.exit("htmlFlowData"),ce(R)):(t.consume(R),te)}function ce(R){return t.exit("htmlFlow"),e(R)}}function wh(t,e,n){const r=this;return i;function i(s){return ae(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):e(s)}}function Th(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Zn,e,n)}}const kh={name:"htmlText",tokenize:_h};function _h(t,e,n){const r=this;let i,o,s;return a;function a(_){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(_),l}function l(_){return _===33?(t.consume(_),u):_===47?(t.consume(_),P):_===63?(t.consume(_),A):ut(_)?(t.consume(_),y):n(_)}function u(_){return _===45?(t.consume(_),c):_===91?(t.consume(_),o=0,b):ut(_)?(t.consume(_),I):n(_)}function c(_){return _===45?(t.consume(_),d):n(_)}function f(_){return _===null?n(_):_===45?(t.consume(_),p):ae(_)?(s=f,X(_)):(t.consume(_),f)}function p(_){return _===45?(t.consume(_),d):f(_)}function d(_){return _===62?B(_):_===45?p(_):f(_)}function b(_){const te="CDATA[";return _===te.charCodeAt(o++)?(t.consume(_),o===te.length?x:b):n(_)}function x(_){return _===null?n(_):_===93?(t.consume(_),v):ae(_)?(s=x,X(_)):(t.consume(_),x)}function v(_){return _===93?(t.consume(_),T):x(_)}function T(_){return _===62?B(_):_===93?(t.consume(_),T):x(_)}function I(_){return _===null||_===62?B(_):ae(_)?(s=I,X(_)):(t.consume(_),I)}function A(_){return _===null?n(_):_===63?(t.consume(_),C):ae(_)?(s=A,X(_)):(t.consume(_),A)}function C(_){return _===62?B(_):A(_)}function P(_){return ut(_)?(t.consume(_),h):n(_)}function h(_){return _===45||et(_)?(t.consume(_),h):S(_)}function S(_){return ae(_)?(s=S,X(_)):Ae(_)?(t.consume(_),S):B(_)}function y(_){return _===45||et(_)?(t.consume(_),y):_===47||_===62||Ke(_)?g(_):n(_)}function g(_){return _===47?(t.consume(_),B):_===58||_===95||ut(_)?(t.consume(_),m):ae(_)?(s=g,X(_)):Ae(_)?(t.consume(_),g):B(_)}function m(_){return _===45||_===46||_===58||_===95||et(_)?(t.consume(_),m):k(_)}function k(_){return _===61?(t.consume(_),E):ae(_)?(s=k,X(_)):Ae(_)?(t.consume(_),k):g(_)}function E(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(t.consume(_),i=_,O):ae(_)?(s=E,X(_)):Ae(_)?(t.consume(_),E):(t.consume(_),F)}function O(_){return _===i?(t.consume(_),i=void 0,D):_===null?n(_):ae(_)?(s=O,X(_)):(t.consume(_),O)}function F(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Ke(_)?g(_):(t.consume(_),F)}function D(_){return _===47||_===62||Ke(_)?g(_):n(_)}function B(_){return _===62?(t.consume(_),t.exit("htmlTextData"),t.exit("htmlText"),e):n(_)}function X(_){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),Q}function Q(_){return Ae(_)?Ce(t,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Z(_)}function Z(_){return t.enter("htmlTextData"),s(_)}}const vi={name:"labelEnd",resolveAll:Sh,resolveTo:Ih,tokenize:Rh},Ah={tokenize:Ch},Eh={tokenize:Nh},Mh={tokenize:Lh};function Sh(t){let e=-1;const n=[];for(;++e=3&&(u===null||ae(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Ae(u)?Ce(t,a,"whitespace")(u):a(u))}}const qe={continuation:{tokenize:Hh},exit:$h,name:"list",tokenize:Vh},Uh={partial:!0,tokenize:qh},jh={partial:!0,tokenize:Gh};function Vh(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const b=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:qr(d)){if(r.containerState.type||(r.containerState.type=b,t.enter(b,{_container:!0})),b==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Dn,n,u)(d):u(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return qr(d)&&++s<10?(t.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),u(d)):n(d)}function u(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(Zn,r.interrupt?n:c,t.attempt(Uh,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return Ae(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function Hh(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Zn,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(t,e,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(jh,e,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(qe,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Gh(t,e,n){const r=this;return Ce(t,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?e(o):n(o)}}function $h(t){t.exit(this.containerState.type)}function qh(t,e,n){const r=this;return Ce(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Ae(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Ro={name:"setextUnderline",resolveTo:Yh,tokenize:Kh};function Yh(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=s,t.push(["exit",s,e]),t}function Kh(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return t.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(t.consume(u),a):(t.exit("setextHeadingLineSequence"),Ae(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ae(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Wh={tokenize:Xh};function Xh(t){const e=this,n=t.attempt(Zn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(th,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Zh={resolveAll:la()},Qh=aa("string"),Jh=aa("text");function aa(t){return{resolveAll:la(t==="text"?em:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function pm(t,e){let n=-1;const r=[];let i;for(;++n0){const He=oe.tokenStack[oe.tokenStack.length-1];(He[1]||Po).call(oe,void 0,He[0])}for(K.position={start:kt(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:kt(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function Sm(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Im(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function fa(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Rm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return fa(t,e);const i={src:Jt(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,o),t.applyData(e,o)}function Cm(t,e){const n={src:Jt(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Nm(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Lm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return fa(t,e);const i={href:Jt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function Pm(t,e){const n={href:Jt(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Dm(t,e,n){const r=t.all(e),i=n?Om(n):da(e),o={},s=[];if(typeof e.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a0){const He=oe.tokenStack[oe.tokenStack.length-1];(He[1]||Po).call(oe,void 0,He[0])}for(K.position={start:kt(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:kt(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function Rm(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Cm(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function fa(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Nm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return fa(t,e);const i={src:Jt(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,o),t.applyData(e,o)}function Lm(t,e){const n={src:Jt(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Pm(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Dm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return fa(t,e);const i={href:Jt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function Om(t,e){const n={href:Jt(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function zm(t,e,n){const r=t.all(e),i=n?Fm(n):da(e),o={},s=[];if(typeof e.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function zm(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function jm(t){const e=ha(t),n=pa(t);if(e&&n)return{start:e,end:n}}function Vm(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=ha(e.children[1]),l=pa(e.children[e.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function Hm(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(zo(e.slice(i),i>0,!1)),o.join("")}function zo(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===Do||o===Oo;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===Do||o===Oo;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function qm(t,e){const n={type:"text",value:$m(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Ym(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Km={blockquote:Tm,break:km,code:_m,delete:Am,emphasis:Em,footnoteReference:Mm,heading:Sm,html:Im,imageReference:Rm,image:Cm,inlineCode:Nm,linkReference:Lm,link:Pm,listItem:Dm,list:zm,paragraph:Fm,root:Bm,strong:Um,table:Vm,tableCell:Gm,tableRow:Hm,text:qm,thematicBreak:Ym,toml:Rn,yaml:Rn,definition:Rn,footnoteDefinition:Rn};function Rn(){}const ga=-1,Zn=0,Vn=1,Hn=2,bi=3,wi=4,Ti=5,ki=6,ya=7,xa=8,Fo=typeof self=="object"?self:globalThis,Wm=(t,e)=>{const n=(i,o)=>(t.set(o,i),i),r=i=>{if(t.has(i))return t.get(i);const[o,s]=e[i];switch(o){case Zn:case ga:return n(s,i);case Vn:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Hn:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case bi:return n(new Date(s),i);case wi:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case Ti:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case ki:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case ya:{const{name:a,message:l}=s;return n(new Fo[a](l),i)}case xa:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new Fo[o](s),i)};return r},Bo=t=>Wm(new Map,t)(0),jt="",{toString:Xm}={},{keys:Qm}=Object,ln=t=>{const e=typeof t;if(e!=="object"||!t)return[Zn,e];const n=Xm.call(t).slice(8,-1);switch(n){case"Array":return[Vn,jt];case"Object":return[Hn,jt];case"Date":return[bi,jt];case"RegExp":return[wi,jt];case"Map":return[Ti,jt];case"Set":return[ki,jt]}return n.includes("Array")?[Vn,n]:n.includes("Error")?[ya,n]:[Hn,n]},Cn=([t,e])=>t===Zn&&(e==="function"||e==="symbol"),Zm=(t,e,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=ln(s);switch(a){case Zn:{let c=s;switch(l){case"bigint":a=xa,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([ga],s)}return i([a,c],s)}case Vn:{if(l)return i([l,[...s]],s);const c=[],f=i([a,c],s);for(const p of s)c.push(o(p));return f}case Hn:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const c=[],f=i([a,c],s);for(const p of Qm(s))(t||!Cn(ln(s[p])))&&c.push([o(p),o(s[p])]);return f}case bi:return i([a,s.toISOString()],s);case wi:{const{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case Ti:{const c=[],f=i([a,c],s);for(const[p,d]of s)(t||!(Cn(ln(p))||Cn(ln(d))))&&c.push([o(p),o(d)]);return f}case ki:{const c=[],f=i([a,c],s);for(const p of s)(t||!Cn(ln(p)))&&c.push(o(p));return f}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},Uo=(t,{json:e,lossy:n}={})=>{const r=[];return Zm(!(e||n),!!e,new Map,r)(t),r},Gn=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Bo(Uo(t,e)):structuredClone(t):(t,e)=>Bo(Uo(t,e));function Jm(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function eg(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function tg(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Jm,r=t.options.footnoteBackLabel||eg,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l0&&b.push({type:"text",value:" "});let I=typeof n=="string"?n:n(l,d);typeof I=="string"&&(I={type:"text",value:I}),b.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const I=v.children[v.children.length-1];I&&I.type==="text"?I.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...b)}else c.push(...b);const T={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,T),a.push(T)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Gn(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:o,children:s};return t.patch(e,u),t.applyData(e,u)}function Fm(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r1}function Bm(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Hm(t){const e=ha(t),n=pa(t);if(e&&n)return{start:e,end:n}}function Gm(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=ha(e.children[1]),l=pa(e.children[e.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function $m(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(zo(e.slice(i),i>0,!1)),o.join("")}function zo(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===Do||o===Oo;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===Do||o===Oo;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Km(t,e){const n={type:"text",value:Ym(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Wm(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Xm={blockquote:_m,break:Am,code:Em,delete:Mm,emphasis:Sm,footnoteReference:Im,heading:Rm,html:Cm,imageReference:Nm,image:Lm,inlineCode:Pm,linkReference:Dm,link:Om,listItem:zm,list:Bm,paragraph:Um,root:jm,strong:Vm,table:Gm,tableCell:qm,tableRow:$m,text:Km,thematicBreak:Wm,toml:Rn,yaml:Rn,definition:Rn,footnoteDefinition:Rn};function Rn(){}const ga=-1,Qn=0,Vn=1,Hn=2,bi=3,wi=4,Ti=5,ki=6,ya=7,xa=8,Fo=typeof self=="object"?self:globalThis,Zm=(t,e)=>{const n=(i,o)=>(t.set(o,i),i),r=i=>{if(t.has(i))return t.get(i);const[o,s]=e[i];switch(o){case Qn:case ga:return n(s,i);case Vn:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Hn:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case bi:return n(new Date(s),i);case wi:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case Ti:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case ki:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case ya:{const{name:a,message:l}=s;return n(new Fo[a](l),i)}case xa:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new Fo[o](s),i)};return r},Bo=t=>Zm(new Map,t)(0),jt="",{toString:Qm}={},{keys:Jm}=Object,ln=t=>{const e=typeof t;if(e!=="object"||!t)return[Qn,e];const n=Qm.call(t).slice(8,-1);switch(n){case"Array":return[Vn,jt];case"Object":return[Hn,jt];case"Date":return[bi,jt];case"RegExp":return[wi,jt];case"Map":return[Ti,jt];case"Set":return[ki,jt]}return n.includes("Array")?[Vn,n]:n.includes("Error")?[ya,n]:[Hn,n]},Cn=([t,e])=>t===Qn&&(e==="function"||e==="symbol"),eg=(t,e,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=ln(s);switch(a){case Qn:{let c=s;switch(l){case"bigint":a=xa,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([ga],s)}return i([a,c],s)}case Vn:{if(l)return i([l,[...s]],s);const c=[],f=i([a,c],s);for(const p of s)c.push(o(p));return f}case Hn:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const c=[],f=i([a,c],s);for(const p of Jm(s))(t||!Cn(ln(s[p])))&&c.push([o(p),o(s[p])]);return f}case bi:return i([a,s.toISOString()],s);case wi:{const{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case Ti:{const c=[],f=i([a,c],s);for(const[p,d]of s)(t||!(Cn(ln(p))||Cn(ln(d))))&&c.push([o(p),o(d)]);return f}case ki:{const c=[],f=i([a,c],s);for(const p of s)(t||!Cn(ln(p)))&&c.push(o(p));return f}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},Uo=(t,{json:e,lossy:n}={})=>{const r=[];return eg(!(e||n),!!e,new Map,r)(t),r},Gn=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Bo(Uo(t,e)):structuredClone(t):(t,e)=>Bo(Uo(t,e));function tg(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function ng(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function rg(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||tg,r=t.options.footnoteBackLabel||ng,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",s=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l0&&b.push({type:"text",value:" "});let I=typeof n=="string"?n:n(l,d);typeof I=="string"&&(I={type:"text",value:I}),b.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(I)?I:[I]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const I=v.children[v.children.length-1];I&&I.type==="text"?I.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...b)}else c.push(...b);const T={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,T),a.push(T)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Gn(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:` -`}]}}const va=function(t){if(t==null)return og;if(typeof t=="function")return Jn(t);if(typeof t=="object")return Array.isArray(t)?ng(t):rg(t);if(typeof t=="string")return ig(t);throw new Error("Expected function, string, or object as test")};function ng(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let d=ba,b,x,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=cg(n(l,c)),d[0]===jo))return d;if("children"in l&&l.children){const T=l;if(T.children&&d[0]!==lg)for(x=(r?T.children.length:-1)+s,v=c.concat(T);x>-1&&x":""))+")"})}return p;function p(){let d=ba,b,x,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=dg(n(l,c)),d[0]===jo))return d;if("children"in l&&l.children){const T=l;if(T.children&&d[0]!==cg)for(x=(r?T.children.length:-1)+s,v=c.concat(T);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function Vo(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Ho(t,e){const n=pg(t,e),r=n.one(t,void 0),i=tg(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function xg(t,e){return t&&"run"in t?async function(n,r){const i=Ho(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Ho(n,{file:r,...t||e})}}function Go(t){if(t)throw t}var _r,$o;function vg(){if($o)return _r;$o=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},o=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var p;for(p in u);return typeof p>"u"||t.call(u,p)},s=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},a=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return _r=function l(){var u,c,f,p,d,b,x=arguments[0],v=1,T=arguments.length,I=!1;for(typeof x=="boolean"&&(I=x,x=arguments[1]||{},v=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});vs.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}class Xe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=dn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const lt={basename:kg,dirname:_g,extname:Ag,join:Eg,sep:"/"};function kg(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');wn(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function _g(t){if(wn(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Ag(t){wn(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.codePointAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Eg(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Sg(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function wn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Ig={cwd:Rg};function Rg(){return"/"}function Qr(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Cg(t){if(typeof t=="string")t=new URL(t);else if(!Qr(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Ng(t)}function Ng(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[d,...b]=c;const x=r[p][1];Xr(x)&&Xr(d)&&(d=Ar(!0,x,d)),r[p]=[u,d,...b]}}}}const zg=new _i().freeze();function Ir(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Rr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Cr(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yo(t){if(!Xr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Ko(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Nn(t){return Fg(t)?t:new Lg(t)}function Fg(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Bg(t){return typeof t=="string"||Ug(t)}function Ug(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function Ai(){const t=zg().use(wm).use(xg).use(mp);return{process:e=>t.processSync(e).toString()}}const jg={relative:""},Vg={"h-full":"","w-full":""},Hg={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"primary-600","px-2":"","py-2":"",transform:"translate-x--1/2"},Gg={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},$g=["innerHTML"],qg=ze({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=W(),n=W(),{stageView:r}=Ye(Wt()),{mouthOpenSize:i}=Ye(iu()),{audioContext:o,calculateVolume:s}=gs(),{onBeforeMessageComposed:a,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:b}=Ai(),x=ui(),v=W(),T=W(!1),I=W(!1),A=or({handlers:[_=>new Promise(te=>{const ce=o.createBufferSource();ce.buffer=_.data.audioBuffer,ce.connect(o.destination),ce.connect(v.value),T.value=!0,ce.start(0),ce.onended=()=>{T.value=!1,te()}})]}),C=Fl(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:S,activeSpeechVoice:y,pitch:g}=Ye(C);async function m(_){try{if(!h.value){console.warn("No active speech provider configured");return}if(!y.value){console.warn("No active speech voice configured");return}const te=x.getProviderInstance(h.value);if(!te){console.error("Failed to initialize speech provider");return}const ce=x.getProviderConfig(h.value),R=P.value?C.generateSSML(_.data,y.value,{...ce,pitch:g.value}):_.data,pe=await Bl({...te.speech(S.value,ce),input:R,voice:y.value.id}),ye=await o.decodeAudioData(pe);await A.add({audioBuffer:ye,text:_.data})}catch(te){console.error("Speech generation failed:",te)}}const k=or({handlers:[m]});k.on("add",_=>{console.debug("ttsQueue added",_)});const E=Ul(k),{live2dCurrentMotion:O}=Ye(Wt()),F=or({handlers:[async _=>{if(r.value==="3d"){const te=La[_.data];if(!te)return;await n.value.setExpression(te)}else r.value==="2d"&&(O.value={group:Pa[_.data]})}]}),D=jl(F);D.onHandlerEvent("emotion",_=>{console.debug("emotion detected",_)});const B=Vl();B.onHandlerEvent("delay",_=>{console.debug("delay detected",_)});function X(){requestAnimationFrame(X),T.value&&(i.value=s(v.value,"linear"))}function Z(){I.value||(X(),o.resume(),I.value=!0)}function Q(){v.value||(v.value=o.createAnalyser())}return a(async()=>{Q(),Z()}),l(async()=>{O.value={group:Si}}),u(async _=>{await E.add(_)}),c(async _=>{await B.add(_),await D.add(_)}),f(async()=>{await B.add(Hl)}),d(async _=>{}),Ot(()=>{var te,ce,R;I.value=!1;const _=window;(te=_.electron)==null||te.ipcRenderer.removeAllListeners("before-hide"),(ce=_.electron)==null||ce.ipcRenderer.removeAllListeners("after-show"),(R=_.electron)==null||R.ipcRenderer.removeAllListeners("before-quit")}),pn(()=>{var te,ce,R;const _=window;(te=_.electron)==null||te.ipcRenderer.on("before-hide",()=>{O.value={group:Ia}}),(ce=_.electron)==null||ce.ipcRenderer.on("after-show",()=>{O.value={group:Ra}}),(R=_.electron)==null||R.ipcRenderer.on("before-quit",()=>{O.value={group:Si}})}),pn(async()=>{e.value=Ca("duckdb-wasm://?bundles=import-url"),await e.value.execute(Na`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(_,te)=>(ee(),ie("div",jg,[z("div",Vg,[H(r)==="2d"?(ee(),Xt(bu,{key:0,"mouth-open-size":H(i),"min-w":"50% (ee(),ie("header",Zg,[z("div",Jg,[ke(Jl)]),ke(H(Rl),{class:"m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-zinc-100 p-2 text-lg text-zinc-500 outline-none dark:bg-zinc-800 dark:text-zinc-400",to:"/settings"},{default:Be(()=>n[0]||(n[0]=[z("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1})]))}});function wa(t,e){const n=fs(e??{},{...zi.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=Cl("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const s=H(t);if(!s)return;const a=await navigator.mediaDevices.getUserMedia({audio:{deviceId:s}});r.value=await zi.MicVAD.new({...n,stream:a}),n.auto&&r.value.start()}return je(i,o,{immediate:!0}),je(Nl(t),o,{immediate:!0}),Ll(o),Ot(()=>{r.value&&(r.value.destroy(),r.value=void 0)}),{destroy:()=>{r.value&&(r.value.destroy(),r.value=void 0)},start:()=>{r.value&&r.value.start()}}}function ty(t,e){const n=fs(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=Pl(t,{type:"module"}),s=W(null),a=W(""),l=W([]),u=W(!1),c=W(0),f=W("");return je(i,p=>{var d,b,x,v,T,I,A,C;switch(p.status){case"loading":s.value="loading",a.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(b=n.onInitiate)==null||b.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(x=n.onProgress)==null||x.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":s.value="ready",(T=n.onReady)==null||T.call(n);break;case"start":u.value=!0,(I=n.onStart)==null||I.call(n);break;case"update":c.value=p.tps,(A=n.onUpdate)==null||A.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(C=n.onComplete)==null||C.call(n,p.output[0]);break}}),Ot(()=>{o()}),{transcribe:p=>r(p),status:s,loadingMessage:a,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const ny="/assets/worker-D9VCBMJ0.js";async function ry(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Ln(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Ln(r,8,"WAVE"),Ln(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,e,!0),r.setUint32(28,e*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),Ln(r,36,"data"),r.setUint32(40,t.length*2,!0),iy(r,44,t);const i=new Blob([r],{type:"audio/wav"});return new Promise((o,s)=>{const a=new FileReader;a.onload=()=>{const l=a.result.split(",")[1];o(l)},a.onerror=s,a.readAsDataURL(i)})}function Ln(t,e,n){for(let r=0;r{jn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ps("auto-animate");return ee(),ie("div",oy,[f[2]||(f[2]=z("div",{"flex-1":""},null,-1)),At((ee(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=z("div",{"flex-1":""},null,-1)),(ee(!0),ie(ai,null,li(H(n),(d,b)=>(ee(),ie("div",{key:b,"mb-2":""},[d.role==="error"?(ee(),ie("div",sy,[z("div",ay,[z("div",ly,[z("div",uy,[z("span",cy,ge(H(s)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=z("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),H(r)?(ee(),ie("div",fy)):(ee(),ie("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!E||!E.trim())return;const O=o.getProviderConfig(s.value);await d(E,{chatProvider:o.getProviderInstance(s.value),model:a.value,providerConfig:O})}});async function h(){if(e.value.trim())try{const E=o.getProviderConfig(s.value);await d(e.value,{chatProvider:o.getProviderInstance(s.value),model:a.value,providerConfig:E})}catch(E){x.value.pop(),x.value.push({role:"error",content:E.message})}}const{destroy:S,start:y}=wa(p,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:E=>{n.value=!1,m(E)},auto:!1});function g(){C.value!=="loading"&&(A(),y())}async function m(E){await v.resume();const O=await ry(E,v.sampleRate);I({type:"generate",data:{audio:O,language:"en"}})}async function k(E){const O=E.target,F=u.value.find(D=>D.deviceId===O.value);if(!F){c.value=void 0;return}c.value=F}return je(f,async E=>{E==="false"&&(S(),P())}),b(async()=>{e.value=""}),(E,O)=>(ee(),ie("div",_y,[z("fieldset",Ay,[z("label",{class:at([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(l)}]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover: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-l-lg":"","px-2":""},[At(z("input",{"onUpdate:modelValue":O[0]||(O[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ir,r.value]]),O[5]||(O[5]=z("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),z("div",My,[z("span",Sy,ge(H(T)("stage.chat.tabs.chat")),1)])],10,Ey),z("label",{class:at([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(l)}]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover: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":"","px-2":""},[At(z("input",{"onUpdate:modelValue":O[1]||(O[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ir,r.value]]),O[6]||(O[6]=z("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),z("div",Ry,[z("span",null,ge(H(T)("stage.chat.tabs.custom")),1)])],10,Iy),z("label",{class:at([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(l)}]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover: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-r-lg":"","px-2":""},[At(z("input",{"onUpdate:modelValue":O[2]||(O[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ir,r.value]]),O[7]||(O[7]=z("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),z("div",Ny,[z("span",null,ge(H(T)("stage.chat.tabs.clothes")),1)])],10,Cy)]),z("div",Ly,[z("div",Py,[ke(ky,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:H(T)("stage.message"),text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 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:at({"transition-colors-none placeholder:transition-colors-none":H(l)}),onSubmit:h},null,8,["modelValue","placeholder","class"])])])]),z("div",Oy,[z("button",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:at({"transition-colors-none":H(l)}),text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:g},[ke(Ol,{mode:"out-in"},{default:Be(()=>[H(C)===null?(ee(),ie("div",zy,ge(H(T)("stage.operations.load-models")),1)):H(C)==="loading"?(ee(),ie("div",Fy,[O[8]||(O[8]=z("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),z("span",null,ge(H(T)("stage.operations.load-models-status.loading")),1)])):H(C)==="ready"?(ee(),ie("div",By,[O[9]||(O[9]=z("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),z("span",null,ge(H(T)("stage.operations.load-models-status.ready")),1)])):it("",!0)]),_:1})],2),z("div",Uy,[ke(H(ci),null,{default:Be(()=>[i.value?(ee(),ie("fieldset",jy,[(ee(!0),ie(ai,null,li(H(u),(F,D)=>(ee(),ie("label",{key:D,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[z("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:k},null,40,Vy),z("div",Hy,[z("div",Gy,[F.deviceId===H(p)?(ee(),ie("div",$y)):it("",!0)]),z("span",{"inline-block":"",class:at([F.deviceId===H(p)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},ge(F.label),3)])]))),128))])):it("",!0)]),_:1}),z("label",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:at({"transition-colors-none":H(l)}),text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":""},[At(z("input",{"onUpdate:modelValue":O[4]||(O[4]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[Jr,i.value]]),O[10]||(O[10]=z("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),z("div",null,[n.value?(ee(),ie("span",Yy,"Listening...")):(ee(),ie("span",qy,ge(H(T)("settings.microphone")),1))])],2)])])]))}}),Wy=Kn(Ky,[["__scopeId","data-v-0b41b5bf"]]),Xy={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Qy={key:0,flex:"",mr:"12"},Zy={flex:"~ col",border:"4 solid primary-200/50 dark:primary-500/50",shadow:"md primary-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {jn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ps("auto-animate");return ee(),ie("div",Xy,[c[1]||(c[1]=z("div",{"flex-1":""},null,-1)),At((ee(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[c[0]||(c[0]=z("div",{"flex-1":""},null,-1)),(ee(!0),ie(ai,null,li(H(r),(p,d)=>(ee(),ie("div",{key:d,"mb-2":""},[p.role==="assistant"?(ee(),ie("div",Qy,[z("div",Zy,[z("div",null,[z("span",Jy,ge(H(n)("stage.chat.message.character-name.airi")),1)]),p.content?(ee(),ie("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:v=>{n.value=!1,x()},auto:!1});function x(v){alert("Transcription is not implemented yet")}return je(s,async v=>{v==="false"&&d()}),c(async()=>{e.value=""}),pn(()=>{b()}),(v,T)=>(ee(),ie("div",null,[z("div",l0,[ke(a0,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),z("div",u0,[ke(H(hs),{modelValue:e.value,"onUpdate:modelValue":T[0]||(T[0]=I=>e.value=I),placeholder:H(f)("stage.message"),border:"solid 2 primary-100 dark:primary-400/20",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",class:at({"transition-colors-none placeholder:transition-colors-none":H(l)}),onSubmit:p},null,8,["modelValue","placeholder","class"])])])]))}}),f0={class:"relative"},d0={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},p0=ze({__name:"AnimatedWave",props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"oklch(95% 0.10 var(--theme-colors-hue))"},direction:{default:"down"},movementDirection:{default:"left"},animationSpeed:{default:50}},setup(t){const e=t,n=W(e.height),r=W(e.amplitude),i=W(e.waveLength),o=W(e.fillColor),s=W(e.direction),a=W(e.movementDirection);function l(f,p,d,b,x){const v=[],I=Math.ceil(f/b)*b,A=1,C=x==="up"?d:p-d;v.push(`M 0 ${C}`);const P=Math.PI*2/b;for(let S=0;S<=I;S+=A){const y=d*Math.sin(P*S),g=x==="up"?C-y:C+y;v.push(`L ${S} ${g}`)}const h=x==="up"?p:0;return v.push(`L ${I} ${h}`),v.push(`L 0 ${h} Z`),v.join(" ")}const u=Ue(()=>n.value+r.value*2),c=Ue(()=>{const f=` +`}),n}function Vo(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Ho(t,e){const n=mg(t,e),r=n.one(t,void 0),i=rg(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function bg(t,e){return t&&"run"in t?async function(n,r){const i=Ho(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Ho(n,{file:r,...t||e})}}function Go(t){if(t)throw t}var _r,$o;function wg(){if($o)return _r;$o=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},o=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var p;for(p in u);return typeof p>"u"||t.call(u,p)},s=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},a=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return _r=function l(){var u,c,f,p,d,b,x=arguments[0],v=1,T=arguments.length,I=!1;for(typeof x=="boolean"&&(I=x,x=arguments[1]||{},v=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});vs.length;let l;a&&s.push(i);try{l=t.apply(this,s)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,e(s,...a))}function o(s){i(null,s)}}class Xe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(s=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=dn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const lt={basename:Ag,dirname:Eg,extname:Mg,join:Sg,sep:"/"};function Ag(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');wn(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let s=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=t.length),t.slice(n,r)}function Eg(t){if(wn(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Mg(t){wn(t);let e=t.length,n=-1,r=0,i=-1,o=0,s;for(;e--;){const a=t.codePointAt(e);if(a===47){if(s){r=e+1;break}continue}n<0&&(s=!0,n=e+1),a===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Sg(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Rg(t,e){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=t.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,s):n=t.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function wn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Cg={cwd:Ng};function Ng(){return"/"}function Zr(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Lg(t){if(typeof t=="string")t=new URL(t);else if(!Zr(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Pg(t)}function Pg(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[d,...b]=c;const x=r[p][1];Xr(x)&&Xr(d)&&(d=Ar(!0,x,d)),r[p]=[u,d,...b]}}}}const Bg=new _i().freeze();function Ir(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Rr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Cr(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yo(t){if(!Xr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Ko(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Nn(t){return Ug(t)?t:new Dg(t)}function Ug(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function jg(t){return typeof t=="string"||Vg(t)}function Vg(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function Ai(){const t=Bg().use(km).use(bg).use(yp);return{process:e=>t.processSync(e).toString()}}const Hg={relative:""},Gg={"h-full":"","w-full":""},$g={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"primary-600","px-2":"","py-2":"",transform:"translate-x--1/2"},qg={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},Yg=["innerHTML"],Kg=ze({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=W(),n=W(),{stageView:r}=Ye(Wt()),{mouthOpenSize:i}=Ye(iu()),{audioContext:o,calculateVolume:s}=gs(),{onBeforeMessageComposed:a,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:b}=Ai(),x=ui(),v=W(),T=W(!1),I=W(!1),A=or({handlers:[_=>new Promise(te=>{const ce=o.createBufferSource();ce.buffer=_.data.audioBuffer,ce.connect(o.destination),ce.connect(v.value),T.value=!0,ce.start(0),ce.onended=()=>{T.value=!1,te()}})]}),C=Fl(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:S,activeSpeechVoice:y,pitch:g}=Ye(C);async function m(_){try{if(!h.value){console.warn("No active speech provider configured");return}if(!y.value){console.warn("No active speech voice configured");return}const te=x.getProviderInstance(h.value);if(!te){console.error("Failed to initialize speech provider");return}const ce=x.getProviderConfig(h.value),R=P.value?C.generateSSML(_.data,y.value,{...ce,pitch:g.value}):_.data,pe=await Bl({...te.speech(S.value,ce),input:R,voice:y.value.id}),ye=await o.decodeAudioData(pe);await A.add({audioBuffer:ye,text:_.data})}catch(te){console.error("Speech generation failed:",te)}}const k=or({handlers:[m]});k.on("add",_=>{console.debug("ttsQueue added",_)});const E=Ul(k),{live2dCurrentMotion:O}=Ye(Wt()),F=or({handlers:[async _=>{if(r.value==="3d"){const te=La[_.data];if(!te)return;await n.value.setExpression(te)}else r.value==="2d"&&(O.value={group:Pa[_.data]})}]}),D=jl(F);D.onHandlerEvent("emotion",_=>{console.debug("emotion detected",_)});const B=Vl();B.onHandlerEvent("delay",_=>{console.debug("delay detected",_)});function X(){requestAnimationFrame(X),T.value&&(i.value=s(v.value,"linear"))}function Q(){I.value||(X(),o.resume(),I.value=!0)}function Z(){v.value||(v.value=o.createAnalyser())}return a(async()=>{Z(),Q()}),l(async()=>{O.value={group:Si}}),u(async _=>{await E.add(_)}),c(async _=>{await B.add(_),await D.add(_)}),f(async()=>{await B.add(Hl)}),d(async _=>{}),Ot(()=>{var te,ce,R;I.value=!1;const _=window;(te=_.electron)==null||te.ipcRenderer.removeAllListeners("before-hide"),(ce=_.electron)==null||ce.ipcRenderer.removeAllListeners("after-show"),(R=_.electron)==null||R.ipcRenderer.removeAllListeners("before-quit")}),pn(()=>{var te,ce,R;const _=window;(te=_.electron)==null||te.ipcRenderer.on("before-hide",()=>{O.value={group:Ia}}),(ce=_.electron)==null||ce.ipcRenderer.on("after-show",()=>{O.value={group:Ra}}),(R=_.electron)==null||R.ipcRenderer.on("before-quit",()=>{O.value={group:Si}})}),pn(async()=>{e.value=Ca("duckdb-wasm://?bundles=import-url"),await e.value.execute(Na`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(_,te)=>(ee(),ie("div",Hg,[z("div",Gg,[H(r)==="2d"?(ee(),Xt(Tu,{key:0,"mouth-open-size":H(i),"min-w":"50% (ee(),ie("header",ey,[z("div",ty,[ke(Jl)]),ke(H(Rl),{class:"m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-zinc-100 p-2 text-lg text-zinc-500 outline-none dark:bg-zinc-800 dark:text-zinc-400",to:"/settings"},{default:Be(()=>n[0]||(n[0]=[z("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1})]))}});function wa(t,e){const n=fs(e??{},{...zi.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=Cl("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const s=H(t);if(!s)return;const a=await navigator.mediaDevices.getUserMedia({audio:{deviceId:s}});r.value=await zi.MicVAD.new({...n,stream:a}),n.auto&&r.value.start()}return je(i,o,{immediate:!0}),je(Nl(t),o,{immediate:!0}),Ll(o),Ot(()=>{r.value&&(r.value.destroy(),r.value=void 0)}),{destroy:()=>{r.value&&(r.value.destroy(),r.value=void 0)},start:()=>{r.value&&r.value.start()}}}function ry(t,e){const n=fs(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=Pl(t,{type:"module"}),s=W(null),a=W(""),l=W([]),u=W(!1),c=W(0),f=W("");return je(i,p=>{var d,b,x,v,T,I,A,C;switch(p.status){case"loading":s.value="loading",a.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(b=n.onInitiate)==null||b.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(x=n.onProgress)==null||x.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":s.value="ready",(T=n.onReady)==null||T.call(n);break;case"start":u.value=!0,(I=n.onStart)==null||I.call(n);break;case"update":c.value=p.tps,(A=n.onUpdate)==null||A.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(C=n.onComplete)==null||C.call(n,p.output[0]);break}}),Ot(()=>{o()}),{transcribe:p=>r(p),status:s,loadingMessage:a,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const iy="/assets/worker-Pjvo6JHG.js";async function oy(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Ln(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Ln(r,8,"WAVE"),Ln(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,e,!0),r.setUint32(28,e*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),Ln(r,36,"data"),r.setUint32(40,t.length*2,!0),sy(r,44,t);const i=new Blob([r],{type:"audio/wav"});return new Promise((o,s)=>{const a=new FileReader;a.onload=()=>{const l=a.result.split(",")[1];o(l)},a.onerror=s,a.readAsDataURL(i)})}function Ln(t,e,n){for(let r=0;r{jn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ps("auto-animate");return ee(),ie("div",ay,[f[2]||(f[2]=z("div",{"flex-1":""},null,-1)),At((ee(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=z("div",{"flex-1":""},null,-1)),(ee(!0),ie(ai,null,li(H(n),(d,b)=>(ee(),ie("div",{key:b,"mb-2":""},[d.role==="error"?(ee(),ie("div",ly,[z("div",uy,[z("div",cy,[z("div",fy,[z("span",dy,ge(H(s)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=z("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),H(r)?(ee(),ie("div",py)):(ee(),ie("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!E||!E.trim())return;const O=o.getProviderConfig(s.value);await d(E,{chatProvider:o.getProviderInstance(s.value),model:a.value,providerConfig:O})}});async function h(){if(e.value.trim())try{const E=o.getProviderConfig(s.value);await d(e.value,{chatProvider:o.getProviderInstance(s.value),model:a.value,providerConfig:E})}catch(E){x.value.pop(),x.value.push({role:"error",content:E.message})}}const{destroy:S,start:y}=wa(p,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:E=>{n.value=!1,m(E)},auto:!1});function g(){C.value!=="loading"&&(A(),y())}async function m(E){await v.resume();const O=await oy(E,v.sampleRate);I({type:"generate",data:{audio:O,language:"en"}})}async function k(E){const O=E.target,F=u.value.find(D=>D.deviceId===O.value);if(!F){c.value=void 0;return}c.value=F}return je(f,async E=>{E==="false"&&(S(),P())}),b(async()=>{e.value=""}),(E,O)=>(ee(),ie("div",Ey,[z("fieldset",My,[z("label",{class:at([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(l)}]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover: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-l-lg":"","px-2":""},[At(z("input",{"onUpdate:modelValue":O[0]||(O[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ir,r.value]]),O[5]||(O[5]=z("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),z("div",Iy,[z("span",Ry,ge(H(T)("stage.chat.tabs.chat")),1)])],10,Sy),z("label",{class:at([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(l)}]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover: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":"","px-2":""},[At(z("input",{"onUpdate:modelValue":O[1]||(O[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ir,r.value]]),O[6]||(O[6]=z("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),z("div",Ny,[z("span",null,ge(H(T)("stage.chat.tabs.custom")),1)])],10,Cy),z("label",{class:at([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":H(l)}]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover: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-r-lg":"","px-2":""},[At(z("input",{"onUpdate:modelValue":O[2]||(O[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ir,r.value]]),O[7]||(O[7]=z("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),z("div",Py,[z("span",null,ge(H(T)("stage.chat.tabs.clothes")),1)])],10,Ly)]),z("div",Dy,[z("div",Oy,[ke(Ay,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:H(T)("stage.message"),text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 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:at({"transition-colors-none placeholder:transition-colors-none":H(l)}),onSubmit:h},null,8,["modelValue","placeholder","class"])])])]),z("div",Fy,[z("button",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:at({"transition-colors-none":H(l)}),text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:g},[ke(Ol,{mode:"out-in"},{default:Be(()=>[H(C)===null?(ee(),ie("div",By,ge(H(T)("stage.operations.load-models")),1)):H(C)==="loading"?(ee(),ie("div",Uy,[O[8]||(O[8]=z("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),z("span",null,ge(H(T)("stage.operations.load-models-status.loading")),1)])):H(C)==="ready"?(ee(),ie("div",jy,[O[9]||(O[9]=z("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),z("span",null,ge(H(T)("stage.operations.load-models-status.ready")),1)])):it("",!0)]),_:1})],2),z("div",Vy,[ke(H(ci),null,{default:Be(()=>[i.value?(ee(),ie("fieldset",Hy,[(ee(!0),ie(ai,null,li(H(u),(F,D)=>(ee(),ie("label",{key:D,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[z("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:k},null,40,Gy),z("div",$y,[z("div",qy,[F.deviceId===H(p)?(ee(),ie("div",Yy)):it("",!0)]),z("span",{"inline-block":"",class:at([F.deviceId===H(p)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},ge(F.label),3)])]))),128))])):it("",!0)]),_:1}),z("label",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:at({"transition-colors-none":H(l)}),text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":""},[At(z("input",{"onUpdate:modelValue":O[4]||(O[4]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[Jr,i.value]]),O[10]||(O[10]=z("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),z("div",null,[n.value?(ee(),ie("span",Wy,"Listening...")):(ee(),ie("span",Ky,ge(H(T)("settings.microphone")),1))])],2)])])]))}}),Zy=Kn(Xy,[["__scopeId","data-v-0b41b5bf"]]),Qy={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Jy={key:0,flex:"",mr:"12"},e0={flex:"~ col",border:"4 solid primary-200/50 dark:primary-500/50",shadow:"md primary-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {jn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ps("auto-animate");return ee(),ie("div",Qy,[c[1]||(c[1]=z("div",{"flex-1":""},null,-1)),At((ee(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[c[0]||(c[0]=z("div",{"flex-1":""},null,-1)),(ee(!0),ie(ai,null,li(H(r),(p,d)=>(ee(),ie("div",{key:d,"mb-2":""},[p.role==="assistant"?(ee(),ie("div",Jy,[z("div",e0,[z("div",null,[z("span",t0,ge(H(n)("stage.chat.message.character-name.airi")),1)]),p.content?(ee(),ie("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:v=>{n.value=!1,x()},auto:!1});function x(v){alert("Transcription is not implemented yet")}return je(s,async v=>{v==="false"&&d()}),c(async()=>{e.value=""}),pn(()=>{b()}),(v,T)=>(ee(),ie("div",null,[z("div",c0,[ke(u0,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),z("div",f0,[ke(H(hs),{modelValue:e.value,"onUpdate:modelValue":T[0]||(T[0]=I=>e.value=I),placeholder:H(f)("stage.message"),border:"solid 2 primary-100 dark:primary-400/20",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",class:at({"transition-colors-none placeholder:transition-colors-none":H(l)}),onSubmit:p},null,8,["modelValue","placeholder","class"])])])]))}}),p0={class:"relative"},h0={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},m0=ze({__name:"AnimatedWave",props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"oklch(95% 0.10 var(--theme-colors-hue))"},direction:{default:"down"},movementDirection:{default:"left"},animationSpeed:{default:50}},setup(t){const e=t,n=W(e.height),r=W(e.amplitude),i=W(e.waveLength),o=W(e.fillColor),s=W(e.direction),a=W(e.movementDirection);function l(f,p,d,b,x){const v=[],I=Math.ceil(f/b)*b,A=1,C=x==="up"?d:p-d;v.push(`M 0 ${C}`);const P=Math.PI*2/b;for(let S=0;S<=I;S+=A){const y=d*Math.sin(P*S),g=x==="up"?C-y:C+y;v.push(`L ${S} ${g}`)}const h=x==="up"?p:0;return v.push(`L ${I} ${h}`),v.push(`L 0 ${h} Z`),v.join(" ")}const u=Ue(()=>n.value+r.value*2),c=Ue(()=>{const f=` - `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return je(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction,e.movementDirection],()=>{n.value=e.height,r.value=e.amplitude,i.value=e.waveLength,o.value=e.fillColor,s.value=e.direction,a.value=e.movementDirection},{immediate:!0}),(f,p)=>(ee(),ie("div",f0,[gn(f.$slots,"default",{},void 0,!0),z("div",d0,[z("div",{class:"wave",style:Dr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/t.animationSpeed}s`,"animation-direction":a.value==="left"?"normal":"reverse"})},null,4)])]))}}),h0=Kn(p0,[["__scopeId","data-v-d4cf94d8"]]),m0={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},g0={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (ee(),Xt(Qg,null,{default:Be(()=>[ke(h0,{"fill-color":H(e)?"oklch(35% calc(var(--theme-colors-chroma) * 0.6) var(--theme-colors-hue))":"color-mix(in srgb, oklch(95% calc(var(--theme-colors-chroma-50) * 0.5) var(--theme-colors-hue)) 80%, oklch(100% 0 360))"},{default:Be(()=>[z("div",m0,[z("div",null,[ke(ey,{class:"flex",p2:""})]),z("div",g0,[ke(H(Yg),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),ke(Wy,{class:"flex `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return je(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction,e.movementDirection],()=>{n.value=e.height,r.value=e.amplitude,i.value=e.waveLength,o.value=e.fillColor,s.value=e.direction,a.value=e.movementDirection},{immediate:!0}),(f,p)=>(ee(),ie("div",p0,[gn(f.$slots,"default",{},void 0,!0),z("div",h0,[z("div",{class:"wave",style:Dr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/t.animationSpeed}s`,"animation-direction":a.value==="left"?"normal":"reverse"})},null,4)])]))}}),g0=Kn(m0,[["__scopeId","data-v-d4cf94d8"]]),y0={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},x0={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (ee(),Xt(Jg,null,{default:Be(()=>[ke(g0,{"fill-color":H(e)?"oklch(35% calc(var(--theme-colors-chroma) * 0.6) var(--theme-colors-hue))":"color-mix(in srgb, oklch(95% calc(var(--theme-colors-chroma-50) * 0.5) var(--theme-colors-hue)) 80%, oklch(100% 0 360))"},{default:Be(()=>[z("div",y0,[z("div",null,[ke(ny,{class:"flex",p2:""})]),z("div",x0,[ke(H(Wg),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),ke(Zy,{class:"flex i.map(i=>d[i]); -var f1=Object.defineProperty;var p1=(r,t,e)=>t in r?f1(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var W=(r,t,e)=>p1(r,typeof t!="symbol"?t+"":t,e);import{bm as If,ch as Dn,b2 as m1,a0 as g1,a9 as Fe,V as mt,Q as ne,a3 as Ps,ba as No,av as Hp,ag as Xp,ak as Yp,b3 as ec,b6 as Ef,ci as y1,$ as v1,cj as _1,a1 as b1,ck as Ho,cl as xn,W as qr,a4 as Wn,a_ as Ca,as as nr,cm as w1,X as Ui,b7 as x1,b5 as S1,cn as qp,bb as Af,co as T1,aj as Jl,J as co,bc as I1,bf as E1,bg as A1,bp as M1,cp as Ei}from"./index-BYewP6KR.js";/*! +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-BIhx9KIo.js","assets/index-CL4rmUJ-.js","assets/index-BXUWdGb6.css","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/import-url-node-BfNoxhRr.js"])))=>i.map(i=>d[i]); +var f1=Object.defineProperty;var p1=(r,t,e)=>t in r?f1(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var W=(r,t,e)=>p1(r,typeof t!="symbol"?t+"":t,e);import{bm as If,ch as Dn,b2 as m1,a0 as g1,a9 as Fe,V as mt,Q as ne,a3 as Ps,ba as No,av as Hp,ag as Xp,ak as Yp,b3 as ec,b6 as Ef,ci as y1,$ as v1,cj as _1,a1 as b1,ck as Ho,cl as xn,W as qr,a4 as Wn,a_ as Ca,as as nr,cm as w1,X as Ui,b7 as x1,b5 as S1,cn as qp,bb as Af,co as T1,aj as Jl,J as co,bc as I1,bf as E1,bg as A1,bp as M1,cp as Ei}from"./index-CL4rmUJ-.js";/*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * @@ -4069,13 +4069,13 @@ void main() { */function Jt(r,t,e,n){function i(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(r,t||[])).next())})}function Qg(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rt(r){return this instanceof Rt?(this.v=r,this):new Rt(r)}function br(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(m){return Promise.resolve(m).then(d,h)}}function a(d,m){n[d]&&(i[d]=function(g){return new Promise(function(p,y){s.push([d,g,p,y])>1||l(d,g)})},m&&(i[d]=m(i[d])))}function l(d,m){try{u(n[d](m))}catch(g){f(s[0][3],g)}}function u(d){d.value instanceof Rt?Promise.resolve(d.value.v).then(c,h):f(s[0][2],d)}function c(d){l("next",d)}function h(d){l("throw",d)}function f(d,m){d(m),s.shift(),s.length&&l(s[0][0],s[0][1])}}function Ss(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=r[i]?function(o){return(e=!e)?{value:Rt(r[i](o)),done:!1}:s?s(o):o}:s}}function Bn(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof Qg=="function"?Qg(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(s){e[s]=r[s]&&function(o){return new Promise(function(a,l){o=r[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}const VR=new TextDecoder("utf-8"),Wd=r=>VR.decode(r),jR=new TextEncoder,Qf=r=>jR.encode(r),$R=r=>typeof r=="number",Pb=r=>typeof r=="boolean",Ye=r=>typeof r=="function",wr=r=>r!=null&&Object(r)===r,Is=r=>wr(r)&&Ye(r.then),Qa=r=>wr(r)&&Ye(r[Symbol.iterator]),Uo=r=>wr(r)&&Ye(r[Symbol.asyncIterator]),Hd=r=>wr(r)&&wr(r.schema),Rb=r=>wr(r)&&"done"in r&&"value"in r,Fb=r=>wr(r)&&Ye(r.stat)&&$R(r.fd),Db=r=>wr(r)&&Zf(r.body),oc=r=>"_getDOMStream"in r&&"_getNodeStream"in r,GR=r=>wr(r)&&Ye(r.abort)&&Ye(r.getWriter)&&!oc(r),Zf=r=>wr(r)&&Ye(r.cancel)&&Ye(r.getReader)&&!oc(r),WR=r=>wr(r)&&Ye(r.end)&&Ye(r.write)&&Pb(r.writable)&&!oc(r),Lb=r=>wr(r)&&Ye(r.read)&&Ye(r.pipe)&&Pb(r.readable)&&!oc(r),HR=r=>wr(r)&&Ye(r.clear)&&Ye(r.bytes)&&Ye(r.position)&&Ye(r.setPosition)&&Ye(r.capacity)&&Ye(r.getBufferIdentifier)&&Ye(r.createLong),Kf=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function XR(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lxe(Int32Array,r),Kg=r=>xe(BigInt64Array,r),ce=r=>xe(Uint8Array,r),Xd=r=>(r.next(),r);function*YR(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Kf?e(t):Qa(t)?t:e(t);return yield*Xd(function*(i){let s=null;do s=i.next(yield xe(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const qR=r=>YR(Uint8Array,r);function Nb(r,t){return br(this,arguments,function*(){if(Is(t))return yield Rt(yield Rt(yield*Ss(Bn(Nb(r,yield Rt(t))))));const n=function(o){return br(this,arguments,function*(){yield yield Rt(yield Rt(o))})},i=function(o){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(Xd(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Kf?n(t):Qa(t)?i(t):Uo(t)?t:n(t);return yield Rt(yield*Ss(Bn(Xd(function(o){return br(this,arguments,function*(){let a=null;do a=yield Rt(o.next(yield yield Rt(xe(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Rt(new r)})}const QR=r=>Nb(Uint8Array,r);function Bb(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++e(r.next(),r);function*KR(r){let t,e=!1,n=[],i,s,o,a=0;function l(){return s==="peek"?kn(n,o)[0]:([i,n,a]=kn(n,o),i)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const u=qR(r)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o0&&(i.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Rt(u()));while(a0&&(i.push(ce(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Rt(u()));while(a{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return Jt(this,void 0,void 0,function*(){const{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return Jt(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=ce(e)),e})}}const Ah=(r,t)=>{const e=i=>n([t,i]);let n;return[t,e,new Promise(i=>(n=i)&&r.once(t,e))]};function rF(r){return br(this,arguments,function*(){const e=[];let n="error",i=!1,s=null,o,a,l=0,u=[],c;function h(){return o==="peek"?kn(u,a)[0]:([c,u,l]=kn(u,a),c)}if({cmd:o,size:a}=(yield yield Rt(null))||{cmd:"read",size:0},r.isTTY)return yield yield Rt(new Uint8Array(0)),yield Rt(null);try{e[0]=Ah(r,"end"),e[1]=Ah(r,"error");do{if(e[2]=Ah(r,"readable"),[n,s]=yield Rt(Promise.race(e.map(d=>d[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-l)?(c=ce(r.read(a-l)),c.byteLength0&&(u.push(c),l+=c.byteLength)),i||a<=l)do({cmd:o,size:a}=yield yield Rt(h()));while(a{for(const[y,_]of d)r.off(y,_);try{const y=r.destroy;y&&y.call(r,m),m=void 0}catch(y){m=y||m}finally{m!=null?p(m):g()}})}})}var je;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(je||(je={}));var lr;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(lr||(lr={}));var ar;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(ar||(ar={}));var nn;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(nn||(nn={}));var Vt;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(Vt||(Vt={}));var zn;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(zn||(zn={}));const Mh=2,Pn=4,oi=4,_e=4,Ti=new Int32Array(2),Jg=new Float32Array(Ti.buffer),ty=new Float64Array(Ti.buffer),Dl=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Yd;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Yd||(Yd={}));let Mo=class Ub{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Ub(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){Jg[0]=e,this.writeInt32(t,Ti[0])}writeFloat64(t,e){ty[0]=e,this.writeInt32(t,Ti[Dl?0:1]),this.writeInt32(t+4,Ti[Dl?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const n=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space=0&&this.vtable[e]==0;e--);const n=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const i=2;this.addInt16(t-this.object_start);const s=(n+i)*Mh;this.addInt16(s);let o=0;const a=this.space;t:for(e=0;e=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,Pn+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(e=0;n--)t.addInt32(e[n]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,n){return vr.startUnion(t),vr.addMode(t,e),vr.addTypeIds(t,n),vr.endUnion(t)}}let ay=class _a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new _a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+_e),(e||new _a).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return _a.startUtf8(t),_a.endUtf8(t)}};var Ee;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded"})(Ee||(Ee={}));let Wr=class Hl{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new Hl).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+_e),(e||new Hl).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Ee.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new ai).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const n=this.bb.__offset(this.bb_pos,14);return n?(e||new Hl).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,16);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,Ee.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},In=class Zn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new Zn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+_e),(e||new Zn).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Co.Little}fields(t,e){const n=this.bb.__offset(this.bb_pos,6);return n?(e||new Wr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,Co.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,n,i,s){return Zn.startSchema(t),Zn.addEndianness(t,e),Zn.addFields(t,n),Zn.addCustomMetadata(t,i),Zn.addFeatures(t,s),Zn.endSchema(t)}};var me;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(me||(me={}));var k;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond"})(k||(k={}));var ni;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(ni||(ni={}));const nF=void 0;function Ba(r){if(r===null)return"null";if(r===nF)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(t=>Ba(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}function Te(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function $b(r,t){return Te(r/t)+Te(r%t)/Te(t)}const iF=Symbol.for("isArrowBigNum");function pn(r,...t){return t.length===0?Object.setPrototypeOf(xe(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}pn.prototype[iF]=!0;pn.prototype.toJSON=function(){return`"${ka(this)}"`};pn.prototype.valueOf=function(r){return Gb(this,r)};pn.prototype.toString=function(){return ka(this)};pn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Gb(this);case"string":return ka(this);case"default":return aF(this)}return ka(this)};function vo(...r){return pn.apply(this,r)}function _o(...r){return pn.apply(this,r)}function Ua(...r){return pn.apply(this,r)}Object.setPrototypeOf(vo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(_o.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ua.prototype,Object.create(Uint32Array.prototype));Object.assign(vo.prototype,pn.prototype,{constructor:vo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(_o.prototype,pn.prototype,{constructor:_o,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Ua.prototype,pn.prototype,{constructor:Ua,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const sF=BigInt(4294967296)*BigInt(4294967296),oF=sF-BigInt(1);function Gb(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return Ch(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Ot.prototype);let Ri=class extends Ot{constructor(){super(k.Null)}toString(){return"Null"}};Xb=Symbol.toStringTag;Ri[Xb]=(r=>r[Symbol.toStringTag]="Null")(Ri.prototype);let Es=class extends Ot{constructor(t,e){super(k.Int),this.isSigned=t,this.bitWidth=e}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 new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};Yb=Symbol.toStringTag;Es[Yb]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Es.prototype);class za extends Es{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(za.prototype,"ArrayType",{value:Int32Array});let mu=class extends Ot{constructor(t){super(k.Float),this.precision=t}get ArrayType(){switch(this.precision){case ar.HALF:return Uint16Array;case ar.SINGLE:return Float32Array;case ar.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};qb=Symbol.toStringTag;mu[qb]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(mu.prototype);let gu=class extends Ot{constructor(){super(k.Binary)}toString(){return"Binary"}};Qb=Symbol.toStringTag;gu[Qb]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(gu.prototype);let yu=class extends Ot{constructor(){super(k.LargeBinary)}toString(){return"LargeBinary"}};Zb=Symbol.toStringTag;yu[Zb]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(yu.prototype);let vu=class extends Ot{constructor(){super(k.Utf8)}toString(){return"Utf8"}};Kb=Symbol.toStringTag;vu[Kb]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(vu.prototype);let _u=class extends Ot{constructor(){super(k.LargeUtf8)}toString(){return"LargeUtf8"}};Jb=Symbol.toStringTag;_u[Jb]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(_u.prototype);let bu=class extends Ot{constructor(){super(k.Bool)}toString(){return"Bool"}};tw=Symbol.toStringTag;bu[tw]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(bu.prototype);let wu=class extends Ot{constructor(t,e,n=128){super(k.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};ew=Symbol.toStringTag;wu[ew]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(wu.prototype);let xu=class extends Ot{constructor(t){super(k.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${nn[this.unit]}>`}get ArrayType(){return this.unit===nn.DAY?Int32Array:BigInt64Array}};rw=Symbol.toStringTag;xu[rw]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(xu.prototype);let Su=class extends Ot{constructor(t,e){super(k.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Vt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};nw=Symbol.toStringTag;Su[nw]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Su.prototype);let Tu=class extends Ot{constructor(t,e){super(k.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Vt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};iw=Symbol.toStringTag;Tu[iw]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(Tu.prototype);let Iu=class extends Ot{constructor(t){super(k.Interval),this.unit=t}toString(){return`Interval<${zn[this.unit]}>`}};sw=Symbol.toStringTag;Iu[sw]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Iu.prototype);let Eu=class extends Ot{constructor(t){super(k.Duration),this.unit=t}toString(){return`Duration<${Vt[this.unit]}>`}};ow=Symbol.toStringTag;Eu[ow]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Eu.prototype);let Au=class extends Ot{constructor(t){super(k.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};aw=Symbol.toStringTag;Au[aw]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(Au.prototype);let dr=class extends Ot{constructor(t){super(k.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};lw=Symbol.toStringTag;dr[lw]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(dr.prototype);let Mu=class extends Ot{constructor(t,e,n){super(k.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};uw=Symbol.toStringTag;Mu[uw]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Mu.prototype);let Cu=class extends Ot{constructor(t){super(k.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};cw=Symbol.toStringTag;Cu[cw]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Cu.prototype);let Ou=class extends Ot{constructor(t,e){super(k.FixedSizeList),this.listSize=t,this.children=[e]}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}>`}};hw=Symbol.toStringTag;Ou[hw]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Ou.prototype);let Pu=class extends Ot{constructor(t,e=!1){var n,i,s;if(super(k.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.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(t=>`${t.name}:${t.type}`).join(", ")}}>`}};dw=Symbol.toStringTag;Pu[dw]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Pu.prototype);const uF=(r=>()=>++r)(-1);let Oo=class extends Ot{constructor(t,e,n,i){super(k.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?uF():Te(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}>`}};fw=Symbol.toStringTag;Oo[fw]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Oo.prototype);function ii(r){const t=r;switch(r.typeId){case k.Decimal:return r.bitWidth/32;case k.Interval:return 1+t.unit;case k.FixedSizeList:return t.listSize;case k.FixedSizeBinary:return t.byteWidth;default:return 1}}let se=class{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return cF(this,t,e)}getVisitFnByTypeId(t,e=!0){return io(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function cF(r,t,e=!0){return typeof t=="number"?io(r,t,e):typeof t=="string"&&t in k?io(r,k[t],e):t&&t instanceof Ot?io(r,ly(t),e):t!=null&&t.type&&t.type instanceof Ot?io(r,ly(t.type),e):io(r,k.NONE,e)}function io(r,t,e=!0){let n=null;switch(t){case k.Null:n=r.visitNull;break;case k.Bool:n=r.visitBool;break;case k.Int:n=r.visitInt;break;case k.Int8:n=r.visitInt8||r.visitInt;break;case k.Int16:n=r.visitInt16||r.visitInt;break;case k.Int32:n=r.visitInt32||r.visitInt;break;case k.Int64:n=r.visitInt64||r.visitInt;break;case k.Uint8:n=r.visitUint8||r.visitInt;break;case k.Uint16:n=r.visitUint16||r.visitInt;break;case k.Uint32:n=r.visitUint32||r.visitInt;break;case k.Uint64:n=r.visitUint64||r.visitInt;break;case k.Float:n=r.visitFloat;break;case k.Float16:n=r.visitFloat16||r.visitFloat;break;case k.Float32:n=r.visitFloat32||r.visitFloat;break;case k.Float64:n=r.visitFloat64||r.visitFloat;break;case k.Utf8:n=r.visitUtf8;break;case k.LargeUtf8:n=r.visitLargeUtf8;break;case k.Binary:n=r.visitBinary;break;case k.LargeBinary:n=r.visitLargeBinary;break;case k.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case k.Date:n=r.visitDate;break;case k.DateDay:n=r.visitDateDay||r.visitDate;break;case k.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case k.Timestamp:n=r.visitTimestamp;break;case k.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case k.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case k.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case k.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case k.Time:n=r.visitTime;break;case k.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case k.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case k.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case k.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case k.Decimal:n=r.visitDecimal;break;case k.List:n=r.visitList;break;case k.Struct:n=r.visitStruct;break;case k.Union:n=r.visitUnion;break;case k.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case k.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case k.Dictionary:n=r.visitDictionary;break;case k.Interval:n=r.visitInterval;break;case k.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case k.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case k.Duration:n=r.visitDuration;break;case k.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case k.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case k.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case k.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case k.FixedSizeList:n=r.visitFixedSizeList;break;case k.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${k[t]}'`)}function ly(r){switch(r.typeId){case k.Null:return k.Null;case k.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?k.Int8:k.Uint8;case 16:return e?k.Int16:k.Uint16;case 32:return e?k.Int32:k.Uint32;case 64:return e?k.Int64:k.Uint64}return k.Int}case k.Float:switch(r.precision){case ar.HALF:return k.Float16;case ar.SINGLE:return k.Float32;case ar.DOUBLE:return k.Float64}return k.Float;case k.Binary:return k.Binary;case k.LargeBinary:return k.LargeBinary;case k.Utf8:return k.Utf8;case k.LargeUtf8:return k.LargeUtf8;case k.Bool:return k.Bool;case k.Decimal:return k.Decimal;case k.Time:switch(r.unit){case Vt.SECOND:return k.TimeSecond;case Vt.MILLISECOND:return k.TimeMillisecond;case Vt.MICROSECOND:return k.TimeMicrosecond;case Vt.NANOSECOND:return k.TimeNanosecond}return k.Time;case k.Timestamp:switch(r.unit){case Vt.SECOND:return k.TimestampSecond;case Vt.MILLISECOND:return k.TimestampMillisecond;case Vt.MICROSECOND:return k.TimestampMicrosecond;case Vt.NANOSECOND:return k.TimestampNanosecond}return k.Timestamp;case k.Date:switch(r.unit){case nn.DAY:return k.DateDay;case nn.MILLISECOND:return k.DateMillisecond}return k.Date;case k.Interval:switch(r.unit){case zn.DAY_TIME:return k.IntervalDayTime;case zn.YEAR_MONTH:return k.IntervalYearMonth}return k.Interval;case k.Duration:switch(r.unit){case Vt.SECOND:return k.DurationSecond;case Vt.MILLISECOND:return k.DurationMillisecond;case Vt.MICROSECOND:return k.DurationMicrosecond;case Vt.NANOSECOND:return k.DurationNanosecond}return k.Duration;case k.Map:return k.Map;case k.List:return k.List;case k.Struct:return k.Struct;case k.Union:switch(r.mode){case lr.Dense:return k.DenseUnion;case lr.Sparse:return k.SparseUnion}return k.Union;case k.FixedSizeBinary:return k.FixedSizeBinary;case k.FixedSizeList:return k.FixedSizeList;case k.Dictionary:return k.Dictionary}throw new Error(`Unrecognized type '${k[r.typeId]}'`)}se.prototype.visitInt8=null;se.prototype.visitInt16=null;se.prototype.visitInt32=null;se.prototype.visitInt64=null;se.prototype.visitUint8=null;se.prototype.visitUint16=null;se.prototype.visitUint32=null;se.prototype.visitUint64=null;se.prototype.visitFloat16=null;se.prototype.visitFloat32=null;se.prototype.visitFloat64=null;se.prototype.visitDateDay=null;se.prototype.visitDateMillisecond=null;se.prototype.visitTimestampSecond=null;se.prototype.visitTimestampMillisecond=null;se.prototype.visitTimestampMicrosecond=null;se.prototype.visitTimestampNanosecond=null;se.prototype.visitTimeSecond=null;se.prototype.visitTimeMillisecond=null;se.prototype.visitTimeMicrosecond=null;se.prototype.visitTimeNanosecond=null;se.prototype.visitDenseUnion=null;se.prototype.visitSparseUnion=null;se.prototype.visitIntervalDayTime=null;se.prototype.visitIntervalYearMonth=null;se.prototype.visitDuration=null;se.prototype.visitDurationSecond=null;se.prototype.visitDurationMillisecond=null;se.prototype.visitDurationMicrosecond=null;se.prototype.visitDurationNanosecond=null;const pw=new Float64Array(1),Ws=new Uint32Array(pw.buffer);function mw(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function hF(r){if(r!==r)return 32256;pw[0]=r;const t=(Ws[1]&2147483648)>>16&65535;let e=Ws[1]&2146435072,n=0;return e>=1089470464?Ws[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Ws[1]&1048575)>>10):e<=1056964608?(n=1048576+(Ws[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Ws[1]&1048575)+512>>10),t|e|n&65535}let jt=class extends se{};function Yt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const dF=(r,t,e)=>{r[t]=Math.floor(e/864e5)},gw=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},Jf=({values:r},t,e)=>{r[t]=e},yw=({values:r},t,e)=>{r[t]=hF(e)},pF=(r,t,e)=>{switch(r.type.precision){case ar.HALF:return yw(r,t,e);case ar.SINGLE:case ar.DOUBLE:return Jf(r,t,e)}},vw=({values:r},t,e)=>{dF(r,t,e.valueOf())},_w=({values:r},t,e)=>{r[t]=BigInt(e)},mF=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},bw=({values:r,valueOffsets:t},e,n)=>gw(r,t,e,n),ww=({values:r,valueOffsets:t},e,n)=>gw(r,t,e,Qf(n)),gF=(r,t,e)=>{r.type.unit===nn.DAY?vw(r,t,e):_w(r,t,e)},xw=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},Sw=({values:r},t,e)=>{r[t]=BigInt(e)},Tw=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},Iw=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},yF=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return xw(r,t,e);case Vt.MILLISECOND:return Sw(r,t,e);case Vt.MICROSECOND:return Tw(r,t,e);case Vt.NANOSECOND:return Iw(r,t,e)}},Ew=({values:r},t,e)=>{r[t]=e},Aw=({values:r},t,e)=>{r[t]=e},Mw=({values:r},t,e)=>{r[t]=e},Cw=({values:r},t,e)=>{r[t]=e},vF=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return Ew(r,t,e);case Vt.MILLISECOND:return Aw(r,t,e);case Vt.MICROSECOND:return Mw(r,t,e);case Vt.NANOSECOND:return Cw(r,t,e)}},_F=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},bF=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=sn.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=sn.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},xF=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),SF=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),TF=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),IF=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),EF=(r,t,e)=>{const n=r.type.children.map(s=>sn.getVisitFn(s.type)),i=e instanceof Map?TF(t,e):e instanceof Ne?SF(t,e):Array.isArray(e)?xF(t,e):IF(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},AF=(r,t,e)=>{r.type.mode===lr.Dense?Ow(r,t,e):Pw(r,t,e)},Ow=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];sn.visit(i,r.valueOffsets[t],e)},Pw=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];sn.visit(i,t,e)},MF=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},CF=(r,t,e)=>{r.type.unit===zn.DAY_TIME?Rw(r,t,e):Fw(r,t,e)},Rw=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},Fw=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Dw=({values:r},t,e)=>{r[t]=e},Lw=({values:r},t,e)=>{r[t]=e},Nw=({values:r},t,e)=>{r[t]=e},Bw=({values:r},t,e)=>{r[t]=e},OF=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return Dw(r,t,e);case Vt.MILLISECOND:return Lw(r,t,e);case Vt.MICROSECOND:return Nw(r,t,e);case Vt.NANOSECOND:return Bw(r,t,e)}},PF=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=sn.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${Ba(t)}: ${Ba(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new RF(this[un],this[bo])}},RF=class{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[un].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[un].type.children.findIndex(n=>n.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[un].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=xr.visit(t[un].children[n],t[bo]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[un].type.children.findIndex(s=>s.name===e);return i!==-1?(sn.visit(t[un].children[i],t[bo],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}},Ft=class extends se{};function $t(r){return(t,e)=>t.getValid(e)?r(t,e):null}const DF=(r,t)=>864e5*r[t],LF=(r,t)=>null,Uw=(r,t,e)=>{if(e+1>=t.length)return null;const n=Te(t[e]),i=Te(t[e+1]);return r.subarray(n,i)},NF=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<DF(r,t),zw=({values:r},t)=>Te(r[t]),zi=({stride:r,values:t},e)=>t[r*e],BF=({stride:r,values:t},e)=>mw(t[r*e]),Vw=({values:r},t)=>r[t],UF=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),jw=({values:r,valueOffsets:t},e)=>Uw(r,t,e),$w=({values:r,valueOffsets:t},e)=>{const n=Uw(r,t,e);return n!==null?Wd(n):null},kF=({values:r},t)=>r[t],zF=({type:r,values:t},e)=>r.precision!==ar.HALF?t[e]:mw(t[e]),VF=(r,t)=>r.type.unit===nn.DAY?kw(r,t):zw(r,t),Gw=({values:r},t)=>1e3*Te(r[t]),Ww=({values:r},t)=>Te(r[t]),Hw=({values:r},t)=>$b(r[t],BigInt(1e3)),Xw=({values:r},t)=>$b(r[t],BigInt(1e6)),jF=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return Gw(r,t);case Vt.MILLISECOND:return Ww(r,t);case Vt.MICROSECOND:return Hw(r,t);case Vt.NANOSECOND:return Xw(r,t)}},Yw=({values:r},t)=>r[t],qw=({values:r},t)=>r[t],Qw=({values:r},t)=>r[t],Zw=({values:r},t)=>r[t],$F=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return Yw(r,t);case Vt.MILLISECOND:return qw(r,t);case Vt.MICROSECOND:return Qw(r,t);case Vt.NANOSECOND:return Zw(r,t)}},GF=({values:r,stride:t},e)=>lF.decimal(r.subarray(t*e,t*(e+1))),WF=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new Ne([l])},HF=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new ep(o.slice(i,s-i))},XF=(r,t)=>new tp(r,t),YF=(r,t)=>r.type.mode===lr.Dense?Kw(r,t):Jw(r,t),Kw=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return xr.visit(n,r.valueOffsets[t])},Jw=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return xr.visit(n,t)},qF=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},QF=(r,t)=>r.type.unit===zn.DAY_TIME?tx(r,t):ex(r,t),tx=({values:r},t)=>r.subarray(2*t,2*(t+1)),ex=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},rx=({values:r},t)=>r[t],nx=({values:r},t)=>r[t],ix=({values:r},t)=>r[t],sx=({values:r},t)=>r[t],ZF=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return rx(r,t);case Vt.MILLISECOND:return nx(r,t);case Vt.MICROSECOND:return ix(r,t);case Vt.NANOSECOND:return sx(r,t)}},KF=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new Ne([s])};Ft.prototype.visitNull=$t(LF);Ft.prototype.visitBool=$t(NF);Ft.prototype.visitInt=$t(kF);Ft.prototype.visitInt8=$t(zi);Ft.prototype.visitInt16=$t(zi);Ft.prototype.visitInt32=$t(zi);Ft.prototype.visitInt64=$t(Vw);Ft.prototype.visitUint8=$t(zi);Ft.prototype.visitUint16=$t(zi);Ft.prototype.visitUint32=$t(zi);Ft.prototype.visitUint64=$t(Vw);Ft.prototype.visitFloat=$t(zF);Ft.prototype.visitFloat16=$t(BF);Ft.prototype.visitFloat32=$t(zi);Ft.prototype.visitFloat64=$t(zi);Ft.prototype.visitUtf8=$t($w);Ft.prototype.visitLargeUtf8=$t($w);Ft.prototype.visitBinary=$t(jw);Ft.prototype.visitLargeBinary=$t(jw);Ft.prototype.visitFixedSizeBinary=$t(UF);Ft.prototype.visitDate=$t(VF);Ft.prototype.visitDateDay=$t(kw);Ft.prototype.visitDateMillisecond=$t(zw);Ft.prototype.visitTimestamp=$t(jF);Ft.prototype.visitTimestampSecond=$t(Gw);Ft.prototype.visitTimestampMillisecond=$t(Ww);Ft.prototype.visitTimestampMicrosecond=$t(Hw);Ft.prototype.visitTimestampNanosecond=$t(Xw);Ft.prototype.visitTime=$t($F);Ft.prototype.visitTimeSecond=$t(Yw);Ft.prototype.visitTimeMillisecond=$t(qw);Ft.prototype.visitTimeMicrosecond=$t(Qw);Ft.prototype.visitTimeNanosecond=$t(Zw);Ft.prototype.visitDecimal=$t(GF);Ft.prototype.visitList=$t(WF);Ft.prototype.visitStruct=$t(XF);Ft.prototype.visitUnion=$t(YF);Ft.prototype.visitDenseUnion=$t(Kw);Ft.prototype.visitSparseUnion=$t(Jw);Ft.prototype.visitDictionary=$t(qF);Ft.prototype.visitInterval=$t(QF);Ft.prototype.visitIntervalDayTime=$t(tx);Ft.prototype.visitIntervalYearMonth=$t(ex);Ft.prototype.visitDuration=$t(ZF);Ft.prototype.visitDurationSecond=$t(rx);Ft.prototype.visitDurationMillisecond=$t(nx);Ft.prototype.visitDurationMicrosecond=$t(ix);Ft.prototype.visitDurationNanosecond=$t(sx);Ft.prototype.visitFixedSizeList=$t(KF);Ft.prototype.visitMap=$t(HF);const xr=new Ft,so=Symbol.for("keys"),wo=Symbol.for("vals"),oo=Symbol.for("kKeysAsStrings"),Kd=Symbol.for("_kKeysAsStrings");let ep=class{constructor(t){return this[so]=new Ne([t.children[0]]).memoize(),this[wo]=t.children[1],new Proxy(this,new t2)}get[oo](){return this[Kd]||(this[Kd]=Array.from(this[so].toArray(),String))}[Symbol.iterator](){return new JF(this[so],this[wo])}get size(){return this[so].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[so],e=this[wo],n={};for(let i=-1,s=t.length;++i`${Ba(t)}: ${Ba(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},JF=class{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),xr.visit(this.vals,t)]})}},t2=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[oo]}has(t,e){return t[oo].includes(e)}getOwnPropertyDescriptor(t,e){if(t[oo].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[oo].indexOf(e);if(n!==-1){const i=xr.visit(Reflect.get(t,wo),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[oo].indexOf(e);return i!==-1?(sn.visit(Reflect.get(t,wo),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}};Object.defineProperties(ep.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[so]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Kd]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let uy;function ox(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const rp=(r,t)=>r<0?t+r:r,cy=r=>r!==r;function ko(r){if(typeof r!=="object"||r===null)return cy(r)?cy:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?ZR(r,e):!1:r instanceof Map?r2(r):Array.isArray(r)?e2(r):r instanceof Ne?n2(r):i2(r,!0)}function e2(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return s2(r,e);case Map:return hy(r,e,e.keys());case ep:case tp:case Object:case void 0:return hy(r,e,t||Object.keys(e))}return e instanceof Ne?o2(r,e):!1}}function s2(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function Ru(r,t,e){const n=e.byteLength+7&-8;if(r>0||e.byteLength>3):Fu(new np(e,r,t,null,ax)).subarray(0,n)),i}return e}function Fu(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}let np=class{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return Jd(r,t,i)+Jd(r,n,e)+l2(r,i>>3,n-i>>3)}function l2(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Oh(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Oh(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Oh(s.getUint8(i)),i+=1;return n}function Oh(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const u2=-1;let Ae=class tf{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){const{type:t}=this;return Ot.isSparseUnion(t)?this.children.some(e=>e.nullable):Ot.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Ot.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=u2&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Jd(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof tf?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=ii(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Ot.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===lr.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Ru(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new tf(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===k.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(Ru(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[ni.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[ni.TYPE])&&(o[ni.TYPE]=s.subarray(t,t+e)),(s=o[ni.OFFSET])&&(o[ni.OFFSET]=s.subarray(t,t+e+1))||(s=o[ni.DATA])&&(o[ni.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}};Ae.prototype.children=Object.freeze([]);class Sa extends se{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:n=0,["length"]:i=0}=t;return new Ae(e,n,i,i)}visitBool(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitInt(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitFloat(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitUtf8(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.data),s=ce(t.nullBitmap),o=ia(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,i,s])}visitLargeUtf8(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.data),s=ce(t.nullBitmap),o=Kg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,i,s])}visitBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.data),s=ce(t.nullBitmap),o=ia(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,i,s])}visitLargeBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.data),s=ce(t.nullBitmap),o=Kg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,i,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitDate(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitTimestamp(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitTime(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitDecimal(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitList(t){const{["type"]:e,["offset"]:n=0,["child"]:i}=t,s=ce(t.nullBitmap),o=ia(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,void 0,s],[i])}visitStruct(t){const{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=ce(t.nullBitmap),{length:o=i.reduce((l,{length:u})=>Math.max(l,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,void 0,s],i)}visitUnion(t){const{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=xe(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(Ot.isSparseUnion(e))return new Ae(e,n,o,a,[void 0,void 0,void 0,s],i);const l=ia(t.valueOffsets);return new Ae(e,n,o,a,[l,void 0,void 0,s],i)}visitDictionary(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.indices.ArrayType,t.data),{["dictionary"]:o=new Ne([new Sa().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[void 0,s,i],[],o)}visitInterval(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitDuration(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitFixedSizeList(t){const{["type"]:e,["offset"]:n=0,["child"]:i=new Sa().visit({type:e.valueType})}=t,s=ce(t.nullBitmap),{["length"]:o=i.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,void 0,s],[i])}visitMap(t){const{["type"]:e,["offset"]:n=0,["child"]:i=new Sa().visit({type:e.childType})}=t,s=ce(t.nullBitmap),o=ia(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,void 0,s],[i])}}const c2=new Sa;function le(r){return c2.visit(r)}let dy=class{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function lx(r){return r.reduce((t,e)=>t+e.nullCount,0)}function ux(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function cx(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function ip(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function f2(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new np(e,r.offset+(t||0),r.length,e,ax)){if(!i)return n;++n}return-1}function Zt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case k.Union:break;case k.Dictionary:break;default:return f2(r,e)}const n=xr.getVisitFn(r),i=ko(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new dy(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new p2(o)})}let p2=class{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Ae)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=mx[o.typeId],c=s[0];this.isValid=h=>sp(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,gx[o.typeId]),this._offsets=ux(s);break}this.data=s,this.type=o,this.stride=ii(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return h2(this.data)}get nullCount(){return lx(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${k[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(rp(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return op.visit(this)}concat(...t){return new ls(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new ls(ox(this,t,e,({data:n,_offsets:i},s,o)=>cx(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case k.Int:case k.Float:case k.Decimal:case k.Time:case k.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Ot.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Ot.isDictionary(this.type)){const t=new fy(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new ls(e)}return new fy(this)}unmemoize(){if(Ot.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new ls(e)}return this}};px=Symbol.toStringTag;Ne[px]=(r=>{r.type=Ot.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(k).map(e=>k[e]).filter(e=>typeof e=="number"&&e!==k.NONE);for(const e of t){const n=xr.getVisitFnByTypeId(e),i=sn.getVisitFnByTypeId(e),s=Lu.getVisitFnByTypeId(e);mx[e]={get:n,set:i,indexOf:s},gx[e]=Object.create(r,{isValid:{value:Du(sp)},get:{value:Du(xr.getVisitFnByTypeId(e))},set:{value:hx(sn.getVisitFnByTypeId(e))},indexOf:{value:dx(Lu.getVisitFnByTypeId(e))}})}return"Vector"})(Ne.prototype);let fy=class yx extends Ne{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new yx(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Ne(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};class ef{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,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(t,e,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(e??0)),t.offset()}}class Er{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new Er).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+_e),(e||new Er).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):je.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new In).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new ef).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const n=this.bb.__offset(this.bb_pos,10);return n?(e||new ef).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,je.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}let Le=class us{constructor(t=[],e,n,i=je.V5){this.fields=t||[],this.metadata=e||new Map,n||(n=rf(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){const e=new Set(t),n=this.fields.filter(i=>e.has(i.name));return new us(n,this.metadata)}selectAt(t){const e=t.map(n=>this.fields[n]).filter(Boolean);return new us(e,this.metadata)}assign(...t){const e=t[0]instanceof us?t[0]:Array.isArray(t[0])?new us(t[0]):new us(t),n=[...this.fields],i=Ll(Ll(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const l=n.findIndex(u=>u.name===a.name);return~l?(n[l]=a.clone({metadata:Ll(Ll(new Map,n[l].metadata),a.metadata)}))&&!1:!0}),o=rf(s,new Map);return new us([...n,...s],i,new Map([...this.dictionaries,...o]))}};Le.prototype.fields=null;Le.prototype.metadata=null;Le.prototype.dictionaries=null;class Pe{static new(...t){let[e,n,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new Pe(`${e}`,n,i,s)}constructor(t,e,n=!1,i){this.name=t,this.type=e,this.nullable=n,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,n,i,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,n=this.type,i=this.nullable,s=this.metadata]=t:{name:e=this.name,type:n=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],Pe.new(e,n,i,s)}}Pe.prototype.type=null;Pe.prototype.name=null;Pe.prototype.nullable=null;Pe.prototype.metadata=null;function Ll(r,t){return new Map([...r||new Map,...t||new Map])}function rf(r,t=new Map){for(let e=-1,n=r.length;++e0&&rf(s.children,t)}return t}var m2=kb,g2=Mo;class Va{static decode(t){t=new g2(ce(t));const e=Er.getRootAsFooter(t),n=Le.decode(e.schema(),new Map,e.version());return new y2(n,e)}static encode(t){const e=new m2,n=Le.encode(e,t.schema);Er.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())Fi.encode(e,o);const i=e.endVector();Er.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())Fi.encode(e,o);const s=e.endVector();return Er.startFooter(e),Er.addSchema(e,n),Er.addVersion(e,je.V5),Er.addRecordBatches(e,i),Er.addDictionaries(e,s),Er.finishFooterBuffer(e,Er.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=je.V5,n,i){this.schema=t,this.version=e,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,e=-1,n=this.numRecordBatches;++e=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Jt(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(Be);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Yr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Yr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Jt(this,void 0,void 0,function*(){return yield this.abort(t),Be})}return(t){return Jt(this,void 0,void 0,function*(){return yield this.close(),Be})}read(t){return Jt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Jt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){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,n)=>{this.resolvers.push({resolve:e,reject:n})}):Promise.resolve(Be)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Xl extends v2{write(t){if((t=ce(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Wd(this.toUint8Array(!0)):this.toUint8Array(!1).then(Wd)}toUint8Array(t=!1){return t?kn(this._values)[0]:Jt(this,void 0,void 0,function*(){var e,n,i,s;const o=[];let a=0;try{for(var l=!0,u=Bn(this),c;c=yield u.next(),e=c.done,!e;l=!0){s=c.value,l=!1;const h=s;o.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!l&&!e&&(i=u.return)&&(yield i.call(u))}finally{if(n)throw n.error}}return kn(o,a)[0]})}}class Nu{constructor(t){t&&(this.source=new _2(Yr.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class Po{constructor(t){t instanceof Po?this.source=t.source:t instanceof Xl?this.source=new ts(Yr.fromAsyncIterable(t)):Lb(t)?this.source=new ts(Yr.fromNodeStream(t)):Zf(t)?this.source=new ts(Yr.fromDOMStream(t)):Db(t)?this.source=new ts(Yr.fromDOMStream(t.body)):Qa(t)?this.source=new ts(Yr.fromIterable(t)):Is(t)?this.source=new ts(Yr.fromAsyncIterable(t)):Uo(t)&&(this.source=new ts(Yr.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class _2{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||Be)}return(t){return Object.create(this.source.return&&this.source.return(t)||Be)}}class ts{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return Jt(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Jt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Jt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return Jt(this,arguments,void 0,function*(e,n="read"){return yield this.source.next({cmd:n,size:e})})}throw(t){return Jt(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||Be;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return Jt(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||Be;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class my extends Nu{constructor(t,e){super(),this.position=0,this.buffer=ce(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:n}=this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${fo(this.buffer[3])} ${fo(this.buffer[2])} ${fo(this.buffer[1])} ${fo(this.buffer[0])}`}static multiply(t,e){return new ti(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ti(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ti.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ti.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new ti(e);for(let o=n?1:0;o0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class x2 extends _x{constructor(t,e,n,i,s){super(new Uint8Array(0),e,n,i,s),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Fu(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return xe(Uint8Array,xe(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return xe(Uint8Array,xe(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:n}=this;return Ot.isTimestamp(t)||(Ot.isInt(t)||Ot.isTime(t))&&t.bitWidth===64||Ot.isDuration(t)||Ot.isDate(t)&&t.unit===nn.MILLISECOND?xe(Uint8Array,Ta.convertArray(n[e])):Ot.isDecimal(t)?xe(Uint8Array,w2.convertArray(n[e])):Ot.isBinary(t)||Ot.isLargeBinary(t)||Ot.isFixedSizeBinary(t)?S2(n[e]):Ot.isBool(t)?Fu(n[e]):Ot.isUtf8(t)||Ot.isLargeUtf8(t)?Qf(n[e].join("")):xe(Uint8Array,xe(t.ArrayType,n[e].map(i=>+i)))}}function S2(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let n=0;n>1]=Number.parseInt(t.slice(n,n+2),16);return e}let Nt=class extends se{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((n,i)=>this.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}};function mr(r,t){return t instanceof r.constructor}function Fs(r,t){return r===t||mr(r,t)}function di(r,t){return r===t||mr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function lc(r,t){return r===t||mr(r,t)&&r.precision===t.precision}function T2(r,t){return r===t||mr(r,t)&&r.byteWidth===t.byteWidth}function up(r,t){return r===t||mr(r,t)&&r.unit===t.unit}function Za(r,t){return r===t||mr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function Ka(r,t){return r===t||mr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function I2(r,t){return r===t||mr(r,t)&&r.children.length===t.children.length&&Di.compareManyFields(r.children,t.children)}function E2(r,t){return r===t||mr(r,t)&&r.children.length===t.children.length&&Di.compareManyFields(r.children,t.children)}function cp(r,t){return r===t||mr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Di.compareManyFields(r.children,t.children)}function A2(r,t){return r===t||mr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Di.visit(r.indices,t.indices)&&Di.visit(r.dictionary,t.dictionary)}function hp(r,t){return r===t||mr(r,t)&&r.unit===t.unit}function Ja(r,t){return r===t||mr(r,t)&&r.unit===t.unit}function M2(r,t){return r===t||mr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Di.compareManyFields(r.children,t.children)}function C2(r,t){return r===t||mr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Di.compareManyFields(r.children,t.children)}Nt.prototype.visitNull=Fs;Nt.prototype.visitBool=Fs;Nt.prototype.visitInt=di;Nt.prototype.visitInt8=di;Nt.prototype.visitInt16=di;Nt.prototype.visitInt32=di;Nt.prototype.visitInt64=di;Nt.prototype.visitUint8=di;Nt.prototype.visitUint16=di;Nt.prototype.visitUint32=di;Nt.prototype.visitUint64=di;Nt.prototype.visitFloat=lc;Nt.prototype.visitFloat16=lc;Nt.prototype.visitFloat32=lc;Nt.prototype.visitFloat64=lc;Nt.prototype.visitUtf8=Fs;Nt.prototype.visitLargeUtf8=Fs;Nt.prototype.visitBinary=Fs;Nt.prototype.visitLargeBinary=Fs;Nt.prototype.visitFixedSizeBinary=T2;Nt.prototype.visitDate=up;Nt.prototype.visitDateDay=up;Nt.prototype.visitDateMillisecond=up;Nt.prototype.visitTimestamp=Za;Nt.prototype.visitTimestampSecond=Za;Nt.prototype.visitTimestampMillisecond=Za;Nt.prototype.visitTimestampMicrosecond=Za;Nt.prototype.visitTimestampNanosecond=Za;Nt.prototype.visitTime=Ka;Nt.prototype.visitTimeSecond=Ka;Nt.prototype.visitTimeMillisecond=Ka;Nt.prototype.visitTimeMicrosecond=Ka;Nt.prototype.visitTimeNanosecond=Ka;Nt.prototype.visitDecimal=Fs;Nt.prototype.visitList=I2;Nt.prototype.visitStruct=E2;Nt.prototype.visitUnion=cp;Nt.prototype.visitDenseUnion=cp;Nt.prototype.visitSparseUnion=cp;Nt.prototype.visitDictionary=A2;Nt.prototype.visitInterval=hp;Nt.prototype.visitIntervalDayTime=hp;Nt.prototype.visitIntervalYearMonth=hp;Nt.prototype.visitDuration=Ja;Nt.prototype.visitDurationSecond=Ja;Nt.prototype.visitDurationMillisecond=Ja;Nt.prototype.visitDurationMicrosecond=Ja;Nt.prototype.visitDurationNanosecond=Ja;Nt.prototype.visitFixedSizeList=M2;Nt.prototype.visitMap=C2;const Di=new Nt;function nf(r,t){return Di.compareSchemas(r,t)}function Ph(r,t){return O2(r,t.map(e=>e.data.concat()))}function O2(r,t){const e=[...r.fields],n=[],i={numBatches:t.reduce((h,f)=>Math.max(h,f.length),0)};let s=0,o=0,a=-1;const l=t.length;let u,c=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(n[s++]=le({type:new dr(e),length:o,nullCount:0,children:c.slice()})))}return[r=r.assign(e),n.map(h=>new _r(r,h))]}function P2(r,t,e,n,i){var s;const o=(t+63&-64)>>3;for(let a=-1,l=n.length;++a=t)c===t?e[a]=u:(e[a]=u.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(u.slice(t,c-t))));else{const h=r[a];r[a]=h.clone({nullable:!0}),e[a]=(s=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:le({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var bx;let Li=class cs{constructor(...t){var e,n;if(t.length===0)return this.batches=[],this.schema=new Le([]),this._offsets=[0],this;let i,s;t[0]instanceof Le&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=l=>{if(l){if(l instanceof _r)return[l];if(l instanceof cs)return l.batches;if(l instanceof Ae){if(l.type instanceof dr)return[new _r(new Le(l.type.children),l)]}else{if(Array.isArray(l))return l.flatMap(u=>o(u));if(typeof l[Symbol.iterator]=="function")return[...l].flatMap(u=>o(u));if(typeof l=="object"){const u=Object.keys(l),c=u.map(d=>new Ne([l[d]])),h=i??new Le(u.map((d,m)=>new Pe(String(d),c[m].type,c[m].nullable))),[,f]=Ph(h,c);return f.length===0?[new _r(l)]:f}}}return[]},a=t.flatMap(l=>o(l));if(i=(n=i??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&n!==void 0?n:new Le([]),!(i instanceof Le))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof _r))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!nf(i,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=s??ux(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=lx(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(rp(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?op.visit(new Ne(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ ${this.toArray().join(`, `)} -]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new cs(e,n.map(i=>new _r(e,i)))}slice(t,e){const n=this.schema;[t,e]=ox({length:this.numRows},t,e);const i=cx(this.data,this._offsets,t,e);return new cs(n,i.map(s=>new _r(n,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&tn.children[t]);if(e.length===0){const{type:n}=this.schema.fields[t],i=le({type:n,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new Ne(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[n,i]=Ph(n,a)}return new cs(n,i)}select(t){const e=this.schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new cs(e,n)}assign(t){const e=this.schema.fields,[n,i]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,f=e.findIndex(d=>d.name===l.name);return~f?h[f]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,i[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new cs(...Ph(s,o))}};bx=Symbol.toStringTag;Li[bx]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Du(sp),r.get=Du(xr.getVisitFn(k.Struct)),r.set=hx(sn.getVisitFn(k.Struct)),r.indexOf=dx(Lu.getVisitFn(k.Struct)),"Table"))(Li.prototype);var wx;let _r=class ba{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Le))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=le({nullCount:0,type:new dr(this.schema.fields),children:this.schema.fields.map(e=>le({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Ae))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=gy(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:i,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Pe.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Le(n),a=le({type:new dr(n),length:s,children:i,nullCount:0});[this.schema,this.data]=gy(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=xx(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(t){return this.data.getValid(t)}get(t){return xr.visit(this.data,t)}at(t){return this.get(rp(t,this.numRows))}set(t,e){return sn.visit(this.data,t,e)}indexOf(t,e){return Lu.visit(this.data,t,e)}[Symbol.iterator](){return op.visit(new Ne([this.data]))}toArray(){return[...this]}concat(...t){return new Li(this.schema,[this,...t])}slice(t,e){const[n]=new Ne([this.data]).slice(t,e).data;return new ba(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&ti.name===t),e)}setChildAt(t,e){let n=this.schema,i=this.data;if(t>-1&&ta.name===s);~o&&(i[o]=this.data.children[o])}return new ba(e,le({type:n,length:this.numRows,children:i}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),i=le({type:new dr(e.fields),length:this.numRows,children:n});return new ba(e,i)}};wx=Symbol.toStringTag;_r[wx]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(_r.prototype);function gy(r,t,e=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;const i=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(i[a]=l.clone({nullable:!0}),s[a]=(n=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:le({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(i),le({type:new dr(i),length:e,children:s})]}function xx(r,t,e=new Map){var n,i;if(((n=r==null?void 0:r.length)!==null&&n!==void 0?n:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sle({type:i.type})),n=le({type:new dr(t.fields),nullCount:0,children:e});super(t,n)}}let bi=class Sn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+_e),(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):je.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):me.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,je.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,me.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,n,i,s,o){return Sn.startMessage(t),Sn.addVersion(t,e),Sn.addHeaderType(t,n),Sn.addHeader(t,i),Sn.addBodyLength(t,s),Sn.addCustomMetadata(t,o),Sn.endMessage(t)}};class R2 extends se{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return oy.startNull(e),oy.endNull(e)}visitInt(t,e){return Cr.startInt(e),Cr.addBitWidth(e,t.bitWidth),Cr.addIsSigned(e,t.isSigned),Cr.endInt(e)}visitFloat(t,e){return Rn.startFloatingPoint(e),Rn.addPrecision(e,t.precision),Rn.endFloatingPoint(e)}visitBinary(t,e){return ey.startBinary(e),ey.endBinary(e)}visitLargeBinary(t,e){return ny.startLargeBinary(e),ny.endLargeBinary(e)}visitBool(t,e){return ry.startBool(e),ry.endBool(e)}visitUtf8(t,e){return ay.startUtf8(e),ay.endUtf8(e)}visitLargeUtf8(t,e){return iy.startLargeUtf8(e),iy.endLargeUtf8(e)}visitDecimal(t,e){return Js.startDecimal(e),Js.addScale(e,t.scale),Js.addPrecision(e,t.precision),Js.addBitWidth(e,t.bitWidth),Js.endDecimal(e)}visitDate(t,e){return Vl.startDate(e),Vl.addUnit(e,t.unit),Vl.endDate(e)}visitTime(t,e){return Zr.startTime(e),Zr.addUnit(e,t.unit),Zr.addBitWidth(e,t.bitWidth),Zr.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0;return Kr.startTimestamp(e),Kr.addUnit(e,t.unit),n!==void 0&&Kr.addTimezone(e,n),Kr.endTimestamp(e)}visitInterval(t,e){return Fn.startInterval(e),Fn.addUnit(e,t.unit),Fn.endInterval(e)}visitDuration(t,e){return jl.startDuration(e),jl.addUnit(e,t.unit),jl.endDuration(e)}visitList(t,e){return sy.startList(e),sy.endList(e)}visitStruct(t,e){return ys.startStruct_(e),ys.endStruct_(e)}visitUnion(t,e){vr.startTypeIdsVector(e,t.typeIds.length);const n=vr.createTypeIdsVector(e,t.typeIds);return vr.startUnion(e),vr.addMode(e,t.mode),vr.addTypeIds(e,n),vr.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return ai.startDictionaryEncoding(e),ai.addId(e,BigInt(t.id)),ai.addIsOrdered(e,t.isOrdered),n!==void 0&&ai.addIndexType(e,n),ai.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return $l.startFixedSizeBinary(e),$l.addByteWidth(e,t.byteWidth),$l.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Gl.startFixedSizeList(e),Gl.addListSize(e,t.listSize),Gl.endFixedSizeList(e)}visitMap(t,e){return Wl.startMap(e),Wl.addKeysSorted(e,t.keysSorted),Wl.endMap(e)}}const Rh=new R2;function F2(r,t=new Map){return new Le(L2(r,t),Yl(r.metadata),t)}function Sx(r){return new Br(r.count,Tx(r.columns),Ix(r.columns))}function D2(r){return new Vn(Sx(r.data),r.id,r.isDelta)}function L2(r,t){return(r.fields||[]).filter(Boolean).map(e=>Pe.fromJSON(e,t))}function yy(r,t){return(r.children||[]).filter(Boolean).map(e=>Pe.fromJSON(e,t))}function Tx(r){return(r||[]).reduce((t,e)=>[...t,new Ni(e.count,N2(e.VALIDITY)),...Tx(e.children)],[])}function Ix(r,t=[]){for(let e=-1,n=(r||[]).length;++et+ +(e===0),0)}function B2(r,t){let e,n,i,s,o,a;return!t||!(s=r.dictionary)?(o=_y(r,yy(r,t)),i=new Pe(r.name,o,r.nullable,Yl(r.metadata))):t.has(e=s.id)?(n=(n=s.indexType)?vy(n):new za,a=new Oo(t.get(e),n,e,s.isOrdered),i=new Pe(r.name,a,r.nullable,Yl(r.metadata))):(n=(n=s.indexType)?vy(n):new za,t.set(e,o=_y(r,yy(r,t))),a=new Oo(o,n,e,s.isOrdered),i=new Pe(r.name,a,r.nullable,Yl(r.metadata))),i||null}function Yl(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function vy(r){return new Es(r.isSigned,r.bitWidth)}function _y(r,t){const e=r.type.name;switch(e){case"NONE":return new Ri;case"null":return new Ri;case"binary":return new gu;case"largebinary":return new yu;case"utf8":return new vu;case"largeutf8":return new _u;case"bool":return new bu;case"list":return new Au((t||[])[0]);case"struct":return new dr(t||[]);case"struct_":return new dr(t||[])}switch(e){case"int":{const n=r.type;return new Es(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=r.type;return new mu(ar[n.precision])}case"decimal":{const n=r.type;return new wu(n.scale,n.precision,n.bitWidth)}case"date":{const n=r.type;return new xu(nn[n.unit])}case"time":{const n=r.type;return new Su(Vt[n.unit],n.bitWidth)}case"timestamp":{const n=r.type;return new Tu(Vt[n.unit],n.timezone)}case"interval":{const n=r.type;return new Iu(zn[n.unit])}case"duration":{const n=r.type;return new Eu(Vt[n.unit])}case"union":{const n=r.type,[i,...s]=(n.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new Mu(lr[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=r.type;return new Cu(n.byteWidth)}case"fixedsizelist":{const n=r.type;return new Ou(n.listSize,(t||[])[0])}case"map":{const n=r.type;return new Pu((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var U2=kb,k2=Mo;class fr{static fromJSON(t,e){const n=new fr(0,je.V5,e);return n._createHeader=z2(t,e),n}static decode(t){t=new k2(ce(t));const e=bi.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),s=e.headerType(),o=new fr(n,i,s);return o._createHeader=V2(e,s),o}static encode(t){const e=new U2;let n=-1;return t.isSchema()?n=Le.encode(e,t.header()):t.isRecordBatch()?n=Br.encode(e,t.header()):t.isDictionaryBatch()&&(n=Vn.encode(e,t.header())),bi.startMessage(e),bi.addVersion(e,je.V5),bi.addHeader(e,n),bi.addHeaderType(e,t.headerType),bi.addBodyLength(e,BigInt(t.bodyLength)),bi.finishMessageBuffer(e,bi.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Le)return new fr(0,je.V5,me.Schema,t);if(t instanceof Br)return new fr(e,je.V5,me.RecordBatch,t);if(t instanceof Vn)return new fr(e,je.V5,me.DictionaryBatch,t);throw new 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===me.Schema}isRecordBatch(){return this.headerType===me.RecordBatch}isDictionaryBatch(){return this.headerType===me.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Te(t)}}class Br{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=Te(t)}}class Vn{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(t,e,n=!1){this._data=t,this._isDelta=n,this._id=Te(e)}}class Ln{constructor(t,e){this.offset=Te(t),this.length=Te(e)}}class Ni{constructor(t,e){this.length=Te(t),this.nullCount=Te(e)}}function z2(r,t){return()=>{switch(t){case me.Schema:return Le.fromJSON(r);case me.RecordBatch:return Br.fromJSON(r);case me.DictionaryBatch:return Vn.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${me[t]}, type: ${t} }`)}}function V2(r,t){return()=>{switch(t){case me.Schema:return Le.decode(r.header(new In),new Map,r.version());case me.RecordBatch:return Br.decode(r.header(new ri),r.version());case me.DictionaryBatch:return Vn.decode(r.header(new Zs),r.version())}throw new Error(`Unrecognized Message type: { name: ${me[t]}, type: ${t} }`)}}Pe.encode=K2;Pe.decode=Q2;Pe.fromJSON=B2;Le.encode=Z2;Le.decode=j2;Le.fromJSON=F2;Br.encode=J2;Br.decode=$2;Br.fromJSON=Sx;Vn.encode=tD;Vn.decode=G2;Vn.fromJSON=D2;Ni.encode=eD;Ni.decode=H2;Ln.encode=rD;Ln.decode=W2;function j2(r,t=new Map,e=je.V5){const n=q2(r,t);return new Le(n,ql(r),t,e)}function $2(r,t=je.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Br(r.length(),X2(r),Y2(r,t))}function G2(r,t=je.V5){return new Vn(Br.decode(r.data(),t),r.id(),r.isDelta())}function W2(r){return new Ln(r.offset(),r.length())}function H2(r){return new Ni(r.length(),r.nullCount())}function X2(r){const t=[];for(let e,n=-1,i=-1,s=r.nodesLength();++nPe.encode(r,s));In.startFieldsVector(r,e.length);const n=In.createFieldsVector(r,e),i=t.metadata&&t.metadata.size>0?In.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return qe.startKeyValue(r),qe.addKey(r,a),qe.addValue(r,l),qe.endKeyValue(r)})):-1;return In.startSchema(r),In.addFields(r,n),In.addEndianness(r,nD?Co.Little:Co.Big),i!==-1&&In.addCustomMetadata(r,i),In.endSchema(r)}function K2(r,t){let e=-1,n=-1,i=-1;const s=t.type;let o=t.typeId;Ot.isDictionary(s)?(o=s.dictionary.typeId,i=Rh.visit(s,r),n=Rh.visit(s.dictionary,r)):n=Rh.visit(s,r);const a=(s.children||[]).map(c=>Pe.encode(r,c)),l=Wr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Wr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const f=r.createString(`${c}`),d=r.createString(`${h}`);return qe.startKeyValue(r),qe.addKey(r,f),qe.addValue(r,d),qe.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Wr.startField(r),Wr.addType(r,n),Wr.addTypeType(r,o),Wr.addChildren(r,l),Wr.addNullable(r,!!t.nullable),e!==-1&&Wr.addName(r,e),i!==-1&&Wr.addDictionary(r,i),u!==-1&&Wr.addCustomMetadata(r,u),Wr.endField(r)}function J2(r,t){const e=t.nodes||[],n=t.buffers||[];ri.startNodesVector(r,e.length);for(const o of e.slice().reverse())Ni.encode(r,o);const i=r.endVector();ri.startBuffersVector(r,n.length);for(const o of n.slice().reverse())Ln.encode(r,o);const s=r.endVector();return ri.startRecordBatch(r),ri.addLength(r,BigInt(t.length)),ri.addNodes(r,i),ri.addBuffers(r,s),ri.endRecordBatch(r)}function tD(r,t){const e=Br.encode(r,t.data);return Zs.startDictionaryBatch(r),Zs.addId(r,BigInt(t.id)),Zs.addIsDelta(r,t.isDelta),Zs.addData(r,e),Zs.endDictionaryBatch(r)}function eD(r,t){return jb.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function rD(r,t){return Vb.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const nD=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),fp=r=>`Expected ${me[r]} Message in stream, but was null or length 0.`,pp=r=>`Header pointer of flatbuffer-encoded ${me[r]} Message is null or length 0.`,Ex=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,Ax=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class Mx{constructor(t){this.source=t instanceof Nu?t:new Nu(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?Be:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(fp(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ce(this.source.read(t));if(e.byteLength[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(fp(t));return e.value}readSchema(){const t=me.Schema,e=this.readMessage(t),n=e==null?void 0:e.header();if(!e||!n)throw new Error(pp(t));return n}}const uc=4,sf="ARROW1",ja=new Uint8Array(sf.length);for(let r=0;rthis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Yr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Yr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof tn?t:Hd(t)?cD(t):Fb(t)?fD(t):Is(t)?Jt(this,void 0,void 0,function*(){return yield tn.from(yield t)}):Db(t)||Zf(t)||Lb(t)||Uo(t)?dD(new Po(t)):hD(new Nu(t))}static readAll(t){return t instanceof tn?t.isSync()?Sy(t):Ty(t):Hd(t)||ArrayBuffer.isView(t)||Qa(t)||Rb(t)?Sy(t):Ty(t)}}class Uu extends tn{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(this[Symbol.iterator]())))})}}class ku extends tn{constructor(t){super(t),this._impl=t}readAll(){return Jt(this,void 0,void 0,function*(){var t,e,n,i;const s=new Array;try{for(var o=!0,a=Bn(this),l;l=yield a.next(),t=l.done,!t;o=!0){i=l.value,o=!1;const u=i;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Ox extends Uu{constructor(t){super(t),this._impl=t}}class aD extends ku{constructor(t){super(t),this._impl=t}}class Px{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const n=this._loadVectors(t,e,this.schema.fields),i=le({type:new dr(this.schema.fields),length:t.length,children:n});return new _r(this.schema,i)}_loadDictionaryBatch(t,e){const{id:n,isDelta:i}=t,{dictionaries:s,schema:o}=this,a=s.get(n),l=o.dictionaries.get(n),u=this._loadVectors(t.data,e,[l]);return(a&&i?a.concat(new Ne(u)):new Ne(u)).memoize()}_loadVectors(t,e,n){return new _x(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class zu extends Px{constructor(t,e){super(e),this._reader=Hd(t)?new sD(this._handle=t):new Mx(this._handle=t)}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(t){return this.closed||(this.autoDestroy=Fx(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):Be}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Be}next(){if(this.closed)return Be;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new dp(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Vu extends Px{constructor(t,e){super(e),this._reader=new iD(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Jt(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return Jt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Fx(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Jt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Be})}return(t){return Jt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Be})}next(){return Jt(this,void 0,void 0,function*(){if(this.closed)return Be;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new dp(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Jt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class Rx extends zu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof my?t:new my(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(me.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(me.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-Cx,n=t.readInt32(e),i=t.readAt(e-n,n);return Va.decode(i)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Jt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Jt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(me.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Jt(this,void 0,void 0,function*(){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(me.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Jt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-Cx,n=yield t.readInt32(e),i=yield t.readAt(e-n,n);return Va.decode(i)})}_readNextMessageAndValidate(t){return Jt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?mp(t)?new Ox(new Rx(r.read())):new Uu(new zu(r)):new Uu(new zu(function*(){}()))}function dD(r){return Jt(this,void 0,void 0,function*(){const t=yield r.peek(tl+7&-8);return t&&t.byteLength>=4?mp(t)?new Ox(new Rx(yield r.read())):new ku(new Vu(r)):new ku(new Vu(function(){return br(this,arguments,function*(){})}()))})}function fD(r){return Jt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Bu(r,t);return t>=oD&&mp(yield e.readAt(0,tl+7&-8))?new aD(new lD(e)):new ku(new Vu(e))})}class ke extends se{static assemble(...t){const e=i=>i.flatMap(s=>Array.isArray(s)?e(s):s instanceof _r?s.data.children:s.data),n=new ke;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Ne)return this.visitMany(t.data),this;const{type:e}=t;if(!Ot.isDictionary(e)){const{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(Ot.isUnion(e))this.nodes.push(new Ni(n,0));else{const{nullCount:i}=t;Ot.isNull(e)||dn.call(this,i<=0?new Uint8Array(0):Ru(t.offset,n,t.nullBitmap)),this.nodes.push(new Ni(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function dn(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Ln(this._byteLength,t)),this._byteLength+=t,this}function pD(r){var t;const{type:e,length:n,typeIds:i,valueOffsets:s}=r;if(dn.call(this,i),e.mode===lr.Sparse)return of.call(this,r);if(e.mode===lr.Dense){if(r.offset<=0)return dn.call(this,s),of.call(this,r);{const o=new Int32Array(n),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],f=a[h],d=l[h];return u.slice(f,Math.min(n,d))}))}}return this}function mD(r){let t;return r.nullCount>=r.length?dn.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?dn.call(this,Ru(r.offset,r.length,t)):dn.call(this,Fu(r.values))}function fi(r){return dn.call(this,r.values.subarray(0,r.length*r.stride))}function cc(r){const{length:t,values:e,valueOffsets:n}=r,i=Te(n[0]),s=Te(n[t]),o=Math.min(s-i,e.byteLength-i);return dn.call(this,Bb(-i,t+1,n)),dn.call(this,e.subarray(i,i+o)),this}function gp(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:n,[t]:i}=e;return dn.call(this,Bb(-n,t+1,e)),this.visit(r.children[0].slice(n,i-n))}return this.visit(r.children[0])}function of(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}ke.prototype.visitBool=mD;ke.prototype.visitInt=fi;ke.prototype.visitFloat=fi;ke.prototype.visitUtf8=cc;ke.prototype.visitLargeUtf8=cc;ke.prototype.visitBinary=cc;ke.prototype.visitLargeBinary=cc;ke.prototype.visitFixedSizeBinary=fi;ke.prototype.visitDate=fi;ke.prototype.visitTimestamp=fi;ke.prototype.visitTime=fi;ke.prototype.visitDecimal=fi;ke.prototype.visitList=gp;ke.prototype.visitStruct=of;ke.prototype.visitUnion=pD;ke.prototype.visitInterval=fi;ke.prototype.visitDuration=fi;ke.prototype.visitFixedSizeList=gp;ke.prototype.visitMap=gp;class Dx extends ap{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Xl,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,wr(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Is(t)?t.then(e=>this.writeAll(e)):Uo(t)?bp(this,t):_p(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof Xl?this._sink=t:(this._sink=new Xl,t&&GR(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&WR(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!nf(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Li&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof _r&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!nf(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof _r?t instanceof dp||this._writeRecordBatch(t):t instanceof Li?this.writeAll(t.batches):Qa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,i=fr.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,l=a-s-o;return t.headerType===me.RecordBatch?this._recordBatchBlocks.push(new Fi(a,t.bodyLength,this._position)):t.headerType===me.DictionaryBatch&&this._dictionaryBlocks.push(new Fi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(l)}_write(t){if(this._started){const e=ce(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(fr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ja)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=ke.assemble(t),o=new Br(t.numRows,n,i),a=fr.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,n=!1){const{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=ke.assemble(new Ne([t])),l=new Br(t.length,s,o),u=new Vn(l,e,n),c=fr.from(u,i);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,i;for(let s=-1,o=t.length;++s0&&(this._write(e),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){var e,n;for(const[i,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(i),l=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,i,u>0);else if(ln.writeAll(i)):Uo(t)?bp(n,t):_p(n,t)}}class vp extends Dx{static writeAll(t){const e=new vp;return Is(t)?t.then(n=>e.writeAll(n)):Uo(t)?bp(e,t):_p(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,n=!1){if(!n&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,n)}_writeFooter(t){const e=Va.encode(new Va(t,je.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function _p(r,t){let e=t;t instanceof Li&&(e=t.batches,r.reset(void 0,t.schema));for(const n of e)r.write(n);return r.finish()}function bp(r,t){return Jt(this,void 0,void 0,function*(){var e,n,i,s,o,a,l;try{for(e=!0,n=Bn(t);i=yield n.next(),s=i.done,!s;e=!0){l=i.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function gD(r,t="stream"){return(t==="stream"?yp:vp).writeAll(r).toUint8Array(!0)}var yD=Object.create,Lx=Object.defineProperty,vD=Object.getOwnPropertyDescriptor,_D=Object.getOwnPropertyNames,bD=Object.getPrototypeOf,wD=Object.prototype.hasOwnProperty,xD=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),SD=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _D(t))!wD.call(r,i)&&i!==e&&Lx(r,i,{get:()=>t[i],enumerable:!(n=vD(t,i))||n.enumerable});return r},TD=(r,t,e)=>(e=r!=null?yD(bD(r)):{},SD(!r||!r.__esModule?Lx(e,"default",{value:r,enumerable:!0}):e,r)),ID=xD((r,t)=>{t.exports=Worker}),Nx=(r=>(r[r.UNDEFINED=0]="UNDEFINED",r[r.AUTOMATIC=1]="AUTOMATIC",r[r.READ_ONLY=2]="READ_ONLY",r[r.READ_WRITE=3]="READ_WRITE",r))(Nx||{}),ED=(r=>(r[r.IDENTIFIER=0]="IDENTIFIER",r[r.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",r[r.STRING_CONSTANT=2]="STRING_CONSTANT",r[r.OPERATOR=3]="OPERATOR",r[r.KEYWORD=4]="KEYWORD",r[r.COMMENT=5]="COMMENT",r))(ED||{}),AD=(r=>(r[r.NONE=0]="NONE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARNING=3]="WARNING",r[r.ERROR=4]="ERROR",r))(AD||{}),MD=(r=>(r[r.NONE=0]="NONE",r[r.CONNECT=1]="CONNECT",r[r.DISCONNECT=2]="DISCONNECT",r[r.OPEN=3]="OPEN",r[r.QUERY=4]="QUERY",r[r.INSTANTIATE=5]="INSTANTIATE",r))(MD||{}),CD=(r=>(r[r.NONE=0]="NONE",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR",r[r.START=3]="START",r[r.RUN=4]="RUN",r[r.CAPTURE=5]="CAPTURE",r))(CD||{}),OD=(r=>(r[r.NONE=0]="NONE",r[r.WEB_WORKER=1]="WEB_WORKER",r[r.NODE_WORKER=2]="NODE_WORKER",r[r.BINDINGS=3]="BINDINGS",r[r.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",r))(OD||{}),PD=class{log(r){}},Bx=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},RD=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(RD||{}),FD=class{constructor(r,t){this._bindings=r,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(r){return r(this._bindings,this._conn)}async query(r){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let t=await this._bindings.runQuery(this._conn,r),e=tn.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new Li(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let n=new Ux(this._bindings,this._conn,e),i=await tn.from(n);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new DD(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=gD(r,"stream");await this.insertArrowFromIPCStream(e,t)}async insertArrowFromIPCStream(r,t){await this._bindings.insertArrowFromIPCStream(this._conn,r,t)}async insertCSVFromPath(r,t){await this._bindings.insertCSVFromPath(this._conn,r,t)}async insertJSONFromPath(r,t){await this._bindings.insertJSONFromPath(this._conn,r,t)}},Ux=class{constructor(r,t,e){this.db=r,this.conn=t,this.header=e,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 r;return this._inFlight!=null?(r=await this._inFlight,this._inFlight=null):r=await this.db.fetchQueryResults(this.conn),this._depleted=r.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:r}}[Symbol.asyncIterator](){return this}},DD=class{constructor(r,t,e){this.bindings=r,this.connectionId=t,this.statementId=e}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...r){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,r),e=tn.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new Li(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new Ux(this.bindings,this.connectionId,t),n=await tn.from(e);return console.assert(n.isAsync()),console.assert(n.isStream()),n}},LD=(r=>(r.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",r.CLOSE_PREPARED="CLOSE_PREPARED",r.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",r.REGISTER_OPFS_FILE_NAME="REGISTER_OPFS_FILE_NAME",r.CONNECT="CONNECT",r.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",r.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",r.CREATE_PREPARED="CREATE_PREPARED",r.DISCONNECT="DISCONNECT",r.DROP_FILE="DROP_FILE",r.DROP_FILES="DROP_FILES",r.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",r.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",r.FLUSH_FILES="FLUSH_FILES",r.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",r.GET_TABLE_NAMES="GET_TABLE_NAMES",r.GET_VERSION="GET_VERSION",r.GLOB_FILE_INFOS="GLOB_FILE_INFOS",r.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",r.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",r.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",r.INSTANTIATE="INSTANTIATE",r.OPEN="OPEN",r.PING="PING",r.POLL_PENDING_QUERY="POLL_PENDING_QUERY",r.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",r.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",r.REGISTER_FILE_URL="REGISTER_FILE_URL",r.RESET="RESET",r.RUN_PREPARED="RUN_PREPARED",r.RUN_QUERY="RUN_QUERY",r.SEND_PREPARED="SEND_PREPARED",r.START_PENDING_QUERY="START_PENDING_QUERY",r.TOKENIZE="TOKENIZE",r))(LD||{}),ND=(r=>(r.CONNECTION_INFO="CONNECTION_INFO",r.ERROR="ERROR",r.FEATURE_FLAGS="FEATURE_FLAGS",r.FILE_BUFFER="FILE_BUFFER",r.FILE_INFOS="FILE_INFOS",r.FILE_SIZE="FILE_SIZE",r.FILE_STATISTICS="FILE_STATISTICS",r.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",r.LOG="LOG",r.OK="OK",r.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",r.QUERY_PLAN="QUERY_PLAN",r.QUERY_RESULT="QUERY_RESULT",r.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",r.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",r.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",r.REGISTERED_FILE="REGISTERED_FILE",r.SCRIPT_TOKENS="SCRIPT_TOKENS",r.SUCCESS="SUCCESS",r.TABLE_NAMES="TABLE_NAMES",r.VERSION_STRING="VERSION_STRING",r))(ND||{}),de=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,n)=>{this.promiseResolver=e,this.promiseRejecter=n})}};function Ql(r){switch(r.typeId){case k.Binary:return{sqlType:"binary"};case k.Bool:return{sqlType:"bool"};case k.Date:return{sqlType:"date"};case k.DateDay:return{sqlType:"date32[d]"};case k.DateMillisecond:return{sqlType:"date64[ms]"};case k.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case k.Float:return{sqlType:"float"};case k.Float16:return{sqlType:"float16"};case k.Float32:return{sqlType:"float32"};case k.Float64:return{sqlType:"float64"};case k.Int:return{sqlType:"int32"};case k.Int16:return{sqlType:"int16"};case k.Int32:return{sqlType:"int32"};case k.Int64:return{sqlType:"int64"};case k.Uint16:return{sqlType:"uint16"};case k.Uint32:return{sqlType:"uint32"};case k.Uint64:return{sqlType:"uint64"};case k.Uint8:return{sqlType:"uint8"};case k.IntervalDayTime:return{sqlType:"interval[dt]"};case k.IntervalYearMonth:return{sqlType:"interval[m]"};case k.List:return{sqlType:"list",valueType:Ql(r.valueType)};case k.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case k.Null:return{sqlType:"null"};case k.Utf8:return{sqlType:"utf8"};case k.Struct:return{sqlType:"struct",fields:r.children.map(t=>af(t.name,t.type))};case k.Map:{let t=r;return{sqlType:"map",keyType:Ql(t.keyType),valueType:Ql(t.valueType)}}case k.Time:return{sqlType:"time[s]"};case k.TimeMicrosecond:return{sqlType:"time[us]"};case k.TimeMillisecond:return{sqlType:"time[ms]"};case k.TimeNanosecond:return{sqlType:"time[ns]"};case k.TimeSecond:return{sqlType:"time[s]"};case k.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case k.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case k.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case k.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case k.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function af(r,t){let e=Ql(t);return e.name=r,e}var BD=new TextEncoder,UD=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,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(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}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(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(e.data);return}}let n=this._pendingRequests.get(e.requestId);if(!n){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let i=new Error(e.data.message);i.name=e.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=e.data.stack),n.promiseRejecter(i);return}switch(n.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(e.type=="OK"){n.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){n.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){n.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){n.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){n.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){n.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){n.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){n.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){n.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){n.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){n.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){n.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){n.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){n.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){n.promiseResolver(e.data);return}break}n.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new de("RESET",null);return await this.postTask(r)}async ping(){let r=new de("PING",null);await this.postTask(r)}async dropFile(r){let t=new de("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new de("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new de("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=n=>{}){this._onInstantiationProgress.push(e);let n=new de("INSTANTIATE",[r,t]);return await this.postTask(n)}async getVersion(){let r=new de("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new de("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new de("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new de("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new de("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new FD(this,r)}async disconnect(r){let t=new de("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new de("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let n=new de("START_PENDING_QUERY",[r,t,e]);return await this.postTask(n)}async pollPendingQuery(r){let t=new de("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new de("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new de("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new de("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new de("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new de("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let n=new de("RUN_PREPARED",[r,t,e]);return await this.postTask(n)}async sendPrepared(r,t,e){let n=new de("SEND_PREPARED",[r,t,e]);return await this.postTask(n)}async globFiles(r){let t=new de("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=BD.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,n){t===void 0&&(t=r);let i=new de("REGISTER_FILE_URL",[r,t,e,n]);await this.postTask(i)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new de("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,n){let i=new de("REGISTER_FILE_HANDLE",[r,t,e,n]);await this.postTask(i,[])}async registerOPFSFileName(r){let t=new de("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new de("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new de("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new de("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new de("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let n=new de("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(n,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(af(s,o))}e.columnsFlat=i,delete e.columns}let n=new de("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(n)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(af(s,o))}e.columnsFlat=i,delete e.columns}let n=new de("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(n)}};function kD(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}kD();var zD=(r=>(r[r.BUFFER=0]="BUFFER",r[r.NODE_FS=1]="NODE_FS",r[r.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",r[r.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",r[r.HTTP=4]="HTTP",r[r.S3=5]="S3",r))(zD||{}),VD=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])),jD=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])),$D=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])),GD=()=>(async r=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(r)}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])),WD={version:"1.29.1-dev68.0"},wp=WD.version.split(".");wp[0];wp[1];wp[2];var HD=()=>typeof navigator>"u",Fh=null,Dh=null,Lh=null,Nh=null,Bh=null;async function XD(){return Fh==null&&(Fh=typeof BigInt64Array<"u"),Dh==null&&(Dh=await jD()),Lh==null&&(Lh=await GD()),Nh==null&&(Nh=await $D()),Bh==null&&(Bh=await VD()),{bigInt64Array:Fh,crossOriginIsolated:HD()||globalThis.crossOriginIsolated||!1,wasmExceptions:Dh,wasmSIMD:Nh,wasmThreads:Lh,wasmBulkMemory:Bh}}async function Iy(r){let t=await XD();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&r.coi)return{mainModule:r.coi.mainModule,mainWorker:r.coi.mainWorker,pthreadWorker:r.coi.pthreadWorker};if(r.eh)return{mainModule:r.eh.mainModule,mainWorker:r.eh.mainWorker,pthreadWorker:null}}return{mainModule:r.mvp.mainModule,mainWorker:r.mvp.mainWorker,pthreadWorker:null}}TD(ID());const Uh={},wa={};function Ia(r,t){try{const n=(Uh[r]||(Uh[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return n in wa?wa[n]:Ey(n,n.split(":"))}catch{if(r in wa)return wa[r];const e=r==null?void 0:r.match(YD);return e?Ey(r,e.slice(1)):NaN}}const YD=/([+-]\d\d):?(\d\d)?/;function Ey(r,t){const e=+t[0],n=+(t[1]||0);return wa[r]=e>0?e*60+n:e*60-n}class Fr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ia(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),kx(this),lf(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Fr(...e,t):new Fr(Date.now(),t)}withTimeZone(t){return new Fr(+this,t)}getTimezoneOffset(){return-Ia(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),lf(this),+this}[Symbol.for("constructDateFrom")](t){return new Fr(+new Date(t),this.timeZone)}}const Ay=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!Ay.test(r))return;const t=r.replace(Ay,"$1UTC");Fr.prototype[t]&&(r.startsWith("get")?Fr.prototype[r]=function(){return this.internal[t]()}:(Fr.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),qD(this),+this},Fr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),lf(this),+this}))});function lf(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function qD(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),kx(r)}function kx(r){const t=Ia(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const n=-new Date(+r).getTimezoneOffset(),i=-new Date(+e).getTimezoneOffset(),s=n-i,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=n-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Ia(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,f=c-a;if(h&&f){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+f);const d=Ia(r.timeZone,r),m=l-d;m&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+m),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+m))}}const QD=new TextDecoder("utf-8"),ZD=r=>QD.decode(r),KD=new TextEncoder,zx=r=>KD.encode(r),An=r=>typeof r=="function",el=r=>r!=null&&Object(r)===r,JD=r=>el(r)&&An(r.then),Vx=r=>el(r)&&An(r[Symbol.iterator]),tL=r=>el(r)&&An(r[Symbol.asyncIterator]),eL=r=>el(r)&&"done"in r&&"value"in r,rL=r=>el(r)&&An(r.clear)&&An(r.bytes)&&An(r.position)&&An(r.setPosition)&&An(r.capacity)&&An(r.getBufferIdentifier)&&An(r.createLong),xp=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function nL(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lur(Int8Array,r),oL=r=>ur(Int16Array,r),aL=r=>ur(Int32Array,r),lL=r=>ur(BigInt64Array,r),uL=r=>ur(Uint8Array,r),cL=r=>ur(Uint16Array,r),hL=r=>ur(Uint32Array,r),dL=r=>ur(BigUint64Array,r),fL=r=>ur(Float32Array,r),pL=r=>ur(Float64Array,r),mL=r=>ur(Uint8ClampedArray,r),cf=r=>(r.next(),r);function*Xn(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof xp?e(t):Vx(t)?t:e(t);return yield*cf(function*(i){let s=null;do s=i.next(yield ur(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const gL=r=>Xn(Int8Array,r),yL=r=>Xn(Int16Array,r),vL=r=>Xn(Int32Array,r),_L=r=>Xn(Uint8Array,r),bL=r=>Xn(Uint16Array,r),wL=r=>Xn(Uint32Array,r),xL=r=>Xn(Float32Array,r),SL=r=>Xn(Float64Array,r),TL=r=>Xn(Uint8ClampedArray,r);function mn(r,t){return br(this,arguments,function*(){if(JD(t))return yield Rt(yield Rt(yield*Ss(Bn(mn(r,yield Rt(t))))));const n=function(o){return br(this,arguments,function*(){yield yield Rt(yield Rt(o))})},i=function(o){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(cf(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof xp?n(t):Vx(t)?i(t):tL(t)?t:n(t);return yield Rt(yield*Ss(Bn(cf(function(o){return br(this,arguments,function*(){let a=null;do a=yield Rt(o.next(yield yield Rt(ur(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Rt(new r)})}const IL=r=>mn(Int8Array,r),EL=r=>mn(Int16Array,r),AL=r=>mn(Int32Array,r),ML=r=>mn(Uint8Array,r),CL=r=>mn(Uint16Array,r),OL=r=>mn(Uint32Array,r),PL=r=>mn(Float32Array,r),RL=r=>mn(Float64Array,r),FL=r=>mn(Uint8ClampedArray,r);function DL(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++eFo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const BL=Object.freeze(Object.defineProperty({__proto__:null,valueToString:Fo},Symbol.toStringTag,{value:"Module"}));function pr(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function $x(r,t){return pr(r/t)+pr(r%t)/pr(t)}const Gx=Symbol.for("isArrowBigNum");function gn(r,...t){return t.length===0?Object.setPrototypeOf(ur(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}gn.prototype[Gx]=!0;gn.prototype.toJSON=function(){return`"${Do(this)}"`};gn.prototype.valueOf=function(r){return Sp(this,r)};gn.prototype.toString=function(){return Do(this)};gn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Sp(this);case"string":return Do(this);case"default":return Wx(this)}return Do(this)};function xo(...r){return gn.apply(this,r)}function So(...r){return gn.apply(this,r)}function $a(...r){return gn.apply(this,r)}Object.setPrototypeOf(xo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(So.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf($a.prototype,Object.create(Uint32Array.prototype));Object.assign(xo.prototype,gn.prototype,{constructor:xo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(So.prototype,gn.prototype,{constructor:So,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign($a.prototype,gn.prototype,{constructor:$a,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const UL=BigInt(4294967296)*BigInt(4294967296),kL=UL-BigInt(1);function Sp(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return kh(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Ct.prototype);class My extends Ct{constructor(){super(H.Null)}toString(){return"Null"}}Xx=Symbol.toStringTag;My[Xx]=(r=>r[Symbol.toStringTag]="Null")(My.prototype);class Cy extends Ct{constructor(t,e){super(H.Int),this.isSigned=t,this.bitWidth=e}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 new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}Yx=Symbol.toStringTag;Cy[Yx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Cy.prototype);class Oy extends Ct{constructor(t){super(H.Float),this.precision=t}get ArrayType(){switch(this.precision){case Dr.HALF:return Uint16Array;case Dr.SINGLE:return Float32Array;case Dr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}qx=Symbol.toStringTag;Oy[qx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Oy.prototype);class Py extends Ct{constructor(){super(H.Binary)}toString(){return"Binary"}}Qx=Symbol.toStringTag;Py[Qx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Py.prototype);class Ry extends Ct{constructor(){super(H.LargeBinary)}toString(){return"LargeBinary"}}Zx=Symbol.toStringTag;Ry[Zx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Ry.prototype);class Fy extends Ct{constructor(){super(H.Utf8)}toString(){return"Utf8"}}Kx=Symbol.toStringTag;Fy[Kx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Fy.prototype);class Dy extends Ct{constructor(){super(H.LargeUtf8)}toString(){return"LargeUtf8"}}Jx=Symbol.toStringTag;Dy[Jx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Dy.prototype);class Ly extends Ct{constructor(){super(H.Bool)}toString(){return"Bool"}}tS=Symbol.toStringTag;Ly[tS]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Ly.prototype);class Ny extends Ct{constructor(t,e,n=128){super(H.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}eS=Symbol.toStringTag;Ny[eS]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Ny.prototype);class By extends Ct{constructor(t){super(H.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Bi[this.unit]}>`}get ArrayType(){return this.unit===Bi.DAY?Int32Array:BigInt64Array}}rS=Symbol.toStringTag;By[rS]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(By.prototype);class Uy extends Ct{constructor(t,e){super(H.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${te[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}nS=Symbol.toStringTag;Uy[nS]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Uy.prototype);class ky extends Ct{constructor(t,e){super(H.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${te[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}iS=Symbol.toStringTag;ky[iS]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(ky.prototype);class zy extends Ct{constructor(t){super(H.Interval),this.unit=t}toString(){return`Interval<${As[this.unit]}>`}}sS=Symbol.toStringTag;zy[sS]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(zy.prototype);class Vy extends Ct{constructor(t){super(H.Duration),this.unit=t}toString(){return`Duration<${te[this.unit]}>`}}oS=Symbol.toStringTag;Vy[oS]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Vy.prototype);class jy extends Ct{constructor(t){super(H.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}aS=Symbol.toStringTag;jy[aS]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(jy.prototype);class hf extends Ct{constructor(t){super(H.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}lS=Symbol.toStringTag;hf[lS]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(hf.prototype);class $y extends Ct{constructor(t,e,n){super(H.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}uS=Symbol.toStringTag;$y[uS]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))($y.prototype);class Gy extends Ct{constructor(t){super(H.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}cS=Symbol.toStringTag;Gy[cS]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Gy.prototype);class Wy extends Ct{constructor(t,e){super(H.FixedSizeList),this.listSize=t,this.children=[e]}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}>`}}hS=Symbol.toStringTag;Wy[hS]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Wy.prototype);class Hy extends Ct{constructor(t,e=!1){var n,i,s;if(super(H.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.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(t=>`${t.name}:${t.type}`).join(", ")}}>`}}dS=Symbol.toStringTag;Hy[dS]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Hy.prototype);const VL=(r=>()=>++r)(-1);class Xy extends Ct{constructor(t,e,n,i){super(H.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?VL():pr(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}>`}}fS=Symbol.toStringTag;Xy[fS]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Xy.prototype);function pS(r){const t=r;switch(r.typeId){case H.Decimal:return r.bitWidth/32;case H.Interval:return 1+t.unit;case H.FixedSizeList:return t.listSize;case H.FixedSizeBinary:return t.byteWidth;default:return 1}}class he{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return jL(this,t,e)}getVisitFnByTypeId(t,e=!0){return ao(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function jL(r,t,e=!0){return typeof t=="number"?ao(r,t,e):typeof t=="string"&&t in H?ao(r,H[t],e):t&&t instanceof Ct?ao(r,Yy(t),e):t!=null&&t.type&&t.type instanceof Ct?ao(r,Yy(t.type),e):ao(r,H.NONE,e)}function ao(r,t,e=!0){let n=null;switch(t){case H.Null:n=r.visitNull;break;case H.Bool:n=r.visitBool;break;case H.Int:n=r.visitInt;break;case H.Int8:n=r.visitInt8||r.visitInt;break;case H.Int16:n=r.visitInt16||r.visitInt;break;case H.Int32:n=r.visitInt32||r.visitInt;break;case H.Int64:n=r.visitInt64||r.visitInt;break;case H.Uint8:n=r.visitUint8||r.visitInt;break;case H.Uint16:n=r.visitUint16||r.visitInt;break;case H.Uint32:n=r.visitUint32||r.visitInt;break;case H.Uint64:n=r.visitUint64||r.visitInt;break;case H.Float:n=r.visitFloat;break;case H.Float16:n=r.visitFloat16||r.visitFloat;break;case H.Float32:n=r.visitFloat32||r.visitFloat;break;case H.Float64:n=r.visitFloat64||r.visitFloat;break;case H.Utf8:n=r.visitUtf8;break;case H.LargeUtf8:n=r.visitLargeUtf8;break;case H.Binary:n=r.visitBinary;break;case H.LargeBinary:n=r.visitLargeBinary;break;case H.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case H.Date:n=r.visitDate;break;case H.DateDay:n=r.visitDateDay||r.visitDate;break;case H.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case H.Timestamp:n=r.visitTimestamp;break;case H.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case H.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case H.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case H.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case H.Time:n=r.visitTime;break;case H.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case H.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case H.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case H.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case H.Decimal:n=r.visitDecimal;break;case H.List:n=r.visitList;break;case H.Struct:n=r.visitStruct;break;case H.Union:n=r.visitUnion;break;case H.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case H.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case H.Dictionary:n=r.visitDictionary;break;case H.Interval:n=r.visitInterval;break;case H.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case H.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case H.Duration:n=r.visitDuration;break;case H.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case H.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case H.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case H.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case H.FixedSizeList:n=r.visitFixedSizeList;break;case H.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${H[t]}'`)}function Yy(r){switch(r.typeId){case H.Null:return H.Null;case H.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?H.Int8:H.Uint8;case 16:return e?H.Int16:H.Uint16;case 32:return e?H.Int32:H.Uint32;case 64:return e?H.Int64:H.Uint64}return H.Int}case H.Float:switch(r.precision){case Dr.HALF:return H.Float16;case Dr.SINGLE:return H.Float32;case Dr.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(r.unit){case te.SECOND:return H.TimeSecond;case te.MILLISECOND:return H.TimeMillisecond;case te.MICROSECOND:return H.TimeMicrosecond;case te.NANOSECOND:return H.TimeNanosecond}return H.Time;case H.Timestamp:switch(r.unit){case te.SECOND:return H.TimestampSecond;case te.MILLISECOND:return H.TimestampMillisecond;case te.MICROSECOND:return H.TimestampMicrosecond;case te.NANOSECOND:return H.TimestampNanosecond}return H.Timestamp;case H.Date:switch(r.unit){case Bi.DAY:return H.DateDay;case Bi.MILLISECOND:return H.DateMillisecond}return H.Date;case H.Interval:switch(r.unit){case As.DAY_TIME:return H.IntervalDayTime;case As.YEAR_MONTH:return H.IntervalYearMonth}return H.Interval;case H.Duration:switch(r.unit){case te.SECOND:return H.DurationSecond;case te.MILLISECOND:return H.DurationMillisecond;case te.MICROSECOND:return H.DurationMicrosecond;case te.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(r.mode){case jn.Dense:return H.DenseUnion;case jn.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 new Error(`Unrecognized type '${H[r.typeId]}'`)}he.prototype.visitInt8=null;he.prototype.visitInt16=null;he.prototype.visitInt32=null;he.prototype.visitInt64=null;he.prototype.visitUint8=null;he.prototype.visitUint16=null;he.prototype.visitUint32=null;he.prototype.visitUint64=null;he.prototype.visitFloat16=null;he.prototype.visitFloat32=null;he.prototype.visitFloat64=null;he.prototype.visitDateDay=null;he.prototype.visitDateMillisecond=null;he.prototype.visitTimestampSecond=null;he.prototype.visitTimestampMillisecond=null;he.prototype.visitTimestampMicrosecond=null;he.prototype.visitTimestampNanosecond=null;he.prototype.visitTimeSecond=null;he.prototype.visitTimeMillisecond=null;he.prototype.visitTimeMicrosecond=null;he.prototype.visitTimeNanosecond=null;he.prototype.visitDenseUnion=null;he.prototype.visitSparseUnion=null;he.prototype.visitIntervalDayTime=null;he.prototype.visitIntervalYearMonth=null;he.prototype.visitDuration=null;he.prototype.visitDurationSecond=null;he.prototype.visitDurationMillisecond=null;he.prototype.visitDurationMicrosecond=null;he.prototype.visitDurationNanosecond=null;const mS=new Float64Array(1),Hs=new Uint32Array(mS.buffer);function Tp(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function gS(r){if(r!==r)return 32256;mS[0]=r;const t=(Hs[1]&2147483648)>>16&65535;let e=Hs[1]&2146435072,n=0;return e>=1089470464?Hs[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Hs[1]&1048575)>>10):e<=1056964608?(n=1048576+(Hs[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Hs[1]&1048575)+512>>10),t|e|n&65535}const $L=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:gS,uint16ToFloat64:Tp},Symbol.toStringTag,{value:"Module"}));class Wt extends he{}function qt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const GL=(r,t,e)=>{r[t]=Math.floor(e/864e5)},yS=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},Ip=({values:r},t,e)=>{r[t]=e},vS=({values:r},t,e)=>{r[t]=gS(e)},HL=(r,t,e)=>{switch(r.type.precision){case Dr.HALF:return vS(r,t,e);case Dr.SINGLE:case Dr.DOUBLE:return Ip(r,t,e)}},_S=({values:r},t,e)=>{GL(r,t,e.valueOf())},bS=({values:r},t,e)=>{r[t]=BigInt(e)},XL=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},wS=({values:r,valueOffsets:t},e,n)=>yS(r,t,e,n),xS=({values:r,valueOffsets:t},e,n)=>yS(r,t,e,zx(n)),YL=(r,t,e)=>{r.type.unit===Bi.DAY?_S(r,t,e):bS(r,t,e)},SS=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},TS=({values:r},t,e)=>{r[t]=BigInt(e)},IS=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},ES=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},qL=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return SS(r,t,e);case te.MILLISECOND:return TS(r,t,e);case te.MICROSECOND:return IS(r,t,e);case te.NANOSECOND:return ES(r,t,e)}},AS=({values:r},t,e)=>{r[t]=e},MS=({values:r},t,e)=>{r[t]=e},CS=({values:r},t,e)=>{r[t]=e},OS=({values:r},t,e)=>{r[t]=e},QL=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return AS(r,t,e);case te.MILLISECOND:return MS(r,t,e);case te.MICROSECOND:return CS(r,t,e);case te.NANOSECOND:return OS(r,t,e)}},ZL=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},KL=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=$n.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=$n.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},tN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),eN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),rN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),nN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),iN=(r,t,e)=>{const n=r.type.children.map(s=>$n.getVisitFn(s.type)),i=e instanceof Map?rN(t,e):e instanceof er?eN(t,e):Array.isArray(e)?tN(t,e):nN(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},sN=(r,t,e)=>{r.type.mode===jn.Dense?PS(r,t,e):RS(r,t,e)},PS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];$n.visit(i,r.valueOffsets[t],e)},RS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];$n.visit(i,t,e)},oN=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},aN=(r,t,e)=>{r.type.unit===As.DAY_TIME?FS(r,t,e):DS(r,t,e)},FS=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},DS=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},LS=({values:r},t,e)=>{r[t]=e},NS=({values:r},t,e)=>{r[t]=e},BS=({values:r},t,e)=>{r[t]=e},US=({values:r},t,e)=>{r[t]=e},lN=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return LS(r,t,e);case te.MILLISECOND:return NS(r,t,e);case te.MICROSECOND:return BS(r,t,e);case te.NANOSECOND:return US(r,t,e)}},uN=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=$n.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${Fo(t)}: ${Fo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new cN(this[cn],this[To])}}class cN{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[cn].type.children.some(n=>n.name===e)}getOwnPropertyDescriptor(t,e){if(t[cn].type.children.some(n=>n.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[cn].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=on.visit(t[cn].children[n],t[To]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[cn].type.children.findIndex(s=>s.name===e);return i!==-1?($n.visit(t[cn].children[i],t[To],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}const dN=new hN;class Bt extends he{}function Ht(r){return(t,e)=>t.getValid(e)?r(t,e):null}const fN=(r,t)=>864e5*r[t],pN=(r,t)=>null,kS=(r,t,e)=>{if(e+1>=t.length)return null;const n=pr(t[e]),i=pr(t[e+1]);return r.subarray(n,i)},mN=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<fN(r,t),VS=({values:r},t)=>pr(r[t]),Vi=({stride:r,values:t},e)=>t[r*e],gN=({stride:r,values:t},e)=>Tp(t[r*e]),jS=({values:r},t)=>r[t],yN=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),$S=({values:r,valueOffsets:t},e)=>kS(r,t,e),GS=({values:r,valueOffsets:t},e)=>{const n=kS(r,t,e);return n!==null?ZD(n):null},vN=({values:r},t)=>r[t],_N=({type:r,values:t},e)=>r.precision!==Dr.HALF?t[e]:Tp(t[e]),bN=(r,t)=>r.type.unit===Bi.DAY?zS(r,t):VS(r,t),WS=({values:r},t)=>1e3*pr(r[t]),HS=({values:r},t)=>pr(r[t]),XS=({values:r},t)=>$x(r[t],BigInt(1e3)),YS=({values:r},t)=>$x(r[t],BigInt(1e6)),wN=(r,t)=>{switch(r.type.unit){case te.SECOND:return WS(r,t);case te.MILLISECOND:return HS(r,t);case te.MICROSECOND:return XS(r,t);case te.NANOSECOND:return YS(r,t)}},qS=({values:r},t)=>r[t],QS=({values:r},t)=>r[t],ZS=({values:r},t)=>r[t],KS=({values:r},t)=>r[t],xN=(r,t)=>{switch(r.type.unit){case te.SECOND:return qS(r,t);case te.MILLISECOND:return QS(r,t);case te.MICROSECOND:return ZS(r,t);case te.NANOSECOND:return KS(r,t)}},SN=({values:r,stride:t},e)=>hc.decimal(r.subarray(t*e,t*(e+1))),TN=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new er([l])},IN=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new Ap(o.slice(i,s-i))},EN=(r,t)=>new Ep(r,t),AN=(r,t)=>r.type.mode===jn.Dense?JS(r,t):tT(r,t),JS=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return on.visit(n,r.valueOffsets[t])},tT=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return on.visit(n,t)},MN=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},CN=(r,t)=>r.type.unit===As.DAY_TIME?eT(r,t):rT(r,t),eT=({values:r},t)=>r.subarray(2*t,2*(t+1)),rT=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},nT=({values:r},t)=>r[t],iT=({values:r},t)=>r[t],sT=({values:r},t)=>r[t],oT=({values:r},t)=>r[t],ON=(r,t)=>{switch(r.type.unit){case te.SECOND:return nT(r,t);case te.MILLISECOND:return iT(r,t);case te.MICROSECOND:return sT(r,t);case te.NANOSECOND:return oT(r,t)}},PN=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new er([s])};Bt.prototype.visitNull=Ht(pN);Bt.prototype.visitBool=Ht(mN);Bt.prototype.visitInt=Ht(vN);Bt.prototype.visitInt8=Ht(Vi);Bt.prototype.visitInt16=Ht(Vi);Bt.prototype.visitInt32=Ht(Vi);Bt.prototype.visitInt64=Ht(jS);Bt.prototype.visitUint8=Ht(Vi);Bt.prototype.visitUint16=Ht(Vi);Bt.prototype.visitUint32=Ht(Vi);Bt.prototype.visitUint64=Ht(jS);Bt.prototype.visitFloat=Ht(_N);Bt.prototype.visitFloat16=Ht(gN);Bt.prototype.visitFloat32=Ht(Vi);Bt.prototype.visitFloat64=Ht(Vi);Bt.prototype.visitUtf8=Ht(GS);Bt.prototype.visitLargeUtf8=Ht(GS);Bt.prototype.visitBinary=Ht($S);Bt.prototype.visitLargeBinary=Ht($S);Bt.prototype.visitFixedSizeBinary=Ht(yN);Bt.prototype.visitDate=Ht(bN);Bt.prototype.visitDateDay=Ht(zS);Bt.prototype.visitDateMillisecond=Ht(VS);Bt.prototype.visitTimestamp=Ht(wN);Bt.prototype.visitTimestampSecond=Ht(WS);Bt.prototype.visitTimestampMillisecond=Ht(HS);Bt.prototype.visitTimestampMicrosecond=Ht(XS);Bt.prototype.visitTimestampNanosecond=Ht(YS);Bt.prototype.visitTime=Ht(xN);Bt.prototype.visitTimeSecond=Ht(qS);Bt.prototype.visitTimeMillisecond=Ht(QS);Bt.prototype.visitTimeMicrosecond=Ht(ZS);Bt.prototype.visitTimeNanosecond=Ht(KS);Bt.prototype.visitDecimal=Ht(SN);Bt.prototype.visitList=Ht(TN);Bt.prototype.visitStruct=Ht(EN);Bt.prototype.visitUnion=Ht(AN);Bt.prototype.visitDenseUnion=Ht(JS);Bt.prototype.visitSparseUnion=Ht(tT);Bt.prototype.visitDictionary=Ht(MN);Bt.prototype.visitInterval=Ht(CN);Bt.prototype.visitIntervalDayTime=Ht(eT);Bt.prototype.visitIntervalYearMonth=Ht(rT);Bt.prototype.visitDuration=Ht(ON);Bt.prototype.visitDurationSecond=Ht(nT);Bt.prototype.visitDurationMillisecond=Ht(iT);Bt.prototype.visitDurationMicrosecond=Ht(sT);Bt.prototype.visitDurationNanosecond=Ht(oT);Bt.prototype.visitFixedSizeList=Ht(PN);Bt.prototype.visitMap=Ht(IN);const on=new Bt,lo=Symbol.for("keys"),Io=Symbol.for("vals"),uo=Symbol.for("kKeysAsStrings"),df=Symbol.for("_kKeysAsStrings");class Ap{constructor(t){return this[lo]=new er([t.children[0]]).memoize(),this[Io]=t.children[1],new Proxy(this,new FN)}get[uo](){return this[df]||(this[df]=Array.from(this[lo].toArray(),String))}[Symbol.iterator](){return new RN(this[lo],this[Io])}get size(){return this[lo].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[lo],e=this[Io],n={};for(let i=-1,s=t.length;++i`${Fo(t)}: ${Fo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class RN{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),on.visit(this.vals,t)]})}}class FN{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[uo]}has(t,e){return t[uo].includes(e)}getOwnPropertyDescriptor(t,e){if(t[uo].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[uo].indexOf(e);if(n!==-1){const i=on.visit(Reflect.get(t,Io),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[uo].indexOf(e);return i!==-1?($n.visit(Reflect.get(t,Io),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(Ap.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[lo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Io]:{writable:!0,enumerable:!1,configurable:!1,value:null},[df]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let qy;function aT(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const lT=(r,t)=>r<0?t+r:r,Qy=r=>r!==r;function Ds(r){if(typeof r!=="object"||r===null)return Qy(r)?Qy:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?jx(r,e):!1:r instanceof Map?LN(r):Array.isArray(r)?DN(r):r instanceof er?NN(r):BN(r,!0)}function DN(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return UN(r,e);case Map:return Zy(r,e,e.keys());case Ap:case Ep:case Object:case void 0:return Zy(r,e,t||Object.keys(e))}return e instanceof er?kN(r,e):!1}}function UN(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function VN(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):cT(new fc(e,r,t,null,Mp)).subarray(0,n)),i}return e}function cT(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class fc{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return ju(r,t,i)+ju(r,n,e)+hT(r,i>>3,n-i>>3)}function hT(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Zl(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Zl(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Zl(s.getUint8(i)),i+=1;return n}function Zl(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const jN=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:fc,getBit:uT,getBool:Mp,packBools:cT,popcnt_array:hT,popcnt_bit_range:ju,popcnt_uint32:Zl,setBool:VN,truncateBitmap:ff},Symbol.toStringTag,{value:"Module"})),$N=-1;class Ga{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){const{type:t}=this;return Ct.isSparseUnion(t)?this.children.some(e=>e.nullable):Ct.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Ct.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=$N&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-ju(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof Ga?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=pS(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Ct.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===jn.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(ff(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new Ga(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===H.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(ff(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[si.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[si.TYPE])&&(o[si.TYPE]=s.subarray(t,t+e)),(s=o[si.OFFSET])&&(o[si.OFFSET]=s.subarray(t,t+e+1))||(s=o[si.DATA])&&(o[si.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}}Ga.prototype.children=Object.freeze([]);class Ky{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function WN(r){return r.reduce((t,e)=>t+e.nullCount,0)}function HN(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function XN(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function Cp(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function ZN(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new fc(e,r.offset+(t||0),r.length,e,Mp)){if(!i)return n;++n}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case H.Union:break;case H.Dictionary:break;default:return ZN(r,e)}const n=on.getVisitFn(r),i=Ds(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new Ky(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new KN(o)})}class KN{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Ga)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=mT[o.typeId],c=s[0];this.isValid=h=>dT(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,gT[o.typeId]),this._offsets=HN(s);break}this.data=s,this.type=o,this.stride=pS(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return GN(this.data)}get nullCount(){return WN(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(t){return!1}get(t){return null}at(t){return this.get(lT(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return JN.visit(this)}concat(...t){return new er(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new er(aT(this,t,e,({data:n,_offsets:i},s,o)=>XN(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case H.Int:case H.Float:case H.Decimal:case H.Time:case H.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Ct.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Ct.isDictionary(this.type)){const t=new $u(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new er(e)}return new $u(this)}unmemoize(){if(Ct.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new er(e)}return this}}pT=Symbol.toStringTag;er[pT]=(r=>{r.type=Ct.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(H).map(e=>H[e]).filter(e=>typeof e=="number"&&e!==H.NONE);for(const e of t){const n=on.getVisitFnByTypeId(e),i=$n.getVisitFnByTypeId(e),s=tv.getVisitFnByTypeId(e);mT[e]={get:n,set:i,indexOf:s},gT[e]=Object.create(r,{isValid:{value:Jy(dT)},get:{value:Jy(on.getVisitFnByTypeId(e))},set:{value:YN($n.getVisitFnByTypeId(e))},indexOf:{value:qN(tv.getVisitFnByTypeId(e))}})}return"Vector"})(er.prototype);class $u extends er{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new $u(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new er(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const tB=65536;function po(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const Lo=8,Op=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Pp{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${po(this.buffer[3])} ${po(this.buffer[2])} ${po(this.buffer[1])} ${po(this.buffer[0])}`}static multiply(t,e){return new En(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new En(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return En.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return En.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new En(e);for(let o=n?1:0;othis.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function gr(r,t){return t instanceof r.constructor}function Ls(r,t){return r===t||gr(r,t)}function mi(r,t){return r===t||gr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function pc(r,t){return r===t||gr(r,t)&&r.precision===t.precision}function rB(r,t){return r===t||gr(r,t)&&r.byteWidth===t.byteWidth}function Rp(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function rl(r,t){return r===t||gr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function nl(r,t){return r===t||gr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function nB(r,t){return r===t||gr(r,t)&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function iB(r,t){return r===t||gr(r,t)&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function Fp(r,t){return r===t||gr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Gn.compareManyFields(r.children,t.children)}function sB(r,t){return r===t||gr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Gn.visit(r.indices,t.indices)&&Gn.visit(r.dictionary,t.dictionary)}function Dp(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function il(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function oB(r,t){return r===t||gr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function aB(r,t){return r===t||gr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}zt.prototype.visitNull=Ls;zt.prototype.visitBool=Ls;zt.prototype.visitInt=mi;zt.prototype.visitInt8=mi;zt.prototype.visitInt16=mi;zt.prototype.visitInt32=mi;zt.prototype.visitInt64=mi;zt.prototype.visitUint8=mi;zt.prototype.visitUint16=mi;zt.prototype.visitUint32=mi;zt.prototype.visitUint64=mi;zt.prototype.visitFloat=pc;zt.prototype.visitFloat16=pc;zt.prototype.visitFloat32=pc;zt.prototype.visitFloat64=pc;zt.prototype.visitUtf8=Ls;zt.prototype.visitLargeUtf8=Ls;zt.prototype.visitBinary=Ls;zt.prototype.visitLargeBinary=Ls;zt.prototype.visitFixedSizeBinary=rB;zt.prototype.visitDate=Rp;zt.prototype.visitDateDay=Rp;zt.prototype.visitDateMillisecond=Rp;zt.prototype.visitTimestamp=rl;zt.prototype.visitTimestampSecond=rl;zt.prototype.visitTimestampMillisecond=rl;zt.prototype.visitTimestampMicrosecond=rl;zt.prototype.visitTimestampNanosecond=rl;zt.prototype.visitTime=nl;zt.prototype.visitTimeSecond=nl;zt.prototype.visitTimeMillisecond=nl;zt.prototype.visitTimeMicrosecond=nl;zt.prototype.visitTimeNanosecond=nl;zt.prototype.visitDecimal=Ls;zt.prototype.visitList=nB;zt.prototype.visitStruct=iB;zt.prototype.visitUnion=Fp;zt.prototype.visitDenseUnion=Fp;zt.prototype.visitSparseUnion=Fp;zt.prototype.visitDictionary=sB;zt.prototype.visitInterval=Dp;zt.prototype.visitIntervalDayTime=Dp;zt.prototype.visitIntervalYearMonth=Dp;zt.prototype.visitDuration=il;zt.prototype.visitDurationSecond=il;zt.prototype.visitDurationMillisecond=il;zt.prototype.visitDurationMicrosecond=il;zt.prototype.visitDurationNanosecond=il;zt.prototype.visitFixedSizeList=oB;zt.prototype.visitMap=aB;const Gn=new zt;function lB(r,t){return Gn.compareSchemas(r,t)}function uB(r,t){return Gn.compareFields(r,t)}function cB(r,t){return Gn.visit(r,t)}const ev=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zL),eB),jN),$L),LL),zN),BL),{compareSchemas:lB,compareFields:uB,compareTypes:cB}),yT=6048e5,hB=864e5,rv=Symbol.for("constructDateFrom");function ui(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&rv in r?r[rv](t):r instanceof Date?new r.constructor(t):new Date(t)}function an(r,t){return ui(t||r,r)}let dB={};function mc(){return dB}function Wa(r,t){var a,l,u,c;const e=mc(),n=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=an(r,t==null?void 0:t.in),s=i.getDay(),o=(s=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function nv(r){const t=an(r),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+r-+e}function fB(r,...t){const e=ui.bind(null,t.find(n=>typeof n=="object"));return t.map(e)}function iv(r,t){const e=an(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function pB(r,t,e){const[n,i]=fB(e==null?void 0:e.in,r,t),s=iv(n),o=iv(i),a=+s-nv(s),l=+o-nv(o);return Math.round((a-l)/hB)}function mB(r,t){const e=vT(r,t),n=ui(r,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Gu(n)}function gB(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function yB(r){return!(!gB(r)&&typeof r!="number"||isNaN(+an(r)))}function vB(r,t){const e=an(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const _B={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"}},bB=(r,t,e)=>{let n;const i=_B[r];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function zh(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const wB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},SB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},TB={date:zh({formats:wB,defaultWidth:"full"}),time:zh({formats:xB,defaultWidth:"full"}),dateTime:zh({formats:SB,defaultWidth:"full"})},IB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},EB=(r,t,e,n)=>IB[r];function sa(r){return(t,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let i;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;i=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;i=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return i[s]}}const AB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},CB={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"]},OB={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"]},PB={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"}},RB={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"}},FB=(r,t)=>{const e=Number(r),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},DB={ordinalNumber:FB,era:sa({values:AB,defaultWidth:"wide"}),quarter:sa({values:MB,defaultWidth:"wide",argumentCallback:r=>r-1}),month:sa({values:CB,defaultWidth:"wide"}),day:sa({values:OB,defaultWidth:"wide"}),dayPeriod:sa({values:PB,defaultWidth:"wide",formattingValues:RB,defaultFormattingWidth:"wide"})};function oa(r){return(t,e={})=>{const n=e.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?NB(a,h=>h.test(o)):LB(a,h=>h.test(o));let u;u=r.valueCallback?r.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function LB(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function NB(r,t){for(let e=0;e{const n=t.match(r.matchPattern);if(!n)return null;const i=n[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const UB=/^(\d+)(th|st|nd|rd)?/i,kB=/\d+/i,zB={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},VB={any:[/^b/i,/^(a|c)/i]},jB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$B={any:[/1/i,/2/i,/3/i,/4/i]},GB={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},WB={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]},HB={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},XB={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]},YB={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},qB={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}},QB={ordinalNumber:BB({matchPattern:UB,parsePattern:kB,valueCallback:r=>parseInt(r,10)}),era:oa({matchPatterns:zB,defaultMatchWidth:"wide",parsePatterns:VB,defaultParseWidth:"any"}),quarter:oa({matchPatterns:jB,defaultMatchWidth:"wide",parsePatterns:$B,defaultParseWidth:"any",valueCallback:r=>r+1}),month:oa({matchPatterns:GB,defaultMatchWidth:"wide",parsePatterns:WB,defaultParseWidth:"any"}),day:oa({matchPatterns:HB,defaultMatchWidth:"wide",parsePatterns:XB,defaultParseWidth:"any"}),dayPeriod:oa({matchPatterns:YB,defaultMatchWidth:"any",parsePatterns:qB,defaultParseWidth:"any"})},ZB={code:"en-US",formatDistance:bB,formatLong:TB,formatRelative:EB,localize:DB,match:QB,options:{weekStartsOn:0,firstWeekContainsDate:1}};function KB(r,t){const e=an(r,t==null?void 0:t.in);return pB(e,vB(e))+1}function JB(r,t){const e=an(r,t==null?void 0:t.in),n=+Gu(e)-+mB(e);return Math.round(n/yT)+1}function _T(r,t){var c,h,f,d;const e=an(r,t==null?void 0:t.in),n=e.getFullYear(),i=mc(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((d=(f=i.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,o=ui((t==null?void 0:t.in)||r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const a=Wa(o,t),l=ui((t==null?void 0:t.in)||r,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const u=Wa(l,t);return+e>=+a?n+1:+e>=+u?n:n-1}function tU(r,t){var a,l,u,c;const e=mc(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=_T(r,t),s=ui((t==null?void 0:t.in)||r,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),Wa(s,t)}function eU(r,t){const e=an(r,t==null?void 0:t.in),n=+Wa(e,t)-+tU(e,t);return Math.round(n/yT)+1}function we(r,t){const e=r<0?"-":"",n=Math.abs(r).toString().padStart(t,"0");return e+n}const wi={y(r,t){const e=r.getFullYear(),n=e>0?e:1-e;return we(t==="yy"?n%100:n,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):we(e+1,2)},d(r,t){return we(r.getDate(),t.length)},a(r,t){const e=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(r,t){return we(r.getHours()%12||12,t.length)},H(r,t){return we(r.getHours(),t.length)},m(r,t){return we(r.getMinutes(),t.length)},s(r,t){return we(r.getSeconds(),t.length)},S(r,t){const e=t.length,n=r.getMilliseconds(),i=Math.trunc(n*Math.pow(10,e-3));return we(i,t.length)}},Xs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sv={G:function(r,t,e){const n=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const n=r.getFullYear(),i=n>0?n:1-n;return e.ordinalNumber(i,{unit:"year"})}return wi.y(r,t)},Y:function(r,t,e,n){const i=_T(r,n),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return we(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):we(s,t.length)},R:function(r,t){const e=vT(r);return we(e,t.length)},u:function(r,t){const e=r.getFullYear();return we(e,t.length)},Q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return we(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return we(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,t,e){const n=r.getMonth();switch(t){case"M":case"MM":return wi.M(r,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(r,t,e){const n=r.getMonth();switch(t){case"L":return String(n+1);case"LL":return we(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(r,t,e,n){const i=eU(r,n);return t==="wo"?e.ordinalNumber(i,{unit:"week"}):we(i,t.length)},I:function(r,t,e){const n=JB(r);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):we(n,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):wi.d(r,t)},D:function(r,t,e){const n=KB(r);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):we(n,t.length)},E:function(r,t,e){const n=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return we(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return we(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,e){const n=r.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return we(i,t.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(r,t,e){const i=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,e){const n=r.getHours();let i;switch(n===12?i=Xs.noon:n===0?i=Xs.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,e){const n=r.getHours();let i;switch(n>=17?i=Xs.evening:n>=12?i=Xs.afternoon:n>=4?i=Xs.morning:i=Xs.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let n=r.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return wi.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):wi.H(r,t)},K:function(r,t,e){const n=r.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):we(n,t.length)},k:function(r,t,e){let n=r.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):we(n,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):wi.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):wi.s(r,t)},S:function(r,t){return wi.S(r,t)},X:function(r,t,e){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return av(n);case"XXXX":case"XX":return hs(n);case"XXXXX":case"XXX":default:return hs(n,":")}},x:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"x":return av(n);case"xxxx":case"xx":return hs(n);case"xxxxx":case"xxx":default:return hs(n,":")}},O:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ov(n,":");case"OOOO":default:return"GMT"+hs(n,":")}},z:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ov(n,":");case"zzzz":default:return"GMT"+hs(n,":")}},t:function(r,t,e){const n=Math.trunc(+r/1e3);return we(n,t.length)},T:function(r,t,e){return we(+r,t.length)}};function ov(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Math.trunc(n/60),s=n%60;return s===0?e+String(i):e+String(i)+t+we(s,2)}function av(r,t){return r%60===0?(r>0?"-":"+")+we(Math.abs(r)/60,2):hs(r,t)}function hs(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=we(Math.trunc(n/60),2),s=we(n%60,2);return e+i+t+s}const lv=(r,t)=>{switch(r){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"})}},bT=(r,t)=>{switch(r){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"})}},rU=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],n=e[1],i=e[2];if(!i)return lv(r,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",lv(n,t)).replace("{{time}}",bT(i,t))},nU={p:bT,P:rU},iU=/^D+$/,sU=/^Y+$/,oU=["D","DD","YY","YYYY"];function aU(r){return iU.test(r)}function lU(r){return sU.test(r)}function uU(r,t,e){const n=cU(r,t,e);if(console.warn(n),oU.includes(r))throw new RangeError(n)}function cU(r,t,e){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const hU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fU=/^'([^]*?)'?$/,pU=/''/g,mU=/[a-zA-Z]/;function wT(r,t,e){var c,h,f,d;const n=mc(),i=n.locale??ZB,s=n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,a=an(r,e==null?void 0:e.in);if(!yB(a))throw new RangeError("Invalid time value");let l=t.match(dU).map(m=>{const g=m[0];if(g==="p"||g==="P"){const p=nU[g];return p(m,i.formatLong)}return m}).join("").match(hU).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const g=m[0];if(g==="'")return{isToken:!1,value:gU(m)};if(sv[g])return{isToken:!0,value:m};if(g.match(mU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(m=>{if(!m.isToken)return m.value;const g=m.value;(lU(g)||aU(g))&&uU(g,t,String(r));const p=sv[g[0]];return p(a,g,i.localize,u)}).join("")}function gU(r){const t=r.match(fU);return t?t[1].replace(pU,"'"):r}function yU(r,t){return an(r*1e3,t==null?void 0:t.in)}function vU(r,t){const e=_U(t)?new t(0):ui(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function _U(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function bU(r,t){let e=r.length;switch("string"){case"string":{for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function Tr(r){return r==null}function wU(r){return r!=null}async function xT(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await Ei(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function xU(r){return Tr(r)?!1:Ct.isInt(r.type)&&!ST(r)||SU(r)}function SU(r){return Tr(r)?!1:Ct.isInt(r.type)&&r.type.isSigned===!1}function TU(r){return Tr(r)?!1:Ct.isFloat(r.type)??!1}function IU(r){return Tr(r)?!1:Ct.isDecimal(r.type)}function EU(r){return Tr(r)?!1:Ct.isBool(r.type)}function AU(r){return Tr(r)?!1:Ct.isDuration(r.type)}function ST(r){return Tr(r)?!1:Ct.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function MU(r){return Tr(r)?!1:Ct.isTimestamp(r.type)}function CU(r){return Tr(r)?!1:Ct.isDate(r.type)}function OU(r){return Tr(r)?!1:Ct.isTime(r.type)}function PU(r){return Tr(r)?!1:Ct.isList(r.type)||Ct.isFixedSizeList(r.type)}function RU(r){return Tr(r)?!1:Ct.isStruct(r.type)||Ct.isMap(r.type)}function FU(r){return Tr(r)?!1:Ct.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Ct.isInterval(r.type)}function DU(r,t){let e;if(t===te.MILLISECOND)e=1e3;else if(t===te.MICROSECOND)e=1e3*1e3;else if(t===te.NANOSECOND)e=1e3*1e3*1e3;else return Number(r);return typeof r=="bigint"&&!Number.isSafeInteger(Number(r))?Number(r/BigInt(e)):Number(r)/e}function LU(r,t){var n;const e=DU(r,((n=t==null?void 0:t.type)==null?void 0:n.unit)??te.SECOND);return yU(e)}function NU(r,t){const e=LU(r,t);return wT(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function BU(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?wT(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function UU(r,t){var i;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const n=(i=t==null?void 0:t.type)==null?void 0:i.timezone;return typeof r=="number"?n?e=new Fr(r,n):e=new Fr(r):n?e=new Fr(r,n):e=new Fr(r),vU(e,Date)}function kU(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let n=ev.bigNumToString(new ev.BN(r)).padStart(e,"0");if(e===0)return n;let i="";n.startsWith("-")&&(i="-",n=n.slice(1));const s=n.slice(0,-e)||"0",o=bU(n.slice(-e),"0")||"";return`${i}${s}${o?`.${o}`:""}`}function zU(r){const t=r[0],e=r[1],n=[];return t!==0&&n.push(`${t} year${t>1?"s":""}`),e!==0&&n.push(`${e} month${e>1?"s":""}`),n.length?n.join(" "):"0 months"}function VU(r,t){var n,i,s,o;if(Ct.isInterval(t==null?void 0:t.type))return zU(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",f=pf(u.left,(i=(n=t.type)==null?void 0:n.children)==null?void 0:i[0]),d=pf(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+f}, ${d+h}`}return String(r)}function jU(r,t){return(t==null?void 0:t.type)instanceof hf?JSON.parse(JSON.stringify(r,(e,n)=>{if(wU(n))return typeof n=="bigint"?Number(n):n})):JSON.parse(JSON.stringify(r,(e,n)=>typeof n=="bigint"?Number(n):n))}function pf(r,t){if(Tr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&CU(t))return BU(r);if(typeof r=="bigint"&&OU(t))return NU(Number(r),t);if(e&&MU(t))return UU(r,t);if(ST(t))throw new Error("Period type is not supported yet");if(FU(t))return VU(r,t);if(AU(t))throw new Error("Duration type is not supported yet");return IU(t)?kU(r,t):TU(t)&&Number.isFinite(r)||xU(t)?r:RU(t)||PU(t)?jU(r,t):EU(t)?!!r:String(r)}function uv(r){return((r.toArray()||[]).map(n=>n.toJSON())||[]).map(n=>(r.schema.fields.forEach(i=>n[i.name]=pf(n[i.name],i)),n))}var Ha=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(Ha||{});async function TT(r){const t=M1(r,{logger:!1});let e,n;const i=await xT();if(i==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await Ei(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}n=await Iy(await t.bundles),e=new Worker(n.mainWorker)}else if(i==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await Ei(async()=>{const{getBundles:h}=await import("./default-node-BIObRWrk.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}n=await Iy(await t.bundles);let l=n.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await Ei(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${i}`);let s;t.logger===!0?s=new Bx:t.logger===!1?s=new PD:s=t.logger;const o=new UD(s,e);if(await o.instantiate(n.mainModule,n.pthreadWorker),t.storage)switch(t.storage.type){case Ha.ORIGIN_PRIVATE_FS:{try{let l=t.storage.path;l.startsWith("/")&&(l=l.slice(1)),await o.open({path:`opfs://${l}`,accessMode:t.storage.accessMode})}catch(l){throw await o.terminate(),await e.terminate(),l}break}case Ha.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(l){throw await o.terminate(),await e.terminate(),l}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(l,u=[])=>{if(!u||u.length===0){const d=await a.query(l);return uv(d)}const c=await a.prepare(l),h=await c.query(...u),f=uv(h);return c.close(),f},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function $U(r,t){await(await r).conn.send("BEGIN TRANSACTION");try{const e=await t(r);return await(await r).conn.send("COMMIT"),e}catch(e){throw await(await r).conn.send("ROLLBACK"),e}}async function GU(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const n=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),n}catch(n){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const St=Symbol.for("drizzle:entityKind");function lt(r,t){if(!r||typeof r!="object")return!1;if(r instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,St))throw new 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 e=Object.getPrototypeOf(r).constructor;if(e)for(;e;){if(St in e&&e[St]===t[St])return!0;e=Object.getPrototypeOf(e)}return!1}var bv;bv=St;class rr{constructor(t,e){W(this,"name");W(this,"keyAsName");W(this,"primary");W(this,"notNull");W(this,"default");W(this,"defaultFn");W(this,"onUpdateFn");W(this,"hasDefault");W(this,"isUnique");W(this,"uniqueName");W(this,"uniqueType");W(this,"dataType");W(this,"columnType");W(this,"enumValues");W(this,"generated");W(this,"generatedIdentity");W(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}W(rr,bv,"Column");const Eo=Symbol.for("drizzle:Name");function WU(r,t){return`${r[Eo]}_${t.join("_")}_unique`}var wv,xv;class Lr extends(xv=rr,wv=St,xv){constructor(t,e){e.uniqueName||(e.uniqueName=WU(t,[e.name])),super(t,e),this.table=t}}W(Lr,wv,"PgColumn");const cv=Symbol.for("drizzle:isPgEnum");function HU(r){return!!r&&typeof r=="function"&&cv in r&&r[cv]===!0}var Sv;Sv=St;class Nr{constructor(t,e,n,i=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:n,isWith:i}}}W(Nr,Sv,"Subquery");var Tv,Iv;class Lp extends(Iv=Nr,Tv=St,Iv){}W(Lp,Tv,"WithSubquery");const Ur={startActiveSpan(r,t){return t()}},Qe=Symbol.for("drizzle:ViewBaseConfig"),Kl=Symbol.for("drizzle:Schema"),mf=Symbol.for("drizzle:Columns"),hv=Symbol.for("drizzle:ExtraConfigColumns"),Vh=Symbol.for("drizzle:OriginalName"),jh=Symbol.for("drizzle:BaseName"),Wu=Symbol.for("drizzle:IsAlias"),dv=Symbol.for("drizzle:ExtraConfigBuilder"),XU=Symbol.for("drizzle:IsDrizzleTable");var Ev,Av,Mv,Cv,Ov,Pv,Rv,Fv,Dv,Lv;Lv=St,Dv=Eo,Fv=Vh,Rv=Kl,Pv=mf,Ov=hv,Cv=jh,Mv=Wu,Av=XU,Ev=dv;class It{constructor(t,e,n){W(this,Dv);W(this,Fv);W(this,Rv);W(this,Pv);W(this,Ov);W(this,Cv);W(this,Mv,!1);W(this,Av,!0);W(this,Ev);this[Eo]=this[Vh]=t,this[Kl]=e,this[jh]=n}}W(It,Lv,"Table"),W(It,"Symbol",{Name:Eo,Schema:Kl,OriginalName:Vh,Columns:mf,ExtraConfigColumns:hv,BaseName:jh,IsAlias:Wu,ExtraConfigBuilder:dv});function vs(r){return r[Eo]}function Xa(r){return`${r[Kl]??"public"}.${r[Eo]}`}function IT(r){return r!=null&&typeof r.getSQL=="function"}function YU(r){var e;const t={sql:"",params:[]};for(const n of r)t.sql+=n.sql,t.params.push(...n.params),(e=n.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var Nv;Nv=St;class Ze{constructor(t){W(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Pt([this])}}W(Ze,Nv,"StringChunk");var Bv;Bv=St;const ps=class ps{constructor(t){W(this,"decoder",ET);W(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Ur.startActiveSpan("drizzle.buildSQL",e=>{const n=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,e){const n=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:i,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=n;return YU(t.map(c=>{var h;if(lt(c,Ze))return{sql:c.value.join(""),params:[]};if(lt(c,Hu))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const f=[new Ze("(")];for(const[d,m]of c.entries())f.push(m),dr},AT={mapToDriverValue:r=>r};({...ET,...AT});var kv;kv=St;class ci{constructor(t,e=AT){W(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Pt([this])}}W(ci,kv,"Param");function Y(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Ze(r[0]));for(const[n,i]of t.entries())e.push(i,new Ze(r[n+1]));return new Pt(e)}(r=>{function t(){return new Pt([])}r.empty=t;function e(l){return new Pt(l)}r.fromList=e;function n(l){return new Pt([new Ze(l)])}r.raw=n;function i(l,u){const c=[];for(const[h,f]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(f);return new Pt(c)}r.join=i;function s(l){return new Hu(l)}r.identifier=s;function o(l){return new Ms(l)}r.placeholder=o;function a(l,u){return new ci(l,u)}r.param=a})(Y||(Y={}));(r=>{var e;e=St;const n=class n{constructor(s,o){W(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}};W(n,e,"SQL.Aliased");let t=n;r.Aliased=t})(Pt||(Pt={}));var zv;zv=St;class Ms{constructor(t){this.name=t}getSQL(){return new Pt([this])}}W(Ms,zv,"Placeholder");function fv(r,t){return r.map(e=>{if(lt(e,Ms)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,ci)&<(e.value,Ms)){if(!(e.value.name in t))throw new Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const QU=Symbol.for("drizzle:IsDrizzleView");var Vv,jv,$v;$v=St,jv=Qe,Vv=QU;class ji{constructor({name:t,schema:e,selectedFields:n,query:i}){W(this,jv);W(this,Vv,!0);this[Qe]={name:t,originalName:t,schema:e,selectedFields:n,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new Pt([this])}}W(ji,$v,"View");rr.prototype.getSQL=function(){return new Pt([this])};It.prototype.getSQL=function(){return new Pt([this])};Nr.prototype.getSQL=function(){return new Pt([this])};var Gv;Gv=St;class Ya{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}W(Ya,Gv,"ColumnAliasProxyHandler");var Wv;Wv=St;class gc{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===It.Symbol.IsAlias)return!0;if(e===It.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===It.Symbol.OriginalName)return this.alias;if(e===Qe)return{...t[Qe],name:this.alias,isAlias:!0};if(e===It.Symbol.Columns){const i=t[It.Symbol.Columns];if(!i)return i;const s={};return Object.keys(i).map(o=>{s[o]=new Proxy(i[o],new Ya(new Proxy(t,this)))}),s}const n=t[e];return lt(n,rr)?new Proxy(n,new Ya(new Proxy(t,this))):n}}W(gc,Wv,"TableAliasProxyHandler");function $h(r,t){return new Proxy(r,new gc(t,!1))}function ei(r,t){return new Proxy(r,new Ya(new Proxy(r.table,new gc(t,!1))))}function MT(r,t){return new Pt.Aliased(Xu(r.sql,t),r.fieldAlias)}function Xu(r,t){return Y.join(r.queryChunks.map(e=>lt(e,rr)?ei(e,t):lt(e,Pt)?Xu(e,t):lt(e,Pt.Aliased)?MT(e,t):e))}var Hv,Xv;class Np extends(Xv=Error,Hv=St,Xv){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}W(Np,Hv,"DrizzleError");var Yv,qv;class CT extends(qv=Np,Yv=St,qv){constructor(){super({message:"Rollback"})}}W(CT,Yv,"TransactionRollbackError");function Sr(r,t){return qU(t)&&!IT(r)&&!lt(r,ci)&&!lt(r,Ms)&&!lt(r,rr)&&!lt(r,It)&&!lt(r,ji)?new ci(r,t):r}const OT=(r,t)=>Y`${r} = ${Sr(t,r)}`,ZU=(r,t)=>Y`${r} <> ${Sr(t,r)}`;function gf(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Pt(t):new Pt([new Ze("("),Y.join(t,new Ze(" and ")),new Ze(")")])}function KU(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Pt(t):new Pt([new Ze("("),Y.join(t,new Ze(" or ")),new Ze(")")])}function JU(r){return Y`not ${r}`}const tk=(r,t)=>Y`${r} > ${Sr(t,r)}`,ek=(r,t)=>Y`${r} >= ${Sr(t,r)}`,rk=(r,t)=>Y`${r} < ${Sr(t,r)}`,nk=(r,t)=>Y`${r} <= ${Sr(t,r)}`;function ik(r,t){return Array.isArray(t)?t.length===0?Y`false`:Y`${r} in ${t.map(e=>Sr(e,r))}`:Y`${r} in ${Sr(t,r)}`}function sk(r,t){return Array.isArray(t)?t.length===0?Y`true`:Y`${r} not in ${t.map(e=>Sr(e,r))}`:Y`${r} not in ${Sr(t,r)}`}function ok(r){return Y`${r} is null`}function ak(r){return Y`${r} is not null`}function lk(r){return Y`exists ${r}`}function uk(r){return Y`not exists ${r}`}function ck(r,t,e){return Y`${r} between ${Sr(t,r)} and ${Sr(e,r)}`}function hk(r,t,e){return Y`${r} not between ${Sr(t,r)} and ${Sr(e,r)}`}function dk(r,t){return Y`${r} like ${t}`}function fk(r,t){return Y`${r} not like ${t}`}function pk(r,t){return Y`${r} ilike ${t}`}function mk(r,t){return Y`${r} not ilike ${t}`}function gk(r){return Y`${r} asc`}function yk(r){return Y`${r} desc`}var Qv;Qv=St;class PT{write(t){console.log(t)}}W(PT,Qv,"ConsoleLogWriter");var Zv;Zv=St;class RT{constructor(t){W(this,"writer");this.writer=(t==null?void 0:t.writer)??new PT}logQuery(t,e){const n=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),i=n.length?` -- params: [${n.join(", ")}]`:"";this.writer.write(`Query: ${t}${i}`)}}W(RT,Zv,"DefaultLogger");var Kv;Kv=St;class FT{logQuery(){}}W(FT,Kv,"NoopLogger");var Jv,t_;t_=St,Jv=Symbol.toStringTag;class $i{constructor(){W(this,Jv,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}W($i,t_,"QueryPromise");function Cs(r,t){return Object.entries(r).reduce((e,[n,i])=>{if(typeof n!="string")return e;const s=t?[...t,n]:[n];return lt(i,rr)||lt(i,Pt)||lt(i,Pt.Aliased)?e.push({path:s,field:i}):lt(i,It)?e.push(...Cs(i[It.Symbol.Columns],s)):e.push(...Cs(i,s)),e},[])}function Bp(r,t){const e=Object.keys(r),n=Object.keys(t);if(e.length!==n.length)return!1;for(const[i,s]of e.entries())if(s!==n[i])return!1;return!0}function DT(r,t){const e=Object.entries(t).filter(([,n])=>n!==void 0).map(([n,i])=>lt(i,Pt)||lt(i,rr)?[n,i]:[n,new ci(i,r[It.Symbol.Columns][n])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function vk(r,t){for(const e of t)for(const n of Object.getOwnPropertyNames(e.prototype))n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n)||Object.create(null))}function _k(r){return r[It.Symbol.Columns]}function fs(r){return lt(r,Nr)?r._.alias:lt(r,ji)?r[Qe].name:lt(r,Pt)?void 0:r[It.Symbol.IsAlias]?r[It.Symbol.Name]:r[It.Symbol.BaseName]}function bk(r){if(typeof r!="object"||r===null||r.constructor.name!=="Object")return!1;if("logger"in r){const t=typeof r.logger;return!(t!=="boolean"&&(t!=="object"||typeof r.logger.logQuery!="function")&&t!=="undefined")}if("schema"in r){const t=typeof r.schema;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.casing;return!(t!=="string"&&t!=="undefined")}if("mode"in r)return!(r.mode!=="default"||r.mode!=="planetscale"||r.mode!==void 0);if("connection"in r){const t=typeof r.connection;return!(t!=="string"&&t!=="object"&&t!=="undefined")}if("client"in r){const t=typeof r.client;return!(t!=="object"&&t!=="function"&&t!=="undefined")}return Object.keys(r).length===0}var e_,r_;class LT extends(r_=Lr,e_=St,r_){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}W(LT,e_,"PgDate");var n_,i_;class NT extends(i_=Lr,n_=St,i_){getSQLType(){return"date"}}W(NT,n_,"PgDateString");var s_,o_;class BT extends(o_=Lr,s_=St,o_){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(BT,s_,"PgJson");var a_,l_;class UT extends(l_=Lr,a_=St,l_){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(UT,a_,"PgJsonb");var u_,c_;class kT extends(c_=Lr,u_=St,c_){constructor(e,n){super(e,n);W(this,"precision");W(this,"scale");this.precision=n.precision,this.scale=n.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})`}}W(kT,u_,"PgNumeric");var h_,d_;class zT extends(d_=Lr,h_=St,d_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(zT,h_,"PgTime");var f_,p_;class VT extends(p_=Lr,f_=St,p_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");W(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));W(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(VT,f_,"PgTimestamp");var m_,g_;class jT extends(g_=Lr,m_=St,g_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(jT,m_,"PgTimestampString");var y_,v_;class $T extends(v_=Lr,y_=St,v_){getSQLType(){return"uuid"}}W($T,y_,"PgUUID");const pv=Symbol.for("drizzle:PgInlineForeignKeys"),mv=Symbol.for("drizzle:EnableRLS");var __,b_,w_,x_,S_,T_;class Xr extends(T_=It,S_=St,x_=pv,w_=mv,b_=It.Symbol.ExtraConfigBuilder,__=It.Symbol.ExtraConfigColumns,T_){constructor(){super(...arguments);W(this,x_,[]);W(this,w_,!1);W(this,b_);W(this,__,{})}}W(Xr,S_,"PgTable"),W(Xr,"Symbol",Object.assign({},It.Symbol,{InlineForeignKeys:pv,EnableRLS:mv}));var I_;I_=St;class GT{constructor(t,e){W(this,"columns");W(this,"name");this.columns=t,this.name=e}build(t){return new WT(t,this.columns,this.name)}}W(GT,I_,"PgPrimaryKeyBuilder");var E_;E_=St;class WT{constructor(t,e,n){W(this,"columns");W(this,"name");this.table=t,this.columns=e,this.name=n}getName(){return this.name??`${this.table[Xr.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}W(WT,E_,"PgPrimaryKey");var A_;A_=St;class Up{constructor(t,e,n){W(this,"referencedTableName");W(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=n,this.referencedTableName=e[It.Symbol.Name]}}W(Up,A_,"Relation");var M_;M_=St;class HT{constructor(t,e){this.table=t,this.config=e}}W(HT,M_,"Relations");var C_,O_;const Qu=class Qu extends(O_=Up,C_=St,O_){constructor(t,e,n,i){super(t,e,n==null?void 0:n.relationName),this.config=n,this.isNullable=i}withFieldName(t){const e=new Qu(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};W(Qu,C_,"One");let Os=Qu;var P_,R_;const Zu=class Zu extends(R_=Up,P_=St,R_){constructor(t,e,n){super(t,e,n==null?void 0:n.relationName),this.config=n}withFieldName(t){const e=new Zu(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};W(Zu,P_,"Many");let Yu=Zu;function wk(){return{and:gf,between:ck,eq:OT,exists:lk,gt:tk,gte:ek,ilike:pk,inArray:ik,isNull:ok,isNotNull:ak,like:dk,lt:rk,lte:nk,ne:ZU,not:JU,notBetween:hk,notExists:uk,notLike:fk,notIlike:mk,notInArray:sk,or:KU,sql:Y}}function xk(){return{sql:Y,asc:gk,desc:yk}}function Sk(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,It)&&(r=r.default);const e={},n={},i={};for(const[o,a]of Object.entries(r))if(lt(a,It)){const l=Xa(a),u=n[l];e[l]=o,i[o]={tsName:o,dbName:a[It.Symbol.Name],schema:a[It.Symbol.Schema],columns:a[It.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[It.Symbol.Columns]))h.primary&&i[o].primaryKey.push(h);const c=(s=a[It.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[It.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,GT)&&i[o].primaryKey.push(...h.columns)}else if(lt(a,HT)){const l=Xa(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[f,d]of Object.entries(c))if(u){const m=i[u];m.relations[f]=d}else l in n||(n[l]={relations:{},primaryKey:h}),n[l].relations[f]=d}return{tables:i,tableNamesMap:e}}function Tk(r){return function(e,n){return new Os(r,e,n,(n==null?void 0:n.fields.reduce((i,s)=>i&&s.notNull,!0))??!1)}}function Ik(r){return function(e,n){return new Yu(r,e,n)}}function Ek(r,t,e){if(lt(e,Os)&&e.config)return{fields:e.config.fields,references:e.config.references};const n=t[Xa(e.referencedTable)];if(!n)throw new Error(`Table "${e.referencedTable[It.Symbol.Name]}" not found in schema`);const i=r[n];if(!i)throw new Error(`Table "${n}" not found in schema`);const s=e.sourceTable,o=t[Xa(s)];if(!o)throw new Error(`Table "${s[It.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(i.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${n}"`):new Error(`There are multiple relations between "${n}" and "${e.sourceTable[It.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],Os)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${o}.${e.fieldName}"`)}function Ak(r){return{one:Tk(r),many:Ik(r)}}function yf(r,t,e,n,i=s=>s){const s={};for(const[o,a]of n.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=lt(l,Os)?c&&yf(r,r[a.relationTableTsKey],c,a.selection,i):c.map(h=>yf(r,r[a.relationTableTsKey],h,a.selection,i))}else{const l=i(e[o]),u=a.field;let c;lt(u,rr)?c=u:lt(u,Pt)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var F_;F_=St;const Ku=class Ku{constructor(t){W(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===Qe)return{...t[Qe],selectedFields:new Proxy(t[Qe].selectedFields,this)};if(typeof e=="symbol")return t[e];const i=(lt(t,Nr)?t._.selectedFields:lt(t,ji)?t[Qe].selectedFields:t)[e];if(lt(i,Pt.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!i.isSelectionField)return i.sql;const s=i.clone();return s.isSelectionField=!0,s}if(lt(i,Pt)){if(this.config.sqlBehavior==="sql")return i;throw new Error(`You tried to reference "${e}" 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 lt(i,rr)?this.config.alias?new Proxy(i,new Ya(new Proxy(i.table,new gc(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!="object"||i===null?i:new Proxy(i,new Ku(this.config))}};W(Ku,F_,"SelectionProxyHandler");let or=Ku;var D_,L_;class vf extends(L_=$i,D_=St,L_){constructor(e,n,i,s){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[It.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Cs(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(vf,D_,"PgDelete");function Mk(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function Ck(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,n,i)=>{const s=i===0?n.toLowerCase():`${n[0].toUpperCase()}${n.slice(1)}`;return e+s},"")}function Ok(r){return r}var N_;N_=St;class XT{constructor(t){W(this,"cache",{});W(this,"cachedTables",{});W(this,"convert");this.convert=t==="snake_case"?Mk:t==="camelCase"?Ck:Ok}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[It.Symbol.Schema]??"public",n=t.table[It.Symbol.OriginalName],i=`${e}.${n}.${t.name}`;return this.cache[i]||this.cacheTable(t.table),this.cache[i]}cacheTable(t){const e=t[It.Symbol.Schema]??"public",n=t[It.Symbol.OriginalName],i=`${e}.${n}`;if(!this.cachedTables[i]){for(const s of Object.values(t[It.Symbol.Columns])){const o=`${i}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[i]=!0}}clearCache(){this.cache={},this.cachedTables={}}}W(XT,N_,"CasingCache");var B_,U_;class kp extends(U_=ji,B_=St,U_){}W(kp,B_,"PgViewBase");var k_;k_=St;class Ea{constructor(t){W(this,"casing");this.casing=new XT(t==null?void 0:t.casing)}async migrate(t,e,n){const i=typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",s=typeof n=="string"?"drizzle":n.migrationsSchema??"drizzle",o=Y` +]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new cs(e,n.map(i=>new _r(e,i)))}slice(t,e){const n=this.schema;[t,e]=ox({length:this.numRows},t,e);const i=cx(this.data,this._offsets,t,e);return new cs(n,i.map(s=>new _r(n,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&tn.children[t]);if(e.length===0){const{type:n}=this.schema.fields[t],i=le({type:n,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new Ne(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[n,i]=Ph(n,a)}return new cs(n,i)}select(t){const e=this.schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new cs(e,n)}assign(t){const e=this.schema.fields,[n,i]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,f=e.findIndex(d=>d.name===l.name);return~f?h[f]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,i[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new cs(...Ph(s,o))}};bx=Symbol.toStringTag;Li[bx]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Du(sp),r.get=Du(xr.getVisitFn(k.Struct)),r.set=hx(sn.getVisitFn(k.Struct)),r.indexOf=dx(Lu.getVisitFn(k.Struct)),"Table"))(Li.prototype);var wx;let _r=class ba{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Le))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=le({nullCount:0,type:new dr(this.schema.fields),children:this.schema.fields.map(e=>le({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Ae))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=gy(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:i,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Pe.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Le(n),a=le({type:new dr(n),length:s,children:i,nullCount:0});[this.schema,this.data]=gy(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=xx(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(t){return this.data.getValid(t)}get(t){return xr.visit(this.data,t)}at(t){return this.get(rp(t,this.numRows))}set(t,e){return sn.visit(this.data,t,e)}indexOf(t,e){return Lu.visit(this.data,t,e)}[Symbol.iterator](){return op.visit(new Ne([this.data]))}toArray(){return[...this]}concat(...t){return new Li(this.schema,[this,...t])}slice(t,e){const[n]=new Ne([this.data]).slice(t,e).data;return new ba(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&ti.name===t),e)}setChildAt(t,e){let n=this.schema,i=this.data;if(t>-1&&ta.name===s);~o&&(i[o]=this.data.children[o])}return new ba(e,le({type:n,length:this.numRows,children:i}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),i=le({type:new dr(e.fields),length:this.numRows,children:n});return new ba(e,i)}};wx=Symbol.toStringTag;_r[wx]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(_r.prototype);function gy(r,t,e=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;const i=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(i[a]=l.clone({nullable:!0}),s[a]=(n=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:le({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(i),le({type:new dr(i),length:e,children:s})]}function xx(r,t,e=new Map){var n,i;if(((n=r==null?void 0:r.length)!==null&&n!==void 0?n:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sle({type:i.type})),n=le({type:new dr(t.fields),nullCount:0,children:e});super(t,n)}}let bi=class Sn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+_e),(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):je.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):me.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,je.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,me.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,n,i,s,o){return Sn.startMessage(t),Sn.addVersion(t,e),Sn.addHeaderType(t,n),Sn.addHeader(t,i),Sn.addBodyLength(t,s),Sn.addCustomMetadata(t,o),Sn.endMessage(t)}};class R2 extends se{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return oy.startNull(e),oy.endNull(e)}visitInt(t,e){return Cr.startInt(e),Cr.addBitWidth(e,t.bitWidth),Cr.addIsSigned(e,t.isSigned),Cr.endInt(e)}visitFloat(t,e){return Rn.startFloatingPoint(e),Rn.addPrecision(e,t.precision),Rn.endFloatingPoint(e)}visitBinary(t,e){return ey.startBinary(e),ey.endBinary(e)}visitLargeBinary(t,e){return ny.startLargeBinary(e),ny.endLargeBinary(e)}visitBool(t,e){return ry.startBool(e),ry.endBool(e)}visitUtf8(t,e){return ay.startUtf8(e),ay.endUtf8(e)}visitLargeUtf8(t,e){return iy.startLargeUtf8(e),iy.endLargeUtf8(e)}visitDecimal(t,e){return Js.startDecimal(e),Js.addScale(e,t.scale),Js.addPrecision(e,t.precision),Js.addBitWidth(e,t.bitWidth),Js.endDecimal(e)}visitDate(t,e){return Vl.startDate(e),Vl.addUnit(e,t.unit),Vl.endDate(e)}visitTime(t,e){return Zr.startTime(e),Zr.addUnit(e,t.unit),Zr.addBitWidth(e,t.bitWidth),Zr.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0;return Kr.startTimestamp(e),Kr.addUnit(e,t.unit),n!==void 0&&Kr.addTimezone(e,n),Kr.endTimestamp(e)}visitInterval(t,e){return Fn.startInterval(e),Fn.addUnit(e,t.unit),Fn.endInterval(e)}visitDuration(t,e){return jl.startDuration(e),jl.addUnit(e,t.unit),jl.endDuration(e)}visitList(t,e){return sy.startList(e),sy.endList(e)}visitStruct(t,e){return ys.startStruct_(e),ys.endStruct_(e)}visitUnion(t,e){vr.startTypeIdsVector(e,t.typeIds.length);const n=vr.createTypeIdsVector(e,t.typeIds);return vr.startUnion(e),vr.addMode(e,t.mode),vr.addTypeIds(e,n),vr.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return ai.startDictionaryEncoding(e),ai.addId(e,BigInt(t.id)),ai.addIsOrdered(e,t.isOrdered),n!==void 0&&ai.addIndexType(e,n),ai.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return $l.startFixedSizeBinary(e),$l.addByteWidth(e,t.byteWidth),$l.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Gl.startFixedSizeList(e),Gl.addListSize(e,t.listSize),Gl.endFixedSizeList(e)}visitMap(t,e){return Wl.startMap(e),Wl.addKeysSorted(e,t.keysSorted),Wl.endMap(e)}}const Rh=new R2;function F2(r,t=new Map){return new Le(L2(r,t),Yl(r.metadata),t)}function Sx(r){return new Br(r.count,Tx(r.columns),Ix(r.columns))}function D2(r){return new Vn(Sx(r.data),r.id,r.isDelta)}function L2(r,t){return(r.fields||[]).filter(Boolean).map(e=>Pe.fromJSON(e,t))}function yy(r,t){return(r.children||[]).filter(Boolean).map(e=>Pe.fromJSON(e,t))}function Tx(r){return(r||[]).reduce((t,e)=>[...t,new Ni(e.count,N2(e.VALIDITY)),...Tx(e.children)],[])}function Ix(r,t=[]){for(let e=-1,n=(r||[]).length;++et+ +(e===0),0)}function B2(r,t){let e,n,i,s,o,a;return!t||!(s=r.dictionary)?(o=_y(r,yy(r,t)),i=new Pe(r.name,o,r.nullable,Yl(r.metadata))):t.has(e=s.id)?(n=(n=s.indexType)?vy(n):new za,a=new Oo(t.get(e),n,e,s.isOrdered),i=new Pe(r.name,a,r.nullable,Yl(r.metadata))):(n=(n=s.indexType)?vy(n):new za,t.set(e,o=_y(r,yy(r,t))),a=new Oo(o,n,e,s.isOrdered),i=new Pe(r.name,a,r.nullable,Yl(r.metadata))),i||null}function Yl(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function vy(r){return new Es(r.isSigned,r.bitWidth)}function _y(r,t){const e=r.type.name;switch(e){case"NONE":return new Ri;case"null":return new Ri;case"binary":return new gu;case"largebinary":return new yu;case"utf8":return new vu;case"largeutf8":return new _u;case"bool":return new bu;case"list":return new Au((t||[])[0]);case"struct":return new dr(t||[]);case"struct_":return new dr(t||[])}switch(e){case"int":{const n=r.type;return new Es(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=r.type;return new mu(ar[n.precision])}case"decimal":{const n=r.type;return new wu(n.scale,n.precision,n.bitWidth)}case"date":{const n=r.type;return new xu(nn[n.unit])}case"time":{const n=r.type;return new Su(Vt[n.unit],n.bitWidth)}case"timestamp":{const n=r.type;return new Tu(Vt[n.unit],n.timezone)}case"interval":{const n=r.type;return new Iu(zn[n.unit])}case"duration":{const n=r.type;return new Eu(Vt[n.unit])}case"union":{const n=r.type,[i,...s]=(n.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new Mu(lr[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=r.type;return new Cu(n.byteWidth)}case"fixedsizelist":{const n=r.type;return new Ou(n.listSize,(t||[])[0])}case"map":{const n=r.type;return new Pu((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var U2=kb,k2=Mo;class fr{static fromJSON(t,e){const n=new fr(0,je.V5,e);return n._createHeader=z2(t,e),n}static decode(t){t=new k2(ce(t));const e=bi.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),s=e.headerType(),o=new fr(n,i,s);return o._createHeader=V2(e,s),o}static encode(t){const e=new U2;let n=-1;return t.isSchema()?n=Le.encode(e,t.header()):t.isRecordBatch()?n=Br.encode(e,t.header()):t.isDictionaryBatch()&&(n=Vn.encode(e,t.header())),bi.startMessage(e),bi.addVersion(e,je.V5),bi.addHeader(e,n),bi.addHeaderType(e,t.headerType),bi.addBodyLength(e,BigInt(t.bodyLength)),bi.finishMessageBuffer(e,bi.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Le)return new fr(0,je.V5,me.Schema,t);if(t instanceof Br)return new fr(e,je.V5,me.RecordBatch,t);if(t instanceof Vn)return new fr(e,je.V5,me.DictionaryBatch,t);throw new 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===me.Schema}isRecordBatch(){return this.headerType===me.RecordBatch}isDictionaryBatch(){return this.headerType===me.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Te(t)}}class Br{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=Te(t)}}class Vn{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(t,e,n=!1){this._data=t,this._isDelta=n,this._id=Te(e)}}class Ln{constructor(t,e){this.offset=Te(t),this.length=Te(e)}}class Ni{constructor(t,e){this.length=Te(t),this.nullCount=Te(e)}}function z2(r,t){return()=>{switch(t){case me.Schema:return Le.fromJSON(r);case me.RecordBatch:return Br.fromJSON(r);case me.DictionaryBatch:return Vn.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${me[t]}, type: ${t} }`)}}function V2(r,t){return()=>{switch(t){case me.Schema:return Le.decode(r.header(new In),new Map,r.version());case me.RecordBatch:return Br.decode(r.header(new ri),r.version());case me.DictionaryBatch:return Vn.decode(r.header(new Zs),r.version())}throw new Error(`Unrecognized Message type: { name: ${me[t]}, type: ${t} }`)}}Pe.encode=K2;Pe.decode=Q2;Pe.fromJSON=B2;Le.encode=Z2;Le.decode=j2;Le.fromJSON=F2;Br.encode=J2;Br.decode=$2;Br.fromJSON=Sx;Vn.encode=tD;Vn.decode=G2;Vn.fromJSON=D2;Ni.encode=eD;Ni.decode=H2;Ln.encode=rD;Ln.decode=W2;function j2(r,t=new Map,e=je.V5){const n=q2(r,t);return new Le(n,ql(r),t,e)}function $2(r,t=je.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Br(r.length(),X2(r),Y2(r,t))}function G2(r,t=je.V5){return new Vn(Br.decode(r.data(),t),r.id(),r.isDelta())}function W2(r){return new Ln(r.offset(),r.length())}function H2(r){return new Ni(r.length(),r.nullCount())}function X2(r){const t=[];for(let e,n=-1,i=-1,s=r.nodesLength();++nPe.encode(r,s));In.startFieldsVector(r,e.length);const n=In.createFieldsVector(r,e),i=t.metadata&&t.metadata.size>0?In.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return qe.startKeyValue(r),qe.addKey(r,a),qe.addValue(r,l),qe.endKeyValue(r)})):-1;return In.startSchema(r),In.addFields(r,n),In.addEndianness(r,nD?Co.Little:Co.Big),i!==-1&&In.addCustomMetadata(r,i),In.endSchema(r)}function K2(r,t){let e=-1,n=-1,i=-1;const s=t.type;let o=t.typeId;Ot.isDictionary(s)?(o=s.dictionary.typeId,i=Rh.visit(s,r),n=Rh.visit(s.dictionary,r)):n=Rh.visit(s,r);const a=(s.children||[]).map(c=>Pe.encode(r,c)),l=Wr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Wr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const f=r.createString(`${c}`),d=r.createString(`${h}`);return qe.startKeyValue(r),qe.addKey(r,f),qe.addValue(r,d),qe.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Wr.startField(r),Wr.addType(r,n),Wr.addTypeType(r,o),Wr.addChildren(r,l),Wr.addNullable(r,!!t.nullable),e!==-1&&Wr.addName(r,e),i!==-1&&Wr.addDictionary(r,i),u!==-1&&Wr.addCustomMetadata(r,u),Wr.endField(r)}function J2(r,t){const e=t.nodes||[],n=t.buffers||[];ri.startNodesVector(r,e.length);for(const o of e.slice().reverse())Ni.encode(r,o);const i=r.endVector();ri.startBuffersVector(r,n.length);for(const o of n.slice().reverse())Ln.encode(r,o);const s=r.endVector();return ri.startRecordBatch(r),ri.addLength(r,BigInt(t.length)),ri.addNodes(r,i),ri.addBuffers(r,s),ri.endRecordBatch(r)}function tD(r,t){const e=Br.encode(r,t.data);return Zs.startDictionaryBatch(r),Zs.addId(r,BigInt(t.id)),Zs.addIsDelta(r,t.isDelta),Zs.addData(r,e),Zs.endDictionaryBatch(r)}function eD(r,t){return jb.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function rD(r,t){return Vb.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const nD=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),fp=r=>`Expected ${me[r]} Message in stream, but was null or length 0.`,pp=r=>`Header pointer of flatbuffer-encoded ${me[r]} Message is null or length 0.`,Ex=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,Ax=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class Mx{constructor(t){this.source=t instanceof Nu?t:new Nu(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?Be:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(fp(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ce(this.source.read(t));if(e.byteLength[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(fp(t));return e.value}readSchema(){const t=me.Schema,e=this.readMessage(t),n=e==null?void 0:e.header();if(!e||!n)throw new Error(pp(t));return n}}const uc=4,sf="ARROW1",ja=new Uint8Array(sf.length);for(let r=0;rthis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Yr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Yr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof tn?t:Hd(t)?cD(t):Fb(t)?fD(t):Is(t)?Jt(this,void 0,void 0,function*(){return yield tn.from(yield t)}):Db(t)||Zf(t)||Lb(t)||Uo(t)?dD(new Po(t)):hD(new Nu(t))}static readAll(t){return t instanceof tn?t.isSync()?Sy(t):Ty(t):Hd(t)||ArrayBuffer.isView(t)||Qa(t)||Rb(t)?Sy(t):Ty(t)}}class Uu extends tn{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(this[Symbol.iterator]())))})}}class ku extends tn{constructor(t){super(t),this._impl=t}readAll(){return Jt(this,void 0,void 0,function*(){var t,e,n,i;const s=new Array;try{for(var o=!0,a=Bn(this),l;l=yield a.next(),t=l.done,!t;o=!0){i=l.value,o=!1;const u=i;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Ox extends Uu{constructor(t){super(t),this._impl=t}}class aD extends ku{constructor(t){super(t),this._impl=t}}class Px{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const n=this._loadVectors(t,e,this.schema.fields),i=le({type:new dr(this.schema.fields),length:t.length,children:n});return new _r(this.schema,i)}_loadDictionaryBatch(t,e){const{id:n,isDelta:i}=t,{dictionaries:s,schema:o}=this,a=s.get(n),l=o.dictionaries.get(n),u=this._loadVectors(t.data,e,[l]);return(a&&i?a.concat(new Ne(u)):new Ne(u)).memoize()}_loadVectors(t,e,n){return new _x(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class zu extends Px{constructor(t,e){super(e),this._reader=Hd(t)?new sD(this._handle=t):new Mx(this._handle=t)}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(t){return this.closed||(this.autoDestroy=Fx(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):Be}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Be}next(){if(this.closed)return Be;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new dp(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Vu extends Px{constructor(t,e){super(e),this._reader=new iD(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Jt(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return Jt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Fx(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Jt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Be})}return(t){return Jt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Be})}next(){return Jt(this,void 0,void 0,function*(){if(this.closed)return Be;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new dp(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Jt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class Rx extends zu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof my?t:new my(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(me.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(me.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-Cx,n=t.readInt32(e),i=t.readAt(e-n,n);return Va.decode(i)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Jt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Jt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(me.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Jt(this,void 0,void 0,function*(){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(me.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Jt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-Cx,n=yield t.readInt32(e),i=yield t.readAt(e-n,n);return Va.decode(i)})}_readNextMessageAndValidate(t){return Jt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?mp(t)?new Ox(new Rx(r.read())):new Uu(new zu(r)):new Uu(new zu(function*(){}()))}function dD(r){return Jt(this,void 0,void 0,function*(){const t=yield r.peek(tl+7&-8);return t&&t.byteLength>=4?mp(t)?new Ox(new Rx(yield r.read())):new ku(new Vu(r)):new ku(new Vu(function(){return br(this,arguments,function*(){})}()))})}function fD(r){return Jt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Bu(r,t);return t>=oD&&mp(yield e.readAt(0,tl+7&-8))?new aD(new lD(e)):new ku(new Vu(e))})}class ke extends se{static assemble(...t){const e=i=>i.flatMap(s=>Array.isArray(s)?e(s):s instanceof _r?s.data.children:s.data),n=new ke;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Ne)return this.visitMany(t.data),this;const{type:e}=t;if(!Ot.isDictionary(e)){const{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(Ot.isUnion(e))this.nodes.push(new Ni(n,0));else{const{nullCount:i}=t;Ot.isNull(e)||dn.call(this,i<=0?new Uint8Array(0):Ru(t.offset,n,t.nullBitmap)),this.nodes.push(new Ni(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function dn(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Ln(this._byteLength,t)),this._byteLength+=t,this}function pD(r){var t;const{type:e,length:n,typeIds:i,valueOffsets:s}=r;if(dn.call(this,i),e.mode===lr.Sparse)return of.call(this,r);if(e.mode===lr.Dense){if(r.offset<=0)return dn.call(this,s),of.call(this,r);{const o=new Int32Array(n),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],f=a[h],d=l[h];return u.slice(f,Math.min(n,d))}))}}return this}function mD(r){let t;return r.nullCount>=r.length?dn.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?dn.call(this,Ru(r.offset,r.length,t)):dn.call(this,Fu(r.values))}function fi(r){return dn.call(this,r.values.subarray(0,r.length*r.stride))}function cc(r){const{length:t,values:e,valueOffsets:n}=r,i=Te(n[0]),s=Te(n[t]),o=Math.min(s-i,e.byteLength-i);return dn.call(this,Bb(-i,t+1,n)),dn.call(this,e.subarray(i,i+o)),this}function gp(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:n,[t]:i}=e;return dn.call(this,Bb(-n,t+1,e)),this.visit(r.children[0].slice(n,i-n))}return this.visit(r.children[0])}function of(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}ke.prototype.visitBool=mD;ke.prototype.visitInt=fi;ke.prototype.visitFloat=fi;ke.prototype.visitUtf8=cc;ke.prototype.visitLargeUtf8=cc;ke.prototype.visitBinary=cc;ke.prototype.visitLargeBinary=cc;ke.prototype.visitFixedSizeBinary=fi;ke.prototype.visitDate=fi;ke.prototype.visitTimestamp=fi;ke.prototype.visitTime=fi;ke.prototype.visitDecimal=fi;ke.prototype.visitList=gp;ke.prototype.visitStruct=of;ke.prototype.visitUnion=pD;ke.prototype.visitInterval=fi;ke.prototype.visitDuration=fi;ke.prototype.visitFixedSizeList=gp;ke.prototype.visitMap=gp;class Dx extends ap{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Xl,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,wr(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Is(t)?t.then(e=>this.writeAll(e)):Uo(t)?bp(this,t):_p(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof Xl?this._sink=t:(this._sink=new Xl,t&&GR(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&WR(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!nf(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Li&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof _r&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!nf(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof _r?t instanceof dp||this._writeRecordBatch(t):t instanceof Li?this.writeAll(t.batches):Qa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,i=fr.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,l=a-s-o;return t.headerType===me.RecordBatch?this._recordBatchBlocks.push(new Fi(a,t.bodyLength,this._position)):t.headerType===me.DictionaryBatch&&this._dictionaryBlocks.push(new Fi(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(l)}_write(t){if(this._started){const e=ce(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(fr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ja)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=ke.assemble(t),o=new Br(t.numRows,n,i),a=fr.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,n=!1){const{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=ke.assemble(new Ne([t])),l=new Br(t.length,s,o),u=new Vn(l,e,n),c=fr.from(u,i);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,i;for(let s=-1,o=t.length;++s0&&(this._write(e),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){var e,n;for(const[i,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(i),l=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,i,u>0);else if(ln.writeAll(i)):Uo(t)?bp(n,t):_p(n,t)}}class vp extends Dx{static writeAll(t){const e=new vp;return Is(t)?t.then(n=>e.writeAll(n)):Uo(t)?bp(e,t):_p(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,n=!1){if(!n&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,n)}_writeFooter(t){const e=Va.encode(new Va(t,je.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function _p(r,t){let e=t;t instanceof Li&&(e=t.batches,r.reset(void 0,t.schema));for(const n of e)r.write(n);return r.finish()}function bp(r,t){return Jt(this,void 0,void 0,function*(){var e,n,i,s,o,a,l;try{for(e=!0,n=Bn(t);i=yield n.next(),s=i.done,!s;e=!0){l=i.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function gD(r,t="stream"){return(t==="stream"?yp:vp).writeAll(r).toUint8Array(!0)}var yD=Object.create,Lx=Object.defineProperty,vD=Object.getOwnPropertyDescriptor,_D=Object.getOwnPropertyNames,bD=Object.getPrototypeOf,wD=Object.prototype.hasOwnProperty,xD=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),SD=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _D(t))!wD.call(r,i)&&i!==e&&Lx(r,i,{get:()=>t[i],enumerable:!(n=vD(t,i))||n.enumerable});return r},TD=(r,t,e)=>(e=r!=null?yD(bD(r)):{},SD(!r||!r.__esModule?Lx(e,"default",{value:r,enumerable:!0}):e,r)),ID=xD((r,t)=>{t.exports=Worker}),Nx=(r=>(r[r.UNDEFINED=0]="UNDEFINED",r[r.AUTOMATIC=1]="AUTOMATIC",r[r.READ_ONLY=2]="READ_ONLY",r[r.READ_WRITE=3]="READ_WRITE",r))(Nx||{}),ED=(r=>(r[r.IDENTIFIER=0]="IDENTIFIER",r[r.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",r[r.STRING_CONSTANT=2]="STRING_CONSTANT",r[r.OPERATOR=3]="OPERATOR",r[r.KEYWORD=4]="KEYWORD",r[r.COMMENT=5]="COMMENT",r))(ED||{}),AD=(r=>(r[r.NONE=0]="NONE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARNING=3]="WARNING",r[r.ERROR=4]="ERROR",r))(AD||{}),MD=(r=>(r[r.NONE=0]="NONE",r[r.CONNECT=1]="CONNECT",r[r.DISCONNECT=2]="DISCONNECT",r[r.OPEN=3]="OPEN",r[r.QUERY=4]="QUERY",r[r.INSTANTIATE=5]="INSTANTIATE",r))(MD||{}),CD=(r=>(r[r.NONE=0]="NONE",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR",r[r.START=3]="START",r[r.RUN=4]="RUN",r[r.CAPTURE=5]="CAPTURE",r))(CD||{}),OD=(r=>(r[r.NONE=0]="NONE",r[r.WEB_WORKER=1]="WEB_WORKER",r[r.NODE_WORKER=2]="NODE_WORKER",r[r.BINDINGS=3]="BINDINGS",r[r.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",r))(OD||{}),PD=class{log(r){}},Bx=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},RD=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(RD||{}),FD=class{constructor(r,t){this._bindings=r,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(r){return r(this._bindings,this._conn)}async query(r){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let t=await this._bindings.runQuery(this._conn,r),e=tn.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new Li(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let n=new Ux(this._bindings,this._conn,e),i=await tn.from(n);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new DD(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=gD(r,"stream");await this.insertArrowFromIPCStream(e,t)}async insertArrowFromIPCStream(r,t){await this._bindings.insertArrowFromIPCStream(this._conn,r,t)}async insertCSVFromPath(r,t){await this._bindings.insertCSVFromPath(this._conn,r,t)}async insertJSONFromPath(r,t){await this._bindings.insertJSONFromPath(this._conn,r,t)}},Ux=class{constructor(r,t,e){this.db=r,this.conn=t,this.header=e,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 r;return this._inFlight!=null?(r=await this._inFlight,this._inFlight=null):r=await this.db.fetchQueryResults(this.conn),this._depleted=r.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:r}}[Symbol.asyncIterator](){return this}},DD=class{constructor(r,t,e){this.bindings=r,this.connectionId=t,this.statementId=e}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...r){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,r),e=tn.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new Li(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new Ux(this.bindings,this.connectionId,t),n=await tn.from(e);return console.assert(n.isAsync()),console.assert(n.isStream()),n}},LD=(r=>(r.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",r.CLOSE_PREPARED="CLOSE_PREPARED",r.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",r.REGISTER_OPFS_FILE_NAME="REGISTER_OPFS_FILE_NAME",r.CONNECT="CONNECT",r.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",r.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",r.CREATE_PREPARED="CREATE_PREPARED",r.DISCONNECT="DISCONNECT",r.DROP_FILE="DROP_FILE",r.DROP_FILES="DROP_FILES",r.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",r.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",r.FLUSH_FILES="FLUSH_FILES",r.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",r.GET_TABLE_NAMES="GET_TABLE_NAMES",r.GET_VERSION="GET_VERSION",r.GLOB_FILE_INFOS="GLOB_FILE_INFOS",r.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",r.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",r.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",r.INSTANTIATE="INSTANTIATE",r.OPEN="OPEN",r.PING="PING",r.POLL_PENDING_QUERY="POLL_PENDING_QUERY",r.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",r.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",r.REGISTER_FILE_URL="REGISTER_FILE_URL",r.RESET="RESET",r.RUN_PREPARED="RUN_PREPARED",r.RUN_QUERY="RUN_QUERY",r.SEND_PREPARED="SEND_PREPARED",r.START_PENDING_QUERY="START_PENDING_QUERY",r.TOKENIZE="TOKENIZE",r))(LD||{}),ND=(r=>(r.CONNECTION_INFO="CONNECTION_INFO",r.ERROR="ERROR",r.FEATURE_FLAGS="FEATURE_FLAGS",r.FILE_BUFFER="FILE_BUFFER",r.FILE_INFOS="FILE_INFOS",r.FILE_SIZE="FILE_SIZE",r.FILE_STATISTICS="FILE_STATISTICS",r.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",r.LOG="LOG",r.OK="OK",r.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",r.QUERY_PLAN="QUERY_PLAN",r.QUERY_RESULT="QUERY_RESULT",r.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",r.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",r.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",r.REGISTERED_FILE="REGISTERED_FILE",r.SCRIPT_TOKENS="SCRIPT_TOKENS",r.SUCCESS="SUCCESS",r.TABLE_NAMES="TABLE_NAMES",r.VERSION_STRING="VERSION_STRING",r))(ND||{}),de=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,n)=>{this.promiseResolver=e,this.promiseRejecter=n})}};function Ql(r){switch(r.typeId){case k.Binary:return{sqlType:"binary"};case k.Bool:return{sqlType:"bool"};case k.Date:return{sqlType:"date"};case k.DateDay:return{sqlType:"date32[d]"};case k.DateMillisecond:return{sqlType:"date64[ms]"};case k.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case k.Float:return{sqlType:"float"};case k.Float16:return{sqlType:"float16"};case k.Float32:return{sqlType:"float32"};case k.Float64:return{sqlType:"float64"};case k.Int:return{sqlType:"int32"};case k.Int16:return{sqlType:"int16"};case k.Int32:return{sqlType:"int32"};case k.Int64:return{sqlType:"int64"};case k.Uint16:return{sqlType:"uint16"};case k.Uint32:return{sqlType:"uint32"};case k.Uint64:return{sqlType:"uint64"};case k.Uint8:return{sqlType:"uint8"};case k.IntervalDayTime:return{sqlType:"interval[dt]"};case k.IntervalYearMonth:return{sqlType:"interval[m]"};case k.List:return{sqlType:"list",valueType:Ql(r.valueType)};case k.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case k.Null:return{sqlType:"null"};case k.Utf8:return{sqlType:"utf8"};case k.Struct:return{sqlType:"struct",fields:r.children.map(t=>af(t.name,t.type))};case k.Map:{let t=r;return{sqlType:"map",keyType:Ql(t.keyType),valueType:Ql(t.valueType)}}case k.Time:return{sqlType:"time[s]"};case k.TimeMicrosecond:return{sqlType:"time[us]"};case k.TimeMillisecond:return{sqlType:"time[ms]"};case k.TimeNanosecond:return{sqlType:"time[ns]"};case k.TimeSecond:return{sqlType:"time[s]"};case k.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case k.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case k.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case k.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case k.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function af(r,t){let e=Ql(t);return e.name=r,e}var BD=new TextEncoder,UD=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,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(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}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(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(e.data);return}}let n=this._pendingRequests.get(e.requestId);if(!n){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let i=new Error(e.data.message);i.name=e.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=e.data.stack),n.promiseRejecter(i);return}switch(n.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(e.type=="OK"){n.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){n.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){n.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){n.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){n.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){n.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){n.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){n.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){n.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){n.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){n.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){n.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){n.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){n.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){n.promiseResolver(e.data);return}break}n.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new de("RESET",null);return await this.postTask(r)}async ping(){let r=new de("PING",null);await this.postTask(r)}async dropFile(r){let t=new de("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new de("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new de("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=n=>{}){this._onInstantiationProgress.push(e);let n=new de("INSTANTIATE",[r,t]);return await this.postTask(n)}async getVersion(){let r=new de("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new de("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new de("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new de("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new de("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new FD(this,r)}async disconnect(r){let t=new de("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new de("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let n=new de("START_PENDING_QUERY",[r,t,e]);return await this.postTask(n)}async pollPendingQuery(r){let t=new de("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new de("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new de("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new de("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new de("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new de("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let n=new de("RUN_PREPARED",[r,t,e]);return await this.postTask(n)}async sendPrepared(r,t,e){let n=new de("SEND_PREPARED",[r,t,e]);return await this.postTask(n)}async globFiles(r){let t=new de("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=BD.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,n){t===void 0&&(t=r);let i=new de("REGISTER_FILE_URL",[r,t,e,n]);await this.postTask(i)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new de("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,n){let i=new de("REGISTER_FILE_HANDLE",[r,t,e,n]);await this.postTask(i,[])}async registerOPFSFileName(r){let t=new de("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new de("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new de("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new de("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new de("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let n=new de("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(n,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(af(s,o))}e.columnsFlat=i,delete e.columns}let n=new de("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(n)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(af(s,o))}e.columnsFlat=i,delete e.columns}let n=new de("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(n)}};function kD(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}kD();var zD=(r=>(r[r.BUFFER=0]="BUFFER",r[r.NODE_FS=1]="NODE_FS",r[r.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",r[r.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",r[r.HTTP=4]="HTTP",r[r.S3=5]="S3",r))(zD||{}),VD=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])),jD=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])),$D=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])),GD=()=>(async r=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(r)}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])),WD={version:"1.29.1-dev68.0"},wp=WD.version.split(".");wp[0];wp[1];wp[2];var HD=()=>typeof navigator>"u",Fh=null,Dh=null,Lh=null,Nh=null,Bh=null;async function XD(){return Fh==null&&(Fh=typeof BigInt64Array<"u"),Dh==null&&(Dh=await jD()),Lh==null&&(Lh=await GD()),Nh==null&&(Nh=await $D()),Bh==null&&(Bh=await VD()),{bigInt64Array:Fh,crossOriginIsolated:HD()||globalThis.crossOriginIsolated||!1,wasmExceptions:Dh,wasmSIMD:Nh,wasmThreads:Lh,wasmBulkMemory:Bh}}async function Iy(r){let t=await XD();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&r.coi)return{mainModule:r.coi.mainModule,mainWorker:r.coi.mainWorker,pthreadWorker:r.coi.pthreadWorker};if(r.eh)return{mainModule:r.eh.mainModule,mainWorker:r.eh.mainWorker,pthreadWorker:null}}return{mainModule:r.mvp.mainModule,mainWorker:r.mvp.mainWorker,pthreadWorker:null}}TD(ID());const Uh={},wa={};function Ia(r,t){try{const n=(Uh[r]||(Uh[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return n in wa?wa[n]:Ey(n,n.split(":"))}catch{if(r in wa)return wa[r];const e=r==null?void 0:r.match(YD);return e?Ey(r,e.slice(1)):NaN}}const YD=/([+-]\d\d):?(\d\d)?/;function Ey(r,t){const e=+t[0],n=+(t[1]||0);return wa[r]=e>0?e*60+n:e*60-n}class Fr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ia(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),kx(this),lf(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Fr(...e,t):new Fr(Date.now(),t)}withTimeZone(t){return new Fr(+this,t)}getTimezoneOffset(){return-Ia(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),lf(this),+this}[Symbol.for("constructDateFrom")](t){return new Fr(+new Date(t),this.timeZone)}}const Ay=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!Ay.test(r))return;const t=r.replace(Ay,"$1UTC");Fr.prototype[t]&&(r.startsWith("get")?Fr.prototype[r]=function(){return this.internal[t]()}:(Fr.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),qD(this),+this},Fr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),lf(this),+this}))});function lf(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function qD(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),kx(r)}function kx(r){const t=Ia(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const n=-new Date(+r).getTimezoneOffset(),i=-new Date(+e).getTimezoneOffset(),s=n-i,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=n-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Ia(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,f=c-a;if(h&&f){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+f);const d=Ia(r.timeZone,r),m=l-d;m&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+m),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+m))}}const QD=new TextDecoder("utf-8"),ZD=r=>QD.decode(r),KD=new TextEncoder,zx=r=>KD.encode(r),An=r=>typeof r=="function",el=r=>r!=null&&Object(r)===r,JD=r=>el(r)&&An(r.then),Vx=r=>el(r)&&An(r[Symbol.iterator]),tL=r=>el(r)&&An(r[Symbol.asyncIterator]),eL=r=>el(r)&&"done"in r&&"value"in r,rL=r=>el(r)&&An(r.clear)&&An(r.bytes)&&An(r.position)&&An(r.setPosition)&&An(r.capacity)&&An(r.getBufferIdentifier)&&An(r.createLong),xp=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function nL(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lur(Int8Array,r),oL=r=>ur(Int16Array,r),aL=r=>ur(Int32Array,r),lL=r=>ur(BigInt64Array,r),uL=r=>ur(Uint8Array,r),cL=r=>ur(Uint16Array,r),hL=r=>ur(Uint32Array,r),dL=r=>ur(BigUint64Array,r),fL=r=>ur(Float32Array,r),pL=r=>ur(Float64Array,r),mL=r=>ur(Uint8ClampedArray,r),cf=r=>(r.next(),r);function*Xn(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof xp?e(t):Vx(t)?t:e(t);return yield*cf(function*(i){let s=null;do s=i.next(yield ur(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const gL=r=>Xn(Int8Array,r),yL=r=>Xn(Int16Array,r),vL=r=>Xn(Int32Array,r),_L=r=>Xn(Uint8Array,r),bL=r=>Xn(Uint16Array,r),wL=r=>Xn(Uint32Array,r),xL=r=>Xn(Float32Array,r),SL=r=>Xn(Float64Array,r),TL=r=>Xn(Uint8ClampedArray,r);function mn(r,t){return br(this,arguments,function*(){if(JD(t))return yield Rt(yield Rt(yield*Ss(Bn(mn(r,yield Rt(t))))));const n=function(o){return br(this,arguments,function*(){yield yield Rt(yield Rt(o))})},i=function(o){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(cf(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof xp?n(t):Vx(t)?i(t):tL(t)?t:n(t);return yield Rt(yield*Ss(Bn(cf(function(o){return br(this,arguments,function*(){let a=null;do a=yield Rt(o.next(yield yield Rt(ur(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Rt(new r)})}const IL=r=>mn(Int8Array,r),EL=r=>mn(Int16Array,r),AL=r=>mn(Int32Array,r),ML=r=>mn(Uint8Array,r),CL=r=>mn(Uint16Array,r),OL=r=>mn(Uint32Array,r),PL=r=>mn(Float32Array,r),RL=r=>mn(Float64Array,r),FL=r=>mn(Uint8ClampedArray,r);function DL(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++eFo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const BL=Object.freeze(Object.defineProperty({__proto__:null,valueToString:Fo},Symbol.toStringTag,{value:"Module"}));function pr(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function $x(r,t){return pr(r/t)+pr(r%t)/pr(t)}const Gx=Symbol.for("isArrowBigNum");function gn(r,...t){return t.length===0?Object.setPrototypeOf(ur(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}gn.prototype[Gx]=!0;gn.prototype.toJSON=function(){return`"${Do(this)}"`};gn.prototype.valueOf=function(r){return Sp(this,r)};gn.prototype.toString=function(){return Do(this)};gn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Sp(this);case"string":return Do(this);case"default":return Wx(this)}return Do(this)};function xo(...r){return gn.apply(this,r)}function So(...r){return gn.apply(this,r)}function $a(...r){return gn.apply(this,r)}Object.setPrototypeOf(xo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(So.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf($a.prototype,Object.create(Uint32Array.prototype));Object.assign(xo.prototype,gn.prototype,{constructor:xo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(So.prototype,gn.prototype,{constructor:So,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign($a.prototype,gn.prototype,{constructor:$a,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const UL=BigInt(4294967296)*BigInt(4294967296),kL=UL-BigInt(1);function Sp(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return kh(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Ct.prototype);class My extends Ct{constructor(){super(H.Null)}toString(){return"Null"}}Xx=Symbol.toStringTag;My[Xx]=(r=>r[Symbol.toStringTag]="Null")(My.prototype);class Cy extends Ct{constructor(t,e){super(H.Int),this.isSigned=t,this.bitWidth=e}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 new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}Yx=Symbol.toStringTag;Cy[Yx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Cy.prototype);class Oy extends Ct{constructor(t){super(H.Float),this.precision=t}get ArrayType(){switch(this.precision){case Dr.HALF:return Uint16Array;case Dr.SINGLE:return Float32Array;case Dr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}qx=Symbol.toStringTag;Oy[qx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Oy.prototype);class Py extends Ct{constructor(){super(H.Binary)}toString(){return"Binary"}}Qx=Symbol.toStringTag;Py[Qx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Py.prototype);class Ry extends Ct{constructor(){super(H.LargeBinary)}toString(){return"LargeBinary"}}Zx=Symbol.toStringTag;Ry[Zx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Ry.prototype);class Fy extends Ct{constructor(){super(H.Utf8)}toString(){return"Utf8"}}Kx=Symbol.toStringTag;Fy[Kx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Fy.prototype);class Dy extends Ct{constructor(){super(H.LargeUtf8)}toString(){return"LargeUtf8"}}Jx=Symbol.toStringTag;Dy[Jx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Dy.prototype);class Ly extends Ct{constructor(){super(H.Bool)}toString(){return"Bool"}}tS=Symbol.toStringTag;Ly[tS]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Ly.prototype);class Ny extends Ct{constructor(t,e,n=128){super(H.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}eS=Symbol.toStringTag;Ny[eS]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Ny.prototype);class By extends Ct{constructor(t){super(H.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Bi[this.unit]}>`}get ArrayType(){return this.unit===Bi.DAY?Int32Array:BigInt64Array}}rS=Symbol.toStringTag;By[rS]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(By.prototype);class Uy extends Ct{constructor(t,e){super(H.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${te[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}nS=Symbol.toStringTag;Uy[nS]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Uy.prototype);class ky extends Ct{constructor(t,e){super(H.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${te[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}iS=Symbol.toStringTag;ky[iS]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(ky.prototype);class zy extends Ct{constructor(t){super(H.Interval),this.unit=t}toString(){return`Interval<${As[this.unit]}>`}}sS=Symbol.toStringTag;zy[sS]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(zy.prototype);class Vy extends Ct{constructor(t){super(H.Duration),this.unit=t}toString(){return`Duration<${te[this.unit]}>`}}oS=Symbol.toStringTag;Vy[oS]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Vy.prototype);class jy extends Ct{constructor(t){super(H.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}aS=Symbol.toStringTag;jy[aS]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(jy.prototype);class hf extends Ct{constructor(t){super(H.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}lS=Symbol.toStringTag;hf[lS]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(hf.prototype);class $y extends Ct{constructor(t,e,n){super(H.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}uS=Symbol.toStringTag;$y[uS]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))($y.prototype);class Gy extends Ct{constructor(t){super(H.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}cS=Symbol.toStringTag;Gy[cS]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Gy.prototype);class Wy extends Ct{constructor(t,e){super(H.FixedSizeList),this.listSize=t,this.children=[e]}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}>`}}hS=Symbol.toStringTag;Wy[hS]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Wy.prototype);class Hy extends Ct{constructor(t,e=!1){var n,i,s;if(super(H.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.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(t=>`${t.name}:${t.type}`).join(", ")}}>`}}dS=Symbol.toStringTag;Hy[dS]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Hy.prototype);const VL=(r=>()=>++r)(-1);class Xy extends Ct{constructor(t,e,n,i){super(H.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?VL():pr(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}>`}}fS=Symbol.toStringTag;Xy[fS]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Xy.prototype);function pS(r){const t=r;switch(r.typeId){case H.Decimal:return r.bitWidth/32;case H.Interval:return 1+t.unit;case H.FixedSizeList:return t.listSize;case H.FixedSizeBinary:return t.byteWidth;default:return 1}}class he{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return jL(this,t,e)}getVisitFnByTypeId(t,e=!0){return ao(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function jL(r,t,e=!0){return typeof t=="number"?ao(r,t,e):typeof t=="string"&&t in H?ao(r,H[t],e):t&&t instanceof Ct?ao(r,Yy(t),e):t!=null&&t.type&&t.type instanceof Ct?ao(r,Yy(t.type),e):ao(r,H.NONE,e)}function ao(r,t,e=!0){let n=null;switch(t){case H.Null:n=r.visitNull;break;case H.Bool:n=r.visitBool;break;case H.Int:n=r.visitInt;break;case H.Int8:n=r.visitInt8||r.visitInt;break;case H.Int16:n=r.visitInt16||r.visitInt;break;case H.Int32:n=r.visitInt32||r.visitInt;break;case H.Int64:n=r.visitInt64||r.visitInt;break;case H.Uint8:n=r.visitUint8||r.visitInt;break;case H.Uint16:n=r.visitUint16||r.visitInt;break;case H.Uint32:n=r.visitUint32||r.visitInt;break;case H.Uint64:n=r.visitUint64||r.visitInt;break;case H.Float:n=r.visitFloat;break;case H.Float16:n=r.visitFloat16||r.visitFloat;break;case H.Float32:n=r.visitFloat32||r.visitFloat;break;case H.Float64:n=r.visitFloat64||r.visitFloat;break;case H.Utf8:n=r.visitUtf8;break;case H.LargeUtf8:n=r.visitLargeUtf8;break;case H.Binary:n=r.visitBinary;break;case H.LargeBinary:n=r.visitLargeBinary;break;case H.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case H.Date:n=r.visitDate;break;case H.DateDay:n=r.visitDateDay||r.visitDate;break;case H.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case H.Timestamp:n=r.visitTimestamp;break;case H.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case H.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case H.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case H.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case H.Time:n=r.visitTime;break;case H.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case H.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case H.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case H.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case H.Decimal:n=r.visitDecimal;break;case H.List:n=r.visitList;break;case H.Struct:n=r.visitStruct;break;case H.Union:n=r.visitUnion;break;case H.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case H.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case H.Dictionary:n=r.visitDictionary;break;case H.Interval:n=r.visitInterval;break;case H.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case H.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case H.Duration:n=r.visitDuration;break;case H.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case H.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case H.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case H.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case H.FixedSizeList:n=r.visitFixedSizeList;break;case H.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${H[t]}'`)}function Yy(r){switch(r.typeId){case H.Null:return H.Null;case H.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?H.Int8:H.Uint8;case 16:return e?H.Int16:H.Uint16;case 32:return e?H.Int32:H.Uint32;case 64:return e?H.Int64:H.Uint64}return H.Int}case H.Float:switch(r.precision){case Dr.HALF:return H.Float16;case Dr.SINGLE:return H.Float32;case Dr.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(r.unit){case te.SECOND:return H.TimeSecond;case te.MILLISECOND:return H.TimeMillisecond;case te.MICROSECOND:return H.TimeMicrosecond;case te.NANOSECOND:return H.TimeNanosecond}return H.Time;case H.Timestamp:switch(r.unit){case te.SECOND:return H.TimestampSecond;case te.MILLISECOND:return H.TimestampMillisecond;case te.MICROSECOND:return H.TimestampMicrosecond;case te.NANOSECOND:return H.TimestampNanosecond}return H.Timestamp;case H.Date:switch(r.unit){case Bi.DAY:return H.DateDay;case Bi.MILLISECOND:return H.DateMillisecond}return H.Date;case H.Interval:switch(r.unit){case As.DAY_TIME:return H.IntervalDayTime;case As.YEAR_MONTH:return H.IntervalYearMonth}return H.Interval;case H.Duration:switch(r.unit){case te.SECOND:return H.DurationSecond;case te.MILLISECOND:return H.DurationMillisecond;case te.MICROSECOND:return H.DurationMicrosecond;case te.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(r.mode){case jn.Dense:return H.DenseUnion;case jn.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 new Error(`Unrecognized type '${H[r.typeId]}'`)}he.prototype.visitInt8=null;he.prototype.visitInt16=null;he.prototype.visitInt32=null;he.prototype.visitInt64=null;he.prototype.visitUint8=null;he.prototype.visitUint16=null;he.prototype.visitUint32=null;he.prototype.visitUint64=null;he.prototype.visitFloat16=null;he.prototype.visitFloat32=null;he.prototype.visitFloat64=null;he.prototype.visitDateDay=null;he.prototype.visitDateMillisecond=null;he.prototype.visitTimestampSecond=null;he.prototype.visitTimestampMillisecond=null;he.prototype.visitTimestampMicrosecond=null;he.prototype.visitTimestampNanosecond=null;he.prototype.visitTimeSecond=null;he.prototype.visitTimeMillisecond=null;he.prototype.visitTimeMicrosecond=null;he.prototype.visitTimeNanosecond=null;he.prototype.visitDenseUnion=null;he.prototype.visitSparseUnion=null;he.prototype.visitIntervalDayTime=null;he.prototype.visitIntervalYearMonth=null;he.prototype.visitDuration=null;he.prototype.visitDurationSecond=null;he.prototype.visitDurationMillisecond=null;he.prototype.visitDurationMicrosecond=null;he.prototype.visitDurationNanosecond=null;const mS=new Float64Array(1),Hs=new Uint32Array(mS.buffer);function Tp(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function gS(r){if(r!==r)return 32256;mS[0]=r;const t=(Hs[1]&2147483648)>>16&65535;let e=Hs[1]&2146435072,n=0;return e>=1089470464?Hs[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Hs[1]&1048575)>>10):e<=1056964608?(n=1048576+(Hs[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Hs[1]&1048575)+512>>10),t|e|n&65535}const $L=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:gS,uint16ToFloat64:Tp},Symbol.toStringTag,{value:"Module"}));class Wt extends he{}function qt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const GL=(r,t,e)=>{r[t]=Math.floor(e/864e5)},yS=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},Ip=({values:r},t,e)=>{r[t]=e},vS=({values:r},t,e)=>{r[t]=gS(e)},HL=(r,t,e)=>{switch(r.type.precision){case Dr.HALF:return vS(r,t,e);case Dr.SINGLE:case Dr.DOUBLE:return Ip(r,t,e)}},_S=({values:r},t,e)=>{GL(r,t,e.valueOf())},bS=({values:r},t,e)=>{r[t]=BigInt(e)},XL=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},wS=({values:r,valueOffsets:t},e,n)=>yS(r,t,e,n),xS=({values:r,valueOffsets:t},e,n)=>yS(r,t,e,zx(n)),YL=(r,t,e)=>{r.type.unit===Bi.DAY?_S(r,t,e):bS(r,t,e)},SS=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},TS=({values:r},t,e)=>{r[t]=BigInt(e)},IS=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},ES=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},qL=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return SS(r,t,e);case te.MILLISECOND:return TS(r,t,e);case te.MICROSECOND:return IS(r,t,e);case te.NANOSECOND:return ES(r,t,e)}},AS=({values:r},t,e)=>{r[t]=e},MS=({values:r},t,e)=>{r[t]=e},CS=({values:r},t,e)=>{r[t]=e},OS=({values:r},t,e)=>{r[t]=e},QL=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return AS(r,t,e);case te.MILLISECOND:return MS(r,t,e);case te.MICROSECOND:return CS(r,t,e);case te.NANOSECOND:return OS(r,t,e)}},ZL=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},KL=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=$n.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=$n.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},tN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),eN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),rN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),nN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),iN=(r,t,e)=>{const n=r.type.children.map(s=>$n.getVisitFn(s.type)),i=e instanceof Map?rN(t,e):e instanceof er?eN(t,e):Array.isArray(e)?tN(t,e):nN(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},sN=(r,t,e)=>{r.type.mode===jn.Dense?PS(r,t,e):RS(r,t,e)},PS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];$n.visit(i,r.valueOffsets[t],e)},RS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];$n.visit(i,t,e)},oN=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},aN=(r,t,e)=>{r.type.unit===As.DAY_TIME?FS(r,t,e):DS(r,t,e)},FS=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},DS=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},LS=({values:r},t,e)=>{r[t]=e},NS=({values:r},t,e)=>{r[t]=e},BS=({values:r},t,e)=>{r[t]=e},US=({values:r},t,e)=>{r[t]=e},lN=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return LS(r,t,e);case te.MILLISECOND:return NS(r,t,e);case te.MICROSECOND:return BS(r,t,e);case te.NANOSECOND:return US(r,t,e)}},uN=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=$n.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${Fo(t)}: ${Fo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new cN(this[cn],this[To])}}class cN{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[cn].type.children.some(n=>n.name===e)}getOwnPropertyDescriptor(t,e){if(t[cn].type.children.some(n=>n.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[cn].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=on.visit(t[cn].children[n],t[To]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[cn].type.children.findIndex(s=>s.name===e);return i!==-1?($n.visit(t[cn].children[i],t[To],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}const dN=new hN;class Bt extends he{}function Ht(r){return(t,e)=>t.getValid(e)?r(t,e):null}const fN=(r,t)=>864e5*r[t],pN=(r,t)=>null,kS=(r,t,e)=>{if(e+1>=t.length)return null;const n=pr(t[e]),i=pr(t[e+1]);return r.subarray(n,i)},mN=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<fN(r,t),VS=({values:r},t)=>pr(r[t]),Vi=({stride:r,values:t},e)=>t[r*e],gN=({stride:r,values:t},e)=>Tp(t[r*e]),jS=({values:r},t)=>r[t],yN=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),$S=({values:r,valueOffsets:t},e)=>kS(r,t,e),GS=({values:r,valueOffsets:t},e)=>{const n=kS(r,t,e);return n!==null?ZD(n):null},vN=({values:r},t)=>r[t],_N=({type:r,values:t},e)=>r.precision!==Dr.HALF?t[e]:Tp(t[e]),bN=(r,t)=>r.type.unit===Bi.DAY?zS(r,t):VS(r,t),WS=({values:r},t)=>1e3*pr(r[t]),HS=({values:r},t)=>pr(r[t]),XS=({values:r},t)=>$x(r[t],BigInt(1e3)),YS=({values:r},t)=>$x(r[t],BigInt(1e6)),wN=(r,t)=>{switch(r.type.unit){case te.SECOND:return WS(r,t);case te.MILLISECOND:return HS(r,t);case te.MICROSECOND:return XS(r,t);case te.NANOSECOND:return YS(r,t)}},qS=({values:r},t)=>r[t],QS=({values:r},t)=>r[t],ZS=({values:r},t)=>r[t],KS=({values:r},t)=>r[t],xN=(r,t)=>{switch(r.type.unit){case te.SECOND:return qS(r,t);case te.MILLISECOND:return QS(r,t);case te.MICROSECOND:return ZS(r,t);case te.NANOSECOND:return KS(r,t)}},SN=({values:r,stride:t},e)=>hc.decimal(r.subarray(t*e,t*(e+1))),TN=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new er([l])},IN=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new Ap(o.slice(i,s-i))},EN=(r,t)=>new Ep(r,t),AN=(r,t)=>r.type.mode===jn.Dense?JS(r,t):tT(r,t),JS=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return on.visit(n,r.valueOffsets[t])},tT=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return on.visit(n,t)},MN=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},CN=(r,t)=>r.type.unit===As.DAY_TIME?eT(r,t):rT(r,t),eT=({values:r},t)=>r.subarray(2*t,2*(t+1)),rT=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},nT=({values:r},t)=>r[t],iT=({values:r},t)=>r[t],sT=({values:r},t)=>r[t],oT=({values:r},t)=>r[t],ON=(r,t)=>{switch(r.type.unit){case te.SECOND:return nT(r,t);case te.MILLISECOND:return iT(r,t);case te.MICROSECOND:return sT(r,t);case te.NANOSECOND:return oT(r,t)}},PN=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new er([s])};Bt.prototype.visitNull=Ht(pN);Bt.prototype.visitBool=Ht(mN);Bt.prototype.visitInt=Ht(vN);Bt.prototype.visitInt8=Ht(Vi);Bt.prototype.visitInt16=Ht(Vi);Bt.prototype.visitInt32=Ht(Vi);Bt.prototype.visitInt64=Ht(jS);Bt.prototype.visitUint8=Ht(Vi);Bt.prototype.visitUint16=Ht(Vi);Bt.prototype.visitUint32=Ht(Vi);Bt.prototype.visitUint64=Ht(jS);Bt.prototype.visitFloat=Ht(_N);Bt.prototype.visitFloat16=Ht(gN);Bt.prototype.visitFloat32=Ht(Vi);Bt.prototype.visitFloat64=Ht(Vi);Bt.prototype.visitUtf8=Ht(GS);Bt.prototype.visitLargeUtf8=Ht(GS);Bt.prototype.visitBinary=Ht($S);Bt.prototype.visitLargeBinary=Ht($S);Bt.prototype.visitFixedSizeBinary=Ht(yN);Bt.prototype.visitDate=Ht(bN);Bt.prototype.visitDateDay=Ht(zS);Bt.prototype.visitDateMillisecond=Ht(VS);Bt.prototype.visitTimestamp=Ht(wN);Bt.prototype.visitTimestampSecond=Ht(WS);Bt.prototype.visitTimestampMillisecond=Ht(HS);Bt.prototype.visitTimestampMicrosecond=Ht(XS);Bt.prototype.visitTimestampNanosecond=Ht(YS);Bt.prototype.visitTime=Ht(xN);Bt.prototype.visitTimeSecond=Ht(qS);Bt.prototype.visitTimeMillisecond=Ht(QS);Bt.prototype.visitTimeMicrosecond=Ht(ZS);Bt.prototype.visitTimeNanosecond=Ht(KS);Bt.prototype.visitDecimal=Ht(SN);Bt.prototype.visitList=Ht(TN);Bt.prototype.visitStruct=Ht(EN);Bt.prototype.visitUnion=Ht(AN);Bt.prototype.visitDenseUnion=Ht(JS);Bt.prototype.visitSparseUnion=Ht(tT);Bt.prototype.visitDictionary=Ht(MN);Bt.prototype.visitInterval=Ht(CN);Bt.prototype.visitIntervalDayTime=Ht(eT);Bt.prototype.visitIntervalYearMonth=Ht(rT);Bt.prototype.visitDuration=Ht(ON);Bt.prototype.visitDurationSecond=Ht(nT);Bt.prototype.visitDurationMillisecond=Ht(iT);Bt.prototype.visitDurationMicrosecond=Ht(sT);Bt.prototype.visitDurationNanosecond=Ht(oT);Bt.prototype.visitFixedSizeList=Ht(PN);Bt.prototype.visitMap=Ht(IN);const on=new Bt,lo=Symbol.for("keys"),Io=Symbol.for("vals"),uo=Symbol.for("kKeysAsStrings"),df=Symbol.for("_kKeysAsStrings");class Ap{constructor(t){return this[lo]=new er([t.children[0]]).memoize(),this[Io]=t.children[1],new Proxy(this,new FN)}get[uo](){return this[df]||(this[df]=Array.from(this[lo].toArray(),String))}[Symbol.iterator](){return new RN(this[lo],this[Io])}get size(){return this[lo].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[lo],e=this[Io],n={};for(let i=-1,s=t.length;++i`${Fo(t)}: ${Fo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class RN{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),on.visit(this.vals,t)]})}}class FN{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[uo]}has(t,e){return t[uo].includes(e)}getOwnPropertyDescriptor(t,e){if(t[uo].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[uo].indexOf(e);if(n!==-1){const i=on.visit(Reflect.get(t,Io),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[uo].indexOf(e);return i!==-1?($n.visit(Reflect.get(t,Io),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(Ap.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[lo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Io]:{writable:!0,enumerable:!1,configurable:!1,value:null},[df]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let qy;function aT(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const lT=(r,t)=>r<0?t+r:r,Qy=r=>r!==r;function Ds(r){if(typeof r!=="object"||r===null)return Qy(r)?Qy:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?jx(r,e):!1:r instanceof Map?LN(r):Array.isArray(r)?DN(r):r instanceof er?NN(r):BN(r,!0)}function DN(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return UN(r,e);case Map:return Zy(r,e,e.keys());case Ap:case Ep:case Object:case void 0:return Zy(r,e,t||Object.keys(e))}return e instanceof er?kN(r,e):!1}}function UN(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function VN(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):cT(new fc(e,r,t,null,Mp)).subarray(0,n)),i}return e}function cT(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class fc{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return ju(r,t,i)+ju(r,n,e)+hT(r,i>>3,n-i>>3)}function hT(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Zl(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Zl(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Zl(s.getUint8(i)),i+=1;return n}function Zl(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const jN=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:fc,getBit:uT,getBool:Mp,packBools:cT,popcnt_array:hT,popcnt_bit_range:ju,popcnt_uint32:Zl,setBool:VN,truncateBitmap:ff},Symbol.toStringTag,{value:"Module"})),$N=-1;class Ga{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){const{type:t}=this;return Ct.isSparseUnion(t)?this.children.some(e=>e.nullable):Ct.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Ct.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=$N&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-ju(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof Ga?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=pS(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Ct.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===jn.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(ff(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new Ga(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===H.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(ff(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[si.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[si.TYPE])&&(o[si.TYPE]=s.subarray(t,t+e)),(s=o[si.OFFSET])&&(o[si.OFFSET]=s.subarray(t,t+e+1))||(s=o[si.DATA])&&(o[si.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}}Ga.prototype.children=Object.freeze([]);class Ky{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function WN(r){return r.reduce((t,e)=>t+e.nullCount,0)}function HN(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function XN(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function Cp(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function ZN(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new fc(e,r.offset+(t||0),r.length,e,Mp)){if(!i)return n;++n}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case H.Union:break;case H.Dictionary:break;default:return ZN(r,e)}const n=on.getVisitFn(r),i=Ds(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new Ky(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new KN(o)})}class KN{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Ga)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=mT[o.typeId],c=s[0];this.isValid=h=>dT(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,gT[o.typeId]),this._offsets=HN(s);break}this.data=s,this.type=o,this.stride=pS(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return GN(this.data)}get nullCount(){return WN(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(t){return!1}get(t){return null}at(t){return this.get(lT(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return JN.visit(this)}concat(...t){return new er(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new er(aT(this,t,e,({data:n,_offsets:i},s,o)=>XN(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case H.Int:case H.Float:case H.Decimal:case H.Time:case H.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Ct.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Ct.isDictionary(this.type)){const t=new $u(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new er(e)}return new $u(this)}unmemoize(){if(Ct.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new er(e)}return this}}pT=Symbol.toStringTag;er[pT]=(r=>{r.type=Ct.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(H).map(e=>H[e]).filter(e=>typeof e=="number"&&e!==H.NONE);for(const e of t){const n=on.getVisitFnByTypeId(e),i=$n.getVisitFnByTypeId(e),s=tv.getVisitFnByTypeId(e);mT[e]={get:n,set:i,indexOf:s},gT[e]=Object.create(r,{isValid:{value:Jy(dT)},get:{value:Jy(on.getVisitFnByTypeId(e))},set:{value:YN($n.getVisitFnByTypeId(e))},indexOf:{value:qN(tv.getVisitFnByTypeId(e))}})}return"Vector"})(er.prototype);class $u extends er{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new $u(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new er(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const tB=65536;function po(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const Lo=8,Op=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Pp{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${po(this.buffer[3])} ${po(this.buffer[2])} ${po(this.buffer[1])} ${po(this.buffer[0])}`}static multiply(t,e){return new En(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new En(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return En.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return En.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new En(e);for(let o=n?1:0;othis.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function gr(r,t){return t instanceof r.constructor}function Ls(r,t){return r===t||gr(r,t)}function mi(r,t){return r===t||gr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function pc(r,t){return r===t||gr(r,t)&&r.precision===t.precision}function rB(r,t){return r===t||gr(r,t)&&r.byteWidth===t.byteWidth}function Rp(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function rl(r,t){return r===t||gr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function nl(r,t){return r===t||gr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function nB(r,t){return r===t||gr(r,t)&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function iB(r,t){return r===t||gr(r,t)&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function Fp(r,t){return r===t||gr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Gn.compareManyFields(r.children,t.children)}function sB(r,t){return r===t||gr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Gn.visit(r.indices,t.indices)&&Gn.visit(r.dictionary,t.dictionary)}function Dp(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function il(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function oB(r,t){return r===t||gr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function aB(r,t){return r===t||gr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}zt.prototype.visitNull=Ls;zt.prototype.visitBool=Ls;zt.prototype.visitInt=mi;zt.prototype.visitInt8=mi;zt.prototype.visitInt16=mi;zt.prototype.visitInt32=mi;zt.prototype.visitInt64=mi;zt.prototype.visitUint8=mi;zt.prototype.visitUint16=mi;zt.prototype.visitUint32=mi;zt.prototype.visitUint64=mi;zt.prototype.visitFloat=pc;zt.prototype.visitFloat16=pc;zt.prototype.visitFloat32=pc;zt.prototype.visitFloat64=pc;zt.prototype.visitUtf8=Ls;zt.prototype.visitLargeUtf8=Ls;zt.prototype.visitBinary=Ls;zt.prototype.visitLargeBinary=Ls;zt.prototype.visitFixedSizeBinary=rB;zt.prototype.visitDate=Rp;zt.prototype.visitDateDay=Rp;zt.prototype.visitDateMillisecond=Rp;zt.prototype.visitTimestamp=rl;zt.prototype.visitTimestampSecond=rl;zt.prototype.visitTimestampMillisecond=rl;zt.prototype.visitTimestampMicrosecond=rl;zt.prototype.visitTimestampNanosecond=rl;zt.prototype.visitTime=nl;zt.prototype.visitTimeSecond=nl;zt.prototype.visitTimeMillisecond=nl;zt.prototype.visitTimeMicrosecond=nl;zt.prototype.visitTimeNanosecond=nl;zt.prototype.visitDecimal=Ls;zt.prototype.visitList=nB;zt.prototype.visitStruct=iB;zt.prototype.visitUnion=Fp;zt.prototype.visitDenseUnion=Fp;zt.prototype.visitSparseUnion=Fp;zt.prototype.visitDictionary=sB;zt.prototype.visitInterval=Dp;zt.prototype.visitIntervalDayTime=Dp;zt.prototype.visitIntervalYearMonth=Dp;zt.prototype.visitDuration=il;zt.prototype.visitDurationSecond=il;zt.prototype.visitDurationMillisecond=il;zt.prototype.visitDurationMicrosecond=il;zt.prototype.visitDurationNanosecond=il;zt.prototype.visitFixedSizeList=oB;zt.prototype.visitMap=aB;const Gn=new zt;function lB(r,t){return Gn.compareSchemas(r,t)}function uB(r,t){return Gn.compareFields(r,t)}function cB(r,t){return Gn.visit(r,t)}const ev=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},zL),eB),jN),$L),LL),zN),BL),{compareSchemas:lB,compareFields:uB,compareTypes:cB}),yT=6048e5,hB=864e5,rv=Symbol.for("constructDateFrom");function ui(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&rv in r?r[rv](t):r instanceof Date?new r.constructor(t):new Date(t)}function an(r,t){return ui(t||r,r)}let dB={};function mc(){return dB}function Wa(r,t){var a,l,u,c;const e=mc(),n=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=an(r,t==null?void 0:t.in),s=i.getDay(),o=(s=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function nv(r){const t=an(r),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+r-+e}function fB(r,...t){const e=ui.bind(null,t.find(n=>typeof n=="object"));return t.map(e)}function iv(r,t){const e=an(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function pB(r,t,e){const[n,i]=fB(e==null?void 0:e.in,r,t),s=iv(n),o=iv(i),a=+s-nv(s),l=+o-nv(o);return Math.round((a-l)/hB)}function mB(r,t){const e=vT(r,t),n=ui(r,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Gu(n)}function gB(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function yB(r){return!(!gB(r)&&typeof r!="number"||isNaN(+an(r)))}function vB(r,t){const e=an(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const _B={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"}},bB=(r,t,e)=>{let n;const i=_B[r];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function zh(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const wB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},SB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},TB={date:zh({formats:wB,defaultWidth:"full"}),time:zh({formats:xB,defaultWidth:"full"}),dateTime:zh({formats:SB,defaultWidth:"full"})},IB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},EB=(r,t,e,n)=>IB[r];function sa(r){return(t,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let i;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;i=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;i=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return i[s]}}const AB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},MB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},CB={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"]},OB={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"]},PB={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"}},RB={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"}},FB=(r,t)=>{const e=Number(r),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},DB={ordinalNumber:FB,era:sa({values:AB,defaultWidth:"wide"}),quarter:sa({values:MB,defaultWidth:"wide",argumentCallback:r=>r-1}),month:sa({values:CB,defaultWidth:"wide"}),day:sa({values:OB,defaultWidth:"wide"}),dayPeriod:sa({values:PB,defaultWidth:"wide",formattingValues:RB,defaultFormattingWidth:"wide"})};function oa(r){return(t,e={})=>{const n=e.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?NB(a,h=>h.test(o)):LB(a,h=>h.test(o));let u;u=r.valueCallback?r.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function LB(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function NB(r,t){for(let e=0;e{const n=t.match(r.matchPattern);if(!n)return null;const i=n[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const UB=/^(\d+)(th|st|nd|rd)?/i,kB=/\d+/i,zB={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},VB={any:[/^b/i,/^(a|c)/i]},jB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$B={any:[/1/i,/2/i,/3/i,/4/i]},GB={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},WB={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]},HB={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},XB={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]},YB={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},qB={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}},QB={ordinalNumber:BB({matchPattern:UB,parsePattern:kB,valueCallback:r=>parseInt(r,10)}),era:oa({matchPatterns:zB,defaultMatchWidth:"wide",parsePatterns:VB,defaultParseWidth:"any"}),quarter:oa({matchPatterns:jB,defaultMatchWidth:"wide",parsePatterns:$B,defaultParseWidth:"any",valueCallback:r=>r+1}),month:oa({matchPatterns:GB,defaultMatchWidth:"wide",parsePatterns:WB,defaultParseWidth:"any"}),day:oa({matchPatterns:HB,defaultMatchWidth:"wide",parsePatterns:XB,defaultParseWidth:"any"}),dayPeriod:oa({matchPatterns:YB,defaultMatchWidth:"any",parsePatterns:qB,defaultParseWidth:"any"})},ZB={code:"en-US",formatDistance:bB,formatLong:TB,formatRelative:EB,localize:DB,match:QB,options:{weekStartsOn:0,firstWeekContainsDate:1}};function KB(r,t){const e=an(r,t==null?void 0:t.in);return pB(e,vB(e))+1}function JB(r,t){const e=an(r,t==null?void 0:t.in),n=+Gu(e)-+mB(e);return Math.round(n/yT)+1}function _T(r,t){var c,h,f,d;const e=an(r,t==null?void 0:t.in),n=e.getFullYear(),i=mc(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((d=(f=i.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,o=ui((t==null?void 0:t.in)||r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const a=Wa(o,t),l=ui((t==null?void 0:t.in)||r,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const u=Wa(l,t);return+e>=+a?n+1:+e>=+u?n:n-1}function tU(r,t){var a,l,u,c;const e=mc(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=_T(r,t),s=ui((t==null?void 0:t.in)||r,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),Wa(s,t)}function eU(r,t){const e=an(r,t==null?void 0:t.in),n=+Wa(e,t)-+tU(e,t);return Math.round(n/yT)+1}function we(r,t){const e=r<0?"-":"",n=Math.abs(r).toString().padStart(t,"0");return e+n}const wi={y(r,t){const e=r.getFullYear(),n=e>0?e:1-e;return we(t==="yy"?n%100:n,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):we(e+1,2)},d(r,t){return we(r.getDate(),t.length)},a(r,t){const e=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(r,t){return we(r.getHours()%12||12,t.length)},H(r,t){return we(r.getHours(),t.length)},m(r,t){return we(r.getMinutes(),t.length)},s(r,t){return we(r.getSeconds(),t.length)},S(r,t){const e=t.length,n=r.getMilliseconds(),i=Math.trunc(n*Math.pow(10,e-3));return we(i,t.length)}},Xs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sv={G:function(r,t,e){const n=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const n=r.getFullYear(),i=n>0?n:1-n;return e.ordinalNumber(i,{unit:"year"})}return wi.y(r,t)},Y:function(r,t,e,n){const i=_T(r,n),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return we(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):we(s,t.length)},R:function(r,t){const e=vT(r);return we(e,t.length)},u:function(r,t){const e=r.getFullYear();return we(e,t.length)},Q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return we(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return we(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,t,e){const n=r.getMonth();switch(t){case"M":case"MM":return wi.M(r,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(r,t,e){const n=r.getMonth();switch(t){case"L":return String(n+1);case"LL":return we(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(r,t,e,n){const i=eU(r,n);return t==="wo"?e.ordinalNumber(i,{unit:"week"}):we(i,t.length)},I:function(r,t,e){const n=JB(r);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):we(n,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):wi.d(r,t)},D:function(r,t,e){const n=KB(r);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):we(n,t.length)},E:function(r,t,e){const n=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return we(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return we(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,e){const n=r.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return we(i,t.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(r,t,e){const i=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,e){const n=r.getHours();let i;switch(n===12?i=Xs.noon:n===0?i=Xs.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,e){const n=r.getHours();let i;switch(n>=17?i=Xs.evening:n>=12?i=Xs.afternoon:n>=4?i=Xs.morning:i=Xs.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let n=r.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return wi.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):wi.H(r,t)},K:function(r,t,e){const n=r.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):we(n,t.length)},k:function(r,t,e){let n=r.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):we(n,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):wi.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):wi.s(r,t)},S:function(r,t){return wi.S(r,t)},X:function(r,t,e){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return av(n);case"XXXX":case"XX":return hs(n);case"XXXXX":case"XXX":default:return hs(n,":")}},x:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"x":return av(n);case"xxxx":case"xx":return hs(n);case"xxxxx":case"xxx":default:return hs(n,":")}},O:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ov(n,":");case"OOOO":default:return"GMT"+hs(n,":")}},z:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ov(n,":");case"zzzz":default:return"GMT"+hs(n,":")}},t:function(r,t,e){const n=Math.trunc(+r/1e3);return we(n,t.length)},T:function(r,t,e){return we(+r,t.length)}};function ov(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Math.trunc(n/60),s=n%60;return s===0?e+String(i):e+String(i)+t+we(s,2)}function av(r,t){return r%60===0?(r>0?"-":"+")+we(Math.abs(r)/60,2):hs(r,t)}function hs(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=we(Math.trunc(n/60),2),s=we(n%60,2);return e+i+t+s}const lv=(r,t)=>{switch(r){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"})}},bT=(r,t)=>{switch(r){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"})}},rU=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],n=e[1],i=e[2];if(!i)return lv(r,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",lv(n,t)).replace("{{time}}",bT(i,t))},nU={p:bT,P:rU},iU=/^D+$/,sU=/^Y+$/,oU=["D","DD","YY","YYYY"];function aU(r){return iU.test(r)}function lU(r){return sU.test(r)}function uU(r,t,e){const n=cU(r,t,e);if(console.warn(n),oU.includes(r))throw new RangeError(n)}function cU(r,t,e){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const hU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fU=/^'([^]*?)'?$/,pU=/''/g,mU=/[a-zA-Z]/;function wT(r,t,e){var c,h,f,d;const n=mc(),i=n.locale??ZB,s=n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,a=an(r,e==null?void 0:e.in);if(!yB(a))throw new RangeError("Invalid time value");let l=t.match(dU).map(m=>{const g=m[0];if(g==="p"||g==="P"){const p=nU[g];return p(m,i.formatLong)}return m}).join("").match(hU).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const g=m[0];if(g==="'")return{isToken:!1,value:gU(m)};if(sv[g])return{isToken:!0,value:m};if(g.match(mU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(m=>{if(!m.isToken)return m.value;const g=m.value;(lU(g)||aU(g))&&uU(g,t,String(r));const p=sv[g[0]];return p(a,g,i.localize,u)}).join("")}function gU(r){const t=r.match(fU);return t?t[1].replace(pU,"'"):r}function yU(r,t){return an(r*1e3,t==null?void 0:t.in)}function vU(r,t){const e=_U(t)?new t(0):ui(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function _U(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function bU(r,t){let e=r.length;switch("string"){case"string":{for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function Tr(r){return r==null}function wU(r){return r!=null}async function xT(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await Ei(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function xU(r){return Tr(r)?!1:Ct.isInt(r.type)&&!ST(r)||SU(r)}function SU(r){return Tr(r)?!1:Ct.isInt(r.type)&&r.type.isSigned===!1}function TU(r){return Tr(r)?!1:Ct.isFloat(r.type)??!1}function IU(r){return Tr(r)?!1:Ct.isDecimal(r.type)}function EU(r){return Tr(r)?!1:Ct.isBool(r.type)}function AU(r){return Tr(r)?!1:Ct.isDuration(r.type)}function ST(r){return Tr(r)?!1:Ct.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function MU(r){return Tr(r)?!1:Ct.isTimestamp(r.type)}function CU(r){return Tr(r)?!1:Ct.isDate(r.type)}function OU(r){return Tr(r)?!1:Ct.isTime(r.type)}function PU(r){return Tr(r)?!1:Ct.isList(r.type)||Ct.isFixedSizeList(r.type)}function RU(r){return Tr(r)?!1:Ct.isStruct(r.type)||Ct.isMap(r.type)}function FU(r){return Tr(r)?!1:Ct.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Ct.isInterval(r.type)}function DU(r,t){let e;if(t===te.MILLISECOND)e=1e3;else if(t===te.MICROSECOND)e=1e3*1e3;else if(t===te.NANOSECOND)e=1e3*1e3*1e3;else return Number(r);return typeof r=="bigint"&&!Number.isSafeInteger(Number(r))?Number(r/BigInt(e)):Number(r)/e}function LU(r,t){var n;const e=DU(r,((n=t==null?void 0:t.type)==null?void 0:n.unit)??te.SECOND);return yU(e)}function NU(r,t){const e=LU(r,t);return wT(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function BU(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?wT(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function UU(r,t){var i;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const n=(i=t==null?void 0:t.type)==null?void 0:i.timezone;return typeof r=="number"?n?e=new Fr(r,n):e=new Fr(r):n?e=new Fr(r,n):e=new Fr(r),vU(e,Date)}function kU(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let n=ev.bigNumToString(new ev.BN(r)).padStart(e,"0");if(e===0)return n;let i="";n.startsWith("-")&&(i="-",n=n.slice(1));const s=n.slice(0,-e)||"0",o=bU(n.slice(-e),"0")||"";return`${i}${s}${o?`.${o}`:""}`}function zU(r){const t=r[0],e=r[1],n=[];return t!==0&&n.push(`${t} year${t>1?"s":""}`),e!==0&&n.push(`${e} month${e>1?"s":""}`),n.length?n.join(" "):"0 months"}function VU(r,t){var n,i,s,o;if(Ct.isInterval(t==null?void 0:t.type))return zU(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",f=pf(u.left,(i=(n=t.type)==null?void 0:n.children)==null?void 0:i[0]),d=pf(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+f}, ${d+h}`}return String(r)}function jU(r,t){return(t==null?void 0:t.type)instanceof hf?JSON.parse(JSON.stringify(r,(e,n)=>{if(wU(n))return typeof n=="bigint"?Number(n):n})):JSON.parse(JSON.stringify(r,(e,n)=>typeof n=="bigint"?Number(n):n))}function pf(r,t){if(Tr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&CU(t))return BU(r);if(typeof r=="bigint"&&OU(t))return NU(Number(r),t);if(e&&MU(t))return UU(r,t);if(ST(t))throw new Error("Period type is not supported yet");if(FU(t))return VU(r,t);if(AU(t))throw new Error("Duration type is not supported yet");return IU(t)?kU(r,t):TU(t)&&Number.isFinite(r)||xU(t)?r:RU(t)||PU(t)?jU(r,t):EU(t)?!!r:String(r)}function uv(r){return((r.toArray()||[]).map(n=>n.toJSON())||[]).map(n=>(r.schema.fields.forEach(i=>n[i.name]=pf(n[i.name],i)),n))}var Ha=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(Ha||{});async function TT(r){const t=M1(r,{logger:!1});let e,n;const i=await xT();if(i==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await Ei(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}n=await Iy(await t.bundles),e=new Worker(n.mainWorker)}else if(i==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await Ei(async()=>{const{getBundles:h}=await import("./default-node-BIhx9KIo.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}n=await Iy(await t.bundles);let l=n.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await Ei(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${i}`);let s;t.logger===!0?s=new Bx:t.logger===!1?s=new PD:s=t.logger;const o=new UD(s,e);if(await o.instantiate(n.mainModule,n.pthreadWorker),t.storage)switch(t.storage.type){case Ha.ORIGIN_PRIVATE_FS:{try{let l=t.storage.path;l.startsWith("/")&&(l=l.slice(1)),await o.open({path:`opfs://${l}`,accessMode:t.storage.accessMode})}catch(l){throw await o.terminate(),await e.terminate(),l}break}case Ha.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(l){throw await o.terminate(),await e.terminate(),l}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(l,u=[])=>{if(!u||u.length===0){const d=await a.query(l);return uv(d)}const c=await a.prepare(l),h=await c.query(...u),f=uv(h);return c.close(),f},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function $U(r,t){await(await r).conn.send("BEGIN TRANSACTION");try{const e=await t(r);return await(await r).conn.send("COMMIT"),e}catch(e){throw await(await r).conn.send("ROLLBACK"),e}}async function GU(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const n=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),n}catch(n){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const St=Symbol.for("drizzle:entityKind");function lt(r,t){if(!r||typeof r!="object")return!1;if(r instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,St))throw new 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 e=Object.getPrototypeOf(r).constructor;if(e)for(;e;){if(St in e&&e[St]===t[St])return!0;e=Object.getPrototypeOf(e)}return!1}var bv;bv=St;class rr{constructor(t,e){W(this,"name");W(this,"keyAsName");W(this,"primary");W(this,"notNull");W(this,"default");W(this,"defaultFn");W(this,"onUpdateFn");W(this,"hasDefault");W(this,"isUnique");W(this,"uniqueName");W(this,"uniqueType");W(this,"dataType");W(this,"columnType");W(this,"enumValues");W(this,"generated");W(this,"generatedIdentity");W(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}W(rr,bv,"Column");const Eo=Symbol.for("drizzle:Name");function WU(r,t){return`${r[Eo]}_${t.join("_")}_unique`}var wv,xv;class Lr extends(xv=rr,wv=St,xv){constructor(t,e){e.uniqueName||(e.uniqueName=WU(t,[e.name])),super(t,e),this.table=t}}W(Lr,wv,"PgColumn");const cv=Symbol.for("drizzle:isPgEnum");function HU(r){return!!r&&typeof r=="function"&&cv in r&&r[cv]===!0}var Sv;Sv=St;class Nr{constructor(t,e,n,i=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:n,isWith:i}}}W(Nr,Sv,"Subquery");var Tv,Iv;class Lp extends(Iv=Nr,Tv=St,Iv){}W(Lp,Tv,"WithSubquery");const Ur={startActiveSpan(r,t){return t()}},Qe=Symbol.for("drizzle:ViewBaseConfig"),Kl=Symbol.for("drizzle:Schema"),mf=Symbol.for("drizzle:Columns"),hv=Symbol.for("drizzle:ExtraConfigColumns"),Vh=Symbol.for("drizzle:OriginalName"),jh=Symbol.for("drizzle:BaseName"),Wu=Symbol.for("drizzle:IsAlias"),dv=Symbol.for("drizzle:ExtraConfigBuilder"),XU=Symbol.for("drizzle:IsDrizzleTable");var Ev,Av,Mv,Cv,Ov,Pv,Rv,Fv,Dv,Lv;Lv=St,Dv=Eo,Fv=Vh,Rv=Kl,Pv=mf,Ov=hv,Cv=jh,Mv=Wu,Av=XU,Ev=dv;class It{constructor(t,e,n){W(this,Dv);W(this,Fv);W(this,Rv);W(this,Pv);W(this,Ov);W(this,Cv);W(this,Mv,!1);W(this,Av,!0);W(this,Ev);this[Eo]=this[Vh]=t,this[Kl]=e,this[jh]=n}}W(It,Lv,"Table"),W(It,"Symbol",{Name:Eo,Schema:Kl,OriginalName:Vh,Columns:mf,ExtraConfigColumns:hv,BaseName:jh,IsAlias:Wu,ExtraConfigBuilder:dv});function vs(r){return r[Eo]}function Xa(r){return`${r[Kl]??"public"}.${r[Eo]}`}function IT(r){return r!=null&&typeof r.getSQL=="function"}function YU(r){var e;const t={sql:"",params:[]};for(const n of r)t.sql+=n.sql,t.params.push(...n.params),(e=n.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var Nv;Nv=St;class Ze{constructor(t){W(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Pt([this])}}W(Ze,Nv,"StringChunk");var Bv;Bv=St;const ps=class ps{constructor(t){W(this,"decoder",ET);W(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Ur.startActiveSpan("drizzle.buildSQL",e=>{const n=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,e){const n=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:i,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=n;return YU(t.map(c=>{var h;if(lt(c,Ze))return{sql:c.value.join(""),params:[]};if(lt(c,Hu))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const f=[new Ze("(")];for(const[d,m]of c.entries())f.push(m),dr},AT={mapToDriverValue:r=>r};({...ET,...AT});var kv;kv=St;class ci{constructor(t,e=AT){W(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Pt([this])}}W(ci,kv,"Param");function Y(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Ze(r[0]));for(const[n,i]of t.entries())e.push(i,new Ze(r[n+1]));return new Pt(e)}(r=>{function t(){return new Pt([])}r.empty=t;function e(l){return new Pt(l)}r.fromList=e;function n(l){return new Pt([new Ze(l)])}r.raw=n;function i(l,u){const c=[];for(const[h,f]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(f);return new Pt(c)}r.join=i;function s(l){return new Hu(l)}r.identifier=s;function o(l){return new Ms(l)}r.placeholder=o;function a(l,u){return new ci(l,u)}r.param=a})(Y||(Y={}));(r=>{var e;e=St;const n=class n{constructor(s,o){W(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}};W(n,e,"SQL.Aliased");let t=n;r.Aliased=t})(Pt||(Pt={}));var zv;zv=St;class Ms{constructor(t){this.name=t}getSQL(){return new Pt([this])}}W(Ms,zv,"Placeholder");function fv(r,t){return r.map(e=>{if(lt(e,Ms)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,ci)&<(e.value,Ms)){if(!(e.value.name in t))throw new Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const QU=Symbol.for("drizzle:IsDrizzleView");var Vv,jv,$v;$v=St,jv=Qe,Vv=QU;class ji{constructor({name:t,schema:e,selectedFields:n,query:i}){W(this,jv);W(this,Vv,!0);this[Qe]={name:t,originalName:t,schema:e,selectedFields:n,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new Pt([this])}}W(ji,$v,"View");rr.prototype.getSQL=function(){return new Pt([this])};It.prototype.getSQL=function(){return new Pt([this])};Nr.prototype.getSQL=function(){return new Pt([this])};var Gv;Gv=St;class Ya{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}W(Ya,Gv,"ColumnAliasProxyHandler");var Wv;Wv=St;class gc{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===It.Symbol.IsAlias)return!0;if(e===It.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===It.Symbol.OriginalName)return this.alias;if(e===Qe)return{...t[Qe],name:this.alias,isAlias:!0};if(e===It.Symbol.Columns){const i=t[It.Symbol.Columns];if(!i)return i;const s={};return Object.keys(i).map(o=>{s[o]=new Proxy(i[o],new Ya(new Proxy(t,this)))}),s}const n=t[e];return lt(n,rr)?new Proxy(n,new Ya(new Proxy(t,this))):n}}W(gc,Wv,"TableAliasProxyHandler");function $h(r,t){return new Proxy(r,new gc(t,!1))}function ei(r,t){return new Proxy(r,new Ya(new Proxy(r.table,new gc(t,!1))))}function MT(r,t){return new Pt.Aliased(Xu(r.sql,t),r.fieldAlias)}function Xu(r,t){return Y.join(r.queryChunks.map(e=>lt(e,rr)?ei(e,t):lt(e,Pt)?Xu(e,t):lt(e,Pt.Aliased)?MT(e,t):e))}var Hv,Xv;class Np extends(Xv=Error,Hv=St,Xv){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}W(Np,Hv,"DrizzleError");var Yv,qv;class CT extends(qv=Np,Yv=St,qv){constructor(){super({message:"Rollback"})}}W(CT,Yv,"TransactionRollbackError");function Sr(r,t){return qU(t)&&!IT(r)&&!lt(r,ci)&&!lt(r,Ms)&&!lt(r,rr)&&!lt(r,It)&&!lt(r,ji)?new ci(r,t):r}const OT=(r,t)=>Y`${r} = ${Sr(t,r)}`,ZU=(r,t)=>Y`${r} <> ${Sr(t,r)}`;function gf(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Pt(t):new Pt([new Ze("("),Y.join(t,new Ze(" and ")),new Ze(")")])}function KU(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Pt(t):new Pt([new Ze("("),Y.join(t,new Ze(" or ")),new Ze(")")])}function JU(r){return Y`not ${r}`}const tk=(r,t)=>Y`${r} > ${Sr(t,r)}`,ek=(r,t)=>Y`${r} >= ${Sr(t,r)}`,rk=(r,t)=>Y`${r} < ${Sr(t,r)}`,nk=(r,t)=>Y`${r} <= ${Sr(t,r)}`;function ik(r,t){return Array.isArray(t)?t.length===0?Y`false`:Y`${r} in ${t.map(e=>Sr(e,r))}`:Y`${r} in ${Sr(t,r)}`}function sk(r,t){return Array.isArray(t)?t.length===0?Y`true`:Y`${r} not in ${t.map(e=>Sr(e,r))}`:Y`${r} not in ${Sr(t,r)}`}function ok(r){return Y`${r} is null`}function ak(r){return Y`${r} is not null`}function lk(r){return Y`exists ${r}`}function uk(r){return Y`not exists ${r}`}function ck(r,t,e){return Y`${r} between ${Sr(t,r)} and ${Sr(e,r)}`}function hk(r,t,e){return Y`${r} not between ${Sr(t,r)} and ${Sr(e,r)}`}function dk(r,t){return Y`${r} like ${t}`}function fk(r,t){return Y`${r} not like ${t}`}function pk(r,t){return Y`${r} ilike ${t}`}function mk(r,t){return Y`${r} not ilike ${t}`}function gk(r){return Y`${r} asc`}function yk(r){return Y`${r} desc`}var Qv;Qv=St;class PT{write(t){console.log(t)}}W(PT,Qv,"ConsoleLogWriter");var Zv;Zv=St;class RT{constructor(t){W(this,"writer");this.writer=(t==null?void 0:t.writer)??new PT}logQuery(t,e){const n=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),i=n.length?` -- params: [${n.join(", ")}]`:"";this.writer.write(`Query: ${t}${i}`)}}W(RT,Zv,"DefaultLogger");var Kv;Kv=St;class FT{logQuery(){}}W(FT,Kv,"NoopLogger");var Jv,t_;t_=St,Jv=Symbol.toStringTag;class $i{constructor(){W(this,Jv,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}W($i,t_,"QueryPromise");function Cs(r,t){return Object.entries(r).reduce((e,[n,i])=>{if(typeof n!="string")return e;const s=t?[...t,n]:[n];return lt(i,rr)||lt(i,Pt)||lt(i,Pt.Aliased)?e.push({path:s,field:i}):lt(i,It)?e.push(...Cs(i[It.Symbol.Columns],s)):e.push(...Cs(i,s)),e},[])}function Bp(r,t){const e=Object.keys(r),n=Object.keys(t);if(e.length!==n.length)return!1;for(const[i,s]of e.entries())if(s!==n[i])return!1;return!0}function DT(r,t){const e=Object.entries(t).filter(([,n])=>n!==void 0).map(([n,i])=>lt(i,Pt)||lt(i,rr)?[n,i]:[n,new ci(i,r[It.Symbol.Columns][n])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function vk(r,t){for(const e of t)for(const n of Object.getOwnPropertyNames(e.prototype))n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n)||Object.create(null))}function _k(r){return r[It.Symbol.Columns]}function fs(r){return lt(r,Nr)?r._.alias:lt(r,ji)?r[Qe].name:lt(r,Pt)?void 0:r[It.Symbol.IsAlias]?r[It.Symbol.Name]:r[It.Symbol.BaseName]}function bk(r){if(typeof r!="object"||r===null||r.constructor.name!=="Object")return!1;if("logger"in r){const t=typeof r.logger;return!(t!=="boolean"&&(t!=="object"||typeof r.logger.logQuery!="function")&&t!=="undefined")}if("schema"in r){const t=typeof r.schema;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.casing;return!(t!=="string"&&t!=="undefined")}if("mode"in r)return!(r.mode!=="default"||r.mode!=="planetscale"||r.mode!==void 0);if("connection"in r){const t=typeof r.connection;return!(t!=="string"&&t!=="object"&&t!=="undefined")}if("client"in r){const t=typeof r.client;return!(t!=="object"&&t!=="function"&&t!=="undefined")}return Object.keys(r).length===0}var e_,r_;class LT extends(r_=Lr,e_=St,r_){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}W(LT,e_,"PgDate");var n_,i_;class NT extends(i_=Lr,n_=St,i_){getSQLType(){return"date"}}W(NT,n_,"PgDateString");var s_,o_;class BT extends(o_=Lr,s_=St,o_){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(BT,s_,"PgJson");var a_,l_;class UT extends(l_=Lr,a_=St,l_){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(UT,a_,"PgJsonb");var u_,c_;class kT extends(c_=Lr,u_=St,c_){constructor(e,n){super(e,n);W(this,"precision");W(this,"scale");this.precision=n.precision,this.scale=n.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})`}}W(kT,u_,"PgNumeric");var h_,d_;class zT extends(d_=Lr,h_=St,d_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(zT,h_,"PgTime");var f_,p_;class VT extends(p_=Lr,f_=St,p_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");W(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));W(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(VT,f_,"PgTimestamp");var m_,g_;class jT extends(g_=Lr,m_=St,g_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(jT,m_,"PgTimestampString");var y_,v_;class $T extends(v_=Lr,y_=St,v_){getSQLType(){return"uuid"}}W($T,y_,"PgUUID");const pv=Symbol.for("drizzle:PgInlineForeignKeys"),mv=Symbol.for("drizzle:EnableRLS");var __,b_,w_,x_,S_,T_;class Xr extends(T_=It,S_=St,x_=pv,w_=mv,b_=It.Symbol.ExtraConfigBuilder,__=It.Symbol.ExtraConfigColumns,T_){constructor(){super(...arguments);W(this,x_,[]);W(this,w_,!1);W(this,b_);W(this,__,{})}}W(Xr,S_,"PgTable"),W(Xr,"Symbol",Object.assign({},It.Symbol,{InlineForeignKeys:pv,EnableRLS:mv}));var I_;I_=St;class GT{constructor(t,e){W(this,"columns");W(this,"name");this.columns=t,this.name=e}build(t){return new WT(t,this.columns,this.name)}}W(GT,I_,"PgPrimaryKeyBuilder");var E_;E_=St;class WT{constructor(t,e,n){W(this,"columns");W(this,"name");this.table=t,this.columns=e,this.name=n}getName(){return this.name??`${this.table[Xr.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}W(WT,E_,"PgPrimaryKey");var A_;A_=St;class Up{constructor(t,e,n){W(this,"referencedTableName");W(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=n,this.referencedTableName=e[It.Symbol.Name]}}W(Up,A_,"Relation");var M_;M_=St;class HT{constructor(t,e){this.table=t,this.config=e}}W(HT,M_,"Relations");var C_,O_;const Qu=class Qu extends(O_=Up,C_=St,O_){constructor(t,e,n,i){super(t,e,n==null?void 0:n.relationName),this.config=n,this.isNullable=i}withFieldName(t){const e=new Qu(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};W(Qu,C_,"One");let Os=Qu;var P_,R_;const Zu=class Zu extends(R_=Up,P_=St,R_){constructor(t,e,n){super(t,e,n==null?void 0:n.relationName),this.config=n}withFieldName(t){const e=new Zu(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};W(Zu,P_,"Many");let Yu=Zu;function wk(){return{and:gf,between:ck,eq:OT,exists:lk,gt:tk,gte:ek,ilike:pk,inArray:ik,isNull:ok,isNotNull:ak,like:dk,lt:rk,lte:nk,ne:ZU,not:JU,notBetween:hk,notExists:uk,notLike:fk,notIlike:mk,notInArray:sk,or:KU,sql:Y}}function xk(){return{sql:Y,asc:gk,desc:yk}}function Sk(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,It)&&(r=r.default);const e={},n={},i={};for(const[o,a]of Object.entries(r))if(lt(a,It)){const l=Xa(a),u=n[l];e[l]=o,i[o]={tsName:o,dbName:a[It.Symbol.Name],schema:a[It.Symbol.Schema],columns:a[It.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[It.Symbol.Columns]))h.primary&&i[o].primaryKey.push(h);const c=(s=a[It.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[It.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,GT)&&i[o].primaryKey.push(...h.columns)}else if(lt(a,HT)){const l=Xa(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[f,d]of Object.entries(c))if(u){const m=i[u];m.relations[f]=d}else l in n||(n[l]={relations:{},primaryKey:h}),n[l].relations[f]=d}return{tables:i,tableNamesMap:e}}function Tk(r){return function(e,n){return new Os(r,e,n,(n==null?void 0:n.fields.reduce((i,s)=>i&&s.notNull,!0))??!1)}}function Ik(r){return function(e,n){return new Yu(r,e,n)}}function Ek(r,t,e){if(lt(e,Os)&&e.config)return{fields:e.config.fields,references:e.config.references};const n=t[Xa(e.referencedTable)];if(!n)throw new Error(`Table "${e.referencedTable[It.Symbol.Name]}" not found in schema`);const i=r[n];if(!i)throw new Error(`Table "${n}" not found in schema`);const s=e.sourceTable,o=t[Xa(s)];if(!o)throw new Error(`Table "${s[It.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(i.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${n}"`):new Error(`There are multiple relations between "${n}" and "${e.sourceTable[It.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],Os)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${o}.${e.fieldName}"`)}function Ak(r){return{one:Tk(r),many:Ik(r)}}function yf(r,t,e,n,i=s=>s){const s={};for(const[o,a]of n.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=lt(l,Os)?c&&yf(r,r[a.relationTableTsKey],c,a.selection,i):c.map(h=>yf(r,r[a.relationTableTsKey],h,a.selection,i))}else{const l=i(e[o]),u=a.field;let c;lt(u,rr)?c=u:lt(u,Pt)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var F_;F_=St;const Ku=class Ku{constructor(t){W(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===Qe)return{...t[Qe],selectedFields:new Proxy(t[Qe].selectedFields,this)};if(typeof e=="symbol")return t[e];const i=(lt(t,Nr)?t._.selectedFields:lt(t,ji)?t[Qe].selectedFields:t)[e];if(lt(i,Pt.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!i.isSelectionField)return i.sql;const s=i.clone();return s.isSelectionField=!0,s}if(lt(i,Pt)){if(this.config.sqlBehavior==="sql")return i;throw new Error(`You tried to reference "${e}" 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 lt(i,rr)?this.config.alias?new Proxy(i,new Ya(new Proxy(i.table,new gc(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!="object"||i===null?i:new Proxy(i,new Ku(this.config))}};W(Ku,F_,"SelectionProxyHandler");let or=Ku;var D_,L_;class vf extends(L_=$i,D_=St,L_){constructor(e,n,i,s){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[It.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Cs(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(vf,D_,"PgDelete");function Mk(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function Ck(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,n,i)=>{const s=i===0?n.toLowerCase():`${n[0].toUpperCase()}${n.slice(1)}`;return e+s},"")}function Ok(r){return r}var N_;N_=St;class XT{constructor(t){W(this,"cache",{});W(this,"cachedTables",{});W(this,"convert");this.convert=t==="snake_case"?Mk:t==="camelCase"?Ck:Ok}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[It.Symbol.Schema]??"public",n=t.table[It.Symbol.OriginalName],i=`${e}.${n}.${t.name}`;return this.cache[i]||this.cacheTable(t.table),this.cache[i]}cacheTable(t){const e=t[It.Symbol.Schema]??"public",n=t[It.Symbol.OriginalName],i=`${e}.${n}`;if(!this.cachedTables[i]){for(const s of Object.values(t[It.Symbol.Columns])){const o=`${i}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[i]=!0}}clearCache(){this.cache={},this.cachedTables={}}}W(XT,N_,"CasingCache");var B_,U_;class kp extends(U_=ji,B_=St,U_){}W(kp,B_,"PgViewBase");var k_;k_=St;class Ea{constructor(t){W(this,"casing");this.casing=new XT(t==null?void 0:t.casing)}async migrate(t,e,n){const i=typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",s=typeof n=="string"?"drizzle":n.migrationsSchema??"drizzle",o=Y` CREATE TABLE IF NOT EXISTS ${Y.identifier(s)}.${Y.identifier(i)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint ) - `;await e.execute(Y`CREATE SCHEMA IF NOT EXISTS ${Y.identifier(s)}`),await e.execute(o);const l=(await e.all(Y`select id, hash, created_at from ${Y.identifier(s)}.${Y.identifier(i)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=n[o])==null?void 0:a.onUpdateFn)!==void 0}),s=i.length;return Y.join(i.flatMap((o,a)=>{const l=n[o],u=e[o]??Y.param(l.onUpdateFn(),l),c=Y`${Y.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Pt.Aliased)&&s.isSelectionField)a.push(Y.identifier(s.fieldAlias));else if(lt(s,Pt.Aliased)||lt(s,Pt)){const l=lt(s,Pt.Aliased)?s.sql:s;e?a.push(new Pt(l.queryChunks.map(u=>lt(u,Lr)?Y.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Pt.Aliased)&&a.push(Y` as ${Y.identifier(s.fieldAlias)}`)}else lt(s,rr)&&(e?a.push(Y.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:P})=>P===(nt[It.Symbol.IsAlias]?vs(nt):nt[It.Symbol.BaseName])))(x.field.table)){const nt=vs(x.field.table);throw new Error(`Your "${x.path.join("->")}" field references a column "${nt}"."${x.field.name}", but the table "${nt}" is not part of the query! Did you forget to join it?`)}const p=!a||a.length===0,y=this.buildWithCTE(t);let _;d&&(_=d===!0?Y` distinct`:Y` distinct on (${Y.join(d.on,Y`, `)})`);const S=this.buildSelection(g,{isSingleTable:p}),T=this.buildFromTable(o),v=this.buildJoins(a),E=i?Y` where ${i}`:void 0,w=s?Y` having ${s}`:void 0;let B;l&&l.length>0&&(B=Y` order by ${Y.join(l,Y`, `)}`);let N;u&&u.length>0&&(N=Y` group by ${Y.join(u,Y`, `)}`);const $=typeof c=="object"||typeof c=="number"&&c>=0?Y` limit ${c}`:void 0,it=h?Y` offset ${h}`:void 0,I=Y.empty();if(f){const x=Y` for ${Y.raw(f.strength)}`;f.config.of&&x.append(Y` of ${Y.join(Array.isArray(f.config.of)?f.config.of:[f.config.of],Y`, `)}`),f.config.noWait?x.append(Y` no wait`):f.config.skipLocked&&x.append(Y` skip locked`),I.append(x)}const Z=Y`${y}select${_} ${S} from ${T}${v}${E}${N}${w}${B}${$}${it}${I}`;return m.length>0?this.buildSetOperations(Z,m):Z}buildSetOperations(t,e){const[n,...i]=e;if(!n)throw new Error("Cannot pass undefined values to any set operator");return i.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:n}),i)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:n,rightSelect:i,limit:s,orderBy:o,offset:a}}){const l=Y`(${t.getSQL()}) `,u=Y`(${i.getSQL()})`;let c;if(o&&o.length>0){const m=[];for(const g of o)if(lt(g,Lr))m.push(Y.identifier(g.name));else if(lt(g,Pt)){for(let p=0;p=0?Y` limit ${s}`:void 0,f=Y.raw(`${e} ${n?"all ":""}`),d=a?Y` offset ${a}`:void 0;return Y`${l}${f}${u}${c}${h}${d}`}buildInsertQuery({table:t,values:e,onConflict:n,returning:i,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[It.Symbol.Columns],c=Object.entries(u).filter(([y,_])=>!_.shouldDisableInsert()),h=c.map(([,y])=>Y.identifier(this.casing.getColumnCasing(y)));if(o){const y=e;lt(y,Pt)?l.push(y):l.push(y.getSQL())}else{const y=e;l.push(Y.raw("values "));for(const[_,S]of y.entries()){const T=[];for(const[v,E]of c){const w=S[v];if(w===void 0||lt(w,ci)&&w.value===void 0)if(E.defaultFn!==void 0){const B=E.defaultFn(),N=lt(B,Pt)?B:Y.param(B,E);T.push(N)}else if(!E.default&&E.onUpdateFn!==void 0){const B=E.onUpdateFn(),N=lt(B,Pt)?B:Y.param(B,E);T.push(N)}else T.push(Y`default`);else T.push(w)}l.push(T),_({dbKey:S.name,tsKey:_,field:ei(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const y=Object.fromEntries(Object.entries(s.columns).map(([w,B])=>[w,ei(B,a)]));if(o.where){const w=typeof o.where=="function"?o.where(y,wk()):o.where;m=w&&Xu(w,a)}const _=[];let S=[];if(o.columns){let w=!1;for(const[B,N]of Object.entries(o.columns))N!==void 0&&B in s.columns&&(!w&&N===!0&&(w=!0),S.push(B));S.length>0&&(S=w?S.filter(B=>{var N;return((N=o.columns)==null?void 0:N[B])===!0}):Object.keys(s.columns).filter(B=>!S.includes(B)))}else S=Object.keys(s.columns);for(const w of S){const B=s.columns[w];_.push({tsKey:w,value:B})}let T=[];o.with&&(T=Object.entries(o.with).filter(w=>!!w[1]).map(([w,B])=>({tsKey:w,queryConfig:B,relation:s.relations[w]})));let v;if(o.extras){v=typeof o.extras=="function"?o.extras(y,{sql:Y}):o.extras;for(const[w,B]of Object.entries(v))_.push({tsKey:w,value:MT(B,a)})}for(const{tsKey:w,value:B}of _)c.push({dbKey:lt(B,Pt.Aliased)?B.fieldAlias:s.columns[w].name,tsKey:w,field:lt(B,rr)?ei(B,a):B,relationTableTsKey:void 0,isJson:!1,selection:[]});let E=typeof o.orderBy=="function"?o.orderBy(y,xk()):o.orderBy??[];Array.isArray(E)||(E=[E]),d=E.map(w=>lt(w,rr)?ei(w,a):Xu(w,a)),h=o.limit,f=o.offset;for(const{tsKey:w,queryConfig:B,relation:N}of T){const $=Ek(e,n,N),it=Xa(N.referencedTable),I=n[it],Z=`${a}_${w}`,x=gf(...$.fields.map((C,R)=>OT(ei($.references[R],Z),ei(C,a)))),nt=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:n,table:t[I],tableConfig:e[I],queryConfig:lt(N,Os)?B===!0?{limit:1}:{...B,limit:1}:B,tableAlias:Z,joinOn:x,nestedQueryRelation:N}),P=Y`${Y.identifier(Z)}.${Y.identifier("data")}`.as(w);g.push({on:Y`true`,table:new Nr(nt.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:w,tsKey:w,field:P,relationTableTsKey:I,isJson:!0,selection:nt.selection})}}if(c.length===0)throw new Np({message:`No fields selected for table "${s.tsName}" ("${a}")`});let p;if(m=gf(u,m),l){let y=Y`json_build_array(${Y.join(c.map(({field:T,tsKey:v,isJson:E})=>E?Y`${Y.identifier(`${a}_${v}`)}.${Y.identifier("data")}`:lt(T,Pt.Aliased)?T.sql:T),Y`, `)})`;lt(l,Yu)&&(y=Y`coalesce(json_agg(${y}${d.length>0?Y` order by ${Y.join(d,Y`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:y.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||f!==void 0||d.length>0?(p=this.buildSelectQuery({table:$h(i,a),fields:{},fieldsFlat:[{path:[],field:Y.raw("*")}],where:m,limit:h,offset:f,orderBy:d,setOperators:[]}),m=void 0,h=void 0,f=void 0,d=[]):p=$h(i,a),p=this.buildSelectQuery({table:lt(p,Xr)?p:new Nr(p,{},a),fields:{},fieldsFlat:_.map(({field:T})=>({path:[],field:lt(T,rr)?ei(T,a):T})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]})}else p=this.buildSelectQuery({table:$h(i,a),fields:{},fieldsFlat:c.map(({field:y})=>({path:[],field:lt(y,rr)?ei(y,a):y})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]});return{tableTsKey:s.tsName,sql:p,selection:c}}}W(Ea,k_,"PgDialect");var z_;z_=St;class YT{getSelectedFields(){return this._.selectedFields}}W(YT,z_,"TypedQueryBuilder");var V_;V_=St;class Or{constructor(t){W(this,"fields");W(this,"session");W(this,"dialect");W(this,"withList",[]);W(this,"distinct");W(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,n=t;let i;return this.fields?i=this.fields:lt(n,Nr)?i=Object.fromEntries(Object.keys(n._.selectedFields).map(s=>[s,n[s]])):lt(n,kp)?i=n[Qe].selectedFields:lt(n,Pt)?i={}:i=_k(n),new zp({table:n,fields:i,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}W(Or,V_,"PgSelectBuilder");var j_,$_;class qT extends($_=YT,j_=St,$_){constructor({table:e,fields:n,isPartialSelect:i,session:s,dialect:o,withList:a,distinct:l}){super();W(this,"_");W(this,"config");W(this,"joinsNotNullableMap");W(this,"tableName");W(this,"isPartialSelect");W(this,"session");W(this,"dialect");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"union",this.createSetOperator("union",!1));W(this,"unionAll",this.createSetOperator("union",!0));W(this,"intersect",this.createSetOperator("intersect",!1));W(this,"intersectAll",this.createSetOperator("intersect",!0));W(this,"except",this.createSetOperator("except",!1));W(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...n},distinct:l,setOperators:[]},this.isPartialSelect=i,this.session=s,this.dialect=o,this._={selectedFields:n},this.tableName=fs(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e){return(n,i)=>{var a;const s=this.tableName,o=fs(n);if(typeof o=="string"&&((a=this.config.joins)!=null&&a.some(l=>l.alias===o)))throw new Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof s=="string"&&(this.config.fields={[s]:this.config.fields}),typeof o=="string"&&!lt(n,Pt))){const l=lt(n,Nr)?n._.selectedFields:lt(n,ji)?n[Qe].selectedFields:n[It.Symbol.Columns];this.config.fields[o]=l}if(typeof i=="function"&&(i=i(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:n,joinType:e,alias:o}),typeof o=="string")switch(e){case"left":{this.joinsNotNullableMap[o]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!0;break}case"inner":{this.joinsNotNullableMap[o]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!1;break}}return this}}createSetOperator(e,n){return i=>{const s=typeof i=="function"?i(Pk()):i;if(!Bp(this.getSelectedFields(),s.getSelectedFields()))throw new 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:n,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new or({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(n)?n:[n]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new or({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(n)?n:[n];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else{const n=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}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,n={}){return this.config.lockingClause={strength:e,config:n},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}as(e){return new Proxy(new Nr(this.getSQL(),this.config.fields,e),new or({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new or({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}W(qT,j_,"PgSelectQueryBuilder");var G_,W_;class zp extends(W_=qT,G_=St,W_){constructor(){super(...arguments);W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:n,config:i,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!n)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Ur.startActiveSpan("drizzle.prepareQuery",()=>{const l=Cs(i.fields),u=n.prepareQuery(s.sqlToQuery(this.getSQL()),l,e,!0);return u.joinsNotNullableMap=o,u.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(zp,G_,"PgSelect");vk(zp,[$i]);function zo(r,t){return(e,n,...i)=>{const s=[n,...i].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Bp(e.getSelectedFields(),o.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return e.addSetOperators(s)}}const Pk=()=>({union:Rk,unionAll:Fk,intersect:Dk,intersectAll:Lk,except:Nk,exceptAll:Bk}),Rk=zo("union",!1),Fk=zo("union",!0),Dk=zo("intersect",!1),Lk=zo("intersect",!0),Nk=zo("except",!1),Bk=zo("except",!0);var H_;H_=St;class Vp{constructor(t){W(this,"dialect");W(this,"dialectConfig");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(n)),new Proxy(new Lp(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new or({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Ea)?t:void 0,this.dialectConfig=lt(t,Ea)?void 0:t}with(...t){const e=this;function n(o){return new Or({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function i(o){return new Or({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Or({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:n,selectDistinct:i,selectDistinctOn:s}}select(t){return new Or({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Or({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Or({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Ea(this.dialectConfig)),this.dialect}}W(Vp,H_,"PgQueryBuilder");var X_;X_=St;class _f{constructor(t,e,n,i,s){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(n=>{const i={},s=this.table[It.Symbol.Columns];for(const o of Object.keys(n)){const a=n[o];i[o]=lt(a,Pt)?a:new ci(a,s[o])}return i});return new bf(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new Vp):t;if(!lt(e,Pt)&&!Bp(this.table[mf],e._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new bf(this.table,e,this.session,this.dialect,this.withList,!0)}}W(_f,X_,"PgInsertBuilder");var Y_,q_;class bf extends(q_=$i,Y_=St,q_){constructor(e,n,i,s,o,a,l){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=s,this.config={table:e,values:n,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[It.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Cs(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=Y`do nothing`;else{let n="";n=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const i=e.where?Y` where ${e.where}`:void 0;this.config.onConflict=Y`(${Y.raw(n)})${i} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const n=e.where?Y` where ${e.where}`:void 0,i=e.targetWhere?Y` where ${e.targetWhere}`:void 0,s=e.setWhere?Y` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,DT(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=Y`(${Y.raw(a)})${i} do update set ${o}${n}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(bf,Y_,"PgInsert");var Q_,Z_;class QT extends(Z_=$i,Q_=St,Z_){constructor(e,n,i){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(QT,Q_,"PgRefreshMaterializedView");var K_;K_=St;class wf{constructor(t,e,n,i){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i}setToken(t){return this.authToken=t,this}set(t){return new ZT(this.table,DT(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}W(wf,K_,"PgUpdateBuilder");var J_,t0;class ZT extends(t0=$i,J_=St,t0){constructor(e,n,i,s,o){super();W(this,"config");W(this,"tableName");W(this,"joinsNotNullableMap");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"authToken");W(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=i,this.dialect=s,this.config={set:n,table:e,withList:o,joins:[]},this.tableName=fs(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const n=e,i=fs(n);return typeof i=="string"&&(this.joinsNotNullableMap[i]=!0),this.config.from=n,this}getTableLikeFields(e){return lt(e,Xr)?e[It.Symbol.Columns]:lt(e,Nr)?e._.selectedFields:e[Qe].selectedFields}createJoin(e){return(n,i)=>{const s=fs(n);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof i=="function"){const o=this.config.from&&!lt(this.config.from,Pt)?this.getTableLikeFields(this.config.from):void 0;i=i(new Proxy(this.config.table[It.Symbol.Columns],new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:i,table:n,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[It.Symbol.Columns]),this.config.from)){const n=fs(this.config.from);if(typeof n=="string"&&this.config.from&&!lt(this.config.from,Pt)){const i=this.getTableLikeFields(this.config.from);e[n]=i}for(const i of this.config.joins){const s=fs(i.table);if(typeof s=="string"&&!lt(i.table,Pt)){const o=this.getTableLikeFields(i.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=Cs(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){const n=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return n.joinsNotNullableMap=this.joinsNotNullableMap,n}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(ZT,J_,"PgUpdate");var e0,r0,n0;const Ma=class Ma extends(n0=Pt,r0=St,e0=Symbol.toStringTag,n0){constructor(e){super(Ma.buildEmbeddedCount(e.source,e.filters).queryChunks);W(this,"sql");W(this,"token");W(this,e0,"PgCountBuilder");W(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Ma.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,n){return Y`(select count(*) from ${e}${Y.raw(" where ").if(n)}${n})`}static buildCount(e,n){return Y`select count(*) as count from ${e}${Y.raw(" where ").if(n)}${n};`}setToken(e){return this.token=e,this}then(e,n){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,n)}catch(e){return this.then(void 0,e)}finally(e){return this.then(n=>(e==null||e(),n),n=>{throw e==null||e(),n})}};W(Ma,r0,"PgCountBuilder");let xf=Ma;var i0;i0=St;class KT{constructor(t,e,n,i,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=n,this.table=i,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Sf(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Sf(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}W(KT,i0,"PgRelationalQueryBuilder");var s0,o0;class Sf extends(o0=$i,s0=St,o0){constructor(e,n,i,s,o,a,l,u,c){super();W(this,"authToken");this.fullSchema=e,this.schema=n,this.tableNamesMap=i,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>{const{query:n,builtQuery:i}=this._toSQL();return this.session.prepareQuery(i,void 0,e,!0,(s,o)=>{const a=s.map(l=>yf(this.schema,this.tableConfig,l,n.selection,o));return this.mode==="first"?a[0]:a})})}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(){const e=this._getQuery(),n=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:n}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}W(Sf,s0,"PgRelationalQuery");var a0,l0;class JT extends(l0=$i,a0=St,l0){constructor(t,e,n,i){super(),this.execute=t,this.sql=e,this.query=n,this.mapBatchResult=i}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}W(JT,a0,"PgRaw");var u0;u0=St;class jp{constructor(t,e,n){W(this,"query");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(new Vp(n.dialect))),new Proxy(new Lp(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new or({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});W(this,"authToken");if(this.dialect=t,this.session=e,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[i,s]of Object.entries(this._.schema))this.query[i]=new KT(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[i],s,t,e)}$count(t,e){return new xf({source:t,filters:e,session:this.session})}with(...t){const e=this;function n(u){return new Or({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function i(u){return new Or({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Or({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new wf(u,e.session,e.dialect,t)}function a(u){return new _f(u,e.session,e.dialect,t)}function l(u){return new vf(u,e.session,e.dialect,t)}return{select:n,selectDistinct:i,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Or({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Or({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Or({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new wf(t,this.session,this.dialect)}insert(t){return new _f(t,this.session,this.dialect)}delete(t){return new vf(t,this.session,this.dialect)}refreshMaterializedView(t){return new QT(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?Y.raw(t):t.getSQL(),n=this.dialect.sqlToQuery(e),i=this.session.prepareQuery(n,void 0,void 0,!1);return new JT(()=>i.execute(void 0,this.authToken),e,n,s=>i.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}W(jp,u0,"PgDatabase");var c0;c0=St;class t1{constructor(t){W(this,"authToken");W(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}W(t1,c0,"PgPreparedQuery");var h0;h0=St;class e1{constructor(t){this.dialect=t}execute(t,e){return Ur.startActiveSpan("drizzle.operation",()=>Ur.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const n=await this.execute(t,e);return Number(n[0].count)}}W(e1,h0,"PgSession");var d0,f0;class r1 extends(f0=jp,d0=St,f0){constructor(t,e,n,i=0){super(t,e,n),this.schema=n,this.nestedIndex=i}rollback(){throw new CT}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),Y.raw(e.join(" "))}setTransaction(t){return this.session.execute(Y`set transaction ${this.getTransactionConfigSQL(t)}`)}}W(r1,d0,"PgTransaction");function gv(r){return typeof r=="string"&&/^true$/i.test(r)}function Uk(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const n=e.searchParams.get("logger");n&&gv(n)&&(t.logger=!0);const i=e.searchParams.get("storage");switch(i){case Ha.ORIGIN_PRIVATE_FS:{e.host.length>0&&console.warn(`Host "${e.host}" will be ignored while using Origin Private FS`);const s=e.searchParams.get("write");t.storage={type:Ha.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&gv(s)&&{accessMode:Nx.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var p0,m0;class n1 extends(m0=t1,p0=St,m0){constructor(t,e,n,i,s,o){super({sql:e,params:n}),this.client=t,this.queryString=e,this.params=n,this.logger=i,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=fv(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:n,queryString:i,client:s,customResultMapper:o}=this,a=await s;return a.query(i,e)}async all(t={}){const e=fv(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}W(n1,p0,"DuckDBWasmPreparedQuery");var g0,y0;const Ju=class Ju extends(y0=e1,g0=St,y0){constructor(e,n,i,s={}){super(n);W(this,"logger");this.client=e,this.schema=i,this.options=s,this.logger=s.logger??new FT}prepareQuery(e,n,i,s,o){return new n1(this.client,e.sql,e.params,this.logger,n,o)}async query(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}async queryObjects(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}transaction(e,n){return $U(this.client,async i=>{const s=new Ju(i,this.dialect,this.schema,this.options),o=new Tf(this.dialect,s,this.schema);return n&&await o.setTransaction(n),e(o)})}};W(Ju,g0,"DuckDBWasmSession");let qu=Ju;var v0,_0;const tc=class tc extends(_0=r1,v0=St,_0){constructor(e,n,i,s=0){super(e,n,i,s);W(this,"dialect");W(this,"session");this.dialect=e,this.session=n}async transaction(e){return GU(this.session.client,"",async n=>{const i=new qu(n,this.dialect,this.schema,this.session.options),s=new tc(this.dialect,i,this.schema);return e(s)})}};W(tc,v0,"DuckDBWasmTransaction");let Tf=tc;var b0,w0;class i1 extends(w0=jp,b0=St,w0){}W(i1,b0,"DuckDBWasmDatabase");function Aa(r,t={}){const e=new Ea({casing:t.casing});let n;t.logger===!0?n=new RT:t.logger!==!1&&(n=t.logger);let i;if(t.schema){const a=Sk(t.schema,Ak);i={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new qu(r,e,i,{logger:n}),o=new i1(e,s,i);return o.$client=r,o}async function kk(r=!1){const t=await xT();switch(t){case"browser":return r?(await Ei(async()=>{const{getImportUrlBundles:e}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:e}},__vite__mapDeps([3,4]))).getImportUrlBundles():(await Ei(async()=>{const{getBundles:e}=await import("./default-browser-BrgSDbLD.js");return{getBundles:e}},[])).getBundles();case"node":return r?await(await Ei(async()=>{const{getImportUrlBundles:e}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:e}},__vite__mapDeps([5,4]))).getImportUrlBundles():await(await Ei(async()=>{const{getBundles:e}=await import("./default-node-BIObRWrk.js");return{getBundles:e}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${t}"`)}}function yv(r,t){const e=Uk(r);return Aa(TT({bundles:kk(e.bundles==="import-url"),logger:e.logger?new Bx:void 0,storage:e.storage}),t)}function vv(...r){if(typeof r[0]=="string")return yv(r[0],r[1]);if(bk(r[0])){const{connection:t,client:e,...n}=r[0];if(e)return Aa(e,n);if(typeof t=="string")return yv(t,n);if(typeof t>"u")throw new Error("connection option is required");return Aa(TT({bundles:t.bundles,logger:t.logger,storage:t.storage}),n)}return Aa(r[0],r[1])}(r=>{function t(e){return Aa({options:{parsers:{},serializers:{}}},e)}r.mock=t})(vv||(vv={}));var Gh={exports:{}};/*! + `;await e.execute(Y`CREATE SCHEMA IF NOT EXISTS ${Y.identifier(s)}`),await e.execute(o);const l=(await e.all(Y`select id, hash, created_at from ${Y.identifier(s)}.${Y.identifier(i)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=n[o])==null?void 0:a.onUpdateFn)!==void 0}),s=i.length;return Y.join(i.flatMap((o,a)=>{const l=n[o],u=e[o]??Y.param(l.onUpdateFn(),l),c=Y`${Y.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Pt.Aliased)&&s.isSelectionField)a.push(Y.identifier(s.fieldAlias));else if(lt(s,Pt.Aliased)||lt(s,Pt)){const l=lt(s,Pt.Aliased)?s.sql:s;e?a.push(new Pt(l.queryChunks.map(u=>lt(u,Lr)?Y.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Pt.Aliased)&&a.push(Y` as ${Y.identifier(s.fieldAlias)}`)}else lt(s,rr)&&(e?a.push(Y.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:P})=>P===(nt[It.Symbol.IsAlias]?vs(nt):nt[It.Symbol.BaseName])))(x.field.table)){const nt=vs(x.field.table);throw new Error(`Your "${x.path.join("->")}" field references a column "${nt}"."${x.field.name}", but the table "${nt}" is not part of the query! Did you forget to join it?`)}const p=!a||a.length===0,y=this.buildWithCTE(t);let _;d&&(_=d===!0?Y` distinct`:Y` distinct on (${Y.join(d.on,Y`, `)})`);const S=this.buildSelection(g,{isSingleTable:p}),T=this.buildFromTable(o),v=this.buildJoins(a),E=i?Y` where ${i}`:void 0,w=s?Y` having ${s}`:void 0;let B;l&&l.length>0&&(B=Y` order by ${Y.join(l,Y`, `)}`);let N;u&&u.length>0&&(N=Y` group by ${Y.join(u,Y`, `)}`);const $=typeof c=="object"||typeof c=="number"&&c>=0?Y` limit ${c}`:void 0,it=h?Y` offset ${h}`:void 0,I=Y.empty();if(f){const x=Y` for ${Y.raw(f.strength)}`;f.config.of&&x.append(Y` of ${Y.join(Array.isArray(f.config.of)?f.config.of:[f.config.of],Y`, `)}`),f.config.noWait?x.append(Y` no wait`):f.config.skipLocked&&x.append(Y` skip locked`),I.append(x)}const Z=Y`${y}select${_} ${S} from ${T}${v}${E}${N}${w}${B}${$}${it}${I}`;return m.length>0?this.buildSetOperations(Z,m):Z}buildSetOperations(t,e){const[n,...i]=e;if(!n)throw new Error("Cannot pass undefined values to any set operator");return i.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:n}),i)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:n,rightSelect:i,limit:s,orderBy:o,offset:a}}){const l=Y`(${t.getSQL()}) `,u=Y`(${i.getSQL()})`;let c;if(o&&o.length>0){const m=[];for(const g of o)if(lt(g,Lr))m.push(Y.identifier(g.name));else if(lt(g,Pt)){for(let p=0;p=0?Y` limit ${s}`:void 0,f=Y.raw(`${e} ${n?"all ":""}`),d=a?Y` offset ${a}`:void 0;return Y`${l}${f}${u}${c}${h}${d}`}buildInsertQuery({table:t,values:e,onConflict:n,returning:i,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[It.Symbol.Columns],c=Object.entries(u).filter(([y,_])=>!_.shouldDisableInsert()),h=c.map(([,y])=>Y.identifier(this.casing.getColumnCasing(y)));if(o){const y=e;lt(y,Pt)?l.push(y):l.push(y.getSQL())}else{const y=e;l.push(Y.raw("values "));for(const[_,S]of y.entries()){const T=[];for(const[v,E]of c){const w=S[v];if(w===void 0||lt(w,ci)&&w.value===void 0)if(E.defaultFn!==void 0){const B=E.defaultFn(),N=lt(B,Pt)?B:Y.param(B,E);T.push(N)}else if(!E.default&&E.onUpdateFn!==void 0){const B=E.onUpdateFn(),N=lt(B,Pt)?B:Y.param(B,E);T.push(N)}else T.push(Y`default`);else T.push(w)}l.push(T),_({dbKey:S.name,tsKey:_,field:ei(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const y=Object.fromEntries(Object.entries(s.columns).map(([w,B])=>[w,ei(B,a)]));if(o.where){const w=typeof o.where=="function"?o.where(y,wk()):o.where;m=w&&Xu(w,a)}const _=[];let S=[];if(o.columns){let w=!1;for(const[B,N]of Object.entries(o.columns))N!==void 0&&B in s.columns&&(!w&&N===!0&&(w=!0),S.push(B));S.length>0&&(S=w?S.filter(B=>{var N;return((N=o.columns)==null?void 0:N[B])===!0}):Object.keys(s.columns).filter(B=>!S.includes(B)))}else S=Object.keys(s.columns);for(const w of S){const B=s.columns[w];_.push({tsKey:w,value:B})}let T=[];o.with&&(T=Object.entries(o.with).filter(w=>!!w[1]).map(([w,B])=>({tsKey:w,queryConfig:B,relation:s.relations[w]})));let v;if(o.extras){v=typeof o.extras=="function"?o.extras(y,{sql:Y}):o.extras;for(const[w,B]of Object.entries(v))_.push({tsKey:w,value:MT(B,a)})}for(const{tsKey:w,value:B}of _)c.push({dbKey:lt(B,Pt.Aliased)?B.fieldAlias:s.columns[w].name,tsKey:w,field:lt(B,rr)?ei(B,a):B,relationTableTsKey:void 0,isJson:!1,selection:[]});let E=typeof o.orderBy=="function"?o.orderBy(y,xk()):o.orderBy??[];Array.isArray(E)||(E=[E]),d=E.map(w=>lt(w,rr)?ei(w,a):Xu(w,a)),h=o.limit,f=o.offset;for(const{tsKey:w,queryConfig:B,relation:N}of T){const $=Ek(e,n,N),it=Xa(N.referencedTable),I=n[it],Z=`${a}_${w}`,x=gf(...$.fields.map((C,R)=>OT(ei($.references[R],Z),ei(C,a)))),nt=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:n,table:t[I],tableConfig:e[I],queryConfig:lt(N,Os)?B===!0?{limit:1}:{...B,limit:1}:B,tableAlias:Z,joinOn:x,nestedQueryRelation:N}),P=Y`${Y.identifier(Z)}.${Y.identifier("data")}`.as(w);g.push({on:Y`true`,table:new Nr(nt.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:w,tsKey:w,field:P,relationTableTsKey:I,isJson:!0,selection:nt.selection})}}if(c.length===0)throw new Np({message:`No fields selected for table "${s.tsName}" ("${a}")`});let p;if(m=gf(u,m),l){let y=Y`json_build_array(${Y.join(c.map(({field:T,tsKey:v,isJson:E})=>E?Y`${Y.identifier(`${a}_${v}`)}.${Y.identifier("data")}`:lt(T,Pt.Aliased)?T.sql:T),Y`, `)})`;lt(l,Yu)&&(y=Y`coalesce(json_agg(${y}${d.length>0?Y` order by ${Y.join(d,Y`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:y.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||f!==void 0||d.length>0?(p=this.buildSelectQuery({table:$h(i,a),fields:{},fieldsFlat:[{path:[],field:Y.raw("*")}],where:m,limit:h,offset:f,orderBy:d,setOperators:[]}),m=void 0,h=void 0,f=void 0,d=[]):p=$h(i,a),p=this.buildSelectQuery({table:lt(p,Xr)?p:new Nr(p,{},a),fields:{},fieldsFlat:_.map(({field:T})=>({path:[],field:lt(T,rr)?ei(T,a):T})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]})}else p=this.buildSelectQuery({table:$h(i,a),fields:{},fieldsFlat:c.map(({field:y})=>({path:[],field:lt(y,rr)?ei(y,a):y})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]});return{tableTsKey:s.tsName,sql:p,selection:c}}}W(Ea,k_,"PgDialect");var z_;z_=St;class YT{getSelectedFields(){return this._.selectedFields}}W(YT,z_,"TypedQueryBuilder");var V_;V_=St;class Or{constructor(t){W(this,"fields");W(this,"session");W(this,"dialect");W(this,"withList",[]);W(this,"distinct");W(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,n=t;let i;return this.fields?i=this.fields:lt(n,Nr)?i=Object.fromEntries(Object.keys(n._.selectedFields).map(s=>[s,n[s]])):lt(n,kp)?i=n[Qe].selectedFields:lt(n,Pt)?i={}:i=_k(n),new zp({table:n,fields:i,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}W(Or,V_,"PgSelectBuilder");var j_,$_;class qT extends($_=YT,j_=St,$_){constructor({table:e,fields:n,isPartialSelect:i,session:s,dialect:o,withList:a,distinct:l}){super();W(this,"_");W(this,"config");W(this,"joinsNotNullableMap");W(this,"tableName");W(this,"isPartialSelect");W(this,"session");W(this,"dialect");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"union",this.createSetOperator("union",!1));W(this,"unionAll",this.createSetOperator("union",!0));W(this,"intersect",this.createSetOperator("intersect",!1));W(this,"intersectAll",this.createSetOperator("intersect",!0));W(this,"except",this.createSetOperator("except",!1));W(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...n},distinct:l,setOperators:[]},this.isPartialSelect=i,this.session=s,this.dialect=o,this._={selectedFields:n},this.tableName=fs(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e){return(n,i)=>{var a;const s=this.tableName,o=fs(n);if(typeof o=="string"&&((a=this.config.joins)!=null&&a.some(l=>l.alias===o)))throw new Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof s=="string"&&(this.config.fields={[s]:this.config.fields}),typeof o=="string"&&!lt(n,Pt))){const l=lt(n,Nr)?n._.selectedFields:lt(n,ji)?n[Qe].selectedFields:n[It.Symbol.Columns];this.config.fields[o]=l}if(typeof i=="function"&&(i=i(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:n,joinType:e,alias:o}),typeof o=="string")switch(e){case"left":{this.joinsNotNullableMap[o]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!0;break}case"inner":{this.joinsNotNullableMap[o]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!1;break}}return this}}createSetOperator(e,n){return i=>{const s=typeof i=="function"?i(Pk()):i;if(!Bp(this.getSelectedFields(),s.getSelectedFields()))throw new 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:n,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new or({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(n)?n:[n]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new or({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(n)?n:[n];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else{const n=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}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,n={}){return this.config.lockingClause={strength:e,config:n},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}as(e){return new Proxy(new Nr(this.getSQL(),this.config.fields,e),new or({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new or({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}W(qT,j_,"PgSelectQueryBuilder");var G_,W_;class zp extends(W_=qT,G_=St,W_){constructor(){super(...arguments);W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:n,config:i,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!n)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Ur.startActiveSpan("drizzle.prepareQuery",()=>{const l=Cs(i.fields),u=n.prepareQuery(s.sqlToQuery(this.getSQL()),l,e,!0);return u.joinsNotNullableMap=o,u.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(zp,G_,"PgSelect");vk(zp,[$i]);function zo(r,t){return(e,n,...i)=>{const s=[n,...i].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Bp(e.getSelectedFields(),o.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return e.addSetOperators(s)}}const Pk=()=>({union:Rk,unionAll:Fk,intersect:Dk,intersectAll:Lk,except:Nk,exceptAll:Bk}),Rk=zo("union",!1),Fk=zo("union",!0),Dk=zo("intersect",!1),Lk=zo("intersect",!0),Nk=zo("except",!1),Bk=zo("except",!0);var H_;H_=St;class Vp{constructor(t){W(this,"dialect");W(this,"dialectConfig");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(n)),new Proxy(new Lp(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new or({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Ea)?t:void 0,this.dialectConfig=lt(t,Ea)?void 0:t}with(...t){const e=this;function n(o){return new Or({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function i(o){return new Or({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Or({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:n,selectDistinct:i,selectDistinctOn:s}}select(t){return new Or({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Or({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Or({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Ea(this.dialectConfig)),this.dialect}}W(Vp,H_,"PgQueryBuilder");var X_;X_=St;class _f{constructor(t,e,n,i,s){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(n=>{const i={},s=this.table[It.Symbol.Columns];for(const o of Object.keys(n)){const a=n[o];i[o]=lt(a,Pt)?a:new ci(a,s[o])}return i});return new bf(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new Vp):t;if(!lt(e,Pt)&&!Bp(this.table[mf],e._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new bf(this.table,e,this.session,this.dialect,this.withList,!0)}}W(_f,X_,"PgInsertBuilder");var Y_,q_;class bf extends(q_=$i,Y_=St,q_){constructor(e,n,i,s,o,a,l){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=s,this.config={table:e,values:n,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[It.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Cs(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=Y`do nothing`;else{let n="";n=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const i=e.where?Y` where ${e.where}`:void 0;this.config.onConflict=Y`(${Y.raw(n)})${i} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const n=e.where?Y` where ${e.where}`:void 0,i=e.targetWhere?Y` where ${e.targetWhere}`:void 0,s=e.setWhere?Y` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,DT(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=Y`(${Y.raw(a)})${i} do update set ${o}${n}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(bf,Y_,"PgInsert");var Q_,Z_;class QT extends(Z_=$i,Q_=St,Z_){constructor(e,n,i){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(QT,Q_,"PgRefreshMaterializedView");var K_;K_=St;class wf{constructor(t,e,n,i){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i}setToken(t){return this.authToken=t,this}set(t){return new ZT(this.table,DT(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}W(wf,K_,"PgUpdateBuilder");var J_,t0;class ZT extends(t0=$i,J_=St,t0){constructor(e,n,i,s,o){super();W(this,"config");W(this,"tableName");W(this,"joinsNotNullableMap");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"authToken");W(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=i,this.dialect=s,this.config={set:n,table:e,withList:o,joins:[]},this.tableName=fs(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const n=e,i=fs(n);return typeof i=="string"&&(this.joinsNotNullableMap[i]=!0),this.config.from=n,this}getTableLikeFields(e){return lt(e,Xr)?e[It.Symbol.Columns]:lt(e,Nr)?e._.selectedFields:e[Qe].selectedFields}createJoin(e){return(n,i)=>{const s=fs(n);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof i=="function"){const o=this.config.from&&!lt(this.config.from,Pt)?this.getTableLikeFields(this.config.from):void 0;i=i(new Proxy(this.config.table[It.Symbol.Columns],new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:i,table:n,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[It.Symbol.Columns]),this.config.from)){const n=fs(this.config.from);if(typeof n=="string"&&this.config.from&&!lt(this.config.from,Pt)){const i=this.getTableLikeFields(this.config.from);e[n]=i}for(const i of this.config.joins){const s=fs(i.table);if(typeof s=="string"&&!lt(i.table,Pt)){const o=this.getTableLikeFields(i.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=Cs(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){const n=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return n.joinsNotNullableMap=this.joinsNotNullableMap,n}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(ZT,J_,"PgUpdate");var e0,r0,n0;const Ma=class Ma extends(n0=Pt,r0=St,e0=Symbol.toStringTag,n0){constructor(e){super(Ma.buildEmbeddedCount(e.source,e.filters).queryChunks);W(this,"sql");W(this,"token");W(this,e0,"PgCountBuilder");W(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Ma.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,n){return Y`(select count(*) from ${e}${Y.raw(" where ").if(n)}${n})`}static buildCount(e,n){return Y`select count(*) as count from ${e}${Y.raw(" where ").if(n)}${n};`}setToken(e){return this.token=e,this}then(e,n){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,n)}catch(e){return this.then(void 0,e)}finally(e){return this.then(n=>(e==null||e(),n),n=>{throw e==null||e(),n})}};W(Ma,r0,"PgCountBuilder");let xf=Ma;var i0;i0=St;class KT{constructor(t,e,n,i,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=n,this.table=i,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Sf(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Sf(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}W(KT,i0,"PgRelationalQueryBuilder");var s0,o0;class Sf extends(o0=$i,s0=St,o0){constructor(e,n,i,s,o,a,l,u,c){super();W(this,"authToken");this.fullSchema=e,this.schema=n,this.tableNamesMap=i,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>{const{query:n,builtQuery:i}=this._toSQL();return this.session.prepareQuery(i,void 0,e,!0,(s,o)=>{const a=s.map(l=>yf(this.schema,this.tableConfig,l,n.selection,o));return this.mode==="first"?a[0]:a})})}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(){const e=this._getQuery(),n=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:n}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}W(Sf,s0,"PgRelationalQuery");var a0,l0;class JT extends(l0=$i,a0=St,l0){constructor(t,e,n,i){super(),this.execute=t,this.sql=e,this.query=n,this.mapBatchResult=i}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}W(JT,a0,"PgRaw");var u0;u0=St;class jp{constructor(t,e,n){W(this,"query");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(new Vp(n.dialect))),new Proxy(new Lp(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new or({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});W(this,"authToken");if(this.dialect=t,this.session=e,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[i,s]of Object.entries(this._.schema))this.query[i]=new KT(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[i],s,t,e)}$count(t,e){return new xf({source:t,filters:e,session:this.session})}with(...t){const e=this;function n(u){return new Or({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function i(u){return new Or({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Or({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new wf(u,e.session,e.dialect,t)}function a(u){return new _f(u,e.session,e.dialect,t)}function l(u){return new vf(u,e.session,e.dialect,t)}return{select:n,selectDistinct:i,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Or({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Or({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Or({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new wf(t,this.session,this.dialect)}insert(t){return new _f(t,this.session,this.dialect)}delete(t){return new vf(t,this.session,this.dialect)}refreshMaterializedView(t){return new QT(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?Y.raw(t):t.getSQL(),n=this.dialect.sqlToQuery(e),i=this.session.prepareQuery(n,void 0,void 0,!1);return new JT(()=>i.execute(void 0,this.authToken),e,n,s=>i.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}W(jp,u0,"PgDatabase");var c0;c0=St;class t1{constructor(t){W(this,"authToken");W(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}W(t1,c0,"PgPreparedQuery");var h0;h0=St;class e1{constructor(t){this.dialect=t}execute(t,e){return Ur.startActiveSpan("drizzle.operation",()=>Ur.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const n=await this.execute(t,e);return Number(n[0].count)}}W(e1,h0,"PgSession");var d0,f0;class r1 extends(f0=jp,d0=St,f0){constructor(t,e,n,i=0){super(t,e,n),this.schema=n,this.nestedIndex=i}rollback(){throw new CT}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),Y.raw(e.join(" "))}setTransaction(t){return this.session.execute(Y`set transaction ${this.getTransactionConfigSQL(t)}`)}}W(r1,d0,"PgTransaction");function gv(r){return typeof r=="string"&&/^true$/i.test(r)}function Uk(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const n=e.searchParams.get("logger");n&&gv(n)&&(t.logger=!0);const i=e.searchParams.get("storage");switch(i){case Ha.ORIGIN_PRIVATE_FS:{e.host.length>0&&console.warn(`Host "${e.host}" will be ignored while using Origin Private FS`);const s=e.searchParams.get("write");t.storage={type:Ha.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&gv(s)&&{accessMode:Nx.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var p0,m0;class n1 extends(m0=t1,p0=St,m0){constructor(t,e,n,i,s,o){super({sql:e,params:n}),this.client=t,this.queryString=e,this.params=n,this.logger=i,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=fv(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:n,queryString:i,client:s,customResultMapper:o}=this,a=await s;return a.query(i,e)}async all(t={}){const e=fv(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}W(n1,p0,"DuckDBWasmPreparedQuery");var g0,y0;const Ju=class Ju extends(y0=e1,g0=St,y0){constructor(e,n,i,s={}){super(n);W(this,"logger");this.client=e,this.schema=i,this.options=s,this.logger=s.logger??new FT}prepareQuery(e,n,i,s,o){return new n1(this.client,e.sql,e.params,this.logger,n,o)}async query(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}async queryObjects(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}transaction(e,n){return $U(this.client,async i=>{const s=new Ju(i,this.dialect,this.schema,this.options),o=new Tf(this.dialect,s,this.schema);return n&&await o.setTransaction(n),e(o)})}};W(Ju,g0,"DuckDBWasmSession");let qu=Ju;var v0,_0;const tc=class tc extends(_0=r1,v0=St,_0){constructor(e,n,i,s=0){super(e,n,i,s);W(this,"dialect");W(this,"session");this.dialect=e,this.session=n}async transaction(e){return GU(this.session.client,"",async n=>{const i=new qu(n,this.dialect,this.schema,this.session.options),s=new tc(this.dialect,i,this.schema);return e(s)})}};W(tc,v0,"DuckDBWasmTransaction");let Tf=tc;var b0,w0;class i1 extends(w0=jp,b0=St,w0){}W(i1,b0,"DuckDBWasmDatabase");function Aa(r,t={}){const e=new Ea({casing:t.casing});let n;t.logger===!0?n=new RT:t.logger!==!1&&(n=t.logger);let i;if(t.schema){const a=Sk(t.schema,Ak);i={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new qu(r,e,i,{logger:n}),o=new i1(e,s,i);return o.$client=r,o}async function kk(r=!1){const t=await xT();switch(t){case"browser":return r?(await Ei(async()=>{const{getImportUrlBundles:e}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:e}},__vite__mapDeps([3,4]))).getImportUrlBundles():(await Ei(async()=>{const{getBundles:e}=await import("./default-browser-BrgSDbLD.js");return{getBundles:e}},[])).getBundles();case"node":return r?await(await Ei(async()=>{const{getImportUrlBundles:e}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:e}},__vite__mapDeps([5,4]))).getImportUrlBundles():await(await Ei(async()=>{const{getBundles:e}=await import("./default-node-BIhx9KIo.js");return{getBundles:e}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${t}"`)}}function yv(r,t){const e=Uk(r);return Aa(TT({bundles:kk(e.bundles==="import-url"),logger:e.logger?new Bx:void 0,storage:e.storage}),t)}function vv(...r){if(typeof r[0]=="string")return yv(r[0],r[1]);if(bk(r[0])){const{connection:t,client:e,...n}=r[0];if(e)return Aa(e,n);if(typeof t=="string")return yv(t,n);if(typeof t>"u")throw new Error("connection option is required");return Aa(TT({bundles:t.bundles,logger:t.logger,storage:t.storage}),n)}return Aa(r[0],r[1])}(r=>{function t(e){return Aa({options:{parsers:{},serializers:{}}},e)}r.mock=t})(vv||(vv={}));var Gh={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files diff --git a/assets/memory-long-term-BsSy-hFO.js b/assets/memory-long-term-fZZgaXdh.js similarity index 92% rename from assets/memory-long-term-BsSy-hFO.js rename to assets/memory-long-term-fZZgaXdh.js index c52ccd7f789b04d7942277bae6517a511d66dbfc..d768fec4f487ef48bd7e5c587cf3dfe6fa7b7740 100644 --- a/assets/memory-long-term-BsSy-hFO.js +++ b/assets/memory-long-term-fZZgaXdh.js @@ -1 +1 @@ -import{d as r,bE as l,q as c,bw as d,A as m,o as p,c as u,a as t,e as o,D as n}from"./index-BYewP6KR.js";const _={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},x={relative:""},v={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},f={text:"neutral-300 dark:neutral-500","text-nowrap":""},g={"text-nowrap":"","text-3xl":"","font-semibold":""},h=r({__name:"memory-long-term",setup(y){const i=l(),{t:s}=c();return(b,e)=>{const a=d("motion");return m((p(),u("div",_,[t("button",{onClick:e[0]||(e[0]=w=>o(i).back())},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",x,[t("div",v,[t("span",f,n(o(s)("settings.title")),1)]),t("div",g,n(o(s)("settings.pages.modules.memory-long-term.title")),1)])])),[[a]])}}});export{h as default}; +import{d as r,bE as l,q as c,bw as d,A as m,o as p,c as u,a as t,e as o,D as n}from"./index-CL4rmUJ-.js";const _={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},x={relative:""},v={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},f={text:"neutral-300 dark:neutral-500","text-nowrap":""},g={"text-nowrap":"","text-3xl":"","font-semibold":""},h=r({__name:"memory-long-term",setup(y){const i=l(),{t:s}=c();return(b,e)=>{const a=d("motion");return m((p(),u("div",_,[t("button",{onClick:e[0]||(e[0]=w=>o(i).back())},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",x,[t("div",v,[t("span",f,n(o(s)("settings.title")),1)]),t("div",g,n(o(s)("settings.pages.modules.memory-long-term.title")),1)])])),[[a]])}}});export{h as default}; diff --git a/assets/memory-short-term-BGN7U3OS.js b/assets/memory-short-term-Pucm6_ta.js similarity index 92% rename from assets/memory-short-term-BGN7U3OS.js rename to assets/memory-short-term-Pucm6_ta.js index f2c57e619636ca2cd85d6417d089740b54d938dd..ded480c6dc91a565c246ff4a1fa783ffff36dbbb 100644 --- a/assets/memory-short-term-BGN7U3OS.js +++ b/assets/memory-short-term-Pucm6_ta.js @@ -1 +1 @@ -import{d as a,bE as l,q as c,bw as d,A as m,o as p,c as u,a as t,e as o,D as n}from"./index-BYewP6KR.js";const _={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},x={relative:""},v={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},f={text:"neutral-300 dark:neutral-500","text-nowrap":""},y={"text-nowrap":"","text-3xl":"","font-semibold":""},k=a({__name:"memory-short-term",setup(b){const i=l(),{t:s}=c();return(h,e)=>{const r=d("motion");return m((p(),u("div",_,[t("button",{onClick:e[0]||(e[0]=w=>o(i).back())},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",x,[t("div",v,[t("span",f,n(o(s)("settings.title")),1)]),t("div",y,n(o(s)("settings.pages.modules.memory-short-term.title")),1)])])),[[r]])}}});export{k as default}; +import{d as a,bE as l,q as c,bw as d,A as m,o as p,c as u,a as t,e as o,D as n}from"./index-CL4rmUJ-.js";const _={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},x={relative:""},v={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},f={text:"neutral-300 dark:neutral-500","text-nowrap":""},y={"text-nowrap":"","text-3xl":"","font-semibold":""},k=a({__name:"memory-short-term",setup(b){const i=l(),{t:s}=c();return(h,e)=>{const r=d("motion");return m((p(),u("div",_,[t("button",{onClick:e[0]||(e[0]=w=>o(i).back())},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",x,[t("div",v,[t("span",f,n(o(s)("settings.title")),1)]),t("div",y,n(o(s)("settings.pages.modules.memory-short-term.title")),1)])])),[[r]])}}});export{k as default}; diff --git a/assets/messages-DYJkpUp7.js b/assets/messages-UpVa7nD_.js similarity index 78% rename from assets/messages-DYJkpUp7.js rename to assets/messages-UpVa7nD_.js index dd473fb2d94a8c8bc6dc0450a5effc242abdc439..cbc93307d9f79863450fad5de2c1709c1b15ad3f 100644 --- a/assets/messages-DYJkpUp7.js +++ b/assets/messages-UpVa7nD_.js @@ -1 +1 @@ -import{u as m,_ as g,l as _}from"./queues-Cj51JWdx.js";import"./live2d-zip-loader-CvpgOHsT.js";import{d as v,g as t,c as l,o as u,a as e,b,e as x,D as c,bx as k,by as h}from"./index-BYewP6KR.js";import{u as z}from"./queue-DRKK1rL_.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},S={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},M={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},E=v({__name:"messages",setup(Q){const s=t(""),d=t([]),a=t(!1),f=z({handlers:[async i=>{d.value.push(i.data)}]}),r=m(f);async function p(){a.value=!0,r.add(s.value),r.add(_),s.value="",a.value=!1}return(i,n)=>(u(),l("div",w,[e("div",y,[b(x(g),{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=o=>s.value=o),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),e("button",S,c(a.value?"Processing...":"Send"),1)]),e("div",V,[e("div",M,[n[1]||(n[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(k,null,h(d.value,o=>(u(),l("div",{key:o},[e("div",null,c(o),1)]))),128))])])]))}});export{E as default}; +import{u as m,_ as g,l as _}from"./queues-D3Ic2N1b.js";import"./live2d-zip-loader-DFrBymqv.js";import{d as v,g as t,c as l,o as u,a as e,b,e as x,D as c,bx as k,by as h}from"./index-CL4rmUJ-.js";import{u as z}from"./queue-DCQeV-U1.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},S={"rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},M={"w-full":"","rounded-lg":"",bg:"zinc-100 dark:zinc-700","p-2":""},E=v({__name:"messages",setup(Q){const s=t(""),d=t([]),a=t(!1),f=z({handlers:[async i=>{d.value.push(i.data)}]}),r=m(f);async function p(){a.value=!0,r.add(s.value),r.add(_),s.value="",a.value=!1}return(i,n)=>(u(),l("div",w,[e("div",y,[b(x(g),{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=o=>s.value=o),placeholder:"Message",p:"2",bg:"zinc-100 dark:zinc-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),e("button",S,c(a.value?"Processing...":"Send"),1)]),e("div",V,[e("div",M,[n[1]||(n[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(k,null,h(d.value,o=>(u(),l("div",{key:o},[e("div",null,c(o),1)]))),128))])])]))}});export{E as default}; diff --git a/assets/microsoft-speech-CDHTXaj-.js b/assets/microsoft-speech-Cf4yrOLH.js similarity index 73% rename from assets/microsoft-speech-CDHTXaj-.js rename to assets/microsoft-speech-Cf4yrOLH.js index 6ee5f10b6a5282b2ee0f24a2669f469c2d7132f5..25a970714ae3cc4f6250959f0742b9990f51859a 100644 --- a/assets/microsoft-speech-CDHTXaj-.js +++ b/assets/microsoft-speech-Cf4yrOLH.js @@ -1 +1 @@ -import{_ as P}from"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./live2d-zip-loader-CvpgOHsT.js";import{d as q,q as B,s as K,g as m,h as p,x as L,o as M,y as f,b as g,e as i}from"./index-BYewP6KR.js";import{u as T}from"./providers-CFIOZO6n.js";import{u as z}from"./speech-CLmksxkl.js";import{_ as E,a as F,b as G}from"./SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-lVYyoUny.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-CGhOEjXF.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";const t="microsoft-speech",x="v1",ee=q({__name:"microsoft-speech",setup(H){const{t:h}=B(),U={pitch:0,speed:1,volume:0},r=z(),d=T(),{providers:n}=K(d),u=m(0),b=m(1),_=m(0),c=p({get:()=>{var o;return((o=n.value[t])==null?void 0:o.region)||"eastasia"},set:o=>{n.value[t]||(n.value[t]={}),n.value[t].region=o}}),C=p(()=>{var o;return!!((o=n.value[t])!=null&&o.apiKey)}),y=p(()=>r.availableVoices[t]||[]),k=p(()=>r.availableLanguages);async function $(o,e,a){const l=d.getProviderInstance(t);if(!l)throw new Error("Failed to initialize speech provider");const s=d.getProviderConfig(t),S=s.model||x,w={...s,region:c.value,disableSsml:!a};if(!a&&e){const V=y.value.find(v=>v.id===e);if(V){const v=r.generateSSML(o,V,{...s,pitch:u.value});return await r.speech(l,S,v,e,w)}}return await r.speech(l,S,o,e,w)}return(o,e)=>(M(),L(i(G),{"provider-id":t,"default-model":x,"additional-settings":U},{"basic-settings":f(()=>[g(i(P),{modelValue:c.value,"onUpdate:modelValue":e[0]||(e[0]=a=>c.value=a),label:i(h)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:i(h)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":f(({voiceSettings:a,updateVoiceSettings:l})=>[g(i(F),{pitch:u.value,"onUpdate:pitch":e[1]||(e[1]=s=>u.value=s),speed:b.value,"onUpdate:speed":e[2]||(e[2]=s=>b.value=s),volume:_.value,"onUpdate:volume":e[3]||(e[3]=s=>_.value=s),settings:a,"show-pitch":!0,"show-speed":!0,"show-volume":!0,onUpdate:l},null,8,["pitch","speed","volume","settings","onUpdate"])]),playground:f(()=>[g(i(E),{"available-voices":y.value,"available-languages":k.value,"generate-speech":$,"api-key-configured":C.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","available-languages","api-key-configured"])]),_:1}))}});export{ee as default}; +import{_ as P}from"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./live2d-zip-loader-DFrBymqv.js";import{d as q,q as B,s as K,g as m,h as p,x as L,o as M,y as f,b as g,e as i}from"./index-CL4rmUJ-.js";import{u as T}from"./providers-BHCrT0RZ.js";import{u as z}from"./speech-Ae5ywnpY.js";import{_ as E,a as F,b as G}from"./SpeechVoiceSettings.vue_vue_type_script_setup_true_lang-8IXQG3Jk.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-D5aCIkT4.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";const t="microsoft-speech",x="v1",ee=q({__name:"microsoft-speech",setup(H){const{t:h}=B(),U={pitch:0,speed:1,volume:0},r=z(),d=T(),{providers:n}=K(d),u=m(0),b=m(1),_=m(0),c=p({get:()=>{var o;return((o=n.value[t])==null?void 0:o.region)||"eastasia"},set:o=>{n.value[t]||(n.value[t]={}),n.value[t].region=o}}),C=p(()=>{var o;return!!((o=n.value[t])!=null&&o.apiKey)}),y=p(()=>r.availableVoices[t]||[]),k=p(()=>r.availableLanguages);async function $(o,e,a){const l=d.getProviderInstance(t);if(!l)throw new Error("Failed to initialize speech provider");const s=d.getProviderConfig(t),S=s.model||x,w={...s,region:c.value,disableSsml:!a};if(!a&&e){const V=y.value.find(v=>v.id===e);if(V){const v=r.generateSSML(o,V,{...s,pitch:u.value});return await r.speech(l,S,v,e,w)}}return await r.speech(l,S,o,e,w)}return(o,e)=>(M(),L(i(G),{"provider-id":t,"default-model":x,"additional-settings":U},{"basic-settings":f(()=>[g(i(P),{modelValue:c.value,"onUpdate:modelValue":e[0]||(e[0]=a=>c.value=a),label:i(h)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:i(h)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":f(({voiceSettings:a,updateVoiceSettings:l})=>[g(i(F),{pitch:u.value,"onUpdate:pitch":e[1]||(e[1]=s=>u.value=s),speed:b.value,"onUpdate:speed":e[2]||(e[2]=s=>b.value=s),volume:_.value,"onUpdate:volume":e[3]||(e[3]=s=>_.value=s),settings:a,"show-pitch":!0,"show-speed":!0,"show-volume":!0,onUpdate:l},null,8,["pitch","speed","volume","settings","onUpdate"])]),playground:f(()=>[g(i(E),{"available-voices":y.value,"available-languages":k.value,"generate-speech":$,"api-key-configured":C.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","available-languages","api-key-configured"])]),_:1}))}});export{ee as default}; diff --git a/assets/mistral-ai-pL5Kxw61.js b/assets/mistral-ai-Cjk87FuW.js similarity index 67% rename from assets/mistral-ai-pL5Kxw61.js rename to assets/mistral-ai-Cjk87FuW.js index 7c1c6e0058bcfcd807d62871a7c3ff264b82dad6..22cb4e202f4f304a041654d05f4bea8db54a93be 100644 --- a/assets/mistral-ai-pL5Kxw61.js +++ b/assets/mistral-ai-Cjk87FuW.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as U,q as V,bE as y,s as $,h as v,l as k,w as K,x as h,o as x,y as m,b as l,e as t}from"./index-BYewP6KR.js";import{u as w}from"./providers-CFIOZO6n.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const a="mistral-ai",H=U({__name:"mistral-ai",setup(S){const{t:p}=V(),_=y(),d=w(),{providers:o}=$(d),n=v(()=>d.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});k(()=>{var e,i;d.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:m(()=>[l(t(N),null,{default:m(()=>[l(t(P),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:m(()=>{var u;return[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(C),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=u=>r.value=u),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as U,q as V,bE as y,s as $,h as v,l as k,w as K,x as h,o as x,y as m,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as w}from"./providers-BHCrT0RZ.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="mistral-ai",H=U({__name:"mistral-ai",setup(S){const{t:p}=V(),_=y(),d=w(),{providers:o}=$(d),n=v(()=>d.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});k(()=>{var e,i;d.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:m(()=>[l(t(N),null,{default:m(()=>[l(t(P),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:m(()=>{var u;return[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(C),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=u=>r.value=u),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; diff --git a/assets/moonshot-ai-COGUtX1e.js b/assets/moonshot-ai-B8RKb1HT.js similarity index 67% rename from assets/moonshot-ai-COGUtX1e.js rename to assets/moonshot-ai-B8RKb1HT.js index aef87d6b013964af9fac39036a8be1f8a48cdb7b..adda942dde0bdac4c66a59c762e4708ab830d922 100644 --- a/assets/moonshot-ai-COGUtX1e.js +++ b/assets/moonshot-ai-B8RKb1HT.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as h,q as U,bE as V,s as y,h as v,l as $,w as k,x as K,o as x,y as m,b as l,e as t}from"./index-BYewP6KR.js";import{u as w}from"./providers-CFIOZO6n.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const a="moonshot-ai",H=h({__name:"moonshot-ai",setup(B){const{t:p}=U(),_=V(),d=w(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;d.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,r],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return x(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:m(()=>[l(t(P),null,{default:m(()=>[l(t(R),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:m(()=>{var u;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=u=>r.value=u),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as h,q as U,bE as V,s as y,h as v,l as $,w as k,x as K,o as x,y as m,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as w}from"./providers-BHCrT0RZ.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="moonshot-ai",H=h({__name:"moonshot-ai",setup(B){const{t:p}=U(),_=V(),d=w(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;d.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,r],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return x(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:m(()=>[l(t(P),null,{default:m(()=>[l(t(R),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:m(()=>{var u;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=u=>r.value=u),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; diff --git a/assets/novita-ai-CfYWAApi.js b/assets/novita-ai-CVRJyGOQ.js similarity index 67% rename from assets/novita-ai-CfYWAApi.js rename to assets/novita-ai-CVRJyGOQ.js index 59edbfcf076b85d349aab1ba9c96b98c2fd26785..b1875ea5190d704da4cdab15f3a227e7cf8b03e6 100644 --- a/assets/novita-ai-CfYWAApi.js +++ b/assets/novita-ai-CVRJyGOQ.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as U,q as V,bE as y,s as $,h as m,l as k,w as K,x as h,o as x,y as p,b as l,e as t}from"./index-BYewP6KR.js";import{u as w}from"./providers-CFIOZO6n.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const a="novita-ai",H=U({__name:"novita-ai",setup(S){const{t:d}=V(),_=y(),v=w(),{providers:o}=$(v),n=m(()=>v.getProviderMetadata(a)),s=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});k(()=>{var e,i;v.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=u=>r.value=u),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as U,q as V,bE as y,s as $,h as m,l as k,w as K,x as h,o as x,y as p,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as w}from"./providers-BHCrT0RZ.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="novita-ai",H=U({__name:"novita-ai",setup(S){const{t:d}=V(),_=y(),v=w(),{providers:o}=$(v),n=m(()=>v.getProviderMetadata(a)),s=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=m({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});k(()=>{var e,i;v.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=u=>r.value=u),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; diff --git a/assets/ollama-8aEB11fY.js b/assets/ollama-BNerp7db.js similarity index 88% rename from assets/ollama-8aEB11fY.js rename to assets/ollama-BNerp7db.js index 7a3193e4801896b22a573ab397faa342c421e95f..fbdddd60fd32f84b781180c5c56c4b2570569040 100644 --- a/assets/ollama-8aEB11fY.js +++ b/assets/ollama-BNerp7db.js @@ -1 +1 @@ -import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";import{d as K,bK as x,bL as U,c as g,o as f,b as m,g as $,w as C,bw as N,a as _,A as D,bH as O,C as R,D as M,bx as S,by as z,q as I,bE as A,s as E,h as q,l as F,c8 as L,x as T,y as b,e as t}from"./index-BYewP6KR.js";import"./live2d-zip-loader-CvpgOHsT.js";import{u as H}from"./providers-CFIOZO6n.js";import{a as j,_ as G}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as J,a as Q}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as W}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";const X={flex:"~ gap-2"},Y=K({__name:"InputKeyValue",props:x({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(v){const o=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,a)=>(f(),g("div",X,[m(P,{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value=n),placeholder:o.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(P,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=n=>u.value=n),placeholder:o.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),Z={"max-w-full":""},ee={flex:"~ col gap-2"},le={class:"flex items-center gap-1 text-sm font-medium"},ae={key:0,class:"text-red-500"},te={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},oe={flex:"~ col gap-2"},re=["onClick"],se=K({__name:"FieldKeyValues",props:x({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:x(["remove","add"],["update:modelValue"]),setup(v,{emit:o}){const s=v,u=o,r=U(v,"modelValue"),a=$(""),n=$("");return C([a,n],()=>{u("add",a.value,n.value)}),(w,p)=>{const k=N("auto-animate");return f(),g("div",Z,[_("label",ee,[_("div",null,[_("div",le,[O(M(s.label)+" ",1),s.required!==!1?(f(),g("span",ae,"*")):R("",!0)]),_("div",te,M(s.description),1)]),D((f(),g("div",oe,[(f(!0),g(S,null,z(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Y,{"property-key":y.key,"onUpdate:propertyKey":e=>y.key=e,"property-value":y.value,"onUpdate:propertyValue":e=>y.value=e,"key-placeholder":s.keyPlaceholder,"value-placeholder":s.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),_("button",{onClick:e=>u("remove",l)},p[0]||(p[0]=[_("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,re)]))),128))])),[[k]])])])}}}),d="ollama",_e=K({__name:"ollama",setup(v){const{t:o}=I(),s=A(),u=H(),{providers:r}=E(u),a=q(()=>u.getProviderMetadata(d)),n=q({get:()=>{var l,e,i;return((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});F(()=>{var l,e,i,h;u.initializeProvider(d),n.value=((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||"",(h=r.value[d])!=null&&h.headers||(r.value[d].headers={})});function w(){var l;r.value[d]={...(l=a.value)==null?void 0:l.defaultOptions}}const p=L([{key:"",value:""}]);function k(l,e,i){l&&l.push({key:e,value:i})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return C(p,l=>{l.length>0&&(l[l.length-1].key!==""||l[l.length-1].value!=="")&&l.push({key:"",value:""})},{deep:!0,immediate:!0}),(l,e)=>{var i,h;return f(),T(t(W),{"provider-name":(i=a.value)==null?void 0:i.localizedName,"provider-icon":(h=a.value)==null?void 0:h.icon,"on-back":()=>t(s).back()},{default:b(()=>[m(t(J),null,{default:b(()=>[m(t(Q),{title:t(o)("settings.pages.providers.common.section.basic.title"),description:t(o)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:b(()=>{var c,V;return[m(t(j),{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=B=>n.value=B),placeholder:((V=(c=a.value)==null?void 0:c.defaultOptions)==null?void 0:V.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(t(G),{title:t(o)("settings.pages.providers.common.section.advanced.title")},{default:b(()=>[m(t(se),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,V)=>k(p,c,V)),onRemove:e[3]||(e[3]=c=>y(c,p))},null,8,["modelValue","label","description","key-placeholder","value-placeholder"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{_e as default}; +import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";import{d as K,bK as x,bL as U,c as g,o as f,b as m,g as $,w as C,bw as N,a as _,A as D,bH as O,C as R,D as M,bx as S,by as z,q as I,bE as A,s as E,h as q,l as F,c8 as L,x as T,y as b,e as t}from"./index-CL4rmUJ-.js";import"./live2d-zip-loader-DFrBymqv.js";import{u as H}from"./providers-BHCrT0RZ.js";import{a as j,_ as G}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as J,a as Q}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as W}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";const X={flex:"~ gap-2"},Y=K({__name:"InputKeyValue",props:x({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(v){const o=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,a)=>(f(),g("div",X,[m(P,{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value=n),placeholder:o.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(P,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=n=>u.value=n),placeholder:o.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),Z={"max-w-full":""},ee={flex:"~ col gap-2"},le={class:"flex items-center gap-1 text-sm font-medium"},ae={key:0,class:"text-red-500"},te={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},oe={flex:"~ col gap-2"},re=["onClick"],se=K({__name:"FieldKeyValues",props:x({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:x(["remove","add"],["update:modelValue"]),setup(v,{emit:o}){const s=v,u=o,r=U(v,"modelValue"),a=$(""),n=$("");return C([a,n],()=>{u("add",a.value,n.value)}),(w,p)=>{const k=N("auto-animate");return f(),g("div",Z,[_("label",ee,[_("div",null,[_("div",le,[O(M(s.label)+" ",1),s.required!==!1?(f(),g("span",ae,"*")):R("",!0)]),_("div",te,M(s.description),1)]),D((f(),g("div",oe,[(f(!0),g(S,null,z(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Y,{"property-key":y.key,"onUpdate:propertyKey":e=>y.key=e,"property-value":y.value,"onUpdate:propertyValue":e=>y.value=e,"key-placeholder":s.keyPlaceholder,"value-placeholder":s.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),_("button",{onClick:e=>u("remove",l)},p[0]||(p[0]=[_("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,re)]))),128))])),[[k]])])])}}}),d="ollama",_e=K({__name:"ollama",setup(v){const{t:o}=I(),s=A(),u=H(),{providers:r}=E(u),a=q(()=>u.getProviderMetadata(d)),n=q({get:()=>{var l,e,i;return((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});F(()=>{var l,e,i,h;u.initializeProvider(d),n.value=((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||"",(h=r.value[d])!=null&&h.headers||(r.value[d].headers={})});function w(){var l;r.value[d]={...(l=a.value)==null?void 0:l.defaultOptions}}const p=L([{key:"",value:""}]);function k(l,e,i){l&&l.push({key:e,value:i})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return C(p,l=>{l.length>0&&(l[l.length-1].key!==""||l[l.length-1].value!=="")&&l.push({key:"",value:""})},{deep:!0,immediate:!0}),(l,e)=>{var i,h;return f(),T(t(W),{"provider-name":(i=a.value)==null?void 0:i.localizedName,"provider-icon":(h=a.value)==null?void 0:h.icon,"on-back":()=>t(s).back()},{default:b(()=>[m(t(J),null,{default:b(()=>[m(t(Q),{title:t(o)("settings.pages.providers.common.section.basic.title"),description:t(o)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:b(()=>{var c,V;return[m(t(j),{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=B=>n.value=B),placeholder:((V=(c=a.value)==null?void 0:c.defaultOptions)==null?void 0:V.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(t(G),{title:t(o)("settings.pages.providers.common.section.advanced.title")},{default:b(()=>[m(t(se),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,V)=>k(p,c,V)),onRemove:e[3]||(e[3]=c=>y(c,p))},null,8,["modelValue","label","description","key-placeholder","value-placeholder"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{_e as default}; diff --git a/assets/openai-CgoRZ1EW.js b/assets/openai-CFF4hUNa.js similarity index 68% rename from assets/openai-CgoRZ1EW.js rename to assets/openai-CFF4hUNa.js index 4d083bcdd16687d8c72fd0a8818f21d1df986b21..8b4050b40c3a99dbfc8f83bf1373cf0d3ebcc9b2 100644 --- a/assets/openai-CgoRZ1EW.js +++ b/assets/openai-CFF4hUNa.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as h,q as U,bE as V,s as k,h as v,l as y,w as $,x as K,o as x,y as p,b as l,e as t}from"./index-BYewP6KR.js";import{u as I}from"./providers-CFIOZO6n.js";import{_ as w,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const e="openai",H=h({__name:"openai",setup(A){const{t:u}=U(),_=V(),c=I(),{providers:a}=k(c),m=v(()=>c.getProviderMetadata(e)),i=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,s;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),i.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((s=a.value[e])==null?void 0:s.baseUrl)||"https://api.openai.com/v1/"}),$([i,r],()=>{a.value[e]={...a.value[e],apiKey:i.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function b(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,s)=>{var d,f;return x(),K(t(z),{"provider-name":((d=m.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=m.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[l(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":((n=m.value)==null?void 0:n.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=n=>r.value=n),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as h,q as U,bE as V,s as k,h as v,l as y,w as $,x as K,o as x,y as p,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as I}from"./providers-BHCrT0RZ.js";import{_ as w,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const e="openai",H=h({__name:"openai",setup(A){const{t:u}=U(),_=V(),c=I(),{providers:a}=k(c),m=v(()=>c.getProviderMetadata(e)),i=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,s;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),i.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((s=a.value[e])==null?void 0:s.baseUrl)||"https://api.openai.com/v1/"}),$([i,r],()=>{a.value[e]={...a.value[e],apiKey:i.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function b(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,s)=>{var d,f;return x(),K(t(z),{"provider-name":((d=m.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=m.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[l(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":((n=m.value)==null?void 0:n.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=n=>r.value=n),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; diff --git a/assets/openrouter-ai-Boprybwg.js b/assets/openrouter-ai-4M13n7g5.js similarity index 70% rename from assets/openrouter-ai-Boprybwg.js rename to assets/openrouter-ai-4M13n7g5.js index 0737a276a73eceb502db2ae5a05fb3620d8bfa10..16c9b60b9cc5dde206399323256c136cf138c292 100644 --- a/assets/openrouter-ai-Boprybwg.js +++ b/assets/openrouter-ai-4M13n7g5.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as V,q as k,bE as y,s as $,h as _,l as K,w as O,x as h,o as x,y as m,b as d,e as l}from"./index-BYewP6KR.js";import{u as w}from"./providers-CFIOZO6n.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const a="openrouter-ai",J=V({__name:"openrouter-ai",setup(B){const{t:c}=k(),b=y(),f=w(),{providers:o}=$(f),s=_(()=>f.getProviderMetadata(a)),i=_({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),n=_({get:()=>{var e,t,r;return((e=o.value[a])==null?void 0:e.baseUrl)||((r=(t=s.value)==null?void 0:t.defaultOptions)==null?void 0:r.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,t,r,u;f.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(r=s.value)==null?void 0:r.defaultOptions)==null?void 0:u.baseUrl)||""}),O([i,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:i.value,baseUrl:n.value||((t=(e=s.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function U(){var e;o.value[a]={...(e=s.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var r,u;return x(),h(l(S),{"provider-name":(r=s.value)==null?void 0:r.localizedName,"provider-icon":(u=s.value)==null?void 0:u.icon,"on-back":()=>l(b).back()},{default:m(()=>[d(l(P),null,{default:m(()=>[d(l(R),{title:l(c)("settings.pages.providers.common.section.basic.title"),description:l(c)("settings.pages.providers.common.section.basic.description"),"on-reset":U},{default:m(()=>{var p;return[d(l(N),{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=v=>i.value=v),"provider-name":(p=s.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(l(z),{title:l(c)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>{var p,v;return[d(l(M),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=g=>n.value=g),placeholder:((v=(p=s.value)==null?void 0:p.defaultOptions)==null?void 0:v.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{J as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as V,q as k,bE as y,s as $,h as _,l as K,w as O,x as h,o as x,y as m,b as d,e as l}from"./index-CL4rmUJ-.js";import{u as w}from"./providers-BHCrT0RZ.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="openrouter-ai",J=V({__name:"openrouter-ai",setup(B){const{t:c}=k(),b=y(),f=w(),{providers:o}=$(f),s=_(()=>f.getProviderMetadata(a)),i=_({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),n=_({get:()=>{var e,t,r;return((e=o.value[a])==null?void 0:e.baseUrl)||((r=(t=s.value)==null?void 0:t.defaultOptions)==null?void 0:r.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,t,r,u;f.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(r=s.value)==null?void 0:r.defaultOptions)==null?void 0:u.baseUrl)||""}),O([i,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:i.value,baseUrl:n.value||((t=(e=s.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function U(){var e;o.value[a]={...(e=s.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var r,u;return x(),h(l(S),{"provider-name":(r=s.value)==null?void 0:r.localizedName,"provider-icon":(u=s.value)==null?void 0:u.icon,"on-back":()=>l(b).back()},{default:m(()=>[d(l(P),null,{default:m(()=>[d(l(R),{title:l(c)("settings.pages.providers.common.section.basic.title"),description:l(c)("settings.pages.providers.common.section.basic.description"),"on-reset":U},{default:m(()=>{var p;return[d(l(N),{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=v=>i.value=v),"provider-name":(p=s.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(l(z),{title:l(c)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>{var p,v;return[d(l(M),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=g=>n.value=g),placeholder:((v=(p=s.value)==null?void 0:p.defaultOptions)==null?void 0:v.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{J as default}; diff --git a/assets/providers-BHCrT0RZ.js b/assets/providers-BHCrT0RZ.js new file mode 100644 index 0000000000000000000000000000000000000000..f4c13032e724deb0fbbca198de5583d06ba2d8c5 --- /dev/null +++ b/assets/providers-BHCrT0RZ.js @@ -0,0 +1 @@ +var oe=Object.defineProperty;var le=(a,r,n)=>r in a?oe(a,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[r]=n;var $=(a,r,n)=>le(a,typeof r!="symbol"?r+"":r,n);import{f as ce,bI as de,q as ue,g as q,w as pe,h as x}from"./index-CL4rmUJ-.js";class T extends Error{constructor(n,o){super(n);$(this,"response");this.name="XSAIError",this.response=o}}const me=a=>a.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`),k=a=>Object.fromEntries(Object.entries(a).map(([r,n])=>[me(r),n])),Q=a=>Object.fromEntries(Object.entries(a).filter(([,r])=>r!==void 0)),Ke=a=>JSON.stringify(k(Q({...a,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),Y=(a,r)=>Q({Authorization:r!==void 0?`Bearer ${r}`:void 0,...a}),R=(a,r)=>{const n=r.toString();return new URL(a,n.endsWith("/")?n:`${n}/`)},ge=async a=>{if(!a.ok){const r=new T(`Remote sent ${a.status} response`,a);throw r.cause=new Error(await a.text()),r}if(!a.body)throw new T("Response body is empty from remote server",a);if(!(a.body instanceof ReadableStream)){const r=new T(`Expected Response body to be a ReadableStream, but got ${String(a.body)}`,a);throw r.cause=new Error(`Content-Type is ${a.headers.get("Content-Type")}`),r}return a},ee=async a=>ge(a).then(async r=>{const n=await r.text();try{return JSON.parse(n)}catch{throw new Error(`Failed to parse response, response body: ${n}`)}}),f=async a=>(a.fetch??globalThis.fetch)(R("models",a.baseURL),{headers:Y(a.headers,a.apiKey),signal:a.abortSignal}).then(ee).then(({data:r})=>r),m=a=>({chat:r=>Object.assign(a,{model:r})}),M=a=>({embed:r=>Object.assign(a,{model:r})}),h=a=>({model:()=>a}),_e=a=>({speech:r=>Object.assign(a,{model:r})}),he=a=>({transcription:r=>Object.assign(a,{model:r})}),p=(a,r)=>({metadata:{id:a,...r}}),u=(...a)=>Object.assign(a[0],...a.slice(1)),ve=(a,r="https://api.anthropic.com/v1/")=>u(p("anthropic"),m({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r})),z=(a,r="https://api.deepseek.com/")=>u(p("deepseek"),m({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r})),D=(a,r="https://api.fireworks.ai/inference/v1/")=>u(p("fireworks"),m({apiKey:a,baseURL:r}),M({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r})),N=(a,r="https://api.mistral.ai/v1/")=>u(p("mistral"),m({apiKey:a,baseURL:r}),M({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r})),G=(a,r="https://api.moonshot.cn/v1/")=>u(p("moonshot"),m({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r})),H=(a,r="https://api.novita.ai/v3/openai/")=>u(p("novita"),m({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r})),C=(a,r="https://api.openai.com/v1/")=>u(p("openai"),m({apiKey:a,baseURL:r}),M({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r}),_e({apiKey:a,baseURL:r}),he({apiKey:a,baseURL:r})),fe=(a,r="")=>u(p("openrouter"),{chat:(n,o)=>{const v={apiKey:a,baseURL:r,model:n};return{...o?(({extraHeaders:d,models:y,provider:g})=>{d!=null&&(v.headers??(v.headers={}),Object.assign(v.headers,d));let c;return g!=null&&(c=k(g)),k({models:y,provider:c})})(o):{},...v}}},h({apiKey:a,baseURL:r})),ye=(a,r="https://api.perplexity.ai/")=>u(p("perplexity"),m({apiKey:a,baseURL:r})),J=(a,r="https://api.together.xyz/v1/")=>u(p("together-ai"),m({apiKey:a,baseURL:r}),M({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r,fetch:async(...n)=>globalThis.fetch(...n).then(async o=>o.json()).then(o=>Response.json({data:o,object:"list"}))})),be=(a,r)=>{const n=`https://api.cloudflare.com/client/v4/accounts/${r}/ai/v1/`;return u(p("workers-ai"),m({apiKey:a,baseURL:n}),M({apiKey:a,baseURL:n}))},V=(a,r="https://api.x.ai/v1/")=>u(p("xai"),m({apiKey:a,baseURL:r}),h({apiKey:a,baseURL:r})),B=(a="http://localhost:11434/v1/")=>u(p("ollama"),m({baseURL:a}),M({baseURL:a}),h({baseURL:a}));function W(a,r="http://localhost:5933/v1/"){const n=({applyTextNormalization:t,languageCode:d,nextRequestIds:y,nextText:g,previousRequestIds:c,previousText:K,pronunciationDictionaryLocators:w,seed:P,voiceSettings:O})=>({extraBody:k({applyTextNormalization:t,languageCode:d,nextRequestIds:y,nextText:g,previousRequestIds:c,previousText:K,pronunciationDictionaryLocators:w?w.map(A=>k(A)):void 0,seed:P,voiceSettings:O!=null?k(O):{similarityBoost:.75,stability:.5}})});return u({speech:(t,d)=>({...d?n(d):{},apiKey:a,baseURL:r,model:`elevenlabs/${t}`})},{voice:t=>(r.endsWith("v1/")?r=r.slice(0,-3):r.endsWith("v1")&&(r=r.slice(0,-2)),{query:"provider=elevenlabs",...t?n(t):{},apiKey:a,baseURL:r})})}async function X(a){return(a.fetch??globalThis.fetch)(R(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:Y({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(ee).then(({voices:r})=>r)}function Z(a,r="http://localhost:5933/v1/"){const n=t=>{const{deploymentId:d,region:y,sampleRate:g}=t,c={deploymentId:d,region:y,sampleRate:g};return"disableSsml"in t?c.disableSsml=t.disableSsml:"lang"in t&&(c.lang=t.lang,c.gender=t.gender,c.voice=t.voice),{extraBody:k(c)}};return u({speech:(t,d)=>({...d?n(d):{},apiKey:a,baseURL:r,model:`microsoft/${t}`})},{voice:t=>(r.endsWith("v1/")?r=r.slice(0,-3):r.endsWith("v1")&&(r=r.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?n(t):{},apiKey:a,baseURL:r})})}const xe=[{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"}],Pe=ce("providers",()=>{const a=de("settings/credentials/providers",{}),{t:r}=ue();async function n(e){try{const i=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":"application/json"}});if(!i.ok)throw new Error(`Failed to fetch OpenRouter models: ${i.statusText}`);return(await i.json()).data.map(s=>({id:s.id,name:s.name||s.id,provider:"openrouter-ai",description:s.description||"",contextLength:s.context_length,deprecated:!1}))}catch(i){throw console.error("Error fetching OpenRouter models:",i),i}}const o={"openrouter-ai":{id:"openrouter-ai",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:e=>fe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>n(e)}},ollama:{id:"ollama",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:e=>B(e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...B(e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))}},vllm:{id:"vllm",nameKey:"settings.pages.providers.provider.vllm.title",name:"vLLM",descriptionKey:"settings.pages.providers.provider.vllm.description",description:"vllm.ai",iconColor:"i-lobe-icons:vllm-color",createProvider:e=>B(e.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}]}},openai:{id:"openai",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:e=>C(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...C(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))}},anthropic:{id:"anthropic",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:e=>ve(e.apiKey.trim(),e.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}]}},elevenlabs:{id:"elevenlabs",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:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>xe.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const i=W(e.apiKey.trim(),e.baseUrl.trim()),l=await X({...i.voice()}),s=l.findIndex(b=>b.name.includes("Aria")),_=l.findIndex(b=>b.name.includes("Bill")),j=s!==-1?s:0,L=_!==-1?_:l.length-1,F=Math.min(j,L),I=Math.max(j,L);return[...l.slice(0,F),...l.slice(I+1),...l.slice(F,I+1)].map(b=>({id:b.id,name:b.name,provider:"elevenlabs",previewURL:b.preview_audio_url,languages:b.languages}))}}},xai:{id:"xai",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:e=>V(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...V(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))}},deepseek:{id:"deepseek",nameKey:"settings.pages.providers.provider.deepseek.title",name:"DeepSeek",descriptionKey:"settings.pages.providers.provider.deepseek.description",description:"deepseek.com",iconColor:"i-lobe-icons:deepseek-color",createProvider:e=>z(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...z(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))}},"together-ai":{id:"together-ai",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-color",createProvider:e=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...J(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))}},"novita-ai":{id:"novita-ai",nameKey:"settings.pages.providers.provider.novita.title",name:"Novita",descriptionKey:"settings.pages.providers.provider.novita.description",description:"novita.ai",iconColor:"i-lobe-icons:novita-color",createProvider:e=>H(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...H(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))}},"fireworks-ai":{id:"fireworks-ai",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:e=>D(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...D(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))}},"microsoft-speech":{id:"microsoft-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-color",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Z(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"v1",name:"v1",provider:"microsoft-speech",description:"",contextLength:0,deprecated:!1}],listVoices:async e=>{const i=Z(e.apiKey.trim(),e.baseUrl.trim());return(await X({...i.voice({region:e.region})})).map(s=>{var _;return{id:s.id,name:s.name,provider:"microsoft-speech",previewURL:s.preview_audio_url,languages:s.languages,gender:(_=s.labels)==null?void 0:_.gender}})}}},"featherless-ai":{id:"featherless-ai",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:e=>C(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...C(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"featherless-ai",description:"",contextLength:0,deprecated:!1}))}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",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-color",createProvider:e=>be(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]}},"perplexity-ai":{id:"perplexity-ai",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:e=>ye(e.apiKey.trim(),e.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}]}},"mistral-ai":{id:"mistral-ai",nameKey:"settings.pages.providers.provider.mistral.title",name:"Mistral",descriptionKey:"settings.pages.providers.provider.mistral.description",description:"mistral.ai",iconColor:"i-lobe-icons:mistral-color",createProvider:e=>N(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...N(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))}},"moonshot-ai":{id:"moonshot-ai",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:e=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await f({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))}}};function v(e){const i=a.value[e];if(!i)return!1;switch(e){case"openrouter-ai":return!!i.apiKey&&!!i.baseUrl;case"ollama":return!!i.baseUrl;case"vllm":return!!i.baseUrl;case"openai":return!!i.apiKey;case"anthropic":return!!i.apiKey;case"elevenlabs":return!!i.apiKey;case"xai":return!!i.apiKey;case"deepseek":return!!i.apiKey;case"together-ai":return!!i.apiKey;case"novita-ai":return!!i.apiKey;case"fireworks-ai":return!!i.apiKey;case"featherless-ai":return!!i.apiKey;case"microsoft-speech":return!!i.apiKey&&!!i.region;case"cloudflare-workers-ai":return!!i.apiKey;case"mistral-ai":return!!i.apiKey;case"moonshot-ai":return!!i.apiKey;default:return!1}}const t=q({});function d(e){var i;if(!a.value[e]){const l=o[e];a.value[e]={baseUrl:((i=l.defaultOptions)==null?void 0:i.baseUrl)||""}}}Object.keys(o).forEach(d);function y(){Object.keys(o).forEach(e=>{t.value[e]=v(e)})}y(),pe(a,y,{deep:!0});const g=x(()=>Object.keys(o).filter(e=>t.value[e])),c=q({}),K=q({}),w=q({});async function P(e){const i=a.value[e];if(!i)return[];const l=o[e];if(!l)return[];K.value[e]=!0,w.value[e]=null;try{const s=l.capabilities.listModels?await l.capabilities.listModels(i):[];return c.value[e]=s.map(_=>({id:_.id,name:_.name,description:_.description,contextLength:_.contextLength,deprecated:_.deprecated,provider:e})),c.value[e]}catch(s){return console.error(`Error fetching models for ${e}:`,s),w.value[e]=s instanceof Error?s.message:"Unknown error",[]}finally{K.value[e]=!1}}function O(e){return c.value[e]||[]}const A=x(()=>{const e=[];for(const i of g.value)e.push(...c.value[i]||[]);return e});async function ae(){for(const e of g.value)o[e].capabilities.listModels&&await P(e)}function U(e){const i=o[e];if(!i)throw new Error(`Provider metadata for ${e} not found`);return{...i,localizedName:r(i.nameKey,i.name),localizedDescription:r(i.descriptionKey,i.description)}}const re=x(()=>Object.values(o).map(e=>({...e,localizedName:r(e.nameKey,e.name),localizedDescription:r(e.descriptionKey,e.description),configured:t.value[e.id]||!1})));function S(e){const i=a.value[e];if(!i)throw new Error(`Provider credentials for ${e} not found`);const l=o[e];if(!l)throw new Error(`Provider metadata for ${e} not found`);try{return l.createProvider(i)}catch(s){throw console.error(`Error creating provider instance for ${e}:`,s),s}}const E=x(()=>g.value.map(e=>U(e))),ie=x(()=>E.value.filter(e=>{const i=S(e.id);return"chat"in i&&typeof i.chat=="function"})),ne=x(()=>E.value.filter(e=>{const i=S(e.id);return"transcription"in i&&typeof i.transcription=="function"})),te=x(()=>E.value.filter(e=>{const i=S(e.id);return"speech"in i&&typeof i.speech=="function"}));function se(e){return a.value[e]}return{providers:a,getProviderConfig:se,availableProviders:g,configuredProviders:t,providerMetadata:o,getProviderMetadata:U,allProvidersMetadata:re,initializeProvider:d,validateProvider:v,availableModels:c,isLoadingModels:K,modelLoadError:w,fetchModelsForProvider:P,getModelsForProvider:O,allAvailableModels:A,loadModelsForConfiguredProviders:ae,getProviderInstance:S,availableProvidersMetadata:E,availableTextGenerationsProvidersMetadata:ie,availableAudioSpeechProvidersMetadata:te,availableAudioTranscriptionProvidersMetadata:ne}});export{Y as a,Ke as b,Q as c,ge as d,f as l,R as r,Pe as u}; diff --git a/assets/providers-CFIOZO6n.js b/assets/providers-CFIOZO6n.js deleted file mode 100644 index 44bee4752f7fd58ef8e1e5b89b6c0323793a3cc4..0000000000000000000000000000000000000000 --- a/assets/providers-CFIOZO6n.js +++ /dev/null @@ -1 +0,0 @@ -var oe=Object.defineProperty;var le=(e,r,n)=>r in e?oe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var $=(e,r,n)=>le(e,typeof r!="symbol"?r+"":r,n);import{f as ce,bI as de,q as ue,g as O,w as pe,h as x}from"./index-BYewP6KR.js";let A=class extends Error{constructor(n,s){super(n);$(this,"response");this.name="XSAIError",this.response=s}};const me=e=>e.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`),B=e=>Object.fromEntries(Object.entries(e).map(([r,n])=>[me(r),n])),Y=e=>Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0)),je=e=>JSON.stringify(B(Y({...e,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),ge=(e,r)=>Y({Authorization:r!==void 0?`Bearer ${r}`:void 0,...e}),_e=(e,r)=>{const n=r.toString();return new URL(e,n.endsWith("/")?n:`${n}/`)},he=async e=>{if(!e.ok){const r=new A(`Remote sent ${e.status} response`,e);throw r.cause=new Error(await e.text()),r}if(!e.body)throw new A("Response body is empty from remote server",e);if(!(e.body instanceof ReadableStream)){const r=new A(`Expected Response body to be a ReadableStream, but got ${String(e.body)}`,e);throw r.cause=new Error(`Content-Type is ${e.headers.get("Content-Type")}`),r}return e},ve=async e=>he(e).then(async r=>{const n=await r.text();try{return JSON.parse(n)}catch{throw new Error(`Failed to parse response, response body: ${n}`)}}),f=async e=>(e.fetch??globalThis.fetch)(_e("models",e.baseURL),{headers:ge({"Content-Type":"application/json",...e.headers},e.apiKey),signal:e.abortSignal}).then(ve).then(({data:r})=>r),m=e=>({chat:r=>Object.assign(e,{model:r})}),k=e=>({embed:r=>Object.assign(e,{model:r})}),h=e=>({model:()=>e}),fe=e=>({speech:r=>Object.assign(e,{model:r})}),ye=e=>({transcription:r=>Object.assign(e,{model:r})}),u=(e,r)=>({metadata:{id:e,...r}}),p=(...e)=>Object.assign(e[0],...e.slice(1)),be=(e,r="https://api.anthropic.com/v1/")=>p(u("anthropic"),m({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r})),N=(e,r="https://api.deepseek.com/")=>p(u("deepseek"),m({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r})),D=(e,r="https://api.fireworks.ai/inference/v1/")=>p(u("fireworks"),m({apiKey:e,baseURL:r}),k({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r})),G=(e,r="https://api.mistral.ai/v1/")=>p(u("mistral"),m({apiKey:e,baseURL:r}),k({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r})),H=(e,r="https://api.moonshot.cn/v1/")=>p(u("moonshot"),m({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r})),J=(e,r="https://api.novita.ai/v3/openai/")=>p(u("novita"),m({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r})),W=(e,r="https://api.openai.com/v1/")=>p(u("openai"),m({apiKey:e,baseURL:r}),k({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r}),fe({apiKey:e,baseURL:r}),ye({apiKey:e,baseURL:r})),xe=(e,r="")=>p(u("openrouter"),{chat:(n,s)=>{const v={apiKey:e,baseURL:r,model:n};return{...s?(({extraHeaders:d,models:y,provider:g})=>{d!=null&&(v.headers??(v.headers={}),Object.assign(v.headers,d));let c;return g!=null&&(c=B(g)),B({models:y,provider:c})})(s):{},...v}}},h({apiKey:e,baseURL:r})),we=(e,r="https://api.perplexity.ai/")=>p(u("perplexity"),m({apiKey:e,baseURL:r})),V=(e,r="https://api.together.xyz/v1/")=>p(u("together-ai"),m({apiKey:e,baseURL:r}),k({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r,fetch:async(...n)=>globalThis.fetch(...n).then(async s=>s.json()).then(s=>Response.json({data:s,object:"list"}))})),ke=(e,r)=>{const n=`https://api.cloudflare.com/client/v4/accounts/${r}/ai/v1/`;return p(u("workers-ai"),m({apiKey:e,baseURL:n}),k({apiKey:e,baseURL:n}))},X=(e,r="https://api.x.ai/v1/")=>p(u("xai"),m({apiKey:e,baseURL:r}),h({apiKey:e,baseURL:r})),T=(e="http://localhost:11434/v1/")=>p(u("ollama"),m({baseURL:e}),k({baseURL:e}),h({baseURL:e})),ee=(...e)=>Object.assign(e[0],...e.slice(1));class j extends Error{constructor(n,s){super(n);$(this,"response");this.name="XSAIError",this.response=s}}const Me=e=>e.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`),C=e=>Object.fromEntries(Object.entries(e).map(([r,n])=>[Me(r),n])),Pe=e=>Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0)),Se=(e,r)=>Pe({Authorization:r!==void 0?`Bearer ${r}`:void 0,...e}),Ke=(e,r)=>{const n=r.toString();return new URL(e,n.endsWith("/")?n:`${n}/`)},Ee=async e=>{if(!e.ok){const r=new j(`Remote sent ${e.status} response`,e);throw r.cause=new Error(await e.text()),r}if(!e.body)throw new j("Response body is empty from remote server",e);if(!(e.body instanceof ReadableStream)){const r=new j(`Expected Response body to be a ReadableStream, but got ${String(e.body)}`,e);throw r.cause=new Error(`Content-Type is ${e.headers.get("Content-Type")}`),r}return e},Oe=async e=>Ee(e).then(async r=>{const n=await r.text();try{return JSON.parse(n)}catch{throw new Error(`Failed to parse response, response body: ${n}`)}});function R(e,r="http://localhost:5933/v1/"){const n=({applyTextNormalization:t,languageCode:d,nextRequestIds:y,nextText:g,previousRequestIds:c,previousText:M,pronunciationDictionaryLocators:w,seed:P,voiceSettings:S})=>({extraBody:C({applyTextNormalization:t,languageCode:d,nextRequestIds:y,nextText:g,previousRequestIds:c,previousText:M,pronunciationDictionaryLocators:w?w.map(q=>C(q)):void 0,seed:P,voiceSettings:S!=null?C(S):{similarityBoost:.75,stability:.5}})});return ee({speech:(t,d)=>({...d?n(d):{},apiKey:e,baseURL:r,model:`elevenlabs/${t}`})},{voice:t=>(r.endsWith("v1/")?r=r.slice(0,-3):r.endsWith("v1")&&(r=r.slice(0,-2)),{query:"provider=elevenlabs",...t?n(t):{},apiKey:e,baseURL:r})})}async function Z(e){return(e.fetch??globalThis.fetch)(Ke(e.query?`api/voices?${e.query}`:"api/voices",e.baseURL),{headers:Se({...e.headers},e.apiKey),method:"GET",signal:e.abortSignal}).then(Oe).then(({voices:r})=>r)}function Q(e,r="http://localhost:5933/v1/"){const n=t=>{const{deploymentId:d,region:y,sampleRate:g}=t,c={deploymentId:d,region:y,sampleRate:g};return"disableSsml"in t?c.disableSsml=t.disableSsml:"lang"in t&&(c.lang=t.lang,c.gender=t.gender,c.voice=t.voice),{extraBody:C(c)}};return ee({speech:(t,d)=>({...d?n(d):{},apiKey:e,baseURL:r,model:`microsoft/${t}`})},{voice:t=>(r.endsWith("v1/")?r=r.slice(0,-3):r.endsWith("v1")&&(r=r.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?n(t):{},apiKey:e,baseURL:r})})}const Ce=[{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"}],Be=ce("providers",()=>{const e=de("settings/credentials/providers",{}),{t:r}=ue();async function n(a){try{const i=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${a.apiKey.trim()}`,"Content-Type":"application/json"}});if(!i.ok)throw new Error(`Failed to fetch OpenRouter models: ${i.statusText}`);return(await i.json()).data.map(o=>({id:o.id,name:o.name||o.id,provider:"openrouter-ai",description:o.description||"",contextLength:o.context_length,deprecated:!1}))}catch(i){throw console.error("Error fetching OpenRouter models:",i),i}}const s={"openrouter-ai":{id:"openrouter-ai",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:a=>xe(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>n(a)}},ollama:{id:"ollama",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:a=>T(a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...T(a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))}},vllm:{id:"vllm",nameKey:"settings.pages.providers.provider.vllm.title",name:"vLLM",descriptionKey:"settings.pages.providers.provider.vllm.description",description:"vllm.ai",iconColor:"i-lobe-icons:vllm-color",createProvider:a=>T(a.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}]}},openai:{id:"openai",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:a=>W(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...W(a.apiKey.trim(),a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))}},anthropic:{id:"anthropic",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:a=>be(a.apiKey.trim(),a.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}]}},elevenlabs:{id:"elevenlabs",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:a=>R(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async()=>Ce.map(a=>({id:a.model_id,name:a.name,provider:"elevenlabs",description:a.description,contextLength:0,deprecated:!1})),listVoices:async a=>{const i=R(a.apiKey.trim(),a.baseUrl.trim()),l=await Z({...i.voice()}),o=l.findIndex(b=>b.name.includes("Aria")),_=l.findIndex(b=>b.name.includes("Bill")),U=o!==-1?o:0,F=_!==-1?_:l.length-1,I=Math.min(U,F),z=Math.max(U,F);return[...l.slice(0,I),...l.slice(z+1),...l.slice(I,z+1)].map(b=>({id:b.id,name:b.name,provider:"elevenlabs",previewURL:b.preview_audio_url,languages:b.languages}))}}},xai:{id:"xai",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:a=>X(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...X(a.apiKey.trim(),a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))}},deepseek:{id:"deepseek",nameKey:"settings.pages.providers.provider.deepseek.title",name:"DeepSeek",descriptionKey:"settings.pages.providers.provider.deepseek.description",description:"deepseek.com",iconColor:"i-lobe-icons:deepseek-color",createProvider:a=>N(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...N(a.apiKey.trim(),a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))}},"together-ai":{id:"together-ai",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-color",createProvider:a=>V(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...V(a.apiKey.trim(),a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))}},"novita-ai":{id:"novita-ai",nameKey:"settings.pages.providers.provider.novita.title",name:"Novita",descriptionKey:"settings.pages.providers.provider.novita.description",description:"novita.ai",iconColor:"i-lobe-icons:novita-color",createProvider:a=>J(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...J(a.apiKey.trim(),a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))}},"fireworks-ai":{id:"fireworks-ai",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:a=>D(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...D(a.apiKey.trim(),a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))}},"microsoft-speech":{id:"microsoft-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-color",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:a=>Q(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"v1",name:"v1",provider:"microsoft-speech",description:"",contextLength:0,deprecated:!1}],listVoices:async a=>{const i=Q(a.apiKey.trim(),a.baseUrl.trim());return(await Z({...i.voice({region:a.region})})).map(o=>{var _;return{id:o.id,name:o.name,provider:"microsoft-speech",previewURL:o.preview_audio_url,languages:o.languages,gender:(_=o.labels)==null?void 0:_.gender}})}}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",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-color",createProvider:a=>ke(a.apiKey.trim(),a.accountId),capabilities:{listModels:async()=>[]}},"perplexity-ai":{id:"perplexity-ai",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:a=>we(a.apiKey.trim(),a.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}]}},"mistral-ai":{id:"mistral-ai",nameKey:"settings.pages.providers.provider.mistral.title",name:"Mistral",descriptionKey:"settings.pages.providers.provider.mistral.description",description:"mistral.ai",iconColor:"i-lobe-icons:mistral-color",createProvider:a=>G(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...G(a.apiKey.trim(),a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))}},"moonshot-ai":{id:"moonshot-ai",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:a=>H(a.apiKey.trim(),a.baseUrl.trim()),capabilities:{listModels:async a=>(await f({...H(a.apiKey.trim(),a.baseUrl.trim()).model()})).map(i=>({id:i.id,name:i.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))}}};function v(a){const i=e.value[a];if(!i)return!1;switch(a){case"openrouter-ai":return!!i.apiKey&&!!i.baseUrl;case"ollama":return!!i.baseUrl;case"vllm":return!!i.baseUrl;case"openai":return!!i.apiKey;case"anthropic":return!!i.apiKey;case"elevenlabs":return!!i.apiKey;case"xai":return!!i.apiKey;case"deepseek":return!!i.apiKey;case"together-ai":return!!i.apiKey;case"novita-ai":return!!i.apiKey;case"fireworks-ai":return!!i.apiKey;case"microsoft-speech":return!!i.apiKey&&!!i.region;case"cloudflare-workers-ai":return!!i.apiKey;case"mistral-ai":return!!i.apiKey;case"moonshot-ai":return!!i.apiKey;default:return!1}}const t=O({});function d(a){var i;if(!e.value[a]){const l=s[a];e.value[a]={baseUrl:((i=l.defaultOptions)==null?void 0:i.baseUrl)||""}}}Object.keys(s).forEach(d);function y(){Object.keys(s).forEach(a=>{t.value[a]=v(a)})}y(),pe(e,y,{deep:!0});const g=x(()=>Object.keys(s).filter(a=>t.value[a])),c=O({}),M=O({}),w=O({});async function P(a){const i=e.value[a];if(!i)return[];const l=s[a];if(!l)return[];M.value[a]=!0,w.value[a]=null;try{const o=l.capabilities.listModels?await l.capabilities.listModels(i):[];return c.value[a]=o.map(_=>({id:_.id,name:_.name,description:_.description,contextLength:_.contextLength,deprecated:_.deprecated,provider:a})),c.value[a]}catch(o){return console.error(`Error fetching models for ${a}:`,o),w.value[a]=o instanceof Error?o.message:"Unknown error",[]}finally{M.value[a]=!1}}function S(a){return c.value[a]||[]}const q=x(()=>{const a=[];for(const i of g.value)a.push(...c.value[i]||[]);return a});async function ae(){for(const a of g.value)s[a].capabilities.listModels&&await P(a)}function L(a){const i=s[a];if(!i)throw new Error(`Provider metadata for ${a} not found`);return{...i,localizedName:r(i.nameKey,i.name),localizedDescription:r(i.descriptionKey,i.description)}}const re=x(()=>Object.values(s).map(a=>({...a,localizedName:r(a.nameKey,a.name),localizedDescription:r(a.descriptionKey,a.description),configured:t.value[a.id]||!1})));function K(a){const i=e.value[a];if(!i)throw new Error(`Provider credentials for ${a} not found`);const l=s[a];if(!l)throw new Error(`Provider metadata for ${a} not found`);try{return l.createProvider(i)}catch(o){throw console.error(`Error creating provider instance for ${a}:`,o),o}}const E=x(()=>g.value.map(a=>L(a))),ie=x(()=>E.value.filter(a=>{const i=K(a.id);return"chat"in i&&typeof i.chat=="function"})),ne=x(()=>E.value.filter(a=>{const i=K(a.id);return"transcription"in i&&typeof i.transcription=="function"})),te=x(()=>E.value.filter(a=>{const i=K(a.id);return"speech"in i&&typeof i.speech=="function"}));function se(a){return e.value[a]}return{providers:e,getProviderConfig:se,availableProviders:g,configuredProviders:t,providerMetadata:s,getProviderMetadata:L,allProvidersMetadata:re,initializeProvider:d,validateProvider:v,availableModels:c,isLoadingModels:M,modelLoadError:w,fetchModelsForProvider:P,getModelsForProvider:S,allAvailableModels:q,loadModelsForConfiguredProviders:ae,getProviderInstance:K,availableProvidersMetadata:E,availableTextGenerationsProvidersMetadata:ie,availableAudioSpeechProvidersMetadata:te,availableAudioTranscriptionProvidersMetadata:ne}});export{ge as a,je as b,Y as c,he as d,f as l,_e as r,Be as u}; diff --git a/assets/queue-DRKK1rL_.js b/assets/queue-DCQeV-U1.js similarity index 91% rename from assets/queue-DRKK1rL_.js rename to assets/queue-DCQeV-U1.js index 5d713ca544b7a8342946f71a5e0c5a7afc02820e..1ce3137b4b145fcf9e36c73811bf2d5cf23cb454 100644 --- a/assets/queue-DRKK1rL_.js +++ b/assets/queue-DCQeV-U1.js @@ -1 +1 @@ -import{g as l}from"./index-BYewP6KR.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function g(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=g();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; +import{g as l}from"./index-CL4rmUJ-.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function g(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=g();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; diff --git a/assets/queue-BTScdVVl.js b/assets/queue-DOUpDv6R.js similarity index 90% rename from assets/queue-BTScdVVl.js rename to assets/queue-DOUpDv6R.js index cdb61f32811f6b38bdd23249f9ce6b734722f1a3..db672f33649242f1b4757c22f7f891ec2d39e051 100644 --- a/assets/queue-BTScdVVl.js +++ b/assets/queue-DOUpDv6R.js @@ -1 +1 @@ -import{u as o}from"./queue-DRKK1rL_.js";import{d as v,g as h,l as g,c as k,o as w,a as I}from"./index-BYewP6KR.js";const Q=v({__name:"queue",setup(P){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),l=o({handlers:[async e=>{const a=[".","?","!"];let s=!1;for(const t of a){if(!e.data.includes(t))continue;const r=e.data.indexOf(t),p=e.data.slice(0,r+1),y=e.data.slice(r+1);n.value+=p,u.add(n.value.trim()),n.value=y,s=!0}s||(n.value+=e.data)}]}),c=["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","?"];async function f(){for(const e of c)await i(100),l.add(e)}async function m(){f()}return g(()=>{m()}),(e,a)=>(w(),k("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; +import{u as o}from"./queue-DCQeV-U1.js";import{d as v,g as h,l as g,c as k,o as w,a as I}from"./index-CL4rmUJ-.js";const Q=v({__name:"queue",setup(P){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),l=o({handlers:[async e=>{const a=[".","?","!"];let s=!1;for(const t of a){if(!e.data.includes(t))continue;const r=e.data.indexOf(t),p=e.data.slice(0,r+1),y=e.data.slice(r+1);n.value+=p,u.add(n.value.trim()),n.value=y,s=!0}s||(n.value+=e.data)}]}),c=["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","?"];async function f(){for(const e of c)await i(100),l.add(e)}async function m(){f()}return g(()=>{m()}),(e,a)=>(w(),k("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; diff --git a/assets/queues-Cj51JWdx.js b/assets/queues-D3Ic2N1b.js similarity index 89% rename from assets/queues-Cj51JWdx.js rename to assets/queues-D3Ic2N1b.js index 8f9c57e62d45adcfc62dc2c161f2a500d53776b3..660a95923aca6ec7bd01634e9043bb528e2db1ee 100644 --- a/assets/queues-Cj51JWdx.js +++ b/assets/queues-D3Ic2N1b.js @@ -1 +1 @@ -import{d as m,bK as p,bL as v,g as u,w as y,A as k,bF as w,o as b,c as h,n as M}from"./index-BYewP6KR.js";import{j as f}from"./live2d-zip-loader-CvpgOHsT.js";import{u as l}from"./queue-DRKK1rL_.js";const D=m({__name:"BasicTextarea",props:{modelValue:{default:""},modelModifiers:{}},emits:p(["submit"],["update:modelValue"]),setup(o,{emit:n}){const e=n,t=v(o,"modelValue"),a=u(),s=u("auto");function i(r){r.code==="Enter"&&!r.shiftKey&&(r.preventDefault(),e("submit",t.value))}return y(t,()=>{s.value="auto",requestAnimationFrame(()=>{a.value&&(s.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(r,d)=>k((b(),h("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":d[0]||(d[0]=c=>t.value=c),style:M({height:s.value}),onKeydown:i},null,36)),[[w,t.value]])}}),E="<|llm_inference_end|>";function A(o){function n(e){for(const t of f)if(e.includes(t))return{ok:!0,emotion:t};return{ok:!1,emotion:""}}return l({handlers:[async e=>{if(f.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:t,emotion:a}=n(e.data);t&&(e.emit("emotion",a),await o.add(a))}}]})}function N(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const t=/<\|DELAY:(\d+)\|>/i.exec(e),a=t==null?void 0:t[1];if(!a)return{ok:!1,delay:0};const s=Number.parseFloat(a);return s<=0||Number.isNaN(s)?{ok:!0,delay:0}:{ok:!0,delay:s}}function n(e){return new Promise(t=>setTimeout(t,e))}return l({handlers:[async e=>{const{ok:t,delay:a}=o(e.data);t&&(e.emit("delay",a),await n(a*1e3))}]})}function T(o){const n=u("");return l({handlers:[async e=>{if(e.data===E){const a=n.value.trim();a&&await o.add(a),n.value="";return}const t=/[.?!]/;for(n.value+=e.data;n.value;){const a=t.exec(n.value);if(!a||typeof a.index>"u")break;const s=n.value.slice(0,a.index+1),i=n.value.slice(a.index+1);await o.add(s),n.value=i}}]})}export{D as _,A as a,N as b,E as l,T as u}; +import{d as m,bK as p,bL as v,g as u,w as y,A as k,bF as w,o as b,c as h,n as M}from"./index-CL4rmUJ-.js";import{j as f}from"./live2d-zip-loader-DFrBymqv.js";import{u as l}from"./queue-DCQeV-U1.js";const D=m({__name:"BasicTextarea",props:{modelValue:{default:""},modelModifiers:{}},emits:p(["submit"],["update:modelValue"]),setup(o,{emit:n}){const e=n,t=v(o,"modelValue"),a=u(),s=u("auto");function i(r){r.code==="Enter"&&!r.shiftKey&&(r.preventDefault(),e("submit",t.value))}return y(t,()=>{s.value="auto",requestAnimationFrame(()=>{a.value&&(s.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(r,d)=>k((b(),h("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":d[0]||(d[0]=c=>t.value=c),style:M({height:s.value}),onKeydown:i},null,36)),[[w,t.value]])}}),E="<|llm_inference_end|>";function A(o){function n(e){for(const t of f)if(e.includes(t))return{ok:!0,emotion:t};return{ok:!1,emotion:""}}return l({handlers:[async e=>{if(f.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:t,emotion:a}=n(e.data);t&&(e.emit("emotion",a),await o.add(a))}}]})}function N(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const t=/<\|DELAY:(\d+)\|>/i.exec(e),a=t==null?void 0:t[1];if(!a)return{ok:!1,delay:0};const s=Number.parseFloat(a);return s<=0||Number.isNaN(s)?{ok:!0,delay:0}:{ok:!0,delay:s}}function n(e){return new Promise(t=>setTimeout(t,e))}return l({handlers:[async e=>{const{ok:t,delay:a}=o(e.data);t&&(e.emit("delay",a),await n(a*1e3))}]})}function T(o){const n=u("");return l({handlers:[async e=>{if(e.data===E){const a=n.value.trim();a&&await o.add(a),n.value="";return}const t=/[.?!]/;for(n.value+=e.data;n.value;){const a=t.exec(n.value);if(!a||typeof a.index>"u")break;const s=n.value.slice(0,a.index+1),i=n.value.slice(a.index+1);await o.add(s),n.value=i}}]})}export{D as _,A as a,N as b,E as l,T as u}; diff --git a/assets/speech-CLmksxkl.js b/assets/speech-Ae5ywnpY.js similarity index 98% rename from assets/speech-CLmksxkl.js rename to assets/speech-Ae5ywnpY.js index e9135dba285c5d5b88b5989d002886838870e8d9..61a786077adc1e94a5dcd8fe24a1b930265761a7 100644 --- a/assets/speech-CLmksxkl.js +++ b/assets/speech-Ae5ywnpY.js @@ -1,2 +1,2 @@ -import{f as oe,bI as h,g as S,h as m,w as q,l as ie}from"./index-BYewP6KR.js";import{r as ce,a as le,b as ue,d as de,u as me}from"./providers-CFIOZO6n.js";const ge=async e=>(e.fetch??globalThis.fetch)(ce("audio/speech",e.baseURL),{body:ue(e),headers:le({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(de).then(async t=>t.arrayBuffer()),pe=/["&'<>`]/g,he=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,fe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ve=/[|\\{}()[\]^$+*?.]/g,j=new WeakMap;function z(e,t){if(e=e.replace(t.subset?ye(t.subset):pe,n),t.subset||t.escapeOnly)return e;return e.replace(he,r).replace(fe,n);function r(a,o,u){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,u.charCodeAt(o+2),t)}function n(a,o,u){return t.format(a.charCodeAt(0),u.charCodeAt(o+1),t)}}function ye(e){let t=j.get(e);return t||(t=Se(e),j.set(e,t)),t}function Se(e){const t=[];let r=-1;for(;++r",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Oe=["cent","copy","divide","gt","lt","not","para","times"],B={}.hasOwnProperty,R={};let b;for(b in M)B.call(M,b)&&(R[M[b]]=b);const Pe=/[^\dA-Za-z]/;function qe(e,t,r,n){const a=String.fromCharCode(e);if(B.call(R,a)){const o=R[a],u="&"+o;return r&&Ee.includes(o)&&!Oe.includes(o)&&(!n||t&&t!==61&&Pe.test(String.fromCharCode(t)))?u:u+";"}return""}function Me(e,t,r){let n=Ae(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=qe(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const o=we(e,t,r.omitOptionalSemicolons);o.length/g,Ue=[">"];function $e(e){return""+y(e.value,Ue,Fe)+""}function je(e){return""}const Ne=[" ",` +import{f as oe,bI as h,g as S,h as m,w as q,l as ie}from"./index-CL4rmUJ-.js";import{r as ce,a as le,b as ue,d as de,u as me}from"./providers-BHCrT0RZ.js";const ge=async e=>(e.fetch??globalThis.fetch)(ce("audio/speech",e.baseURL),{body:ue(e),headers:le({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(de).then(async t=>t.arrayBuffer()),pe=/["&'<>`]/g,he=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,fe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ve=/[|\\{}()[\]^$+*?.]/g,j=new WeakMap;function z(e,t){if(e=e.replace(t.subset?ye(t.subset):pe,n),t.subset||t.escapeOnly)return e;return e.replace(he,r).replace(fe,n);function r(a,o,u){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,u.charCodeAt(o+2),t)}function n(a,o,u){return t.format(a.charCodeAt(0),u.charCodeAt(o+1),t)}}function ye(e){let t=j.get(e);return t||(t=Se(e),j.set(e,t)),t}function Se(e){const t=[];let r=-1;for(;++r",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Oe=["cent","copy","divide","gt","lt","not","para","times"],B={}.hasOwnProperty,R={};let b;for(b in M)B.call(M,b)&&(R[M[b]]=b);const Pe=/[^\dA-Za-z]/;function qe(e,t,r,n){const a=String.fromCharCode(e);if(B.call(R,a)){const o=R[a],u="&"+o;return r&&Ee.includes(o)&&!Oe.includes(o)&&(!n||t&&t!==61&&Pe.test(String.fromCharCode(t)))?u:u+";"}return""}function Me(e,t,r){let n=Ae(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=qe(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const o=we(e,t,r.omitOptionalSemicolons);o.length/g,Ue=[">"];function $e(e){return""+y(e.value,Ue,Fe)+""}function je(e){return""}const Ne=[" ",` `," ",'"',"&","'","/","<","=",">"];function A(e){return y(e,Ne)}function N(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,a=r.indexOf(t);for(;a!==-1;)n++,a=r.indexOf(t,a+t.length);return n}function T(e,t){const r=String(e);let n=t.options.quote||'"';if(t.options.quoteSmart){const a=n==='"'?"'":'"';N(r,n)>N(r,a)&&(n=a)}return n+y(r,["<","&",n])+n}function ke(e,t){const r=A(e.name),n=e.public,a=e.system;let o=""}const De={}.hasOwnProperty;function Ie(e,t){const r=A(e.name),n=K(e,t),a=e.attributes||{},o=n?!1:t.options.closeEmptyElements,u=[];let f;for(f in a)if(De.call(a,f)){const p=a[f];p!=null&&u.push(A(f)+"="+T(p,t))}return"<"+r+(u.length===0?"":" "+u.join(" "))+(o?(t.options.tightClose?"":" ")+"/":"")+">"+n+(o?"":"")}const ze=/\?>/g,Be=[">"];function Ve(e){const t=A(e.name)||"x",r=y(e.value,Be,ze);return""}const He=["&","<"];function V(e){return y(e.value,He)}function Ke(e,t){return t.options.allowDangerousXml?e.value:V(e)}const Ye={}.hasOwnProperty,k={cdata:$e,comment:je,doctype:ke,element:Ie,instruction:Ve,raw:Ke,root:K,text:V};function H(e,t){const r=e&&e.type;if(!r)throw new Error("Expected node, not `"+e+"`");if(!Ye.call(k,r))throw new Error("Cannot compile unknown node `"+r+"`");const n=k[r];return n(e,t)}function K(e,t){const r=e&&e.children||[];let n=-1;const a=[];for(;++n{const e=me(),t=h("settings/speech/active-provider",""),r=h("settings/speech/active-model","eleven_multilingual_v2"),n=h("settings/speech/voice",""),a=S(),o=h("settings/speech/pitch",0),u=h("settings/speech/rate",1),f=h("settings/speech/ssml-enabled",!1),p=S(!1),x=S(null),v=S({}),U=h("settings/speech/language","en-US"),w=S(""),Y=m(()=>e.availableProviders.filter(s=>O(s)).map(s=>e.getProviderMetadata(s))),G=m(()=>{var s;return((s=e.getProviderMetadata(t.value))==null?void 0:s.capabilities.listModels)!==void 0}),E=m(()=>e.getModelsForProvider(t.value)),X=m(()=>e.isLoadingModels[t.value]||!1),Z=m(()=>e.modelLoadError[t.value]||null),_=m(()=>{if(!w.value.trim())return E.value;const s=w.value.toLowerCase().trim();return E.value.filter(i=>i.name.toLowerCase().includes(s)||i.id.toLowerCase().includes(s)||i.description&&i.description.toLowerCase().includes(s))}),Q=m(()=>["elevenlabs","microsoft-speech","azure-speech","google"].includes(t.value)),W=m(()=>Object.keys(L)),J=m(()=>{const s=U.value;return!s||!L[s]?[]:L[s].map(i=>({id:Ze[i],name:i,provider:"elevenlabs",language:s}))});function O(s){return["elevenlabs","microsoft-speech","azure-speech","google","amazon"].includes(s)}async function P(s){var i,c;if(!s||!O(s))return[];p.value=!0,x.value=null;try{const l=await((c=(i=e.getProviderMetadata(s).capabilities).listVoices)==null?void 0:c.call(i,e.getProviderConfig(s)))||[];return v.value[s]=l,l}catch(l){return console.error(`Error fetching voices for ${s}:`,l),x.value=l instanceof Error?l.message:"Unknown error",[]}finally{p.value=!1}}function ee(s){return v.value[s]||[]}q(t,async s=>{s&&await P(s)}),ie(()=>{P(t.value).then(()=>{var s;n.value&&(a.value=(s=v.value[t.value])==null?void 0:s.find(i=>i.id===n.value))})}),q(n,s=>{var i;s&&(a.value=(i=v.value[t.value])==null?void 0:i.find(c=>c.id===s))},{immediate:!0}),q(v,s=>{var i;n.value&&(a.value=(i=s[t.value])==null?void 0:i.find(c=>c.id===n.value))},{immediate:!0});async function te(s,i,c,l,g={}){return await ge({...s.speech(i,{...g}),input:c,voice:l})}function re(s,i,c){var $;const l=c==null?void 0:c.pitch,g=c==null?void 0:c.speed,d=c==null?void 0:c.volume,ne={pitch:l!=null?l>0?`+${l}%`:`-${l}%`:void 0,rate:g!=null?g!==1?`${g}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},ae=C("speak",{version:"1.0",xmlns:"http://www.w3.org/2001/10/synthesis","xml:lang":(($=i.languages[0])==null?void 0:$.code)||"en-US"},[C("voice",{name:i.id,gender:i.gender||"neutral"},[Object.entries(ne).filter(([_e,se])=>se!=null).length>0?C("prosody",{pitch:l!=null?l>0?`+${l}%`:`-${l}%`:void 0,rate:g!=null?g!==1?`${g}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},[s]):s])]);return Ge(ae)}return{activeSpeechProvider:t,activeSpeechModel:r,activeSpeechVoice:a,activeSpeechVoiceId:n,pitch:o,rate:u,ssmlEnabled:f,selectedLanguage:U,isLoadingSpeechProviderVoices:p,speechProviderError:x,availableVoices:v,modelSearchQuery:w,availableSpeechProvidersMetadata:Y,supportsSSML:Q,availableLanguages:W,availableVoicesForLanguage:J,supportsModelListing:G,providerModels:E,isLoadingActiveProviderModels:X,activeProviderModelError:Z,filteredModels:_,speech:te,loadVoicesForProvider:P,getVoicesForProvider:ee,generateSSML:re,isSpeechProvider:O}});export{N as c,ge as g,Je as s,et as u}; diff --git a/assets/speech-g41aUB8v.js b/assets/speech-DqVeJv2L.js similarity index 98% rename from assets/speech-g41aUB8v.js rename to assets/speech-DqVeJv2L.js index 2540ec4d8bf3595e173cc565a8a5f204bdb7b0b6..4b57eaf0a19c9202e5d627040172235da11e9869 100644 --- a/assets/speech-g41aUB8v.js +++ b/assets/speech-DqVeJv2L.js @@ -1 +1 @@ -import{d as O,g as V,l as ne,w as Z,m as ie,c as i,o as n,bx as H,by as K,a as e,n as me,z as C,bK as Y,bL as J,A as j,bA as pe,C as $,D as k,b as S,y as I,bn as ee,h as fe,c7 as ge,bF as W,x as X,q as xe,s as le,bE as be,H as he,bw as ye,e as t,bo as ke,ad as N,bG as we}from"./index-BYewP6KR.js";import{_ as oe,a as ae,b as _e}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-CGhOEjXF.js";import{_ as Se}from"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import{R as Ve,a as Me}from"./RadioCardDetailManySelect-ConUGerY.js";import{_ as Ce}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import{_ as $e}from"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";import"./live2d-zip-loader-CvpgOHsT.js";import{u as Pe}from"./providers-CFIOZO6n.js";import{u as Ue,g as Le}from"./speech-CLmksxkl.js";import{b as re}from"./route-block-B_A1xBdJ.js";const qe=O({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(o){const l=o,x=V(Array.from({length:l.bars}).fill(0));ne(()=>{p()}),Z(()=>l.stream,()=>{p()});function p(){if(!l.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),g=c.createMediaStreamSource(l.stream),v=c.createAnalyser();v.fftSize=2048,g.connect(v);const b=v.frequencyBinCount,M=new Uint8Array(b),f=c.sampleRate/v.fftSize,w=Math.floor(l.minFreq/f),P=Math.floor(l.maxFreq/f),L=P-w,A=Math.floor(L/l.bars),E=()=>{try{requestAnimationFrame(E),v.getByteFrequencyData(M);const q=Array.from({length:l.bars}).fill(0);for(let T=0;Tie(c.$slots,"default",{frequencies:x.value})}}),Ae={"h-full":"",flex:"","items-center":"","gap-1":""},Re=5,Ee=O({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(o){const l=o;function x(c,g){return .1+(1-.1)*(c/g)}function p(c,g){const v=x(g,l.frequencies.length);return Math.min(100,Math.max(10,c*100*Re*v))}return(c,g)=>(n(),i("div",Ae,[(n(!0),i(H,null,K(o.frequencies,(v,b)=>(n(),i("div",{key:b,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:C(o.barsClass),style:me({height:`${p(v,b)}%`})},null,6)]))),128))]))}}),Te={class:"p-3"},ze={class:"flex items-start"},Be=["checked","name","value"],Fe={class:"relative mr-3 mt-0.5 flex-shrink-0"},Ne={key:0,class:"i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ie={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},De={key:1,class:"mt-auto w-full flex items-center justify-center bg-neutral-50 py-3 text-xs text-neutral-400 italic dark:bg-neutral-800/50 dark:text-neutral-600"},je={class:"flex-1 cursor-pointer"},Oe={class:"flex items-center"},Qe={key:0,class:"mt-1 flex flex-wrap gap-1"},He={key:1,class:"mt-3"},Ge={relative:""},Je={key:0,class:"h-16 px-3 pb-2"},Ke=O({__name:"VoiceCard",props:Y({name:null,voice:null,currentlyPlayingId:null,customInputPlaceholder:{default:"Enter custom voice name"},showVisualizer:{type:Boolean,default:!0},audioStream:{default:null}},{"voice-id":{required:!1,default:""},"voice-idModifiers":{},"custom-voice-name":{required:!1,default:""},"custom-voice-nameModifiers":{}}),emits:Y(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(o,{emit:l}){const x=o,p=l,c=J(o,"voice-id"),g=J(o,"custom-voice-name");function v(h){return h.previewURL||h.preview_audio_url}function b(h){var w,P,L;const f=[];if((w=h.labels)!=null&&w.gender&&f.push(h.labels.gender),(P=h.labels)!=null&&P.age&&f.push(h.labels.age),(L=h.labels)!=null&&L.accent&&f.push(h.labels.accent),h.languages&&h.languages.length>0){const A=h.languages.map(E=>E.name).join(", ");f.push(A)}return f}function M(){p("togglePlayback",x.voice)}return(h,f)=>(n(),i("label",{border:"2px solid",class:C(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[c.value===x.voice.id?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",c.value===x.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Te,[e("div",ze,[j(e("input",{"onUpdate:modelValue":f[0]||(f[0]=w=>c.value=w),checked:c.value===x.voice.id,type:"radio",name:o.name,value:x.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,Be),[[pe,c.value]]),e("div",Fe,[e("div",{class:C(["size-5 border-2 rounded-full transition-colors duration-200",[c.value===x.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:C(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[c.value===x.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),v(o.voice)?(n(),i("button",{key:0,absolute:"","right-0":"",top:"0","z-100":"",class:C(["translate-x-[-50%] translate-y-[50%]",[o.currentlyPlayingId===o.voice.id?"text-white dark:text-white":""]]),onClick:M},[o.currentlyPlayingId===o.voice.id?(n(),i("div",Ne)):(n(),i("div",Ie))],2)):(n(),i("div",De," No preview available ")),e("div",je,[e("div",Oe,[e("span",{class:C(["line-clamp-1 font-medium",[c.value===o.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},k(o.voice.name),3)]),b(o.voice).length>0?(n(),i("div",Qe,[(n(!0),i(H,null,K(b(o.voice),(w,P)=>(n(),i("span",{key:P,class:C(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===o.voice.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400":"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"]])},k(w),3))),128))])):$("",!0),o.voice.customizable&&c.value===o.voice.id?(n(),i("div",He,[S($e,{modelValue:g.value,"onUpdate:modelValue":f[1]||(f[1]=w=>g.value=w),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:o.customInputPlaceholder},null,8,["modelValue","placeholder"])])):$("",!0),o.voice.description?(n(),i("div",{key:2,class:C(["line-clamp-2 mt-1 text-xs",[c.value===o.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},k(o.voice.description),3)):$("",!0)])])]),e("div",Ge,[S(Ce,null,{default:I(()=>[o.showVisualizer&&o.currentlyPlayingId===o.voice.id&&o.audioStream?(n(),i("div",Je,[S(qe,{stream:o.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:I(({frequencies:w})=>[S(Ee,{frequencies:w,"bars-class":c.value===o.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):$("",!0)]),_:1})])],2))}}),Ye=ee(Ke,[["__scopeId","data-v-dbab964e"]]),We={class:"voice-preview-player"},Xe={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Ze=["placeholder"],et={class:"mt-4 space-y-2"},tt={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},st={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},lt={class:"flex flex-col"},ot={class:"font-medium"},at={class:"text-sm text-amber-600 dark:text-amber-400"},rt={class:"relative"},nt=O({__name:"VoiceCardManySelect",props:Y({voices:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search voices..."},searchNoResultsTitle:{default:"No voices found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} voices"},customInputPlaceholder:{default:"Enter custom voice name"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},playButtonText:{default:"Play sample"},pauseButtonText:{default:"Pause"},showVisualizer:{type:Boolean,default:!0}},{"search-query":{required:!1,default:""},"search-queryModifiers":{},"voice-id":{required:!1,default:""},"voice-idModifiers":{}}),emits:["update:search-query","update:voice-id"],setup(o){const l=o,x=V(!1),p=V(),c=V(new Map),g=V(new Map),v=V(new Map),b=V(new Map),M=V(null);function h(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const f=J(o,"search-query"),w=J(o,"voice-id"),P=fe(()=>{if(!f.value)return l.voices;const a=f.value.toLowerCase();return l.voices.filter(r=>{const d=r.name.toLowerCase().includes(a),m=r.description&&r.description.toLowerCase().includes(a),_=r.tags&&r.tags.some(y=>y.toLowerCase().includes(a)),U=r.labels&&Object.values(r.labels).some(y=>typeof y=="string"&&y.toLowerCase().includes(a)),B=r.languages&&r.languages.some(y=>y.name.toLowerCase().includes(a)||y.code.toLowerCase().includes(a));return d||m||_||U||B})});function L(a){return a.previewURL||a.preview_audio_url}function A(a){const r=L(a);if(!r)return null;if(c.value.has(a.id))return c.value.get(a.id)||null;const d=new Audio(r);return d.crossOrigin="anonymous",d.preload="auto",d.addEventListener("ended",()=>{if(p.value===a.id){p.value=void 0;const m=g.value.get(a.id);m&&(m.getTracks().forEach(_=>_.stop()),g.value.delete(a.id))}}),c.value.set(a.id,d),d}function E(a,r){try{if(g.value.has(r))return g.value.get(r)||null;const d=h();if(b.value.has(r)){const B=b.value.get(r),y=d.createMediaStreamDestination();B.connect(y);const F=y.stream;return g.value.set(r,F),F}const m=d.createMediaElementSource(a);b.value.set(r,m),m.connect(d.destination);const _=d.createMediaStreamDestination();m.connect(_);const U=_.stream;return g.value.set(r,U),U}catch(d){return console.error("Failed to create audio stream for visualizer:",d),null}}function q(a){try{if(!L(a))return;const d=A(a);if(!d)return;if(p.value===a.id){d.pause(),p.value=void 0;const m=g.value.get(a.id);m&&(m.getTracks().forEach(_=>_.stop()),g.value.delete(a.id));return}if(p.value){const m=c.value.get(p.value);m&&m.pause();const _=g.value.get(p.value);_&&(_.getTracks().forEach(U=>U.stop()),g.value.delete(p.value))}l.showVisualizer&&!g.value.has(a.id)&&E(d,a.id),d.currentTime=0,d.play().catch(m=>{console.error("Failed to play audio:",m)}),p.value=a.id}catch(r){console.error(r),p.value=void 0}}function T(){c.value.forEach(a=>{a.pause(),a.src=""}),c.value.clear(),g.value.forEach(a=>{a.getTracks().forEach(r=>r.stop())}),g.value.clear(),v.value.forEach(a=>{a.state!=="closed"&&a.close()}),v.value.clear(),b.value.clear(),p.value=void 0}Z(f,()=>{if(p.value){const a=c.value.get(p.value);a&&a.pause();const r=g.value.get(p.value);r&&(r.getTracks().forEach(d=>d.stop()),g.value.delete(p.value)),p.value=void 0}}),ge(T);const z=V("");return(a,r)=>(n(),i("div",We,[o.searchable?(n(),i("div",Xe,[r[4]||(r[4]=e("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[e("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),j(e("input",{"onUpdate:modelValue":r[0]||(r[0]=d=>f.value=d),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:o.searchPlaceholder},null,8,Ze),[[W,f.value]])])):$("",!0),e("div",et,[f.value?(n(),i("div",tt,k(o.searchResultsText.replace("{count}",P.value.length.toString()).replace("{total}",o.voices.length.toString())),1)):$("",!0),f.value&&P.value.length===0?(n(),i("div",st,[r[5]||(r[5]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",lt,[e("span",ot,k(o.searchNoResultsTitle),1),e("span",at,k(o.searchNoResultsDescription.replace("{query}",f.value)),1)])])):$("",!0),e("div",rt,[e("div",{class:C(["scrollbar-hide grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto",[x.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(n(!0),i(H,null,K(P.value,d=>(n(),X(Ye,{key:d.id,"voice-id":w.value,"onUpdate:voiceId":r[1]||(r[1]=m=>w.value=m),"custom-voice-name":z.value,"onUpdate:customVoiceName":r[2]||(r[2]=m=>z.value=m),name:"voice",voice:d,"currently-playing-id":p.value,"custom-input-placeholder":o.customInputPlaceholder,"show-visualizer":o.showVisualizer,"audio-stream":g.value.get(d.id),onTogglePlayback:q},null,8,["voice-id","custom-voice-name","voice","currently-playing-id","custom-input-placeholder","show-visualizer","audio-stream"]))),128))],2),e("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:C([x.value?"w-full":"mt-4 w-full rounded-lg"])},[e("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:C([x.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:r[3]||(r[3]=d=>x.value=!x.value)},[e("span",null,k(x.value?o.collapseButtonText:o.expandButtonText),1),e("div",{class:C([x.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),it=ee(nt,[["__scopeId","data-v-070104a7"]]),ut=O({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(o){const l=o;return(x,p)=>(n(),i("div",{class:C(["skeleton",l.animation!=="none"?`skeleton-${l.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[ie(x.$slots,"default",{},void 0,!0)],2))}}),Q=ee(ut,[["__scopeId","data-v-f404da2a"]]),dt={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},ct={relative:""},vt={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},mt={text:"neutral-300 dark:neutral-500","text-nowrap":""},pt={"text-nowrap":"","text-3xl":"","font-semibold":""},ft={flex:"~ col md:row gap-6"},gt={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},xt={flex:"~ col gap-4"},bt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},ht={text:"neutral-400 dark:neutral-500"},yt={"max-w-full":""},kt={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},wt={key:1},_t={key:0},St={flex:"~ col gap-4"},Vt={class:"text-lg md:text-2xl"},Mt={text:"neutral-400 dark:neutral-400"},Ct={key:0,class:"flex items-center justify-center py-4"},$t={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},Pt={class:"flex flex-col"},Ut={class:"font-medium"},Lt={class:"text-sm text-red-600 dark:text-red-400"},qt={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},At={class:"flex flex-col"},Rt={class:"font-medium"},Et={class:"text-sm text-amber-600 dark:text-amber-400"},Tt={key:0},zt={flex:"~ col gap-4"},Bt={key:0},Ft={class:"flex flex-col gap-4"},Nt={flex:"~ row gap-4"},It={key:1,class:"space-y-6"},Dt={key:2,class:"flex items-center gap-3 border border-2 border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},jt={class:"flex flex-col"},Ot={class:"text-sm text-red-600 dark:text-red-400"},Qt={key:3,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},Ht={flex:"~ col gap-4"},Gt={key:4,class:"mt-2 space-y-6"},Jt={key:0},Kt={flex:"~ col gap-4"},Yt={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Wt={"w-full":"","rounded-xl":""},Xt={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Zt={class:"inline-flex items-center gap-4"},es={flex:"~ col gap-4"},ts=["placeholder"],ss={flex:"~ row","gap-4":""},ls=["disabled"],os={flex:"~ row","items-center":"","gap-2":""},as=["src"],rs=O({__name:"speech",setup(o){const{t:l}=xe(),x=Pe(),p=Ue(),{availableProviders:c,availableAudioSpeechProvidersMetadata:g}=le(x),{activeSpeechProvider:v,activeSpeechModel:b,activeSpeechVoice:M,activeSpeechVoiceId:h,pitch:f,isLoadingSpeechProviderVoices:w,supportsModelListing:P,providerModels:L,isLoadingActiveProviderModels:A,activeProviderModelError:E,modelSearchQuery:q,speechProviderError:T,ssmlEnabled:z,availableVoices:a}=le(p),r=be(),d=V(""),m=V(!1),_=V("Hello, my name is AI Assistant"),U=V(""),B=V(!1),y=V(""),F=V(null),te=V("");ne(async()=>{await p.loadVoicesForProvider(v.value),await x.loadModelsForConfiguredProviders()}),Z(v,async()=>{await p.loadVoicesForProvider(v.value),await x.loadModelsForConfiguredProviders()});async function ue(){if(!_.value.trim()&&!m.value||m.value&&!U.value.trim())return;if(!b.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const R=x.getProviderInstance(v.value);if(!R){console.error("Failed to initialize speech provider");return}const s=x.getProviderConfig(v.value);B.value=!0,te.value="";try{y.value&&se();const D=m.value?U.value:p.generateSSML(_.value,M.value,{...s,pitch:f.value}),G=await Le({...R.speech(b.value,s),input:D,voice:M.value.id});y.value=URL.createObjectURL(new Blob([G])),setTimeout(()=>{F.value&&F.value.play()},100)}catch(D){console.error("Error generating speech:",D),te.value=D instanceof Error?D.message:"An unknown error occurred"}finally{B.value=!1}}function se(){F.value&&(F.value.pause(),F.value.currentTime=0),y.value&&(URL.revokeObjectURL(y.value),y.value="")}he(()=>{y.value&&URL.revokeObjectURL(y.value)});function de(R){M.value={id:R,name:R,description:R,previewURL:R,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function ce(R){b.value=R}return(R,s)=>{var G;const D=ye("motion");return n(),i(H,null,[j((n(),i("div",dt,[e("button",{onClick:s[0]||(s[0]=u=>t(r).back())},s[14]||(s[14]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-xl":""},null,-1)])),e("h1",ct,[e("div",vt,[e("span",mt,k(t(l)("settings.pages.modules.title")),1)]),e("div",pt,k(t(l)("settings.pages.modules.speech.title")),1)])])),[[D]]),e("div",ft,[e("div",gt,[e("div",null,[e("div",xt,[e("div",null,[e("h2",bt,k(t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",ht,[e("span",null,k(t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",yt,[t(c).length>0?(n(),i("fieldset",kt,[(n(!0),i(H,null,K(t(g),u=>(n(),X(t(Me),{id:u.id,key:u.id,modelValue:t(v),"onUpdate:modelValue":s[1]||(s[1]=ve=>N(v)?v.value=ve:null),name:"speech-provider",value:u.id,title:u.localizedName,description:u.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(n(),i("div",wt,[S(t(ke),{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:I(()=>s[15]||(s[15]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Speech Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your speech providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])]),e("div",null,[t(v)&&t(P)?(n(),i("div",_t,[e("div",St,[e("div",null,[e("h2",Vt,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",Mt,[e("span",null,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(A)?(n(),i("div",Ct,[s[16]||(s[16]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(E)?(n(),i("div",$t,[s[17]||(s[17]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",Pt,[e("span",Ut,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Lt,k(t(E)),1)])])):t(L).length===0&&!t(A)?(n(),i("div",qt,[s[18]||(s[18]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",At,[e("span",Rt,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Et,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(L).length>0?(n(),X(t(Ve),{key:3,modelValue:t(b),"onUpdate:modelValue":s[2]||(s[2]=u=>N(b)?b.value=u:null),"search-query":t(q),"onUpdate:searchQuery":s[3]||(s[3]=u=>N(q)?q.value=u:null),items:t(L),searchable:!0,"search-placeholder":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(q)}),"search-results-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":ce},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)])]),t(v)?(n(),i("div",Tt,[e("div",zt,[s[29]||(s[29]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Configuration "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Customize how your AI assistant speaks")])],-1)),t(w)?(n(),i("div",Bt,[e("div",Ft,[S(t(Q),{class:"w-full rounded-lg p-2.5 text-sm"},{default:I(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),e("div",Nt,[S(t(Q),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),S(t(Q),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),S(t(Q),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[22]||(s[22]=[e("div",{class:"h-1lh"},null,-1)])),_:1})]),S(t(Q),{class:"w-full rounded-lg p-3 text-sm"},{default:I(()=>s[23]||(s[23]=[e("div",{class:"h-1lh"},null,-1)])),_:1})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(n(),i("div",It,[S(t(it),{"search-query":d.value,"onUpdate:searchQuery":s[4]||(s[4]=u=>d.value=u),"voice-id":t(h),"onUpdate:voiceId":s[5]||(s[5]=u=>N(h)?h.value=u:null),voices:(G=t(a)[t(v)])==null?void 0:G.map(u=>({id:u.id,name:u.name,description:u.description,previewURL:u.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":de},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"])])):t(T)?(n(),i("div",Dt,[s[25]||(s[25]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",jt,[s[24]||(s[24]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Ot,k(t(T)),1)])])):(n(),i("div",Qt,s[26]||(s[26]=[e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No voices available"),e("span",{class:"text-sm text-amber-600 dark:text-amber-400"}," No voices were found for this provider. You can enter a custom voice name below. ")],-1)]))),e("div",Ht,[S(t(oe),{modelValue:t(f),"onUpdate:modelValue":s[6]||(s[6]=u=>N(f)?f.value=u:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":u=>`${u}%`},null,8,["modelValue","format-value"]),S(t(ae),{modelValue:t(z),"onUpdate:modelValue":s[7]||(s[7]=u=>N(z)?z.value=u:null),label:"Enable SSML",description:"Enable Speech Synthesis Markup Language for more control over speech output"},null,8,["modelValue"])]),!t(a)[t(v)]||t(a)[t(v)].length===0?(n(),i("div",Gt,[S(t(Se),{modelValue:t(h),"onUpdate:modelValue":s[8]||(s[8]=u=>N(h)?h.value=u: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"]),t(v)==="elevenlabs"?(n(),i("div",Jt,[s[28]||(s[28]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),j(e("select",{"onUpdate:modelValue":s[9]||(s[9]=u=>N(b)?b.value=u:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[27]||(s[27]=[e("option",{value:"eleven_monolingual_v1"}," Monolingual v1 ",-1),e("option",{value:"eleven_multilingual_v1"}," Multilingual v1 ",-1),e("option",{value:"eleven_multilingual_v2"}," Multilingual v2 ",-1)]),512),[[we,t(b)]])])):$("",!0),e("div",Kt,[S(t(oe),{modelValue:t(f),"onUpdate:modelValue":s[10]||(s[10]=u=>N(f)?f.value=u:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":u=>`${u}%`},null,8,["modelValue","format-value"])])])):$("",!0)])])):$("",!0)]),e("div",Yt,[e("div",Wt,[e("h2",Xt,[e("div",Zt,[S(t(_e)),e("div",null,k(t(l)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",es,[S(t(ae),{modelValue:m.value,"onUpdate:modelValue":s[11]||(s[11]=u=>m.value=u),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),m.value?j((n(),i("textarea",{key:1,"onUpdate:modelValue":s[13]||(s[13]=u=>U.value=u),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)),[[W,U.value]]):j((n(),i("textarea",{key:0,"onUpdate:modelValue":s[12]||(s[12]=u=>_.value=u),placeholder:t(l)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,ts)),[[W,_.value]]),e("div",ss,[e("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:B.value||!_.value.trim()&&!m.value||m.value&&!U.value.trim()||!t(M),class:C({"opacity-50 cursor-not-allowed":B.value||!_.value.trim()&&!m.value||m.value&&!U.value.trim()||!t(M)}),bg:"neutral-700 dark:neutral-300",onClick:ue},[e("div",os,[s[30]||(s[30]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,k(B.value?t(l)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(l)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,ls),y.value?(n(),i("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:se},s[31]||(s[31]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):$("",!0)]),y.value?(n(),i("audio",{key:2,ref_key:"audioPlayer",ref:F,src:y.value,controls:"",class:"mt-2 w-full"},null,8,as)):$("",!0)])])])]),s[32]||(s[32]=e("div",{text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:volume-2":""})],-1))],64)}}});typeof re=="function"&&re(rs);export{rs as default}; +import{d as O,g as V,l as ne,w as Z,m as ie,c as i,o as n,bx as H,by as K,a as e,n as me,z as C,bK as Y,bL as J,A as j,bA as pe,C as $,D as k,b as S,y as I,bn as ee,h as fe,c7 as ge,bF as W,x as X,q as xe,s as le,bE as be,H as he,bw as ye,e as t,bo as ke,ad as N,bG as we}from"./index-CL4rmUJ-.js";import{_ as oe,a as ae,b as _e}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-D5aCIkT4.js";import{_ as Se}from"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import{R as Ve,a as Me}from"./RadioCardDetailManySelect-Cc_QkuwQ.js";import{_ as Ce}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import{_ as $e}from"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";import"./live2d-zip-loader-DFrBymqv.js";import{u as Pe}from"./providers-BHCrT0RZ.js";import{u as Ue,g as Le}from"./speech-Ae5ywnpY.js";import{b as re}from"./route-block-B_A1xBdJ.js";const qe=O({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(o){const l=o,x=V(Array.from({length:l.bars}).fill(0));ne(()=>{p()}),Z(()=>l.stream,()=>{p()});function p(){if(!l.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),g=c.createMediaStreamSource(l.stream),v=c.createAnalyser();v.fftSize=2048,g.connect(v);const b=v.frequencyBinCount,M=new Uint8Array(b),f=c.sampleRate/v.fftSize,w=Math.floor(l.minFreq/f),P=Math.floor(l.maxFreq/f),L=P-w,A=Math.floor(L/l.bars),E=()=>{try{requestAnimationFrame(E),v.getByteFrequencyData(M);const q=Array.from({length:l.bars}).fill(0);for(let T=0;Tie(c.$slots,"default",{frequencies:x.value})}}),Ae={"h-full":"",flex:"","items-center":"","gap-1":""},Re=5,Ee=O({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(o){const l=o;function x(c,g){return .1+(1-.1)*(c/g)}function p(c,g){const v=x(g,l.frequencies.length);return Math.min(100,Math.max(10,c*100*Re*v))}return(c,g)=>(n(),i("div",Ae,[(n(!0),i(H,null,K(o.frequencies,(v,b)=>(n(),i("div",{key:b,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:C(o.barsClass),style:me({height:`${p(v,b)}%`})},null,6)]))),128))]))}}),Te={class:"p-3"},ze={class:"flex items-start"},Be=["checked","name","value"],Fe={class:"relative mr-3 mt-0.5 flex-shrink-0"},Ne={key:0,class:"i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ie={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},De={key:1,class:"mt-auto w-full flex items-center justify-center bg-neutral-50 py-3 text-xs text-neutral-400 italic dark:bg-neutral-800/50 dark:text-neutral-600"},je={class:"flex-1 cursor-pointer"},Oe={class:"flex items-center"},Qe={key:0,class:"mt-1 flex flex-wrap gap-1"},He={key:1,class:"mt-3"},Ge={relative:""},Je={key:0,class:"h-16 px-3 pb-2"},Ke=O({__name:"VoiceCard",props:Y({name:null,voice:null,currentlyPlayingId:null,customInputPlaceholder:{default:"Enter custom voice name"},showVisualizer:{type:Boolean,default:!0},audioStream:{default:null}},{"voice-id":{required:!1,default:""},"voice-idModifiers":{},"custom-voice-name":{required:!1,default:""},"custom-voice-nameModifiers":{}}),emits:Y(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(o,{emit:l}){const x=o,p=l,c=J(o,"voice-id"),g=J(o,"custom-voice-name");function v(h){return h.previewURL||h.preview_audio_url}function b(h){var w,P,L;const f=[];if((w=h.labels)!=null&&w.gender&&f.push(h.labels.gender),(P=h.labels)!=null&&P.age&&f.push(h.labels.age),(L=h.labels)!=null&&L.accent&&f.push(h.labels.accent),h.languages&&h.languages.length>0){const A=h.languages.map(E=>E.name).join(", ");f.push(A)}return f}function M(){p("togglePlayback",x.voice)}return(h,f)=>(n(),i("label",{border:"2px solid",class:C(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[c.value===x.voice.id?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",c.value===x.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Te,[e("div",ze,[j(e("input",{"onUpdate:modelValue":f[0]||(f[0]=w=>c.value=w),checked:c.value===x.voice.id,type:"radio",name:o.name,value:x.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,Be),[[pe,c.value]]),e("div",Fe,[e("div",{class:C(["size-5 border-2 rounded-full transition-colors duration-200",[c.value===x.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:C(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[c.value===x.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),v(o.voice)?(n(),i("button",{key:0,absolute:"","right-0":"",top:"0","z-100":"",class:C(["translate-x-[-50%] translate-y-[50%]",[o.currentlyPlayingId===o.voice.id?"text-white dark:text-white":""]]),onClick:M},[o.currentlyPlayingId===o.voice.id?(n(),i("div",Ne)):(n(),i("div",Ie))],2)):(n(),i("div",De," No preview available ")),e("div",je,[e("div",Oe,[e("span",{class:C(["line-clamp-1 font-medium",[c.value===o.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},k(o.voice.name),3)]),b(o.voice).length>0?(n(),i("div",Qe,[(n(!0),i(H,null,K(b(o.voice),(w,P)=>(n(),i("span",{key:P,class:C(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===o.voice.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400":"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"]])},k(w),3))),128))])):$("",!0),o.voice.customizable&&c.value===o.voice.id?(n(),i("div",He,[S($e,{modelValue:g.value,"onUpdate:modelValue":f[1]||(f[1]=w=>g.value=w),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:o.customInputPlaceholder},null,8,["modelValue","placeholder"])])):$("",!0),o.voice.description?(n(),i("div",{key:2,class:C(["line-clamp-2 mt-1 text-xs",[c.value===o.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},k(o.voice.description),3)):$("",!0)])])]),e("div",Ge,[S(Ce,null,{default:I(()=>[o.showVisualizer&&o.currentlyPlayingId===o.voice.id&&o.audioStream?(n(),i("div",Je,[S(qe,{stream:o.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:I(({frequencies:w})=>[S(Ee,{frequencies:w,"bars-class":c.value===o.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):$("",!0)]),_:1})])],2))}}),Ye=ee(Ke,[["__scopeId","data-v-dbab964e"]]),We={class:"voice-preview-player"},Xe={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Ze=["placeholder"],et={class:"mt-4 space-y-2"},tt={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},st={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},lt={class:"flex flex-col"},ot={class:"font-medium"},at={class:"text-sm text-amber-600 dark:text-amber-400"},rt={class:"relative"},nt=O({__name:"VoiceCardManySelect",props:Y({voices:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search voices..."},searchNoResultsTitle:{default:"No voices found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} voices"},customInputPlaceholder:{default:"Enter custom voice name"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},playButtonText:{default:"Play sample"},pauseButtonText:{default:"Pause"},showVisualizer:{type:Boolean,default:!0}},{"search-query":{required:!1,default:""},"search-queryModifiers":{},"voice-id":{required:!1,default:""},"voice-idModifiers":{}}),emits:["update:search-query","update:voice-id"],setup(o){const l=o,x=V(!1),p=V(),c=V(new Map),g=V(new Map),v=V(new Map),b=V(new Map),M=V(null);function h(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const f=J(o,"search-query"),w=J(o,"voice-id"),P=fe(()=>{if(!f.value)return l.voices;const a=f.value.toLowerCase();return l.voices.filter(r=>{const d=r.name.toLowerCase().includes(a),m=r.description&&r.description.toLowerCase().includes(a),_=r.tags&&r.tags.some(y=>y.toLowerCase().includes(a)),U=r.labels&&Object.values(r.labels).some(y=>typeof y=="string"&&y.toLowerCase().includes(a)),B=r.languages&&r.languages.some(y=>y.name.toLowerCase().includes(a)||y.code.toLowerCase().includes(a));return d||m||_||U||B})});function L(a){return a.previewURL||a.preview_audio_url}function A(a){const r=L(a);if(!r)return null;if(c.value.has(a.id))return c.value.get(a.id)||null;const d=new Audio(r);return d.crossOrigin="anonymous",d.preload="auto",d.addEventListener("ended",()=>{if(p.value===a.id){p.value=void 0;const m=g.value.get(a.id);m&&(m.getTracks().forEach(_=>_.stop()),g.value.delete(a.id))}}),c.value.set(a.id,d),d}function E(a,r){try{if(g.value.has(r))return g.value.get(r)||null;const d=h();if(b.value.has(r)){const B=b.value.get(r),y=d.createMediaStreamDestination();B.connect(y);const F=y.stream;return g.value.set(r,F),F}const m=d.createMediaElementSource(a);b.value.set(r,m),m.connect(d.destination);const _=d.createMediaStreamDestination();m.connect(_);const U=_.stream;return g.value.set(r,U),U}catch(d){return console.error("Failed to create audio stream for visualizer:",d),null}}function q(a){try{if(!L(a))return;const d=A(a);if(!d)return;if(p.value===a.id){d.pause(),p.value=void 0;const m=g.value.get(a.id);m&&(m.getTracks().forEach(_=>_.stop()),g.value.delete(a.id));return}if(p.value){const m=c.value.get(p.value);m&&m.pause();const _=g.value.get(p.value);_&&(_.getTracks().forEach(U=>U.stop()),g.value.delete(p.value))}l.showVisualizer&&!g.value.has(a.id)&&E(d,a.id),d.currentTime=0,d.play().catch(m=>{console.error("Failed to play audio:",m)}),p.value=a.id}catch(r){console.error(r),p.value=void 0}}function T(){c.value.forEach(a=>{a.pause(),a.src=""}),c.value.clear(),g.value.forEach(a=>{a.getTracks().forEach(r=>r.stop())}),g.value.clear(),v.value.forEach(a=>{a.state!=="closed"&&a.close()}),v.value.clear(),b.value.clear(),p.value=void 0}Z(f,()=>{if(p.value){const a=c.value.get(p.value);a&&a.pause();const r=g.value.get(p.value);r&&(r.getTracks().forEach(d=>d.stop()),g.value.delete(p.value)),p.value=void 0}}),ge(T);const z=V("");return(a,r)=>(n(),i("div",We,[o.searchable?(n(),i("div",Xe,[r[4]||(r[4]=e("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[e("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),j(e("input",{"onUpdate:modelValue":r[0]||(r[0]=d=>f.value=d),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:o.searchPlaceholder},null,8,Ze),[[W,f.value]])])):$("",!0),e("div",et,[f.value?(n(),i("div",tt,k(o.searchResultsText.replace("{count}",P.value.length.toString()).replace("{total}",o.voices.length.toString())),1)):$("",!0),f.value&&P.value.length===0?(n(),i("div",st,[r[5]||(r[5]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",lt,[e("span",ot,k(o.searchNoResultsTitle),1),e("span",at,k(o.searchNoResultsDescription.replace("{query}",f.value)),1)])])):$("",!0),e("div",rt,[e("div",{class:C(["scrollbar-hide grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto",[x.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(n(!0),i(H,null,K(P.value,d=>(n(),X(Ye,{key:d.id,"voice-id":w.value,"onUpdate:voiceId":r[1]||(r[1]=m=>w.value=m),"custom-voice-name":z.value,"onUpdate:customVoiceName":r[2]||(r[2]=m=>z.value=m),name:"voice",voice:d,"currently-playing-id":p.value,"custom-input-placeholder":o.customInputPlaceholder,"show-visualizer":o.showVisualizer,"audio-stream":g.value.get(d.id),onTogglePlayback:q},null,8,["voice-id","custom-voice-name","voice","currently-playing-id","custom-input-placeholder","show-visualizer","audio-stream"]))),128))],2),e("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:C([x.value?"w-full":"mt-4 w-full rounded-lg"])},[e("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:C([x.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:r[3]||(r[3]=d=>x.value=!x.value)},[e("span",null,k(x.value?o.collapseButtonText:o.expandButtonText),1),e("div",{class:C([x.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),it=ee(nt,[["__scopeId","data-v-070104a7"]]),ut=O({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(o){const l=o;return(x,p)=>(n(),i("div",{class:C(["skeleton",l.animation!=="none"?`skeleton-${l.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[ie(x.$slots,"default",{},void 0,!0)],2))}}),Q=ee(ut,[["__scopeId","data-v-f404da2a"]]),dt={flex:"~ row","items-center":"","gap-2":"",initial:{opacity:0,x:10},enter:{opacity:1,x:0},leave:{opacity:0,x:-10},duration:250},ct={relative:""},vt={absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},mt={text:"neutral-300 dark:neutral-500","text-nowrap":""},pt={"text-nowrap":"","text-3xl":"","font-semibold":""},ft={flex:"~ col md:row gap-6"},gt={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},xt={flex:"~ col gap-4"},bt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},ht={text:"neutral-400 dark:neutral-500"},yt={"max-w-full":""},kt={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},wt={key:1},_t={key:0},St={flex:"~ col gap-4"},Vt={class:"text-lg md:text-2xl"},Mt={text:"neutral-400 dark:neutral-400"},Ct={key:0,class:"flex items-center justify-center py-4"},$t={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},Pt={class:"flex flex-col"},Ut={class:"font-medium"},Lt={class:"text-sm text-red-600 dark:text-red-400"},qt={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},At={class:"flex flex-col"},Rt={class:"font-medium"},Et={class:"text-sm text-amber-600 dark:text-amber-400"},Tt={key:0},zt={flex:"~ col gap-4"},Bt={key:0},Ft={class:"flex flex-col gap-4"},Nt={flex:"~ row gap-4"},It={key:1,class:"space-y-6"},Dt={key:2,class:"flex items-center gap-3 border border-2 border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},jt={class:"flex flex-col"},Ot={class:"text-sm text-red-600 dark:text-red-400"},Qt={key:3,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},Ht={flex:"~ col gap-4"},Gt={key:4,class:"mt-2 space-y-6"},Jt={key:0},Kt={flex:"~ col gap-4"},Yt={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Wt={"w-full":"","rounded-xl":""},Xt={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Zt={class:"inline-flex items-center gap-4"},es={flex:"~ col gap-4"},ts=["placeholder"],ss={flex:"~ row","gap-4":""},ls=["disabled"],os={flex:"~ row","items-center":"","gap-2":""},as=["src"],rs=O({__name:"speech",setup(o){const{t:l}=xe(),x=Pe(),p=Ue(),{availableProviders:c,availableAudioSpeechProvidersMetadata:g}=le(x),{activeSpeechProvider:v,activeSpeechModel:b,activeSpeechVoice:M,activeSpeechVoiceId:h,pitch:f,isLoadingSpeechProviderVoices:w,supportsModelListing:P,providerModels:L,isLoadingActiveProviderModels:A,activeProviderModelError:E,modelSearchQuery:q,speechProviderError:T,ssmlEnabled:z,availableVoices:a}=le(p),r=be(),d=V(""),m=V(!1),_=V("Hello, my name is AI Assistant"),U=V(""),B=V(!1),y=V(""),F=V(null),te=V("");ne(async()=>{await p.loadVoicesForProvider(v.value),await x.loadModelsForConfiguredProviders()}),Z(v,async()=>{await p.loadVoicesForProvider(v.value),await x.loadModelsForConfiguredProviders()});async function ue(){if(!_.value.trim()&&!m.value||m.value&&!U.value.trim())return;if(!b.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const R=x.getProviderInstance(v.value);if(!R){console.error("Failed to initialize speech provider");return}const s=x.getProviderConfig(v.value);B.value=!0,te.value="";try{y.value&&se();const D=m.value?U.value:p.generateSSML(_.value,M.value,{...s,pitch:f.value}),G=await Le({...R.speech(b.value,s),input:D,voice:M.value.id});y.value=URL.createObjectURL(new Blob([G])),setTimeout(()=>{F.value&&F.value.play()},100)}catch(D){console.error("Error generating speech:",D),te.value=D instanceof Error?D.message:"An unknown error occurred"}finally{B.value=!1}}function se(){F.value&&(F.value.pause(),F.value.currentTime=0),y.value&&(URL.revokeObjectURL(y.value),y.value="")}he(()=>{y.value&&URL.revokeObjectURL(y.value)});function de(R){M.value={id:R,name:R,description:R,previewURL:R,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function ce(R){b.value=R}return(R,s)=>{var G;const D=ye("motion");return n(),i(H,null,[j((n(),i("div",dt,[e("button",{onClick:s[0]||(s[0]=u=>t(r).back())},s[14]||(s[14]=[e("div",{"i-solar:alt-arrow-left-line-duotone":"","text-xl":""},null,-1)])),e("h1",ct,[e("div",vt,[e("span",mt,k(t(l)("settings.pages.modules.title")),1)]),e("div",pt,k(t(l)("settings.pages.modules.speech.title")),1)])])),[[D]]),e("div",ft,[e("div",gt,[e("div",null,[e("div",xt,[e("div",null,[e("h2",bt,k(t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",ht,[e("span",null,k(t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",yt,[t(c).length>0?(n(),i("fieldset",kt,[(n(!0),i(H,null,K(t(g),u=>(n(),X(t(Me),{id:u.id,key:u.id,modelValue:t(v),"onUpdate:modelValue":s[1]||(s[1]=ve=>N(v)?v.value=ve:null),name:"speech-provider",value:u.id,title:u.localizedName,description:u.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(n(),i("div",wt,[S(t(ke),{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:I(()=>s[15]||(s[15]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Speech Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your speech providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])]),e("div",null,[t(v)&&t(P)?(n(),i("div",_t,[e("div",St,[e("div",null,[e("h2",Vt,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",Mt,[e("span",null,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(A)?(n(),i("div",Ct,[s[16]||(s[16]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(E)?(n(),i("div",$t,[s[17]||(s[17]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",Pt,[e("span",Ut,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Lt,k(t(E)),1)])])):t(L).length===0&&!t(A)?(n(),i("div",qt,[s[18]||(s[18]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",At,[e("span",Rt,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Et,k(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(L).length>0?(n(),X(t(Ve),{key:3,modelValue:t(b),"onUpdate:modelValue":s[2]||(s[2]=u=>N(b)?b.value=u:null),"search-query":t(q),"onUpdate:searchQuery":s[3]||(s[3]=u=>N(q)?q.value=u:null),items:t(L),searchable:!0,"search-placeholder":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(q)}),"search-results-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":ce},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)])]),t(v)?(n(),i("div",Tt,[e("div",zt,[s[29]||(s[29]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Configuration "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Customize how your AI assistant speaks")])],-1)),t(w)?(n(),i("div",Bt,[e("div",Ft,[S(t(Q),{class:"w-full rounded-lg p-2.5 text-sm"},{default:I(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),e("div",Nt,[S(t(Q),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),S(t(Q),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),S(t(Q),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[22]||(s[22]=[e("div",{class:"h-1lh"},null,-1)])),_:1})]),S(t(Q),{class:"w-full rounded-lg p-3 text-sm"},{default:I(()=>s[23]||(s[23]=[e("div",{class:"h-1lh"},null,-1)])),_:1})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(n(),i("div",It,[S(t(it),{"search-query":d.value,"onUpdate:searchQuery":s[4]||(s[4]=u=>d.value=u),"voice-id":t(h),"onUpdate:voiceId":s[5]||(s[5]=u=>N(h)?h.value=u:null),voices:(G=t(a)[t(v)])==null?void 0:G.map(u=>({id:u.id,name:u.name,description:u.description,previewURL:u.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":de},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"])])):t(T)?(n(),i("div",Dt,[s[25]||(s[25]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",jt,[s[24]||(s[24]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Ot,k(t(T)),1)])])):(n(),i("div",Qt,s[26]||(s[26]=[e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No voices available"),e("span",{class:"text-sm text-amber-600 dark:text-amber-400"}," No voices were found for this provider. You can enter a custom voice name below. ")],-1)]))),e("div",Ht,[S(t(oe),{modelValue:t(f),"onUpdate:modelValue":s[6]||(s[6]=u=>N(f)?f.value=u:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":u=>`${u}%`},null,8,["modelValue","format-value"]),S(t(ae),{modelValue:t(z),"onUpdate:modelValue":s[7]||(s[7]=u=>N(z)?z.value=u:null),label:"Enable SSML",description:"Enable Speech Synthesis Markup Language for more control over speech output"},null,8,["modelValue"])]),!t(a)[t(v)]||t(a)[t(v)].length===0?(n(),i("div",Gt,[S(t(Se),{modelValue:t(h),"onUpdate:modelValue":s[8]||(s[8]=u=>N(h)?h.value=u: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"]),t(v)==="elevenlabs"?(n(),i("div",Jt,[s[28]||(s[28]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),j(e("select",{"onUpdate:modelValue":s[9]||(s[9]=u=>N(b)?b.value=u:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[27]||(s[27]=[e("option",{value:"eleven_monolingual_v1"}," Monolingual v1 ",-1),e("option",{value:"eleven_multilingual_v1"}," Multilingual v1 ",-1),e("option",{value:"eleven_multilingual_v2"}," Multilingual v2 ",-1)]),512),[[we,t(b)]])])):$("",!0),e("div",Kt,[S(t(oe),{modelValue:t(f),"onUpdate:modelValue":s[10]||(s[10]=u=>N(f)?f.value=u:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":u=>`${u}%`},null,8,["modelValue","format-value"])])])):$("",!0)])])):$("",!0)]),e("div",Yt,[e("div",Wt,[e("h2",Xt,[e("div",Zt,[S(t(_e)),e("div",null,k(t(l)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",es,[S(t(ae),{modelValue:m.value,"onUpdate:modelValue":s[11]||(s[11]=u=>m.value=u),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),m.value?j((n(),i("textarea",{key:1,"onUpdate:modelValue":s[13]||(s[13]=u=>U.value=u),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)),[[W,U.value]]):j((n(),i("textarea",{key:0,"onUpdate:modelValue":s[12]||(s[12]=u=>_.value=u),placeholder:t(l)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,ts)),[[W,_.value]]),e("div",ss,[e("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:B.value||!_.value.trim()&&!m.value||m.value&&!U.value.trim()||!t(M),class:C({"opacity-50 cursor-not-allowed":B.value||!_.value.trim()&&!m.value||m.value&&!U.value.trim()||!t(M)}),bg:"neutral-700 dark:neutral-300",onClick:ue},[e("div",os,[s[30]||(s[30]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,k(B.value?t(l)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(l)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,ls),y.value?(n(),i("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:se},s[31]||(s[31]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):$("",!0)]),y.value?(n(),i("audio",{key:2,ref_key:"audioPlayer",ref:F,src:y.value,controls:"",class:"mt-2 w-full"},null,8,as)):$("",!0)])])])]),s[32]||(s[32]=e("div",{text:"neutral-200/50 dark:neutral-500/20","pointer-events-none":"",fixed:"","bottom-0":"","right-0":"","z--1":"","translate-x-10":"","translate-y-10":""},[e("div",{text:"40","i-lucide:volume-2":""})],-1))],64)}}});typeof re=="function"&&re(rs);export{rs as default}; diff --git a/assets/stage-BZEQTMlY.js b/assets/stage-Bqjk4H4J.js similarity index 84% rename from assets/stage-BZEQTMlY.js rename to assets/stage-Bqjk4H4J.js index 7571008d7a454abcc419bbcf2ca425e4652b636c..b8df62840da4eccbfb9ef3b747e9ff66f5e34e55 100644 --- a/assets/stage-BZEQTMlY.js +++ b/assets/stage-Bqjk4H4J.js @@ -1 +1 @@ -import{d as p,u as s,c,b as d,r as i,n as m,e,o as l}from"./index-BYewP6KR.js";const x=p({__name:"stage",setup(u){const{top:t,right:o,bottom:a,left:n}=s();return(f,_)=>{const r=i("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(o)}px`,paddingBottom:`${e(a)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; +import{d as p,u as s,c,b as d,r as i,n as m,e,o as l}from"./index-CL4rmUJ-.js";const x=p({__name:"stage",setup(u){const{top:t,right:o,bottom:a,left:n}=s();return(f,_)=>{const r=i("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(o)}px`,paddingBottom:`${e(a)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; diff --git a/assets/together-ai-Eu2_AJ3V.js b/assets/together-ai-DeW9vX9c.js similarity index 72% rename from assets/together-ai-Eu2_AJ3V.js rename to assets/together-ai-DeW9vX9c.js index f1e2ade5796c6ca8b59b3441621486b2277f10b1..93b6b886068dc3e8968807b454dfb509b594ce99 100644 --- a/assets/together-ai-Eu2_AJ3V.js +++ b/assets/together-ai-DeW9vX9c.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as h,q as y,bE as U,s as V,h as v,l as $,w as k,x,o as K,y as p,b as l,e as t}from"./index-BYewP6KR.js";import{u as z}from"./providers-CFIOZO6n.js";import{_ as w,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const a="together-ai",H=h({__name:"together-ai",setup(S){const{t:d}=y(),_=U(),m=z(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,r;m.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),k([i,s],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var c,f;return K(),x(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var u;return[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=b=>i.value=b),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=u=>s.value=u),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as h,q as y,bE as U,s as V,h as v,l as $,w as k,x,o as K,y as p,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as z}from"./providers-BHCrT0RZ.js";import{_ as w,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="together-ai",H=h({__name:"together-ai",setup(S){const{t:d}=y(),_=U(),m=z(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,r;m.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),k([i,s],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var c,f;return K(),x(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var u;return[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=b=>i.value=b),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=u=>s.value=u),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; diff --git a/assets/useIconAnimation-B3hjTK1u.js b/assets/useIconAnimation-D_Q3CYV7.js similarity index 68% rename from assets/useIconAnimation-B3hjTK1u.js rename to assets/useIconAnimation-D_Q3CYV7.js index d85b8a0416084f2ca1b35c56e3871dd4b1975415..ef8c11b746de630905c4b1de3edd4b61bbfc7f48 100644 --- a/assets/useIconAnimation-B3hjTK1u.js +++ b/assets/useIconAnimation-D_Q3CYV7.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{g as t,v as u,h as r,l as c,H as m}from"./index-BYewP6KR.js";function p(s){const n=t(!1),o=t(!1),a=t(s),e=u(),i=r(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return c(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),m(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{p as u}; +import"./live2d-zip-loader-DFrBymqv.js";import{g as t,v as u,h as r,l as c,H as m}from"./index-CL4rmUJ-.js";function p(s){const n=t(!1),o=t(!1),a=t(s),e=u(),i=r(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return c(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),m(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{p as u}; diff --git a/assets/worker-D9VCBMJ0.js b/assets/worker-D9VCBMJ0.js deleted file mode 100644 index ab478a44e71501319c6161a02d146992ac793d62..0000000000000000000000000000000000000000 --- a/assets/worker-D9VCBMJ0.js +++ /dev/null @@ -1,2846 +0,0 @@ -var Ax=Object.defineProperty;var Fx=(bs,$r,Ln)=>$r in bs?Ax(bs,$r,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):bs[$r]=Ln;var re=(bs,$r,Ln)=>Fx(bs,typeof $r!="symbol"?$r+"":$r,Ln);(function(){"use strict";const bs=new Map,$r=[],Ln=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=bs.get(e);if(s===void 0)bs.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){const i=$r.indexOf(e);i!==-1&&$r.splice(i,1);for(let n=0;n<$r.length;n++)if(bs.get($r[n]).priority<=t){$r.splice(n,0,e);return}$r.push(e)}return}throw new TypeError("not a valid backend")},Mb=async e=>{const r=bs.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{const t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},bb=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?$r:t;let i;const n=[],o=new Set;for(const l of s){const d=await Mb(l);typeof d=="string"?n.push({name:l,err:d}):(i||(i=d),i===d&&o.add(l))}if(!i)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:d}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${d}`);const a=r.filter(l=>o.has(typeof l=="string"?l:l.name));return[i,new Proxy(e,{get:(l,d)=>d==="executionProviders"?a:Reflect.get(l,d)})]},vb="1.21.0";let Au="warning";const es={wasm:{},webgl:{},webgpu:{},versions:{common:vb},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);Au=e}},get logLevel(){return Au}};Object.defineProperty(es,"logLevel",{enumerable:!0});const xb=es,Tb=(e,r)=>{const t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];const s=t.getContext("2d");if(s!=null){let i,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(i=e.dims[2],n=e.dims[3]):(i=e.dims[3],n=e.dims[2]);const o=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,d;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?d=[0,0,0,0]:typeof a.bias=="number"?d=[a.bias,a.bias,a.bias,a.bias]:(d=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(d[3]=a.bias[3]));const p=n*i;let u=0,h=p,w=p*2,f=-1;o==="RGBA"?(u=0,h=p,w=p*2,f=p*3):o==="RGB"?(u=0,h=p,w=p*2):o==="RBG"&&(u=0,w=p,h=p*2);for(let P=0;P{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let i,n,o;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(i=e.dims[2],n=e.dims[1],o=e.dims[3]):(i=e.dims[3],n=e.dims[2],o=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let d,p;l===void 0||l.mean===void 0?d=[255,255,255,255]:typeof l.mean=="number"?d=[l.mean,l.mean,l.mean,l.mean]:(d=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(d[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));const u=n*i;if(r!==void 0&&(r.format!==void 0&&o===4&&r.format!=="RGBA"||o===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const h=4;let w=0,f=1,P=2,A=3,b=0,y=u,$=u*2,T=-1;a==="RGBA"?(b=0,y=u,$=u*2,T=u*3):a==="RGB"?(b=0,y=u,$=u*2):a==="RBG"&&(b=0,$=u,y=u*2),s=t.createImageData(i,n);for(let g=0;g{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:t,width:s}=r,i=r.norm??{mean:255,bias:0};let n,o;typeof i.mean=="number"?n=[i.mean,i.mean,i.mean,i.mean]:n=[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],typeof i.bias=="number"?o=[i.bias,i.bias,i.bias,i.bias]:o=[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",d=t*s,p=l==="RGBA"?new Float32Array(d*4):new Float32Array(d*3);let u=4,h=0,w=1,f=2,P=3,A=0,b=d,y=d*2,$=-1;a==="RGB"&&(u=3,h=0,w=1,f=2,P=-1),l==="RGBA"?$=d*3:l==="RBG"?(A=0,y=d,b=d*2):l==="BGR"&&(y=0,b=d,A=d*2);for(let g=0;g{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,i=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let o,a=r??{};const l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},d=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){const p=l();p.width=e.width,p.height=e.height;const u=d(p);if(u!=null){let h=e.height,w=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(h=r.resizedHeight,w=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=h,a.width=w}else a.tensorFormat="RGBA",a.height=h,a.width=w;u.drawImage(e,0,0),o=u.getImageData(0,0,w,h).data}else throw new Error("Can not access image data")}else if(s){let p,u;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,u=r.resizedWidth):(p=e.height,u=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=u,r!==void 0){const h=l();h.width=u,h.height=p;const w=d(h);if(w!=null)w.putImageData(e,0,0),o=w.getImageData(0,0,u,p).data;else throw new Error("Can not access image data")}else o=e.data}else if(i){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=l();p.width=e.width,p.height=e.height;const u=d(p);if(u!=null){const h=e.height,w=e.width;return u.drawImage(e,0,0,w,h),o=u.getImageData(0,0,w,h).data,a.height=h,a.width=w,ad(o,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,u)=>{const h=l(),w=d(h);if(!e||!w)return u();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{h.width=f.width,h.height=f.height,w.drawImage(f,0,0,h.width,h.height);const P=w.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,p(ad(P.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(o!==void 0)return ad(o,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Cb=(e,r)=>{const{width:t,height:s,download:i,dispose:n}=r,o=[1,s,t,4];return new Gr({location:"texture",type:"float32",texture:e,dims:o,download:i,dispose:n})},Sb=(e,r)=>{const{dataType:t,dims:s,download:i,dispose:n}=r;return new Gr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:i,dispose:n})},$b=(e,r)=>{const{dataType:t,dims:s,download:i,dispose:n}=r;return new Gr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:i,dispose:n})},kb=(e,r,t)=>new Gr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),zn=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ha=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let Fu=!1;const Ib=()=>{if(!Fu){Fu=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(zn.set("int64",BigInt64Array),ha.set(BigInt64Array,"int64")),r&&(zn.set("uint64",BigUint64Array),ha.set(BigUint64Array,"uint64")),s?(zn.set("float16",t),ha.set(t,"float16")):zn.set("float16",Uint16Array)}},Ab=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Gr(e.type,e.data,r);case"cpu-pinned":return new Gr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Gr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Gr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Gr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let Gr=class{constructor(r,t,s){Ib();let i,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,i=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=zn.get(i);if(!a)throw new TypeError(`unsupported type "${i}" to create tensor from pinned buffer`);if(!(r.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=r.data;break}case"texture":{if(i!=="float32")throw new TypeError(`unsupported type "${i}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(i!=="float32"&&i!=="float16"&&i!=="int32"&&i!=="int64"&&i!=="uint32"&&i!=="uint8"&&i!=="bool"&&i!=="uint4"&&i!=="int4")throw new TypeError(`unsupported type "${i}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(i!=="float32"&&i!=="float16"&&i!=="int32"&&i!=="int64"&&i!=="uint32"&&i!=="uint64"&&i!=="int8"&&i!=="uint8"&&i!=="bool"&&i!=="uint4"&&i!=="int4")throw new TypeError(`unsupported type "${i}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,l;if(typeof r=="string")if(i=r,l=s,r==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");a=t}else{const d=zn.get(r);if(d===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&d===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${d.name} as data.`);r==="uint64"||r==="int64"?a=d.from(t,BigInt):a=d.from(t)}else if(t instanceof d)a=t;else if(t instanceof Uint8ClampedArray)if(r==="uint8")a=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&t instanceof Uint16Array&&d!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${i} tensor's data must be type of ${d}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const d=typeof r[0];if(d==="string")i="string",a=r;else if(d==="boolean")i="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${d}.`)}else if(r instanceof Uint8ClampedArray)i="uint8",a=Uint8Array.from(r);else{const d=ha.get(r.constructor);if(d===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);i=d,a=r}if(l===void 0)l=[a.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");n=l,this.cpuData=a,this.dataLocation="cpu"}const o=Ab(n);if(this.cpuData&&o!==this.cpuData.length&&!((i==="uint4"||i==="int4")&&Math.ceil(o/2)===this.cpuData.length))throw new Error(`Tensor's size(${o}) does not match data length(${this.cpuData.length}).`);this.type=i,this.dims=n,this.size=o}static async fromImage(r,t){return Pb(r,t)}static fromTexture(r,t){return Cb(r,t)}static fromGpuBuffer(r,t){return Sb(r,t)}static fromMLTensor(r,t){return $b(r,t)}static fromPinnedBuffer(r,t,s){return kb(r,t,s)}toDataURL(r){return Tb(this,r)}toImageData(r){return Eb(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new 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 new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){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 new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,r&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new 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 new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Fb(this,r)}};const Bn=Gr,Ou=(e,r)=>{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||console.timeStamp(`${e}::ORT::${r}`)},Du=(e,r)=>{var i;const t=((i=new Error().stack)==null?void 0:i.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||Du("BEGIN",e)},dd=e=>{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||Du("END",e)};var Ob=Object.freeze({__proto__:null,InferenceSession:class gb{constructor(r){this.handler=r}async run(r,t,s){ld();const i={};let n={};if(typeof r!="object"||r===null||r instanceof Bn||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let o=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof Bn)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");o=!1;for(const d of t){if(typeof d!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(d)===-1)throw new RangeError(`'fetches' contains invalid output name: ${d}.`);i[d]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let d=!1;const p=Object.getOwnPropertyNames(t);for(const u of this.outputNames)if(p.indexOf(u)!==-1){const h=t[u];(h===null||h instanceof Bn)&&(d=!0,o=!1,i[u]=h)}if(d){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const d of this.inputNames)if(typeof r[d]>"u")throw new Error(`input '${d}' is missing in 'feeds'.`);if(o)for(const d of this.outputNames)i[d]=null;const a=await this.handler.run(r,i,n),l={};for(const d in a)if(Object.hasOwnProperty.call(a,d)){const p=a[d];p instanceof Bn?l[d]=p:l[d]=new Bn(p.type,p.data,p.dims)}return dd(),l}async release(){return this.handler.dispose()}static async create(r,t,s,i){ld();let n,o={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)o=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)o=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const p=r;let u=0,h=r.byteLength;if(typeof t=="object"&&t!==null)o=t;else if(typeof t=="number"){if(u=t,!Number.isSafeInteger(u))throw new RangeError("'byteOffset' must be an integer.");if(u<0||u>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(h=r.byteLength-u,typeof s=="number"){if(h=s,!Number.isSafeInteger(h))throw new RangeError("'byteLength' must be an integer.");if(h<=0||u+h>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-u}].`);if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,u,h)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await bb(o),d=await a.createInferenceSessionHandler(n,l);return dd(),new gb(d)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}},TRACE:Ou,TRACE_FUNC_BEGIN:ld,TRACE_FUNC_END:dd,Tensor:Bn,env:xb,registerBackend:Ln});/*! - * ONNX Runtime Web v1.22.0-dev.20250306-ccf8fdd9ea - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - */var cd=Object.defineProperty,Db=Object.getOwnPropertyDescriptor,Lb=Object.getOwnPropertyNames,zb=Object.prototype.hasOwnProperty,Bb=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Ue=(e,r)=>()=>(e&&(r=e(e=0)),r),Ci=(e,r)=>{for(var t in r)cd(e,t,{get:r[t],enumerable:!0})},Rb=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Lb(r))!zb.call(e,i)&&i!==t&&cd(e,i,{get:()=>r[i],enumerable:!(s=Db(r,i))||s.enumerable});return e},ma=e=>Rb(cd({},"__esModule",{value:!0}),e),Si,Vs,un,Lu,zu,Bu=Ue(()=>{Si=new Map,Vs=[],un=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){let s=Si.get(e);if(s===void 0)Si.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){let i=Vs.indexOf(e);i!==-1&&Vs.splice(i,1);for(let n=0;n{let r=Si.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{let t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},zu=async e=>{let r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?Vs:t,i,n=[],o=new Set;for(let l of s){let d=await Lu(l);typeof d=="string"?n.push({name:l,err:d}):(i||(i=d),i===d&&o.add(l))}if(!i)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(let{name:l,err:d}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${d}`);let a=r.filter(l=>o.has(typeof l=="string"?l:l.name));return[i,new Proxy(e,{get:(l,d)=>d==="executionProviders"?a:Reflect.get(l,d)})]}}),Nb=Ue(()=>{Bu()}),Ru,jb=Ue(()=>{Ru="1.22.0-dev.20250306-aafa8d170a"}),ud,Kr,Nu=Ue(()=>{jb(),ud="warning",Kr={wasm:{},webgl:{},webgpu:{},versions:{common:Ru},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);ud=e}},get logLevel(){return ud}},Object.defineProperty(Kr,"logLevel",{enumerable:!0})}),Vt,Ub=Ue(()=>{Nu(),Vt=Kr}),ju,Uu,Vb=Ue(()=>{ju=(e,r)=>{let t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];let s=t.getContext("2d");if(s!=null){let i,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(i=e.dims[2],n=e.dims[3]):(i=e.dims[3],n=e.dims[2]);let o=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm,l,d;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?d=[0,0,0,0]:typeof a.bias=="number"?d=[a.bias,a.bias,a.bias,a.bias]:(d=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(d[3]=a.bias[3]));let p=n*i,u=0,h=p,w=p*2,f=-1;o==="RGBA"?(u=0,h=p,w=p*2,f=p*3):o==="RGB"?(u=0,h=p,w=p*2):o==="RBG"&&(u=0,w=p,h=p*2);for(let P=0;P{let t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),s;if(t!=null){let i,n,o;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(i=e.dims[2],n=e.dims[1],o=e.dims[3]):(i=e.dims[3],n=e.dims[2],o=e.dims[1]);let a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm,d,p;l===void 0||l.mean===void 0?d=[255,255,255,255]:typeof l.mean=="number"?d=[l.mean,l.mean,l.mean,l.mean]:(d=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(d[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));let u=n*i;if(r!==void 0&&(r.format!==void 0&&o===4&&r.format!=="RGBA"||o===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let h=4,w=0,f=1,P=2,A=3,b=0,y=u,$=u*2,T=-1;a==="RGBA"?(b=0,y=u,$=u*2,T=u*3):a==="RGB"?(b=0,y=u,$=u*2):a==="RBG"&&(b=0,$=u,y=u*2),s=t.createImageData(i,n);for(let g=0;g{hd(),_a=(e,r)=>{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:t,width:s}=r,i=r.norm??{mean:255,bias:0},n,o;typeof i.mean=="number"?n=[i.mean,i.mean,i.mean,i.mean]:n=[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],typeof i.bias=="number"?o=[i.bias,i.bias,i.bias,i.bias]:o=[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",d=t*s,p=l==="RGBA"?new Float32Array(d*4):new Float32Array(d*3),u=4,h=0,w=1,f=2,P=3,A=0,b=d,y=d*2,$=-1;a==="RGB"&&(u=3,h=0,w=1,f=2,P=-1),l==="RGBA"?$=d*3:l==="RBG"?(A=0,y=d,b=d*2):l==="BGR"&&(y=0,b=d,A=d*2);for(let T=0;T{let t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,i=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string",o,a=r??{},l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},d=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){let p=l();p.width=e.width,p.height=e.height;let u=d(p);if(u!=null){let h=e.height,w=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(h=r.resizedHeight,w=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=h,a.width=w}else a.tensorFormat="RGBA",a.height=h,a.width=w;u.drawImage(e,0,0),o=u.getImageData(0,0,w,h).data}else throw new Error("Can not access image data")}else if(s){let p,u;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,u=r.resizedWidth):(p=e.height,u=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=u,r!==void 0){let h=l();h.width=u,h.height=p;let w=d(h);if(w!=null)w.putImageData(e,0,0),o=w.getImageData(0,0,u,p).data;else throw new Error("Can not access image data")}else o=e.data}else if(i){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");let p=l();p.width=e.width,p.height=e.height;let u=d(p);if(u!=null){let h=e.height,w=e.width;return u.drawImage(e,0,0,w,h),o=u.getImageData(0,0,w,h).data,a.height=h,a.width=w,_a(o,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,u)=>{let h=l(),w=d(h);if(!e||!w)return u();let f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{h.width=f.width,h.height=f.height,w.drawImage(f,0,0,h.width,h.height);let P=w.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,p(_a(P.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(o!==void 0)return _a(o,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Wu=(e,r)=>{let{width:t,height:s,download:i,dispose:n}=r,o=[1,s,t,4];return new Br({location:"texture",type:"float32",texture:e,dims:o,download:i,dispose:n})},Gu=(e,r)=>{let{dataType:t,dims:s,download:i,dispose:n}=r;return new Br({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:i,dispose:n})},Ku=(e,r)=>{let{dataType:t,dims:s,download:i,dispose:n}=r;return new Br({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:i,dispose:n})},Hu=(e,r,t)=>new Br({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]})}),pn,$i,pd,qu,Gb=Ue(()=>{pn=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),$i=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),pd=!1,qu=()=>{if(!pd){pd=!0;let e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(pn.set("int64",BigInt64Array),$i.set(BigInt64Array,"int64")),r&&(pn.set("uint64",BigUint64Array),$i.set(BigUint64Array,"uint64")),s?(pn.set("float16",t),$i.set(t,"float16")):pn.set("float16",Uint16Array)}}}),Qu,Xu,Kb=Ue(()=>{hd(),Qu=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Br(e.type,e.data,r);case"cpu-pinned":return new Br({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Br({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Br({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Br({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Br,hd=Ue(()=>{Vb(),Wb(),Gb(),Kb(),Br=class{constructor(e,r,t){qu();let s,i;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,s=e.type,i=e.dims,e.location){case"cpu-pinned":{let o=pn.get(s);if(!o)throw new TypeError(`unsupported type "${s}" to create tensor from pinned buffer`);if(!(e.data instanceof o))throw new TypeError(`buffer should be of type ${o.name}`);this.cpuData=e.data;break}case"texture":{if(s!=="float32")throw new TypeError(`unsupported type "${s}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint64"&&s!=="int8"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let o,a;if(typeof e=="string")if(s=e,a=t,e==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");o=r}else{let l=pn.get(e);if(l===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(r)){if(e==="float16"&&l===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${l.name} as data.`);e==="uint64"||e==="int64"?o=l.from(r,BigInt):o=l.from(r)}else if(r instanceof l)o=r;else if(r instanceof Uint8ClampedArray)if(e==="uint8")o=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&r instanceof Uint16Array&&l!==Uint16Array)o=new globalThis.Float16Array(r.buffer,r.byteOffset,r.length);else throw new TypeError(`A ${s} tensor's data must be type of ${l}`)}else if(a=r,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let l=typeof e[0];if(l==="string")s="string",o=e;else if(l==="boolean")s="bool",o=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${l}.`)}else if(e instanceof Uint8ClampedArray)s="uint8",o=Uint8Array.from(e);else{let l=$i.get(e.constructor);if(l===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);s=l,o=e}if(a===void 0)a=[o.length];else if(!Array.isArray(a))throw new TypeError("A tensor's dims must be a number array");i=a,this.cpuData=o,this.dataLocation="cpu"}let n=Qu(i);if(this.cpuData&&n!==this.cpuData.length&&!((s==="uint4"||s==="int4")&&Math.ceil(n/2)===this.cpuData.length))throw new Error(`Tensor's size(${n}) does not match data length(${this.cpuData.length}).`);this.type=s,this.dims=i,this.size=n}static async fromImage(e,r){return Vu(e,r)}static fromTexture(e,r){return Wu(e,r)}static fromGpuBuffer(e,r){return Gu(e,r)}static fromMLTensor(e,r){return Ku(e,r)}static fromPinnedBuffer(e,r,t){return Hu(e,r,t)}toDataURL(e){return ju(this,e)}toImageData(e){return Uu(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new 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 new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new 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 new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,e&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new 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 new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Xu(this,e)}}}),ts,Ju=Ue(()=>{hd(),ts=Br}),ki,md,rs,Hr,Yu=Ue(()=>{Nu(),ki=(e,r)=>{(typeof Kr.trace>"u"?!Kr.wasm.trace:!Kr.trace)||console.timeStamp(`${e}::ORT::${r}`)},md=(e,r)=>{var i;let t=((i=new Error().stack)==null?void 0:i.split(/\r\n|\r|\n/g))||[],s=!1;for(let n=0;n{(typeof Kr.trace>"u"?!Kr.wasm.trace:!Kr.trace)||md("BEGIN",e)},Hr=e=>{(typeof Kr.trace>"u"?!Kr.wasm.trace:!Kr.trace)||md("END",e)}}),Zu,Hb=Ue(()=>{Bu(),Ju(),Yu(),Zu=class wb{constructor(r){this.handler=r}async run(r,t,s){rs();let i={},n={};if(typeof r!="object"||r===null||r instanceof ts||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let o=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof ts)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");o=!1;for(let d of t){if(typeof d!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(d)===-1)throw new RangeError(`'fetches' contains invalid output name: ${d}.`);i[d]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let d=!1,p=Object.getOwnPropertyNames(t);for(let u of this.outputNames)if(p.indexOf(u)!==-1){let h=t[u];(h===null||h instanceof ts)&&(d=!0,o=!1,i[u]=h)}if(d){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let d of this.inputNames)if(typeof r[d]>"u")throw new Error(`input '${d}' is missing in 'feeds'.`);if(o)for(let d of this.outputNames)i[d]=null;let a=await this.handler.run(r,i,n),l={};for(let d in a)if(Object.hasOwnProperty.call(a,d)){let p=a[d];p instanceof ts?l[d]=p:l[d]=new ts(p.type,p.data,p.dims)}return Hr(),l}async release(){return this.handler.dispose()}static async create(r,t,s,i){rs();let n,o={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)o=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)o=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){let p=r,u=0,h=r.byteLength;if(typeof t=="object"&&t!==null)o=t;else if(typeof t=="number"){if(u=t,!Number.isSafeInteger(u))throw new RangeError("'byteOffset' must be an integer.");if(u<0||u>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(h=r.byteLength-u,typeof s=="number"){if(h=s,!Number.isSafeInteger(h))throw new RangeError("'byteLength' must be an integer.");if(h<=0||u+h>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-u}].`);if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,u,h)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[a,l]=await zu(o),d=await a.createInferenceSessionHandler(n,l);return Hr(),new wb(d)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}}),_d,qb=Ue(()=>{Hb(),_d=Zu}),Qb=Ue(()=>{}),Xb=Ue(()=>{}),Jb=Ue(()=>{}),Yb=Ue(()=>{}),ep={};Ci(ep,{InferenceSession:()=>_d,TRACE:()=>ki,TRACE_FUNC_BEGIN:()=>rs,TRACE_FUNC_END:()=>Hr,Tensor:()=>ts,env:()=>Vt,registerBackend:()=>un});var ss=Ue(()=>{Nb(),Ub(),qb(),Ju(),Qb(),Xb(),Yu(),Jb(),Yb()}),fd=Ue(()=>{}),tp={};Ci(tp,{default:()=>rp});var gd,wd,rp,Zb=Ue(()=>{var e;Fw(),hn(),Pd(),gd="ort-wasm-proxy-worker",wd=((e=globalThis.self)==null?void 0:e.name)===gd,wd&&(self.onmessage=r=>{let{type:t,in:s}=r.data;try{switch(t){case"init-wasm":$d(s.wasm).then(()=>{Bc(s).then(()=>{postMessage({type:t})},i=>{postMessage({type:t,err:i})})},i=>{postMessage({type:t,err:i})});break;case"init-ep":{let{epName:i,env:n}=s;Rc(n,i).then(()=>{postMessage({type:t})},o=>{postMessage({type:t,err:o})});break}case"copy-from":{let{buffer:i}=s,n=Fa(i);postMessage({type:t,out:n});break}case"create":{let{model:i,options:n}=s;Nc(i,n).then(o=>{postMessage({type:t,out:o})},o=>{postMessage({type:t,err:o})});break}case"release":jc(s),postMessage({type:t});break;case"run":{let{sessionId:i,inputIndices:n,inputs:o,outputIndices:a,options:l}=s;Vc(i,n,o,a,new Array(a.length).fill(null),l).then(d=>{d.some(p=>p[3]!=="cpu")?postMessage({type:t,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:t,out:d},Gc([...o,...d]))},d=>{postMessage({type:t,err:d})});break}case"end-profiling":Wc(s),postMessage({type:t});break;default:}}catch(i){postMessage({type:t,err:i})}}),rp=wd?null:r=>new Worker(r??Rr,{type:"module",name:gd})}),sp={};Ci(sp,{default:()=>np});var yd,Md,np,ip,ev=Ue(()=>{var e,r;Md=(yd=self.location.href,async function(t={}){var ca;var s,i,n=t,o=new Promise((c,m)=>{s=c,i=m}),a=typeof window=="object",l=typeof WorkerGlobalScope<"u",d=l&&((ca=self.name)==null?void 0:ca.startsWith("em-pthread"));n.mountExternalData=(c,m)=>{c.startsWith("./")&&(c=c.substring(2)),(n.Bd||(n.Bd=new Map)).set(c,m)},n.unmountExternalData=()=>{delete n.Bd};var p=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor;let u=()=>{let c=(v,C,I)=>(...W)=>{let se=Rt,ge=C==null?void 0:C();W=v(...W);let Ee=C==null?void 0:C();return ge!==Ee&&(v=Ee,I(ge),C=I=null),Rt!=se?new Promise((ze,Ye)=>{rn={resolve:ze,reject:Ye}}):W},m=v=>async(...C)=>{var I;try{if(n.Cd)throw Error("Session already started");let W=n.Cd={be:C[0],errors:[]},se=await v(...C);if(n.Cd!==W)throw Error("Session mismatch");(I=n.Dd)==null||I.flush();let ge=W.errors;if(0ze),0n._OrtCreateSession,v=>n._OrtCreateSession=v),n._OrtRun=m(c(n._OrtRun,()=>n._OrtRun,v=>n._OrtRun=v)),n._OrtRunWithBinding=m(c(n._OrtRunWithBinding,()=>n._OrtRunWithBinding,v=>n._OrtRunWithBinding=v)),n._OrtBindInput=c(n._OrtBindInput,()=>n._OrtBindInput,v=>n._OrtBindInput=v),u=void 0};n.jsepInit=(c,m)=>{if(u==null||u(),c==="webgpu"){[n.Dd,n.Rd,n.Vd,n.Hd,n.Ud,n.hc,n.Wd,n.Zd,n.Sd,n.Td,n.Xd]=m;let v=n.Dd;n.jsepRegisterBuffer=(C,I,W,se)=>v.registerBuffer(C,I,W,se),n.jsepGetBuffer=C=>v.getBuffer(C),n.jsepCreateDownloader=(C,I,W)=>v.createDownloader(C,I,W),n.jsepOnCreateSession=C=>{v.onCreateSession(C)},n.jsepOnReleaseSession=C=>{v.onReleaseSession(C)},n.jsepOnRunStart=C=>v.onRunStart(C),n.$d=(C,I)=>{v.upload(C,I)}}else if(c==="webnn"){[n.Dd,n.Yd,n.Id,n.jsepEnsureTensor,n.Jd,n.jsepDownloadTensor]=m,n.jsepReleaseTensorId=n.Id,n.jsepUploadTensor=n.Jd;let v=n.Dd;n.jsepOnRunStart=C=>v.onRunStart(C),n.jsepOnRunEnd=v.onRunEnd.bind(v),n.jsepRegisterMLContext=(C,I)=>{v.registerMLContext(C,I)},n.jsepOnReleaseSession=C=>{v.onReleaseSession(C)},n.jsepCreateMLTensorDownloader=(C,I)=>v.createMLTensorDownloader(C,I),n.jsepRegisterMLTensor=(C,I,W,se)=>v.registerMLTensor(C,I,W,se),n.jsepCreateMLContext=C=>v.createMLContext(C),n.jsepRegisterMLConstant=(C,I,W,se,ge)=>v.registerMLConstant(C,I,W,se,ge,n.Bd),n.jsepRegisterGraphInput=v.registerGraphInput.bind(v),n.jsepIsGraphInput=v.isGraphInput.bind(v),n.jsepCreateTemporaryTensor=v.createTemporaryTensor.bind(v)}};var h,w,f=Object.assign({},n),P=(c,m)=>{throw m},A="";(a||l)&&(l?A=self.location.href:typeof document<"u"&&document.currentScript&&(A=document.currentScript.src),yd&&(A=yd),A=A.startsWith("blob:")?"":A.slice(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1),l&&(w=c=>{var m=new XMLHttpRequest;return m.open("GET",c,!1),m.responseType="arraybuffer",m.send(null),new Uint8Array(m.response)}),h=async c=>{if(we(c))return new Promise((v,C)=>{var I=new XMLHttpRequest;I.open("GET",c,!0),I.responseType="arraybuffer",I.onload=()=>{I.status==200||I.status==0&&I.response?v(I.response):C(I.status)},I.onerror=C,I.send(null)});var m=await fetch(c,{credentials:"same-origin"});if(m.ok)return m.arrayBuffer();throw Error(m.status+" : "+m.url)});var b=console.log.bind(console),y=console.error.bind(console),$=b,T=y;Object.assign(n,f),f=null;var g,M,E,k,B,N,J,q,V,Y,H,Q,ie,le=n.wasmBinary,ae=!1,we=c=>c.startsWith("file://");function R(){return g.buffer!=k.buffer&&K(),k}function O(){return g.buffer!=k.buffer&&K(),B}function G(){return g.buffer!=k.buffer&&K(),N}function ne(){return g.buffer!=k.buffer&&K(),J}function X(){return g.buffer!=k.buffer&&K(),q}function ye(){return g.buffer!=k.buffer&&K(),V}function _e(){return g.buffer!=k.buffer&&K(),Y}function ke(){return g.buffer!=k.buffer&&K(),ie}if(d){let c=function(m){try{var v=m.data,C=v.yd;if(C==="load"){let I=[];self.onmessage=W=>I.push(W),self.startWorker=()=>{postMessage({yd:"loaded"});for(let W of I)c(W);self.onmessage=c};for(let W of v.Od)n[W]&&!n[W].proxy||(n[W]=(...se)=>{postMessage({yd:"callHandler",Nd:W,args:se})},W=="print"&&($=n[W]),W=="printErr"&&(T=n[W]));g=v.he,K(),He(v.ie)}else if(C==="run"){Fs(v.xd),ri(v.xd,0,0,1,0,0),jt(),Ot(v.xd),Me||(ti(),Me=!0);try{Dr(v.de,v.Fd)}catch(I){if(I!="unwind")throw I}}else v.target!=="setimmediate"&&(C==="checkMailbox"?Me&&Ut():C&&(T(`worker: received unknown command ${C}`),T(v)))}catch(I){throw uo(),I}};var He,Me=!1;T=function(...m){m=m.join(" "),console.error(m)},self.alert=function(...m){postMessage({yd:"alert",text:m.join(" "),fe:In()})},self.onunhandledrejection=m=>{throw m.reason||m},self.onmessage=c}function K(){var c=g.buffer;n.HEAP8=k=new Int8Array(c),n.HEAP16=N=new Int16Array(c),n.HEAPU8=B=new Uint8Array(c),n.HEAPU16=J=new Uint16Array(c),n.HEAP32=q=new Int32Array(c),n.HEAPU32=V=new Uint32Array(c),n.HEAPF32=Y=new Float32Array(c),n.HEAPF64=ie=new Float64Array(c),n.HEAP64=H=new BigInt64Array(c),n.HEAPU64=Q=new BigUint64Array(c)}function U(){d?startWorker(n):Oe.Bb()}d||(g=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),K());var pe,Pe=0,Te=null;function Ae(){if(--Pe==0&&Te){var c=Te;Te=null,c()}}function Ie(c){throw T(c="Aborted("+c+")"),ae=!0,c=new WebAssembly.RuntimeError(c+". Build with -sASSERTIONS for more info."),i(c),c}function Le(){return{a:{Ta:D,Va:Ve,W:Os,la:dt,b:xs,u:Ts,R:Es,Za:Ds,d:mr,pb:et,g:Ur,T:Ir,Ga:ps,lb:ms,nb:_s,Ha:Qr,Ea:Ps,wb:qs,Da:Qs,pa:Xs,mb:Js,jb:fs,Fa:Ys,kb:Zs,Ma:Cs,za:Tn,eb:En,cb:Ss,ya:ue,V:F,N:j,db:te,ma:ht,fb:Ct,zb:kt,hb:vr,qb:Yr,ab:xr,Aa:gs,yb:Ot,Ja:Gt,S:Zr,Wa:ws,$:za,H:Ba,E:Na,l:Jr,F:Gi,B:Va,X:Ki,J:Wa,v:Hi,O:Jc,D:Ga,t:qi,A:Ka,z:Kn,w:Ha,r:qa,tb:Qa,ub:Xa,vb:Hn,rb:qn,sb:Yi,bb:Zi,Oa:Yc,La:Zc,y:Ya,ja:Za,Ba:el,Ka:Ja,qa:tl,Ia:rl,ib:Jn,U:js,fa:sl,Sa:nl,gb:il,Qa:to,Pa:ol,Ab:so,Ca:Zn,ob:je,aa:no,oa:io,xb:ei,na:oo,$a:Pl,ia:aa,sa:zl,ga:ra,da:kl,ua:Ll,p:xl,e:ul,c:dl,ea:na,f:pl,n:hl,k:ea,Y:_l,ka:bl,j:Tl,wa:Sl,Ra:da,ca:oa,Ua:Rl,P:$l,K:Zo,_:ia,Q:El,Z:Ol,x:fl,m:cl,va:Al,i:Jo,h:ml,ra:Bl,ta:la,o:Yo,q:gl,s:yl,I:Ml,C:ta,L:vl,xa:Cl,_a:sa,G:Fl,Ya:xi,ba:Dl,M:wl,Xa:Il,ha:ao,a:g,Na:Re}}}var Ne={1320978:()=>typeof wasmOffsetConverter<"u",1321035:(c,m,v,C,I)=>{if(n===void 0||!n.Bd)return 1;if((c=zt(Number(c>>>0))).startsWith("./")&&(c=c.substring(2)),!(c=n.Bd.get(c)))return 2;if(m=Number(m>>>0),v=Number(v>>>0),C=Number(C>>>0),m+v>c.byteLength)return 3;try{let W=c.subarray(m,m+v);switch(I){case 0:O().set(W,C>>>0);break;case 1:n.$d(C,W);break;default:return 4}return 0}catch{return 4}},1321750:(c,m,v)=>{n.Jd(c,O().subarray(m>>>0,m+v>>>0))},1321813:()=>n.Yd(),1321854:c=>{n.Id(c)},1321890:()=>{n.Sd()},1321921:()=>{n.Td()},1321950:()=>{n.Xd()},1321975:c=>n.Rd(c),1322008:c=>n.Vd(c),1322040:(c,m,v)=>{n.Hd(Number(c),Number(m),Number(v),!0)},1322103:(c,m,v)=>{n.Hd(Number(c),Number(m),Number(v))},1322160:c=>{n.hc("Abs",c,void 0)},1322211:c=>{n.hc("Neg",c,void 0)},1322262:c=>{n.hc("Floor",c,void 0)},1322315:c=>{n.hc("Ceil",c,void 0)},1322367:c=>{n.hc("Reciprocal",c,void 0)},1322425:c=>{n.hc("Sqrt",c,void 0)},1322477:c=>{n.hc("Exp",c,void 0)},1322528:c=>{n.hc("Erf",c,void 0)},1322579:c=>{n.hc("Sigmoid",c,void 0)},1322634:(c,m,v)=>{n.hc("HardSigmoid",c,{alpha:m,beta:v})},1322713:c=>{n.hc("Log",c,void 0)},1322764:c=>{n.hc("Sin",c,void 0)},1322815:c=>{n.hc("Cos",c,void 0)},1322866:c=>{n.hc("Tan",c,void 0)},1322917:c=>{n.hc("Asin",c,void 0)},1322969:c=>{n.hc("Acos",c,void 0)},1323021:c=>{n.hc("Atan",c,void 0)},1323073:c=>{n.hc("Sinh",c,void 0)},1323125:c=>{n.hc("Cosh",c,void 0)},1323177:c=>{n.hc("Asinh",c,void 0)},1323230:c=>{n.hc("Acosh",c,void 0)},1323283:c=>{n.hc("Atanh",c,void 0)},1323336:c=>{n.hc("Tanh",c,void 0)},1323388:c=>{n.hc("Not",c,void 0)},1323439:(c,m,v)=>{n.hc("Clip",c,{min:m,max:v})},1323508:c=>{n.hc("Clip",c,void 0)},1323560:(c,m)=>{n.hc("Elu",c,{alpha:m})},1323618:c=>{n.hc("Gelu",c,void 0)},1323670:c=>{n.hc("Relu",c,void 0)},1323722:(c,m)=>{n.hc("LeakyRelu",c,{alpha:m})},1323786:(c,m)=>{n.hc("ThresholdedRelu",c,{alpha:m})},1323856:(c,m)=>{n.hc("Cast",c,{to:m})},1323914:c=>{n.hc("Add",c,void 0)},1323965:c=>{n.hc("Sub",c,void 0)},1324016:c=>{n.hc("Mul",c,void 0)},1324067:c=>{n.hc("Div",c,void 0)},1324118:c=>{n.hc("Pow",c,void 0)},1324169:c=>{n.hc("Equal",c,void 0)},1324222:c=>{n.hc("Greater",c,void 0)},1324277:c=>{n.hc("GreaterOrEqual",c,void 0)},1324339:c=>{n.hc("Less",c,void 0)},1324391:c=>{n.hc("LessOrEqual",c,void 0)},1324450:(c,m,v,C,I)=>{n.hc("ReduceMean",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1324625:(c,m,v,C,I)=>{n.hc("ReduceMax",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1324799:(c,m,v,C,I)=>{n.hc("ReduceMin",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1324973:(c,m,v,C,I)=>{n.hc("ReduceProd",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325148:(c,m,v,C,I)=>{n.hc("ReduceSum",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325322:(c,m,v,C,I)=>{n.hc("ReduceL1",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325495:(c,m,v,C,I)=>{n.hc("ReduceL2",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325668:(c,m,v,C,I)=>{n.hc("ReduceLogSum",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325845:(c,m,v,C,I)=>{n.hc("ReduceSumSquare",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1326025:(c,m,v,C,I)=>{n.hc("ReduceLogSumExp",c,{keepDims:!!m,noopWithEmptyAxes:!!v,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1326205:c=>{n.hc("Where",c,void 0)},1326258:(c,m,v)=>{n.hc("Transpose",c,{perm:m?Array.from(X().subarray(Number(m)>>>0,Number(v)>>>0)):[]})},1326382:(c,m,v,C)=>{n.hc("DepthToSpace",c,{blocksize:m,mode:zt(v),format:C?"NHWC":"NCHW"})},1326515:(c,m,v,C)=>{n.hc("DepthToSpace",c,{blocksize:m,mode:zt(v),format:C?"NHWC":"NCHW"})},1326648:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt,Pr)=>{n.hc("ConvTranspose",c,{format:Ee?"NHWC":"NCHW",autoPad:m,dilations:[v],group:C,kernelShape:[I],pads:[W,se],strides:[ge],wIsConst:()=>!!R()[ze>>>0],outputPadding:Ye?Array.from(X().subarray(Number(Ye)>>>0,Number(ot)>>>0)):[],outputShape:gt?Array.from(X().subarray(Number(gt)>>>0,Number(Bt)>>>0)):[],activation:zt(Pr)})},1327081:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt)=>{n.hc("ConvTranspose",c,{format:ge?"NHWC":"NCHW",autoPad:m,dilations:Array.from(X().subarray(Number(v)>>>0,2+(Number(v)>>>0)>>>0)),group:C,kernelShape:Array.from(X().subarray(Number(I)>>>0,2+(Number(I)>>>0)>>>0)),pads:Array.from(X().subarray(Number(W)>>>0,4+(Number(W)>>>0)>>>0)),strides:Array.from(X().subarray(Number(se)>>>0,2+(Number(se)>>>0)>>>0)),wIsConst:()=>!!R()[Ee>>>0],outputPadding:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],outputShape:ot?Array.from(X().subarray(Number(ot)>>>0,Number(gt)>>>0)):[],activation:zt(Bt)})},1327742:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt,Pr)=>{n.hc("ConvTranspose",c,{format:Ee?"NHWC":"NCHW",autoPad:m,dilations:[v],group:C,kernelShape:[I],pads:[W,se],strides:[ge],wIsConst:()=>!!R()[ze>>>0],outputPadding:Ye?Array.from(X().subarray(Number(Ye)>>>0,Number(ot)>>>0)):[],outputShape:gt?Array.from(X().subarray(Number(gt)>>>0,Number(Bt)>>>0)):[],activation:zt(Pr)})},1328175:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt)=>{n.hc("ConvTranspose",c,{format:ge?"NHWC":"NCHW",autoPad:m,dilations:Array.from(X().subarray(Number(v)>>>0,2+(Number(v)>>>0)>>>0)),group:C,kernelShape:Array.from(X().subarray(Number(I)>>>0,2+(Number(I)>>>0)>>>0)),pads:Array.from(X().subarray(Number(W)>>>0,4+(Number(W)>>>0)>>>0)),strides:Array.from(X().subarray(Number(se)>>>0,2+(Number(se)>>>0)>>>0)),wIsConst:()=>!!R()[Ee>>>0],outputPadding:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],outputShape:ot?Array.from(X().subarray(Number(ot)>>>0,Number(gt)>>>0)):[],activation:zt(Bt)})},1328836:(c,m)=>{n.hc("GlobalAveragePool",c,{format:m?"NHWC":"NCHW"})},1328927:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt)=>{n.hc("AveragePool",c,{format:Bt?"NHWC":"NCHW",auto_pad:m,ceil_mode:v,count_include_pad:C,storage_order:I,dilations:W?Array.from(X().subarray(Number(W)>>>0,Number(se)>>>0)):[],kernel_shape:ge?Array.from(X().subarray(Number(ge)>>>0,Number(Ee)>>>0)):[],pads:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],strides:ot?Array.from(X().subarray(Number(ot)>>>0,Number(gt)>>>0)):[]})},1329406:(c,m)=>{n.hc("GlobalAveragePool",c,{format:m?"NHWC":"NCHW"})},1329497:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt)=>{n.hc("AveragePool",c,{format:Bt?"NHWC":"NCHW",auto_pad:m,ceil_mode:v,count_include_pad:C,storage_order:I,dilations:W?Array.from(X().subarray(Number(W)>>>0,Number(se)>>>0)):[],kernel_shape:ge?Array.from(X().subarray(Number(ge)>>>0,Number(Ee)>>>0)):[],pads:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],strides:ot?Array.from(X().subarray(Number(ot)>>>0,Number(gt)>>>0)):[]})},1329976:(c,m)=>{n.hc("GlobalMaxPool",c,{format:m?"NHWC":"NCHW"})},1330063:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt)=>{n.hc("MaxPool",c,{format:Bt?"NHWC":"NCHW",auto_pad:m,ceil_mode:v,count_include_pad:C,storage_order:I,dilations:W?Array.from(X().subarray(Number(W)>>>0,Number(se)>>>0)):[],kernel_shape:ge?Array.from(X().subarray(Number(ge)>>>0,Number(Ee)>>>0)):[],pads:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],strides:ot?Array.from(X().subarray(Number(ot)>>>0,Number(gt)>>>0)):[]})},1330538:(c,m)=>{n.hc("GlobalMaxPool",c,{format:m?"NHWC":"NCHW"})},1330625:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt)=>{n.hc("MaxPool",c,{format:Bt?"NHWC":"NCHW",auto_pad:m,ceil_mode:v,count_include_pad:C,storage_order:I,dilations:W?Array.from(X().subarray(Number(W)>>>0,Number(se)>>>0)):[],kernel_shape:ge?Array.from(X().subarray(Number(ge)>>>0,Number(Ee)>>>0)):[],pads:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],strides:ot?Array.from(X().subarray(Number(ot)>>>0,Number(gt)>>>0)):[]})},1331100:(c,m,v,C,I)=>{n.hc("Gemm",c,{alpha:m,beta:v,transA:C,transB:I})},1331204:c=>{n.hc("MatMul",c,void 0)},1331258:(c,m,v,C)=>{n.hc("ArgMax",c,{keepDims:!!m,selectLastIndex:!!v,axis:C})},1331366:(c,m,v,C)=>{n.hc("ArgMin",c,{keepDims:!!m,selectLastIndex:!!v,axis:C})},1331474:(c,m)=>{n.hc("Softmax",c,{axis:m})},1331537:(c,m)=>{n.hc("Concat",c,{axis:m})},1331597:(c,m,v,C,I)=>{n.hc("Split",c,{axis:m,numOutputs:v,splitSizes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1331753:c=>{n.hc("Expand",c,void 0)},1331807:(c,m)=>{n.hc("Gather",c,{axis:Number(m)})},1331878:(c,m)=>{n.hc("GatherElements",c,{axis:Number(m)})},1331957:(c,m)=>{n.hc("GatherND",c,{batch_dims:Number(m)})},1332036:(c,m,v,C,I,W,se,ge,Ee,ze,Ye)=>{n.hc("Resize",c,{antialias:m,axes:v?Array.from(X().subarray(Number(v)>>>0,Number(C)>>>0)):[],coordinateTransformMode:zt(I),cubicCoeffA:W,excludeOutside:se,extrapolationValue:ge,keepAspectRatioPolicy:zt(Ee),mode:zt(ze),nearestMode:zt(Ye)})},1332398:(c,m,v,C,I,W,se)=>{n.hc("Slice",c,{starts:m?Array.from(X().subarray(Number(m)>>>0,Number(v)>>>0)):[],ends:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[],axes:W?Array.from(X().subarray(Number(W)>>>0,Number(se)>>>0)):[]})},1332662:c=>{n.hc("Tile",c,void 0)},1332714:(c,m,v)=>{n.hc("InstanceNormalization",c,{epsilon:m,format:v?"NHWC":"NCHW"})},1332828:(c,m,v)=>{n.hc("InstanceNormalization",c,{epsilon:m,format:v?"NHWC":"NCHW"})},1332942:c=>{n.hc("Range",c,void 0)},1332995:(c,m)=>{n.hc("Einsum",c,{equation:zt(m)})},1333076:(c,m,v,C,I)=>{n.hc("Pad",c,{mode:m,value:v,pads:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1333219:(c,m,v,C,I,W)=>{n.hc("BatchNormalization",c,{epsilon:m,momentum:v,spatial:!!I,trainingMode:!!C,format:W?"NHWC":"NCHW"})},1333388:(c,m,v,C,I,W)=>{n.hc("BatchNormalization",c,{epsilon:m,momentum:v,spatial:!!I,trainingMode:!!C,format:W?"NHWC":"NCHW"})},1333557:(c,m,v)=>{n.hc("CumSum",c,{exclusive:Number(m),reverse:Number(v)})},1333654:(c,m,v)=>{n.hc("DequantizeLinear",c,{axis:m,blockSize:v})},1333744:(c,m,v,C,I)=>{n.hc("GridSample",c,{align_corners:m,mode:zt(v),padding_mode:zt(C),format:I?"NHWC":"NCHW"})},1333914:(c,m,v,C,I)=>{n.hc("GridSample",c,{align_corners:m,mode:zt(v),padding_mode:zt(C),format:I?"NHWC":"NCHW"})},1334084:(c,m)=>{n.hc("ScatterND",c,{reduction:zt(m)})},1334169:(c,m,v,C,I,W,se,ge,Ee)=>{n.hc("Attention",c,{numHeads:m,isUnidirectional:v,maskFilterValue:C,scale:I,doRotary:W,qkvHiddenSizes:se?Array.from(X().subarray(Number(ge)>>>0,Number(ge)+se>>>0)):[],pastPresentShareBuffer:!!Ee})},1334441:c=>{n.hc("BiasAdd",c,void 0)},1334496:c=>{n.hc("BiasSplitGelu",c,void 0)},1334557:c=>{n.hc("FastGelu",c,void 0)},1334613:(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt,Pr,an)=>{n.hc("Conv",c,{format:ot?"NHWC":"NCHW",auto_pad:m,dilations:v?Array.from(X().subarray(Number(v)>>>0,Number(C)>>>0)):[],group:I,kernel_shape:W?Array.from(X().subarray(Number(W)>>>0,Number(se)>>>0)):[],pads:ge?Array.from(X().subarray(Number(ge)>>>0,Number(Ee)>>>0)):[],strides:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],w_is_const:()=>!!R()[Number(gt)>>>0],activation:zt(Bt),activation_params:Pr?Array.from(_e().subarray(Number(Pr)>>>0,Number(an)>>>0)):[]})},1335197:c=>{n.hc("Gelu",c,void 0)},1335249:(c,m,v,C,I,W,se,ge,Ee)=>{n.hc("GroupQueryAttention",c,{numHeads:m,kvNumHeads:v,scale:C,softcap:I,doRotary:W,rotaryInterleaved:se,smoothSoftmax:ge,localWindowSize:Ee})},1335466:(c,m,v,C)=>{n.hc("LayerNormalization",c,{axis:m,epsilon:v,simplified:!!C})},1335577:(c,m,v,C)=>{n.hc("LayerNormalization",c,{axis:m,epsilon:v,simplified:!!C})},1335688:(c,m,v,C,I,W)=>{n.hc("MatMulNBits",c,{k:m,n:v,accuracyLevel:C,bits:I,blockSize:W})},1335815:(c,m,v,C,I,W)=>{n.hc("MultiHeadAttention",c,{numHeads:m,isUnidirectional:v,maskFilterValue:C,scale:I,doRotary:W})},1335974:(c,m)=>{n.hc("QuickGelu",c,{alpha:m})},1336038:(c,m,v,C,I)=>{n.hc("RotaryEmbedding",c,{interleaved:!!m,numHeads:v,rotaryEmbeddingDim:C,scale:I})},1336177:(c,m,v)=>{n.hc("SkipLayerNormalization",c,{epsilon:m,simplified:!!v})},1336279:(c,m,v)=>{n.hc("SkipLayerNormalization",c,{epsilon:m,simplified:!!v})},1336381:(c,m,v,C)=>{n.hc("GatherBlockQuantized",c,{gatherAxis:m,quantizeAxis:v,blockSize:C})},1336502:c=>{n.Wd(c)},1336536:(c,m)=>n.Zd(Number(c),Number(m),n.Cd.be,n.Cd.errors)};function Ve(c,m,v){return Vi(async()=>{await n.Ud(Number(c),Number(m),Number(v))})}function D(){return typeof wasmOffsetConverter<"u"}class Z{constructor(m){re(this,"name","ExitStatus");this.message=`Program terminated with exit(${m})`,this.status=m}}var z=c=>{c.terminate(),c.onmessage=()=>{}},ee=[],ce=c=>{Qe.length==0&&(ds(),dr(Qe[0]));var m=Qe.pop();if(!m)return 6;Xe.push(m),wt[c.xd]=m,m.xd=c.xd;var v={yd:"run",de:c.ce,Fd:c.Fd,xd:c.xd};return m.postMessage(v,c.Ld),0},be=0,ve=(c,m,...v)=>{for(var C=2*v.length,I=_t(),W=An(8*C),se=W>>>3,ge=0;ge>>0]=Ee)}return c=si(c,0,C,W,m),mt(I),c};function Re(c){if(d)return ve(0,1,c);if(E=c,!(0{if(E=c,d)throw Fe(c),"unwind";Re(c)},Qe=[],Xe=[],ut=[],wt={},nr=c=>{var m=c.xd;delete wt[m],Qe.push(c),Xe.splice(Xe.indexOf(c),1),c.xd=0,po(m)};function jt(){ut.forEach(c=>c())}var dr=c=>new Promise(m=>{c.onmessage=I=>{var W=(I=I.data).yd;if(I.Ed&&I.Ed!=In()){var se=wt[I.Ed];se?se.postMessage(I,I.Ld):T(`Internal error! Worker sent a message "${W}" to target pthread ${I.Ed}, but that thread no longer exists!`)}else W==="checkMailbox"?Ut():W==="spawnThread"?ce(I):W==="cleanupThread"?nr(wt[I.ee]):W==="loaded"?(c.loaded=!0,m(c)):W==="alert"?alert(`Thread ${I.fe}: ${I.text}`):I.target==="setimmediate"?c.postMessage(I):W==="callHandler"?n[I.Nd](...I.args):W&&T(`worker sent an unknown command ${W}`)},c.onerror=I=>{throw T(`worker sent an error! ${I.filename}:${I.lineno}: ${I.message}`),I};var v,C=[];for(v of[])n.propertyIsEnumerable(v)&&C.push(v);c.postMessage({yd:"load",Od:C,he:g,ie:M})});function ds(){var c=new Worker((()=>{let m=URL;return self.location.href>"file:"&&self.location.href<"file;"?new m("ort.bundle.min.mjs",self.location.href):new URL(self.location.href)})(),{type:"module",workerData:"em-pthread",name:"em-pthread"});Qe.push(c)}var Fs=c=>{K();var m=ye()[c+52>>>2>>>0];c=ye()[c+56>>>2>>>0],mo(m,m-c),mt(m)},Dr=(c,m)=>{be=0,c=li(c,m),0>>=0);if(R()[m.wd+12>>>0]==0){var v=1;R()[m.wd+12>>>0]=v}return v=0,R()[m.wd+13>>>0]=v,cs.push(m),oi(c),go(c)}var jr=0,dt=()=>{ft(0,0);var c=cs.pop();_o(c.Gd),jr=0};class qr{constructor(m){this.Gd=m,this.wd=m-24}}function Ur(c){throw jr||(jr=c>>>0),jr}var us=c=>{var m=jr;if(!m)return Us(0),0;var v=new qr(m);ye()[v.wd+16>>>2>>>0]=m;var C=ye()[v.wd+4>>>2>>>0];if(!C)return Us(0),m;for(var I of c){if(I===0||I===C)break;if(fo(I,C,v.wd+16))return Us(I),m}return Us(C),m};function xs(){return us([])}function Ts(c){return us([c>>>0])}function Es(c,m){return us([c>>>0,m>>>0])}var Ds=()=>{var c=cs.pop();c||Ie("no exception to throw");var m=c.Gd;if(R()[c.wd+13>>>0]==0){cs.push(c);var v=1;R()[c.wd+13>>>0]=v,v=0,R()[c.wd+12>>>0]=v}throw jr=m};function mr(c,m,v){var C=new qr(c>>>=0);throw m>>>=0,v>>>=0,ye()[C.wd+16>>>2>>>0]=0,ye()[C.wd+4>>>2>>>0]=m,ye()[C.wd+8>>>2>>>0]=v,jr=c}function Be(c,m,v,C){return d?ve(2,1,c,m,v,C):et(c,m,v,C)}function et(c,m,v,C){if(c>>>=0,v>>>=0,C>>>=0,p===void 0)return 6;var I=[];return d&&I.length===0?Be(c,m>>>=0,v,C):(c={ce:v,xd:c,Fd:C,Ld:I},d?(c.yd="spawnThread",postMessage(c,I),0):ce(c))}var it=typeof TextDecoder<"u"?new TextDecoder:void 0,rr=(c,m=0,v=NaN)=>{var C=(m>>>=0)+v;for(v=m;c[v]&&!(v>=C);)++v;if(16(I=(240&I)==224?(15&I)<<12|W<<6|se:(7&I)<<18|W<<12|se<<6|63&c[m++])?C+=String.fromCharCode(I):(I-=65536,C+=String.fromCharCode(55296|I>>10,56320|1023&I))}}else C+=String.fromCharCode(I)}return C},zt=(c,m)=>(c>>>=0)?rr(O(),c,m):"";function Ir(c,m,v){return d?ve(3,1,c,m,v):0}function ps(c,m){if(d)return ve(4,1,c,m)}var hs=c=>{for(var m=0,v=0;v=C?m++:2047>=C?m+=2:55296<=C&&57343>=C?(m+=4,++v):m+=3}return m},Er=(c,m,v)=>{var C=O();if(m>>>=0,0=se&&(se=65536+((1023&se)<<10)|1023&c.charCodeAt(++W)),127>=se){if(m>=v)break;C[m++>>>0]=se}else{if(2047>=se){if(m+1>=v)break;C[m++>>>0]=192|se>>6}else{if(65535>=se){if(m+2>=v)break;C[m++>>>0]=224|se>>12}else{if(m+3>=v)break;C[m++>>>0]=240|se>>18,C[m++>>>0]=128|se>>12&63}C[m++>>>0]=128|se>>6&63}C[m++>>>0]=128|63&se}}C[m>>>0]=0,c=m-I}else c=0;return c};function ms(c,m){if(d)return ve(5,1,c,m)}function _s(c,m,v){if(d)return ve(6,1,c,m,v)}function Qr(c,m,v){return d?ve(7,1,c,m,v):0}function Ps(c,m){if(d)return ve(8,1,c,m)}function qs(c,m,v){if(d)return ve(9,1,c,m,v)}function Qs(c,m,v,C){if(d)return ve(10,1,c,m,v,C)}function Xs(c,m,v,C){if(d)return ve(11,1,c,m,v,C)}function Js(c,m,v,C){if(d)return ve(12,1,c,m,v,C)}function fs(c){if(d)return ve(13,1,c)}function Ys(c,m){if(d)return ve(14,1,c,m)}function Zs(c,m,v){if(d)return ve(15,1,c,m,v)}var en,Lr,Cs=()=>Ie(""),br=c=>{for(var m="";O()[c>>>0];)m+=en[O()[c++>>>0]];return m},Ls={},zs={};function Ar(c,m,v={}){return function(C,I,W={}){var se=I.name;if(!C)throw new Lr(`type "${se}" must have a positive integer typeid pointer`);if(zs.hasOwnProperty(C)){if(W.Pd)return;throw new Lr(`Cannot register type '${se}' twice`)}zs[C]=I,Ls.hasOwnProperty(C)&&(I=Ls[C],delete Ls[C],I.forEach(ge=>ge()))}(c,m,v)}var Xr=(c,m,v)=>{switch(m){case 1:return v?C=>R()[C>>>0]:C=>O()[C>>>0];case 2:return v?C=>G()[C>>>1>>>0]:C=>ne()[C>>>1>>>0];case 4:return v?C=>X()[C>>>2>>>0]:C=>ye()[C>>>2>>>0];case 8:return v?C=>H[C>>>3]:C=>Q[C>>>3];default:throw new TypeError(`invalid integer width (${m}): ${c}`)}};function Tn(c,m,v){v>>>=0,Ar(c>>>=0,{name:m=br(m>>>0),fromWireType:C=>C,toWireType:function(C,I){if(typeof I!="bigint"&&typeof I!="number")throw I=I===null?"null":(C=typeof I)=="object"||C==="array"||C==="function"?I.toString():""+I,new TypeError(`Cannot convert "${I}" to ${this.name}`);return typeof I=="number"&&(I=BigInt(I)),I},zd:zr,readValueFromPointer:Xr(m,v,m.indexOf("u")==-1),Ad:null})}var zr=8;function En(c,m,v,C){Ar(c>>>=0,{name:m=br(m>>>0),fromWireType:function(I){return!!I},toWireType:function(I,W){return W?v:C},zd:zr,readValueFromPointer:function(I){return this.fromWireType(O()[I>>>0])},Ad:null})}var Bs=[],Fr=[];function Jr(c){9<(c>>>=0)&&--Fr[c+1]==0&&(Fr[c]=void 0,Bs.push(c))}var cr=c=>{if(!c)throw new Lr("Cannot use deleted val. handle = "+c);return Fr[c]},_r=c=>{switch(c){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let m=Bs.pop()||Fr.length;return Fr[m]=c,Fr[m+1]=1,m}};function Rs(c){return this.fromWireType(ye()[c>>>2>>>0])}var Pn={name:"emscripten::val",fromWireType:c=>{var m=cr(c);return Jr(c),m},toWireType:(c,m)=>_r(m),zd:zr,readValueFromPointer:Rs,Ad:null};function Ss(c){return Ar(c>>>0,Pn)}var Cn=(c,m)=>{switch(m){case 4:return function(v){return this.fromWireType(_e()[v>>>2>>>0])};case 8:return function(v){return this.fromWireType(ke()[v>>>3>>>0])};default:throw new TypeError(`invalid float width (${m}): ${c}`)}};function ue(c,m,v){v>>>=0,Ar(c>>>=0,{name:m=br(m>>>0),fromWireType:C=>C,toWireType:(C,I)=>I,zd:zr,readValueFromPointer:Cn(m,v),Ad:null})}function F(c,m,v,C,I){if(c>>>=0,v>>>=0,m=br(m>>>0),I===-1&&(I=4294967295),I=ge=>ge,C===0){var W=32-8*v;I=ge=>ge<>>W}var se=m.includes("unsigned")?function(ge,Ee){return Ee>>>0}:function(ge,Ee){return Ee};Ar(c,{name:m,fromWireType:I,toWireType:se,zd:zr,readValueFromPointer:Xr(m,v,C!==0),Ad:null})}function j(c,m,v){function C(W){var se=ye()[W>>>2>>>0];return W=ye()[W+4>>>2>>>0],new I(R().buffer,W,se)}var I=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][m];Ar(c>>>=0,{name:v=br(v>>>0),fromWireType:C,zd:zr,readValueFromPointer:C},{Pd:!0})}function te(c,m){Ar(c>>>=0,{name:m=br(m>>>0),fromWireType:function(v){for(var C,I=ye()[v>>>2>>>0],W=v+4,se=W,ge=0;ge<=I;++ge){var Ee=W+ge;ge!=I&&O()[Ee>>>0]!=0||(se=zt(se,Ee-se),C===void 0?C=se:(C+="\0",C+=se),se=Ee+1)}return Vr(v),C},toWireType:function(v,C){C instanceof ArrayBuffer&&(C=new Uint8Array(C));var I=typeof C=="string";if(!(I||C instanceof Uint8Array||C instanceof Uint8ClampedArray||C instanceof Int8Array))throw new Lr("Cannot pass non-string to std::string");var W=I?hs(C):C.length,se=on(4+W+1),ge=se+4;if(ye()[se>>>2>>>0]=W,I)Er(C,ge,W+1);else if(I)for(I=0;I>>0]=Ee}else for(I=0;I>>0]=C[I];return v!==null&&v.push(Vr,se),se},zd:zr,readValueFromPointer:Rs,Ad(v){Vr(v)}})}var de=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,he=(c,m)=>{for(var v=c>>1,C=v+m/2;!(v>=C)&&ne()[v>>>0];)++v;if(32<(v<<=1)-c&&de)return de.decode(O().slice(c,v));for(v="",C=0;!(C>=m/2);++C){var I=G()[c+2*C>>>1>>>0];if(I==0)break;v+=String.fromCharCode(I)}return v},Ce=(c,m,v)=>{if(v??(v=2147483647),2>v)return 0;var C=m;v=(v-=2)<2*c.length?v/2:c.length;for(var I=0;I>>1>>>0]=W,m+=2}return G()[m>>>1>>>0]=0,m-C},We=c=>2*c.length,qe=(c,m)=>{for(var v=0,C="";!(v>=m/4);){var I=X()[c+4*v>>>2>>>0];if(I==0)break;++v,65536<=I?(I-=65536,C+=String.fromCharCode(55296|I>>10,56320|1023&I)):C+=String.fromCharCode(I)}return C},Ke=(c,m,v)=>{if(m>>>=0,v??(v=2147483647),4>v)return 0;var C=m;v=C+v-4;for(var I=0;I=W&&(W=65536+((1023&W)<<10)|1023&c.charCodeAt(++I)),X()[m>>>2>>>0]=W,(m+=4)+4>v)break}return X()[m>>>2>>>0]=0,m-C},Ze=c=>{for(var m=0,v=0;v=C&&++v,m+=4}return m};function ht(c,m,v){if(c>>>=0,m>>>=0,v=br(v>>>=0),m===2)var C=he,I=Ce,W=We,se=ge=>ne()[ge>>>1>>>0];else m===4&&(C=qe,I=Ke,W=Ze,se=ge=>ye()[ge>>>2>>>0]);Ar(c,{name:v,fromWireType:ge=>{for(var Ee,ze=ye()[ge>>>2>>>0],Ye=ge+4,ot=0;ot<=ze;++ot){var gt=ge+4+ot*m;ot!=ze&&se(gt)!=0||(Ye=C(Ye,gt-Ye),Ee===void 0?Ee=Ye:(Ee+="\0",Ee+=Ye),Ye=gt+m)}return Vr(ge),Ee},toWireType:(ge,Ee)=>{if(typeof Ee!="string")throw new Lr(`Cannot pass non-string to C++ string type ${v}`);var ze=W(Ee),Ye=on(4+ze+m);return ye()[Ye>>>2>>>0]=ze/m,I(Ee,Ye+4,ze+m),ge!==null&&ge.push(Vr,Ye),Ye},zd:zr,readValueFromPointer:Rs,Ad(ge){Vr(ge)}})}function Ct(c,m){Ar(c>>>=0,{Qd:!0,name:m=br(m>>>0),zd:0,fromWireType:()=>{},toWireType:()=>{}})}function kt(c){ri(c>>>0,!l,1,!a,131072,!1),jt()}var Wt=c=>{if(!ae)try{if(c(),!(0>>=0,typeof Atomics.ge=="function"&&(Atomics.ge(X(),c>>>2,c).value.then(Ut),c+=128,Atomics.store(X(),c>>>2,1))}var Ut=()=>{var c=In();c&&(Ot(c),Wt(ho))};function vr(c,m){(c>>>=0)==m>>>0?setTimeout(Ut):d?postMessage({Ed:c,yd:"checkMailbox"}):(c=wt[c])&&c.postMessage({yd:"checkMailbox"})}var fr=[];function Yr(c,m,v,C,I){for(m>>>=0,C/=2,fr.length=C,v=I>>>0>>>3,I=0;I>>0];return(m?Ne[m]:ll[c])(...fr)}var xr=()=>{be=0};function gs(c){c>>>=0,d?postMessage({yd:"cleanupThread",ee:c}):nr(wt[c])}function Gt(c){}var Zt=(c,m)=>{var v=zs[c];if(v===void 0)throw c=co(c),v=br(c),Vr(c),new Lr(`${m} has unknown type ${v}`);return v},gr=(c,m,v)=>{var C=[];return c=c.toWireType(C,v),C.length&&(ye()[m>>>2>>>0]=_r(C)),c};function Zr(c,m,v){return m>>>=0,v>>>=0,c=cr(c>>>0),m=Zt(m,"emval::as"),gr(m,v,c)}function ws(c,m){return m>>>=0,c=cr(c>>>0),(m=Zt(m,"emval::as")).toWireType(null,c)}var Ht=c=>{try{c()}catch(m){Ie(m)}},ur=0,Rt=null,Jt=0,qt=[],er={},ir={},tn=0,rn=null,La=[];function Vi(c){return function(m){if(!ae){if(ur===0){var v=!1,C=!1;m((I=0)=>{if(!ae&&(Jt=I,v=!0,C)){ur=2,Ht(()=>Qo(Rt)),typeof MainLoop<"u"&&MainLoop.Md&&MainLoop.resume(),I=!1;try{var W=function(){var Ee=X()[Rt+8>>>2>>>0];return Ee=Oe[ir[Ee]],--be,Ee()}()}catch(Ee){W=Ee,I=!0}var se=!1;if(!Rt){var ge=rn;ge&&(rn=null,(I?ge.reject:ge.resolve)(W),se=!0)}if(I&&!se)throw W}}),C=!0,v||(ur=1,Rt=function(){var I=on(65548),W=I+12;ye()[I>>>2>>>0]=W,ye()[I+4>>>2>>>0]=W+65536,W=qt[0];var se=er[W];return se===void 0&&(se=tn++,er[W]=se,ir[se]=W),W=se,X()[I+8>>>2>>>0]=W,I}(),typeof MainLoop<"u"&&MainLoop.Md&&MainLoop.pause(),Ht(()=>Ho(Rt)))}else ur===2?(ur=0,Ht(Xo),Vr(Rt),Rt=null,La.forEach(Wt)):Ie(`invalid state: ${ur}`);return Jt}}(m=>{c().then(m)})}function za(c){return c>>>=0,Vi(async()=>{var m=await cr(c);return _r(m)})}var ys=[];function Ba(c,m,v,C){return v>>>=0,C>>>=0,(c=ys[c>>>0])(null,m=cr(m>>>0),v,C)}var Ra={},Sn=c=>{var m=Ra[c];return m===void 0?br(c):m};function Na(c,m,v,C,I){return v>>>=0,C>>>=0,I>>>=0,(c=ys[c>>>0])(m=cr(m>>>0),m[v=Sn(v)],C,I)}var Wi=()=>typeof globalThis=="object"?globalThis:Function("return this")();function Gi(c){return(c>>>=0)==0?_r(Wi()):(c=Sn(c),_r(Wi()[c]))}var ja=c=>{var m=ys.length;return ys.push(c),m},Ua=(c,m)=>{for(var v=Array(c),C=0;C>>2>>>0],"parameter "+C);return v},Gn=(c,m)=>Object.defineProperty(m,"name",{value:c});function Va(c,m,v){var C=(m=Ua(c,m>>>0)).shift();c--;var I=`return function (obj, func, destructorsRef, args) { -`,W=0,se=[];v===0&&se.push("obj");for(var ge=["retType"],Ee=[C],ze=0;zeYe.name).join(", ")}) => ${C.name}>`,ja(Gn(v,c))}function Ki(c){return c=Sn(c>>>0),_r(n[c])}function Wa(c,m){return m>>>=0,c=cr(c>>>0),m=cr(m),_r(c[m])}function Hi(c){9<(c>>>=0)&&(Fr[c+1]+=1)}function Jc(){return _r([])}function Ga(c){c=cr(c>>>0);for(var m=Array(c.length),v=0;v>>0))}function Ka(){return _r({})}function Kn(c){for(var m=cr(c>>>=0);m.length;){var v=m.pop();m.pop()(v)}Jr(c)}function Ha(c,m,v){m>>>=0,v>>>=0,c=cr(c>>>0),m=cr(m),v=cr(v),c[m]=v}function qa(c,m){return m>>>=0,c=(c=Zt(c>>>0,"_emval_take_value")).readValueFromPointer(m),_r(c)}function Qa(c,m){c=-9007199254740992>c||9007199254740992>>=0,c=new Date(1e3*c),X()[m>>>2>>>0]=c.getUTCSeconds(),X()[m+4>>>2>>>0]=c.getUTCMinutes(),X()[m+8>>>2>>>0]=c.getUTCHours(),X()[m+12>>>2>>>0]=c.getUTCDate(),X()[m+16>>>2>>>0]=c.getUTCMonth(),X()[m+20>>>2>>>0]=c.getUTCFullYear()-1900,X()[m+24>>>2>>>0]=c.getUTCDay(),c=(c.getTime()-Date.UTC(c.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,X()[m+28>>>2>>>0]=c}var Qi=c=>c%4==0&&(c%100!=0||c%400==0),Xi=[0,31,60,91,121,152,182,213,244,274,305,335],Ji=[0,31,59,90,120,151,181,212,243,273,304,334];function Xa(c,m){c=-9007199254740992>c||9007199254740992>>=0,c=new Date(1e3*c),X()[m>>>2>>>0]=c.getSeconds(),X()[m+4>>>2>>>0]=c.getMinutes(),X()[m+8>>>2>>>0]=c.getHours(),X()[m+12>>>2>>>0]=c.getDate(),X()[m+16>>>2>>>0]=c.getMonth(),X()[m+20>>>2>>>0]=c.getFullYear()-1900,X()[m+24>>>2>>>0]=c.getDay();var v=(Qi(c.getFullYear())?Xi:Ji)[c.getMonth()]+c.getDate()-1|0;X()[m+28>>>2>>>0]=v,X()[m+36>>>2>>>0]=-60*c.getTimezoneOffset(),v=new Date(c.getFullYear(),6,1).getTimezoneOffset();var C=new Date(c.getFullYear(),0,1).getTimezoneOffset();c=0|(v!=C&&c.getTimezoneOffset()==Math.min(C,v)),X()[m+32>>>2>>>0]=c}function Hn(c){c>>>=0;var m=new Date(X()[c+20>>>2>>>0]+1900,X()[c+16>>>2>>>0],X()[c+12>>>2>>>0],X()[c+8>>>2>>>0],X()[c+4>>>2>>>0],X()[c>>>2>>>0],0),v=X()[c+32>>>2>>>0],C=m.getTimezoneOffset(),I=new Date(m.getFullYear(),6,1).getTimezoneOffset(),W=new Date(m.getFullYear(),0,1).getTimezoneOffset(),se=Math.min(W,I);return 0>v?X()[c+32>>>2>>>0]=+(I!=W&&se==C):0>>2>>>0]=m.getDay(),v=(Qi(m.getFullYear())?Xi:Ji)[m.getMonth()]+m.getDate()-1|0,X()[c+28>>>2>>>0]=v,X()[c>>>2>>>0]=m.getSeconds(),X()[c+4>>>2>>>0]=m.getMinutes(),X()[c+8>>>2>>>0]=m.getHours(),X()[c+12>>>2>>>0]=m.getDate(),X()[c+16>>>2>>>0]=m.getMonth(),X()[c+20>>>2>>>0]=m.getYear(),c=m.getTime(),BigInt(isNaN(c)?-1:c/1e3)}function qn(c,m,v,C,I,W,se){return d?ve(16,1,c,m,v,C,I,W,se):-52}function Yi(c,m,v,C,I,W){if(d)return ve(17,1,c,m,v,C,I,W)}var Ns={},js=()=>performance.timeOrigin+performance.now();function Zi(c,m){if(d)return ve(18,1,c,m);if(Ns[c]&&(clearTimeout(Ns[c].id),delete Ns[c]),!m)return 0;var v=setTimeout(()=>{delete Ns[c],Wt(()=>ii(c,performance.timeOrigin+performance.now()))},m);return Ns[c]={id:v,ke:m},0}function Yc(c,m,v,C){c>>>=0,m>>>=0,v>>>=0,C>>>=0;var I=new Date().getFullYear(),W=new Date(I,0,1).getTimezoneOffset();I=new Date(I,6,1).getTimezoneOffset();var se=Math.max(W,I);ye()[c>>>2>>>0]=60*se,X()[m>>>2>>>0]=+(W!=I),c=(m=ge=>{var Ee=Math.abs(ge);return`UTC${0<=ge?"-":"+"}${String(Math.floor(Ee/60)).padStart(2,"0")}${String(Ee%60).padStart(2,"0")}`})(W),m=m(I),IDate.now();function Zc(c,m,v){return 0<=c&&3>=c?(c===0?c=Date.now():c=performance.timeOrigin+performance.now(),H[v>>>0>>>3]=BigInt(Math.round(1e6*c)),0):28}var Qn=[],Xn=(c,m)=>{Qn.length=0;for(var v;v=O()[c++>>>0];){var C=v!=105;m+=(C&=v!=112)&&m%8?4:0,Qn.push(v==112?ye()[m>>>2>>>0]:v==106?H[m>>>3]:v==105?X()[m>>>2>>>0]:ke()[m>>>3>>>0]),m+=C?8:4}return Qn};function Ya(c,m,v){return c>>>=0,m=Xn(m>>>0,v>>>0),Ne[c](...m)}function Za(c,m,v){return c>>>=0,m=Xn(m>>>0,v>>>0),Ne[c](...m)}var el=()=>{};function tl(c,m){return T(zt(c>>>0,m>>>0))}var rl=()=>{throw be+=1,"unwind"};function Jn(){return 4294901760}var sl=()=>navigator.hardwareConcurrency;function nl(){return Ie("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}function il(c){c>>>=0;var m=O().length;if(c<=m||4294901760=v;v*=2){var C=m*(1+.2/v);C=Math.min(C,c+100663296);e:{C=(Math.min(4294901760,65536*Math.ceil(Math.max(c,C)/65536))-g.buffer.byteLength+65535)/65536|0;try{g.grow(C),K();var I=1;break e}catch{}I=void 0}if(I)return!0}return!1}var sn=()=>(Ie("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),nn={},eo=c=>{c.forEach(m=>{sn()})};function to(){var c=Error().stack.toString().split(` -`);return c[0]=="Error"&&c.shift(),eo(c),nn.Kd=sn(),nn.ae=c,nn.Kd}function ol(c,m,v){if(c>>>=0,m>>>=0,nn.Kd==c)var C=nn.ae;else(C=Error().stack.toString().split(` -`))[0]=="Error"&&C.shift(),eo(C);for(var I=3;C[I]&&sn()!=c;)++I;for(c=0;c>>2>>>0]=sn();return c}var Yn,$n={},ro=()=>{if(!Yn){var c,m={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(c in $n)$n[c]===void 0?delete m[c]:m[c]=$n[c];var v=[];for(c in m)v.push(`${c}=${m[c]}`);Yn=v}return Yn};function so(c,m){if(d)return ve(19,1,c,m);c>>>=0,m>>>=0;var v=0;return ro().forEach((C,I)=>{var W=m+v;for(I=ye()[c+4*I>>>2>>>0]=W,W=0;W>>0]=C.charCodeAt(W);R()[I>>>0]=0,v+=C.length+1}),0}function Zn(c,m){if(d)return ve(20,1,c,m);c>>>=0,m>>>=0;var v=ro();ye()[c>>>2>>>0]=v.length;var C=0;return v.forEach(I=>C+=I.length+1),ye()[m>>>2>>>0]=C,0}function no(c){return d?ve(21,1,c):52}function io(c,m,v,C){return d?ve(22,1,c,m,v,C):52}function ei(c,m,v,C){return d?ve(23,1,c,m,v,C):70}var al=[null,[],[]];function oo(c,m,v,C){if(d)return ve(24,1,c,m,v,C);m>>>=0,v>>>=0,C>>>=0;for(var I=0,W=0;W>>2>>>0],ge=ye()[m+4>>>2>>>0];m+=8;for(var Ee=0;Ee>>0],Ye=al[c];ze===0||ze===10?((c===1?$:T)(rr(Ye)),Ye.length=0):Ye.push(ze)}I+=ge}return ye()[C>>>2>>>0]=I,0}function ao(c){return c>>>0}d||function(){for(var c=n.numThreads-1;c--;)ds();ee.unshift(()=>{Pe++,function(m){d?m():Promise.all(Qe.map(dr)).then(m)}(()=>Ae())})}();for(var lo=Array(256),kn=0;256>kn;++kn)lo[kn]=String.fromCharCode(kn);en=lo,Lr=n.BindingError=class extends Error{constructor(c){super(c),this.name="BindingError"}},n.InternalError=class extends Error{constructor(c){super(c),this.name="InternalError"}},Fr.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=()=>Fr.length/2-5-Bs.length;var Oe,ll=[Re,Fe,Be,Ir,ps,ms,_s,Qr,Ps,qs,Qs,Xs,Js,fs,Ys,Zs,qn,Yi,Zi,so,Zn,no,io,ei,oo];(async function(){function c(C,I){return Oe=C.exports,Oe=function(){var W=Oe,se={};for(let[ge,Ee]of Object.entries(W))se[ge]=typeof Ee=="function"?(...ze)=>{qt.push(ge);try{return Ee(...ze)}finally{ae||(qt.pop(),Rt&&ur===1&&qt.length===0&&(ur=0,be+=1,Ht(qo),typeof Fibers<"u"&&Fibers.le()))}}:Ee;return se}(),Oe=function(){var W=Oe,se=Ee=>ze=>Ee(ze)>>>0,ge=Ee=>()=>Ee()>>>0;return(W=Object.assign({},W)).Cb=se(W.Cb),W.fc=ge(W.fc),W.ic=se(W.ic),W.vc=se(W.vc),W.wc=ge(W.wc),W.Ac=se(W.Ac),W}(),ut.push(Oe.jc),M=I,Ae(),Oe}Pe++;var m=Le();if(n.instantiateWasm)return new Promise(C=>{n.instantiateWasm(m,(I,W)=>{c(I,W),C(I.exports)})});if(d)return new Promise(C=>{He=I=>{var W=new WebAssembly.Instance(I,Le());C(c(W,I))}});pe??(pe=n.locateFile?n.locateFile?n.locateFile("ort-wasm-simd-threaded.jsep.wasm",A):A+"ort-wasm-simd-threaded.jsep.wasm":new URL("/assets/ort-wasm-simd-threaded.jsep-BAR87mbD.wasm",self.location.href).href);try{var v=await async function(C){var I=pe;if(!le&&typeof WebAssembly.instantiateStreaming=="function"&&!we(I))try{var W=fetch(I,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(W,C)}catch(se){T(`wasm streaming compile failed: ${se}`),T("falling back to ArrayBuffer instantiation")}return async function(se,ge){try{var Ee=await async function(ze){if(!le)try{var Ye=await h(ze);return new Uint8Array(Ye)}catch{}if(ze==pe&&le)ze=new Uint8Array(le);else{if(!w)throw"both async and sync fetching of the wasm failed";ze=w(ze)}return ze}(se);return await WebAssembly.instantiate(Ee,ge)}catch(ze){T(`failed to asynchronously prepare wasm: ${ze}`),Ie(ze)}}(I,C)}(m);return c(v.instance,v.module)}catch(C){return i(C),Promise.reject(C)}})();var co=c=>(co=Oe.Cb)(c),ti=()=>(ti=Oe.Db)();n._OrtInit=(c,m)=>(n._OrtInit=Oe.Eb)(c,m),n._OrtGetLastError=(c,m)=>(n._OrtGetLastError=Oe.Fb)(c,m),n._OrtCreateSessionOptions=(c,m,v,C,I,W,se,ge,Ee,ze)=>(n._OrtCreateSessionOptions=Oe.Gb)(c,m,v,C,I,W,se,ge,Ee,ze),n._OrtAppendExecutionProvider=(c,m)=>(n._OrtAppendExecutionProvider=Oe.Hb)(c,m),n._OrtAddFreeDimensionOverride=(c,m,v)=>(n._OrtAddFreeDimensionOverride=Oe.Ib)(c,m,v),n._OrtAddSessionConfigEntry=(c,m,v)=>(n._OrtAddSessionConfigEntry=Oe.Jb)(c,m,v),n._OrtReleaseSessionOptions=c=>(n._OrtReleaseSessionOptions=Oe.Kb)(c),n._OrtCreateSession=(c,m,v)=>(n._OrtCreateSession=Oe.Lb)(c,m,v),n._OrtReleaseSession=c=>(n._OrtReleaseSession=Oe.Mb)(c),n._OrtGetInputOutputCount=(c,m,v)=>(n._OrtGetInputOutputCount=Oe.Nb)(c,m,v),n._OrtGetInputName=(c,m)=>(n._OrtGetInputName=Oe.Ob)(c,m),n._OrtGetOutputName=(c,m)=>(n._OrtGetOutputName=Oe.Pb)(c,m),n._OrtFree=c=>(n._OrtFree=Oe.Qb)(c),n._OrtCreateTensor=(c,m,v,C,I,W)=>(n._OrtCreateTensor=Oe.Rb)(c,m,v,C,I,W),n._OrtGetTensorData=(c,m,v,C,I)=>(n._OrtGetTensorData=Oe.Sb)(c,m,v,C,I),n._OrtReleaseTensor=c=>(n._OrtReleaseTensor=Oe.Tb)(c),n._OrtCreateRunOptions=(c,m,v,C)=>(n._OrtCreateRunOptions=Oe.Ub)(c,m,v,C),n._OrtAddRunConfigEntry=(c,m,v)=>(n._OrtAddRunConfigEntry=Oe.Vb)(c,m,v),n._OrtReleaseRunOptions=c=>(n._OrtReleaseRunOptions=Oe.Wb)(c),n._OrtCreateBinding=c=>(n._OrtCreateBinding=Oe.Xb)(c),n._OrtBindInput=(c,m,v)=>(n._OrtBindInput=Oe.Yb)(c,m,v),n._OrtBindOutput=(c,m,v,C)=>(n._OrtBindOutput=Oe.Zb)(c,m,v,C),n._OrtClearBoundOutputs=c=>(n._OrtClearBoundOutputs=Oe._b)(c),n._OrtReleaseBinding=c=>(n._OrtReleaseBinding=Oe.$b)(c),n._OrtRunWithBinding=(c,m,v,C,I)=>(n._OrtRunWithBinding=Oe.ac)(c,m,v,C,I),n._OrtRun=(c,m,v,C,I,W,se,ge)=>(n._OrtRun=Oe.bc)(c,m,v,C,I,W,se,ge),n._OrtEndProfiling=c=>(n._OrtEndProfiling=Oe.cc)(c),n._JsepOutput=(c,m,v)=>(n._JsepOutput=Oe.dc)(c,m,v),n._JsepGetNodeName=c=>(n._JsepGetNodeName=Oe.ec)(c);var In=()=>(In=Oe.fc)(),Vr=n._free=c=>(Vr=n._free=Oe.gc)(c),on=n._malloc=c=>(on=n._malloc=Oe.ic)(c),ri=(c,m,v,C,I,W)=>(ri=Oe.kc)(c,m,v,C,I,W),uo=()=>(uo=Oe.lc)(),si=(c,m,v,C,I)=>(si=Oe.mc)(c,m,v,C,I),po=c=>(po=Oe.nc)(c),ni=c=>(ni=Oe.oc)(c),ii=(c,m)=>(ii=Oe.pc)(c,m),ho=()=>(ho=Oe.qc)(),ft=(c,m)=>(ft=Oe.rc)(c,m),Us=c=>(Us=Oe.sc)(c),mo=(c,m)=>(mo=Oe.tc)(c,m),mt=c=>(mt=Oe.uc)(c),An=c=>(An=Oe.vc)(c),_t=()=>(_t=Oe.wc)(),_o=c=>(_o=Oe.xc)(c),oi=c=>(oi=Oe.yc)(c),fo=(c,m,v)=>(fo=Oe.zc)(c,m,v),go=c=>(go=Oe.Ac)(c),ai=n.dynCall_iii=(c,m,v)=>(ai=n.dynCall_iii=Oe.Bc)(c,m,v),wo=n.dynCall_vi=(c,m)=>(wo=n.dynCall_vi=Oe.Cc)(c,m),li=n.dynCall_ii=(c,m)=>(li=n.dynCall_ii=Oe.Dc)(c,m),di=n.dynCall_vii=(c,m,v)=>(di=n.dynCall_vii=Oe.Ec)(c,m,v),yo=n.dynCall_iiii=(c,m,v,C)=>(yo=n.dynCall_iiii=Oe.Fc)(c,m,v,C),Mo=n.dynCall_viii=(c,m,v,C)=>(Mo=n.dynCall_viii=Oe.Gc)(c,m,v,C),ci=n.dynCall_iiiii=(c,m,v,C,I)=>(ci=n.dynCall_iiiii=Oe.Hc)(c,m,v,C,I),bo=n.dynCall_viiii=(c,m,v,C,I)=>(bo=n.dynCall_viiii=Oe.Ic)(c,m,v,C,I),vo=n.dynCall_viiiiii=(c,m,v,C,I,W,se)=>(vo=n.dynCall_viiiiii=Oe.Jc)(c,m,v,C,I,W,se),ui=n.dynCall_viiiiiii=(c,m,v,C,I,W,se,ge)=>(ui=n.dynCall_viiiiiii=Oe.Kc)(c,m,v,C,I,W,se,ge),xo=n.dynCall_ji=(c,m)=>(xo=n.dynCall_ji=Oe.Lc)(c,m),To=n.dynCall_v=c=>(To=n.dynCall_v=Oe.Mc)(c),pi=n.dynCall_viiiii=(c,m,v,C,I,W)=>(pi=n.dynCall_viiiii=Oe.Nc)(c,m,v,C,I,W),Eo=n.dynCall_i=c=>(Eo=n.dynCall_i=Oe.Oc)(c),Po=n.dynCall_fii=(c,m,v)=>(Po=n.dynCall_fii=Oe.Pc)(c,m,v),hi=n.dynCall_viiiiiiii=(c,m,v,C,I,W,se,ge,Ee)=>(hi=n.dynCall_viiiiiiii=Oe.Qc)(c,m,v,C,I,W,se,ge,Ee),Co=n.dynCall_viiiiiiiiii=(c,m,v,C,I,W,se,ge,Ee,ze,Ye)=>(Co=n.dynCall_viiiiiiiiii=Oe.Rc)(c,m,v,C,I,W,se,ge,Ee,ze,Ye),So=n.dynCall_jiii=(c,m,v,C)=>(So=n.dynCall_jiii=Oe.Sc)(c,m,v,C),mi=n.dynCall_dii=(c,m,v)=>(mi=n.dynCall_dii=Oe.Tc)(c,m,v),$o=n.dynCall_viiiiiiiii=(c,m,v,C,I,W,se,ge,Ee,ze)=>($o=n.dynCall_viiiiiiiii=Oe.Uc)(c,m,v,C,I,W,se,ge,Ee,ze),ko=n.dynCall_viiiiiiiiiii=(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot)=>(ko=n.dynCall_viiiiiiiiiii=Oe.Vc)(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot),_i=n.dynCall_iiiiii=(c,m,v,C,I,W)=>(_i=n.dynCall_iiiiii=Oe.Wc)(c,m,v,C,I,W),Io=n.dynCall_iij=(c,m,v)=>(Io=n.dynCall_iij=Oe.Xc)(c,m,v),Ao=n.dynCall_iiiiiiiiii=(c,m,v,C,I,W,se,ge,Ee,ze)=>(Ao=n.dynCall_iiiiiiiiii=Oe.Yc)(c,m,v,C,I,W,se,ge,Ee,ze),Fo=n.dynCall_iiiiiiiiiii=(c,m,v,C,I,W,se,ge,Ee,ze,Ye)=>(Fo=n.dynCall_iiiiiiiiiii=Oe.Zc)(c,m,v,C,I,W,se,ge,Ee,ze,Ye),Oo=n.dynCall_vij=(c,m,v)=>(Oo=n.dynCall_vij=Oe._c)(c,m,v),fi=n.dynCall_iiif=(c,m,v,C)=>(fi=n.dynCall_iiif=Oe.$c)(c,m,v,C),Do=n.dynCall_iiij=(c,m,v,C)=>(Do=n.dynCall_iiij=Oe.ad)(c,m,v,C),Lo=n.dynCall_fiii=(c,m,v,C)=>(Lo=n.dynCall_fiii=Oe.bd)(c,m,v,C),gi=n.dynCall_viiiiiiiiiiiii=(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt)=>(gi=n.dynCall_viiiiiiiiiiiii=Oe.cd)(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt),zo=n.dynCall_vjiii=(c,m,v,C,I)=>(zo=n.dynCall_vjiii=Oe.dd)(c,m,v,C,I),Bo=n.dynCall_vif=(c,m,v)=>(Bo=n.dynCall_vif=Oe.ed)(c,m,v),wi=n.dynCall_iiiiiii=(c,m,v,C,I,W,se)=>(wi=n.dynCall_iiiiiii=Oe.fd)(c,m,v,C,I,W,se),Ro=n.dynCall_iiiij=(c,m,v,C,I)=>(Ro=n.dynCall_iiiij=Oe.gd)(c,m,v,C,I),No=n.dynCall_iiiiiiii=(c,m,v,C,I,W,se,ge)=>(No=n.dynCall_iiiiiiii=Oe.hd)(c,m,v,C,I,W,se,ge),yi=n.dynCall_viiiiiiiiiiii=(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt)=>(yi=n.dynCall_viiiiiiiiiiii=Oe.id)(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt),jo=n.dynCall_diii=(c,m,v,C)=>(jo=n.dynCall_diii=Oe.jd)(c,m,v,C),Uo=n.dynCall_jiiii=(c,m,v,C,I)=>(Uo=n.dynCall_jiiii=Oe.kd)(c,m,v,C,I),Mi=n.dynCall_viiij=(c,m,v,C,I)=>(Mi=n.dynCall_viiij=Oe.ld)(c,m,v,C,I),Vo=n.dynCall_fiiii=(c,m,v,C,I)=>(Vo=n.dynCall_fiiii=Oe.md)(c,m,v,C,I),Wo=n.dynCall_viiif=(c,m,v,C,I)=>(Wo=n.dynCall_viiif=Oe.nd)(c,m,v,C,I),bi=n.dynCall_diiii=(c,m,v,C,I)=>(bi=n.dynCall_diiii=Oe.od)(c,m,v,C,I),Go=n.dynCall_viiid=(c,m,v,C,I)=>(Go=n.dynCall_viiid=Oe.pd)(c,m,v,C,I),Ko=n.dynCall_iiiijii=(c,m,v,C,I,W,se)=>(Ko=n.dynCall_iiiijii=Oe.qd)(c,m,v,C,I,W,se),vi=n.dynCall_iiiiiij=(c,m,v,C,I,W,se)=>(vi=n.dynCall_iiiiiij=Oe.rd)(c,m,v,C,I,W,se),Ho=c=>(Ho=Oe.sd)(c),qo=()=>(qo=Oe.td)(),Qo=c=>(Qo=Oe.ud)(c),Xo=()=>(Xo=Oe.vd)();function Jo(c,m,v){var C=_t();try{di(c,m,v)}catch(I){if(mt(C),I!==I+0)throw I;ft(1,0)}}function dl(c,m,v){var C=_t();try{return ai(c,m,v)}catch(I){if(mt(C),I!==I+0)throw I;ft(1,0)}}function cl(c,m){var v=_t();try{wo(c,m)}catch(C){if(mt(v),C!==C+0)throw C;ft(1,0)}}function ul(c,m){var v=_t();try{return li(c,m)}catch(C){if(mt(v),C!==C+0)throw C;ft(1,0)}}function pl(c,m,v,C){var I=_t();try{return yo(c,m,v,C)}catch(W){if(mt(I),W!==W+0)throw W;ft(1,0)}}function Yo(c,m,v,C,I){var W=_t();try{bo(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function hl(c,m,v,C,I){var W=_t();try{return ci(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function ml(c,m,v,C){var I=_t();try{Mo(c,m,v,C)}catch(W){if(mt(I),W!==W+0)throw W;ft(1,0)}}function _l(c,m,v,C,I,W,se){var ge=_t();try{return wi(c,m,v,C,I,W,se)}catch(Ee){if(mt(ge),Ee!==Ee+0)throw Ee;ft(1,0)}}function fl(c){var m=_t();try{To(c)}catch(v){if(mt(m),v!==v+0)throw v;ft(1,0)}}function Zo(c,m,v){var C=_t();try{return Io(c,m,v)}catch(I){if(mt(C),I!==I+0)throw I;ft(1,0)}}function gl(c,m,v,C,I,W){var se=_t();try{pi(c,m,v,C,I,W)}catch(ge){if(mt(se),ge!==ge+0)throw ge;ft(1,0)}}function wl(c,m,v){var C=_t();try{Oo(c,m,v)}catch(I){if(mt(C),I!==I+0)throw I;ft(1,0)}}function yl(c,m,v,C,I,W,se){var ge=_t();try{vo(c,m,v,C,I,W,se)}catch(Ee){if(mt(ge),Ee!==Ee+0)throw Ee;ft(1,0)}}function Ml(c,m,v,C,I,W,se,ge){var Ee=_t();try{ui(c,m,v,C,I,W,se,ge)}catch(ze){if(mt(Ee),ze!==ze+0)throw ze;ft(1,0)}}function ea(c,m,v,C,I,W){var se=_t();try{return _i(c,m,v,C,I,W)}catch(ge){if(mt(se),ge!==ge+0)throw ge;ft(1,0)}}function bl(c,m,v,C,I,W,se,ge){var Ee=_t();try{return No(c,m,v,C,I,W,se,ge)}catch(ze){if(mt(Ee),ze!==ze+0)throw ze;ft(1,0)}}function vl(c,m,v,C,I,W,se,ge,Ee,ze){var Ye=_t();try{$o(c,m,v,C,I,W,se,ge,Ee,ze)}catch(ot){if(mt(Ye),ot!==ot+0)throw ot;ft(1,0)}}function ta(c,m,v,C,I,W,se,ge,Ee){var ze=_t();try{hi(c,m,v,C,I,W,se,ge,Ee)}catch(Ye){if(mt(ze),Ye!==Ye+0)throw Ye;ft(1,0)}}function xl(c){var m=_t();try{return Eo(c)}catch(v){if(mt(m),v!==v+0)throw v;ft(1,0)}}function Tl(c,m,v,C,I,W,se,ge,Ee,ze){var Ye=_t();try{return Ao(c,m,v,C,I,W,se,ge,Ee,ze)}catch(ot){if(mt(Ye),ot!==ot+0)throw ot;ft(1,0)}}function ra(c,m,v){var C=_t();try{return Po(c,m,v)}catch(I){if(mt(C),I!==I+0)throw I;ft(1,0)}}function El(c,m,v,C){var I=_t();try{return So(c,m,v,C)}catch(W){if(mt(I),W!==W+0)throw W;return ft(1,0),0n}}function Pl(c,m,v){var C=_t();try{return mi(c,m,v)}catch(I){if(mt(C),I!==I+0)throw I;ft(1,0)}}function sa(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot){var gt=_t();try{ko(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot)}catch(Bt){if(mt(gt),Bt!==Bt+0)throw Bt;ft(1,0)}}function Cl(c,m,v,C,I,W,se,ge,Ee,ze,Ye){var ot=_t();try{Co(c,m,v,C,I,W,se,ge,Ee,ze,Ye)}catch(gt){if(mt(ot),gt!==gt+0)throw gt;ft(1,0)}}function Sl(c,m,v,C,I,W,se,ge,Ee,ze,Ye){var ot=_t();try{return Fo(c,m,v,C,I,W,se,ge,Ee,ze,Ye)}catch(gt){if(mt(ot),gt!==gt+0)throw gt;ft(1,0)}}function na(c,m,v,C){var I=_t();try{return fi(c,m,v,C)}catch(W){if(mt(I),W!==W+0)throw W;ft(1,0)}}function $l(c,m,v,C){var I=_t();try{return Do(c,m,v,C)}catch(W){if(mt(I),W!==W+0)throw W;ft(1,0)}}function kl(c,m,v,C){var I=_t();try{return Lo(c,m,v,C)}catch(W){if(mt(I),W!==W+0)throw W;ft(1,0)}}function xi(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt){var Pr=_t();try{gi(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt,Bt)}catch(an){if(mt(Pr),an!==an+0)throw an;ft(1,0)}}function Il(c,m,v,C,I){var W=_t();try{zo(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function Al(c,m,v){var C=_t();try{Bo(c,m,v)}catch(I){if(mt(C),I!==I+0)throw I;ft(1,0)}}function ia(c,m){var v=_t();try{return xo(c,m)}catch(C){if(mt(v),C!==C+0)throw C;return ft(1,0),0n}}function oa(c,m,v,C,I){var W=_t();try{return Ro(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function Fl(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt){var Bt=_t();try{yi(c,m,v,C,I,W,se,ge,Ee,ze,Ye,ot,gt)}catch(Pr){if(mt(Bt),Pr!==Pr+0)throw Pr;ft(1,0)}}function aa(c,m,v,C){var I=_t();try{return jo(c,m,v,C)}catch(W){if(mt(I),W!==W+0)throw W;ft(1,0)}}function Ol(c,m,v,C,I){var W=_t();try{return Uo(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;return ft(1,0),0n}}function Dl(c,m,v,C,I){var W=_t();try{Mi(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function Ll(c,m,v,C,I){var W=_t();try{return Vo(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function la(c,m,v,C,I){var W=_t();try{Wo(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function zl(c,m,v,C,I){var W=_t();try{return bi(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function Bl(c,m,v,C,I){var W=_t();try{Go(c,m,v,C,I)}catch(se){if(mt(W),se!==se+0)throw se;ft(1,0)}}function Rl(c,m,v,C,I,W,se){var ge=_t();try{return Ko(c,m,v,C,I,W,se)}catch(Ee){if(mt(ge),Ee!==Ee+0)throw Ee;ft(1,0)}}function da(c,m,v,C,I,W,se){var ge=_t();try{return vi(c,m,v,C,I,W,se)}catch(Ee){if(mt(ge),Ee!==Ee+0)throw Ee;ft(1,0)}}return n.stackSave=()=>_t(),n.stackRestore=c=>mt(c),n.stackAlloc=c=>An(c),n.setValue=function(c,m,v="i8"){switch(v.endsWith("*")&&(v="*"),v){case"i1":case"i8":R()[c>>>0]=m;break;case"i16":G()[c>>>1>>>0]=m;break;case"i32":X()[c>>>2>>>0]=m;break;case"i64":H[c>>>3]=BigInt(m);break;case"float":_e()[c>>>2>>>0]=m;break;case"double":ke()[c>>>3>>>0]=m;break;case"*":ye()[c>>>2>>>0]=m;break;default:Ie(`invalid type for setValue: ${v}`)}},n.getValue=function(c,m="i8"){switch(m.endsWith("*")&&(m="*"),m){case"i1":case"i8":return R()[c>>>0];case"i16":return G()[c>>>1>>>0];case"i32":return X()[c>>>2>>>0];case"i64":return H[c>>>3];case"float":return _e()[c>>>2>>>0];case"double":return ke()[c>>>3>>>0];case"*":return ye()[c>>>2>>>0];default:Ie(`invalid type for getValue: ${m}`)}},n.UTF8ToString=zt,n.stringToUTF8=Er,n.lengthBytesUTF8=hs,function c(){if(0{fd(),bd=typeof location>"u"?void 0:location.origin,vd=self.location.href>"file:"&&self.location.href<"file;",op=()=>{{if(vd){let e=URL;return new URL(new e("ort.bundle.min.mjs",self.location.href).href,bd).href}return self.location.href}},Rr=op(),ap=()=>{if(Rr&&!Rr.startsWith("blob:"))return Rr.substring(0,Rr.lastIndexOf("/")+1)},fa=(e,r)=>{try{let t=r??Rr;return(t?new URL(e,t):new URL(e)).origin===bd}catch{return!1}},lp=(e,r)=>{let t=r??Rr;try{return(t?new URL(e,t):new URL(e)).href}catch{return}},dp=(e,r)=>`${r??"./"}${e}`,xd=async e=>{let r=await(await fetch(e,{credentials:"same-origin"})).blob();return URL.createObjectURL(r)},cp=async e=>(await import(e)).default,Td=(Zb(),ma(tp)).default,up=async()=>{if(!Rr)throw new Error("Failed to load proxy worker: cannot determine the script source URL.");if(fa(Rr))return[void 0,Td()];let e=await xd(Rr);return[e,Td(e)]},Ed=(ev(),ma(sp)).default,pp=async(e,r,t)=>{if(!e&&!r&&Ed&&Rr&&fa(Rr))return[void 0,Ed];{let s="ort-wasm-simd-threaded.jsep.mjs",i=e??lp(s,r),n=t&&i&&!fa(i,r),o=n?await xd(i):i??dp(s,r);return[n?o:void 0,await cp(o)]}}}),Cd,ga,Ii,Sd,hp,mp,$d,ar,hn=Ue(()=>{Pd(),ga=!1,Ii=!1,Sd=!1,hp=()=>{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}},mp=()=>{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}},$d=async e=>{if(ga)return Promise.resolve();if(Ii)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(Sd)throw new Error("previous call to 'initializeWebAssembly()' failed.");Ii=!0;let r=e.initTimeout,t=e.numThreads;if(!mp())throw new Error("WebAssembly SIMD is not supported in the current environment.");let s=hp();t>1&&!s&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+t+", 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=t=1);let i=e.wasmPaths,n=typeof i=="string"?i:void 0,o=i==null?void 0:i.mjs,a=(o==null?void 0:o.href)??o,l=i==null?void 0:i.wasm,d=(l==null?void 0:l.href)??l,p=e.wasmBinary,[u,h]=await pp(a,n,t>1),w=!1,f=[];if(r>0&&f.push(new Promise(P=>{setTimeout(()=>{w=!0,P()},r)})),f.push(new Promise((P,A)=>{let b={numThreads:t};if(p)b.wasmBinary=p;else if(d||n)b.locateFile=y=>d??n+y;else if(a&&a.indexOf("blob:")!==0)b.locateFile=y=>new URL(y,a).href;else if(u){let y=ap();y&&(b.locateFile=$=>y+$)}h(b).then(y=>{Ii=!1,ga=!0,Cd=y,P(),u&&URL.revokeObjectURL(u)},y=>{Ii=!1,Sd=!0,A(y)})})),await Promise.race(f),w)throw new Error(`WebAssembly backend initializing failed due to timeout: ${r}ms`)},ar=()=>{if(ga&&Cd)return Cd;throw new Error("WebAssembly is not initialized yet.")}}),Mr,wa,At,kd=Ue(()=>{hn(),Mr=(e,r)=>{let t=ar(),s=t.lengthBytesUTF8(e)+1,i=t._malloc(s);return t.stringToUTF8(e,i,s),r.push(i),i},wa=(e,r,t,s)=>{if(typeof e=="object"&&e!==null){if(t.has(e))throw new Error("Circular reference in options");t.add(e)}Object.entries(e).forEach(([i,n])=>{let o=r?r+i:i;if(typeof n=="object")wa(n,o+".",t,s);else if(typeof n=="string"||typeof n=="number")s(o,n.toString());else if(typeof n=="boolean")s(o,n?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof n}`)})},At=e=>{let r=ar(),t=r.stackSave();try{let s=r.PTR_SIZE,i=r.stackAlloc(2*s);r._OrtGetLastError(i,i+s);let n=Number(r.getValue(i,s===4?"i32":"i64")),o=r.getValue(i+s,"*"),a=o?r.UTF8ToString(o):"";throw new Error(`${e} ERROR_CODE: ${n}, ERROR_MESSAGE: ${a}`)}finally{r.stackRestore(t)}}}),_p,tv=Ue(()=>{hn(),kd(),_p=e=>{let r=ar(),t=0,s=[],i=e||{};try{if((e==null?void 0:e.logSeverityLevel)===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!="number"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if((e==null?void 0:e.logVerbosityLevel)===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!="number"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);(e==null?void 0:e.terminate)===void 0&&(i.terminate=!1);let n=0;return(e==null?void 0:e.tag)!==void 0&&(n=Mr(e.tag,s)),t=r._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,n),t===0&&At("Can't create run options."),(e==null?void 0:e.extra)!==void 0&&wa(e.extra,"",new WeakSet,(o,a)=>{let l=Mr(o,s),d=Mr(a,s);r._OrtAddRunConfigEntry(t,l,d)!==0&&At(`Can't set a run config entry: ${o} - ${a}.`)}),[t,s]}catch(n){throw t!==0&&r._OrtReleaseRunOptions(t),s.forEach(o=>r._free(o)),n}}}),fp,gp,wp,yp,Mp,rv=Ue(()=>{hn(),kd(),fp=e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}},gp=e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},wp=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let r=e.extra.session;r.use_ort_model_bytes_directly||(r.use_ort_model_bytes_directly="1"),e.executionProviders&&e.executionProviders.some(t=>(typeof t=="string"?t:t.name)==="webgpu")&&(e.enableMemPattern=!1)},yp=(e,r,t)=>{for(let s of r){let i=typeof s=="string"?s:s.name;switch(i){case"webnn":if(i="WEBNN",typeof s!="string"){let o=s==null?void 0:s.deviceType;if(o){let a=Mr("deviceType",t),l=Mr(o,t);ar()._OrtAddSessionConfigEntry(e,a,l)!==0&&At(`Can't set a session config entry: 'deviceType' - ${o}.`)}}break;case"webgpu":if(i="JS",typeof s!="string"){let o=s;if(o!=null&&o.preferredLayout){if(o.preferredLayout!=="NCHW"&&o.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${o.preferredLayout}`);let a=Mr("preferredLayout",t),l=Mr(o.preferredLayout,t);ar()._OrtAddSessionConfigEntry(e,a,l)!==0&&At(`Can't set a session config entry: 'preferredLayout' - ${o.preferredLayout}.`)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${i}`)}let n=Mr(i,t);ar()._OrtAppendExecutionProvider(e,n)!==0&&At(`Can't append execution provider: ${i}.`)}},Mp=e=>{let r=ar(),t=0,s=[],i=e||{};wp(i);try{let n=fp(i.graphOptimizationLevel??"all"),o=gp(i.executionMode??"sequential"),a=typeof i.logId=="string"?Mr(i.logId,s):0,l=i.logSeverityLevel??2;if(!Number.isInteger(l)||l<0||l>4)throw new Error(`log serverity level is not valid: ${l}`);let d=i.logVerbosityLevel??0;if(!Number.isInteger(d)||d<0||d>4)throw new Error(`log verbosity level is not valid: ${d}`);let p=typeof i.optimizedModelFilePath=="string"?Mr(i.optimizedModelFilePath,s):0;if(t=r._OrtCreateSessionOptions(n,!!i.enableCpuMemArena,!!i.enableMemPattern,o,!!i.enableProfiling,0,a,l,d,p),t===0&&At("Can't create session options."),i.executionProviders&&yp(t,i.executionProviders,s),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);let u=Mr("enableGraphCapture",s),h=Mr(i.enableGraphCapture.toString(),s);r._OrtAddSessionConfigEntry(t,u,h)!==0&&At(`Can't set a session config entry: 'enableGraphCapture' - ${i.enableGraphCapture}.`)}if(i.freeDimensionOverrides)for(let[u,h]of Object.entries(i.freeDimensionOverrides)){if(typeof u!="string")throw new Error(`free dimension override name must be a string: ${u}`);if(typeof h!="number"||!Number.isInteger(h)||h<0)throw new Error(`free dimension override value must be a non-negative integer: ${h}`);let w=Mr(u,s);r._OrtAddFreeDimensionOverride(t,w,h)!==0&&At(`Can't set a free dimension override: ${u} - ${h}.`)}return i.extra!==void 0&&wa(i.extra,"",new WeakSet,(u,h)=>{let w=Mr(u,s),f=Mr(h,s);r._OrtAddSessionConfigEntry(t,w,f)!==0&&At(`Can't set a session config entry: ${u} - ${h}.`)}),[t,s]}catch(n){throw t!==0&&r._OrtReleaseSessionOptions(t)!==0&&At("Can't release session options."),s.forEach(o=>r._free(o)),n}}}),Rn,mn,_n,Id,ya,Ad,Fd,Od,pt=Ue(()=>{Rn=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 new Error(`unsupported data type: ${e}`)}},mn=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 new Error(`unsupported data type: ${e}`)}},_n=(e,r)=>{let t=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],s=typeof r=="number"?r:r.reduce((i,n)=>i*n,1);return t>0?Math.ceil(s*t):void 0},Id=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 new Error(`unsupported type: ${e}`)}},ya=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 new Error(`unsupported logging level: ${e}`)}},Ad=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",Fd=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint64"||e==="int8"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",Od=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 new Error(`unsupported data location: ${e}`)}}}),Dd,bp=Ue(()=>{fd(),Dd=async e=>{if(typeof e=="string"){let r=await fetch(e);if(!r.ok)throw new Error(`failed to load external data file: ${e}`);let t=r.headers.get("Content-Length"),s=t?parseInt(t,10):0;if(s<1073741824)return new Uint8Array(await r.arrayBuffer());{if(!r.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let i=r.body.getReader(),n;try{n=new ArrayBuffer(s)}catch(a){if(a instanceof RangeError){let l=Math.ceil(s/65536);n=new WebAssembly.Memory({initial:l,maximum:l}).buffer}else throw a}let o=0;for(;;){let{done:a,value:l}=await i.read();if(a)break;let d=l.byteLength;new Uint8Array(n,o,d).set(l),o+=d}return new Uint8Array(n,0,s)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),vp,xp,Tp,Ep,Ld,Pp,St,ks=Ue(()=>{pt(),vp=["V","I","W","E","F"],xp=(e,r)=>{console.log(`[${vp[e]},${new Date().toISOString()}]${r}`)},Ld=(e,r)=>{Tp=e,Ep=r},Pp=(e,r)=>{let t=ya(e),s=ya(Tp);t>=s&&xp(t,typeof r=="function"?r():r)},St=(...e)=>{Ep&&Pp(...e)}}),zd,Cp=Ue(()=>{pt(),zd=(e,r)=>new(Id(r))(e)}),Bd=Ue(()=>{}),Rd,Ma,ba,Sp,$p,Nd,jd,kp,Ip,sv=Ue(()=>{ks(),Bd(),Rd=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]]),Ma=[],ba=e=>Math.ceil(Number(e)/16)*16,Sp=e=>{for(let r=0;r$p++,jd=async(e,r,t,s)=>{let i=ba(t),n=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(r,0,n,0,i),e.flush(),await n.mapAsync(GPUMapMode.READ);let a=n.getMappedRange();if(s){let l=s();return l.set(new Uint8Array(a,0,t)),l}else return new Uint8Array(a.slice(0,t))}finally{n.destroy()}},kp=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[r]of Rd)Ma.push(r),this.freeBuffers.set(r,[]),this.freeUniformBuffers.set(r,[]);this.sessionCount=0}upload(e,r){let t=r.buffer,s=r.byteOffset,i=r.byteLength,n=ba(i),o=this.storageCache.get(e);if(!o)throw new Error("gpu data for uploading does not exist");if(Number(o.originalSize)!==i)throw new Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let a=this.backend.device.createBuffer({mappedAtCreation:!0,size:n,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),l=a.getMappedRange();new Uint8Array(l).set(new Uint8Array(t,s,i)),a.unmap();let d=this.backend.device.createCommandEncoder();d.copyBufferToBuffer(a,0,o.gpuData.buffer,0,n),this.backend.device.queue.submit([d.finish()]),a.destroy(),St("verbose",()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,r){let t=this.storageCache.get(e);if(!t)throw new Error("source gpu data for memcpy does not exist");let s=this.storageCache.get(r);if(!s)throw new Error("destination gpu data for memcpy does not exist");if(t.originalSize!==s.originalSize)throw new Error("inconsistent source and destination gpu data size");let i=ba(t.originalSize),n=this.backend.getCommandEncoder();this.backend.endComputePass(),n.copyBufferToBuffer(t.gpuData.buffer,0,s.gpuData.buffer,0,i)}registerExternalBuffer(e,r,t){let s;if(t){if(s=t[0],e===t[1])return St("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${s}, buffer is the same, skip.`),s;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw new Error(`Registering a different external buffer under graph capture mode is not supported yet. - Please use the previous external buffer!`)}else s=Nd();return this.storageCache.set(s,{gpuData:{id:s,type:0,buffer:e},originalSize:r}),St("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${s}, registered.`),s}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),St("verbose",()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,r=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let t=Sp(e),s,i=(r&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,n=(r&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||n){let a=(i?this.freeBuffers:this.freeUniformBuffers).get(t);a?a.length>0?s=a.pop():s=this.backend.device.createBuffer({size:t,usage:r}):s=this.backend.device.createBuffer({size:t,usage:r})}else s=this.backend.device.createBuffer({size:t,usage:r});let o={id:Nd(),type:0,buffer:s};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),St("verbose",()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){var r;return(r=this.storageCache.get(e))==null?void 0:r.gpuData}release(e){let r=typeof e=="bigint"?Number(e):e,t=this.storageCache.get(r);if(!t){if(this.storageCache.size===0)return 0;throw new Error("releasing data does not exist")}return St("verbose",()=>`[WebGPU] GpuDataManager.release(id=${r}), gpuDataId=${t.gpuData.id}`),this.storageCache.delete(r),this.buffersPending.push(t.gpuData.buffer),t.originalSize}async download(e,r){let t=this.storageCache.get(Number(e));if(!t)throw new Error("data does not exist");await jd(this.backend,t.gpuData.buffer,t.originalSize,r)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus==="default"){for(let e of this.buffersPending){let r=Rd.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let t=this.freeBuffers.get(e.size)||[];r===void 0||t.length>=r?e.destroy():t.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let t=this.freeUniformBuffers.get(e.size)||[];r===void 0||t.length>=r?e.destroy():t.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 r of this.buffersPending)e.push(r);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let r=this.capturedPendingBuffers.get(e);r&&(r.forEach(t=>{t.destroy()}),this.capturedPendingBuffers.delete(e)),this.sessionCount-=1,this.sessionCount===0&&(St("warning",()=>"[WebGPU] Clearing webgpu buffer cache"),this.storageCache.forEach(t=>{t.gpuData.buffer.destroy()}),this.storageCache=new Map)}},Ip=(...e)=>new kp(...e)}),Ap,Dt,Yt=Ue(()=>{Ap=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this.key}},Dt=e=>new Ap(e)}),Fp,Nn,xe,va,Op,Dp,Lp,Mt=Ue(()=>{Fp=class{static calcMatMulShape(e,r){return e[1]!==r[0]?void 0:[e[0],r[1]]}},Nn=class{static calcShape(e,r,t=!1){let s=e.length,i=r.length;if(s===0)return r;if(i===0)return e;let n=Math.max(e.length,r.length),o=new Array(n);if(t){if(s<2||i<2)return;let a=Fp.calcMatMulShape([e[s-2],e[s-1]],[r[i-2],r[i-1]]);if(a===void 0)return;[o[n-2],o[n-1]]=a}for(let a=t?3:1;a<=n;a++){let l=s-a<0?1:e[s-a],d=i-a<0?1:r[i-a];if(l!==d&&l>1&&d>1)return;let p=Math.max(l,d);if(l&&d)o[n-a]=Math.max(l,d);else{if(p>1)return;o[n-a]=0}}return o}static isValidBroadcast(e,r){let t=e.length,s=r.length;if(t>s)return!1;for(let i=1;i<=t;i++)if(e[t-i]!==1&&e[t-i]!==r[s-i])return!1;return!0}},xe=class od{static size(r){return od.getSizeFromDimensionRange(r,0,r.length)}static convertShape(r,t=4){let s=r.length;if(s===0)return[];let i=new Array(s),n=s-1;for(;n>=0;){if(r[n]%t===0){i[n]=r[n]/t;break}if(t%r[n]!==0)throw new Error("cannot convert shape");i[n]=1,t/=r[n],n--}for(n--;n>=0;n--)i[n]=r[n];return i}static sizeFromDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${r.length} dimensions.`);return od.getSizeFromDimensionRange(r,t,r.length)}static sizeToDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${r.length} dimensions.`);return od.getSizeFromDimensionRange(r,0,t)}static getSizeFromDimensionRange(r,t,s){let i=1;for(let n=t;n=0;--i)s[i]=s[i+1]*r[i+1];return s}static normalizeAxis(r,t){if(r<-t&&r>=t)throw new Error("unsupported axis for this operation.");return r<0?r+t:r}static normalizeAxes(r,t){return r.map(s=>this.normalizeAxis(s,t??r.length))}static sortBasedOnPerm(r,t){return t?t.map(s=>r[s]):r.slice().reverse()}static padShape(r,t){let s=r.length;return r.map((i,n)=>i+t[n]+t[n+s])}static areEqual(r,t){return r.length!==t.length?!1:r.every((s,i)=>s===t[i])}},va=class pa{static adjustPoolAttributes(r,t,s,i,n,o){if(!r&&s.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(r)for(let a=0;a=s.length?s.push(t[a+2]):s[a]=t[a+2];for(let a=0;a=s[a]||o[a+s.length]>=s[a])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(r,t,s,i,n,o,a){if(a){if(n.length!==2*(r.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==r.length-2)throw new Error("length of strides should be the length of data dimensions");if(i.length!==r.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let l=0;l{pt(),Mt(),jn=64,xa=(e,r)=>{if(r===3)throw new Error("vec3 has same alignment as vec4, use vec4 instead");switch(Number(e)){case 10:return r>1?`vec${r}`:"f16";case 1:return r>1?`vec${r}`:"f32";case 6:return r>1?`vec${r}`:"i32";case 12:return r>1?`vec${r}`:"u32";case 7:if(r>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2","i32"];case 13:if(r>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2","u32"];case 9:if(r!==4)throw new Error("bool must be vec4");return["u32","vec4"];case 22:return"i32";case 21:return"u32";default:throw new Error(`Unknown data type: ${e}`)}},lr=(e,r=1)=>{let t=xa(e,r);return typeof t=="string"?t:t[0]},Tr=(e,r=1)=>{let t=xa(e,r);return typeof t=="string"?t:t[1]},nt=(...e)=>{let r=[];return e.forEach(t=>{t.length!==0&&r.push({type:12,data:t},{type:12,data:xe.computeStrides(t)})}),r},Xt=e=>e%4===0?4:e%2===0?2:1,Ud=(e="f32",r,t="0")=>!r||r===1?`${e}(${t})`:`vec${r}<${e}>(${t})`,Un=(e,r,t)=>e==="f32"?t:r===1?`f32(${t})`:`vec${r}(${t})`,Ws=(e,r)=>r===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:r===2?`(${e}.x + ${e}.y)`:r===3?`(${e}.x + ${e}.y + ${e}.z)`:e,rt=(e,r,t,s)=>e.startsWith("uniforms.")&&t>4?typeof r=="string"?s==="f16"?`${e}[(${r}) / 8][(${r}) % 8 / 4][(${r}) % 8 % 4]`:`${e}[(${r}) / 4][(${r}) % 4]`:s==="f16"?`${e}[${Math.floor(r/8)}][${Math.floor(r%8/4)}][${r%8%4}]`:`${e}[${Math.floor(r/4)}][${r%4}]`:t>1?`${e}[${r}]`:e,Ai=(e,r,t,s,i)=>{let n=typeof t=="number",o=n?t:t.length,a=[...new Array(o).keys()],l=o<2?"u32":o<=4?`vec${o}`:`array`,d=xa(r,i),p=typeof d=="string"?d:d[1],u=typeof d=="string"?d:d[0],h={indices:l,value:p,storage:u,tensor:r},w=R=>typeof R=="string"?R:`${R}u`,f={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},P=n?"uniforms.":"",A=`${P}${e}_shape`,b=`${P}${e}_strides`,y="";for(let R=0;R ${h.indices} { - var indices: ${h.indices}; - var current = offset; - ${y} - return indices; - }`,T=R=>(f.offsetToIndices=!0,o<2?R:`o2i_${e}(${R})`),g=[];if(o>=2)for(let R=o-1;R>=0;R--)g.push(`${rt(b,R,o)} * (indices[${R}])`);let M=o<2?"":` - fn i2o_${e}(indices: ${h.indices}) -> u32 { - return ${g.join("+")}; - }`,E=R=>(f.indicesToOffset=!0,o<2?R:`i2o_${e}(${R})`),k=(...R)=>o===0?"0u":`${h.indices}(${R.map(w).join(",")})`,B=(R,O)=>o<2?`${R}`:`${rt(R,O,o)}`,N=(R,O,G)=>o<2?`${R}=${G};`:`${rt(R,O,o)}=${G};`,J={},q=(R,O)=>{f.broadcastedIndicesToOffset=!0;let G=`${O.name}broadcastedIndicesTo${e}Offset`;if(G in J)return`${G}(${R})`;let ne=[];for(let X=o-1;X>=0;X--){let ye=O.indicesGet("outputIndices",X+O.rank-o);ne.push(`${B(b,X)} * (${ye} % ${B(A,X)})`)}return J[G]=`fn ${G}(outputIndices: ${O.type.indices}) -> u32 { - return ${ne.length>0?ne.join("+"):"0u"}; - }`,`${G}(${R})`},V=(R,O)=>(()=>{if(h.storage===h.value)return`${e}[${R}]=${O};`;if(h.storage==="vec2"&&h.value==="i32")return`${e}[${R}]=vec2(u32(${O}), select(0u, 0xFFFFFFFFu, ${O} < 0));`;if(h.storage==="vec2"&&h.value==="u32")return`${e}[${R}]=vec2(u32(${O}), 0u);`;if(h.storage==="u32"&&h.value==="vec4")return`${e}[${R}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${O}));`;throw new Error(`not supported combination of storage type ${h.storage} and value type ${h.value} yet`)})(),Y=R=>(()=>{if(h.storage===h.value)return`${e}[${R}]`;if(h.storage==="vec2"&&h.value==="i32")return`i32(${e}[${R}].x)`;if(h.storage==="vec2"&&h.value==="u32")return`u32(${e}[${R}].x)`;if(h.storage==="u32"&&h.value==="vec4")return`vec4(bool(${e}[${R}] & 0xFFu), bool(${e}[${R}] & 0xFF00u), bool(${e}[${R}] & 0xFF0000u), bool(${e}[${R}] & 0xFF000000u))`;throw new Error(`not supported combination of storage type ${h.storage} and value type ${h.value} yet`)})(),H=o<2?"":` - fn get_${e}ByIndices(indices: ${h.indices}) -> ${p} { - return ${Y(`i2o_${e}(indices)`)}; - }`,Q=o<2?"":(()=>{let R=a.map(G=>`d${G}: u32`).join(", "),O=a.map(G=>`d${G}`).join(", ");return` - fn get_${e}(${R}) -> ${p} { - return get_${e}ByIndices(${k(O)}); - }`})(),ie=(...R)=>{if(R.length!==o)throw new Error(`indices length must be ${o}`);let O=R.map(w).join(",");return o===0?Y("0u"):o===1?Y(O[0]):(f.get=!0,f.getByIndices=!0,f.indicesToOffset=!0,`get_${e}(${O})`)},le=R=>o<2?Y(R):(f.getByIndices=!0,f.indicesToOffset=!0,`get_${e}ByIndices(${R})`),ae=o<2?"":` - fn set_${e}ByIndices(indices: ${h.indices}, value: ${p}) { - ${V(`i2o_${e}(indices)`,"value")} - }`,we=o<2?"":(()=>{let R=a.map(G=>`d${G}: u32`).join(", "),O=a.map(G=>`d${G}`).join(", ");return` - fn set_${e}(${R}, value: ${p}) { - set_${e}ByIndices(${k(O)}, value); - }`})();return{impl:()=>{let R=[],O=!1;return f.offsetToIndices&&(R.push($),O=!0),f.indicesToOffset&&(R.push(M),O=!0),f.broadcastedIndicesToOffset&&(Object.values(J).forEach(G=>R.push(G)),O=!0),f.set&&(R.push(we),O=!0),f.setByIndices&&(R.push(ae),O=!0),f.get&&(R.push(Q),O=!0),f.getByIndices&&(R.push(H),O=!0),!n&&O&&R.unshift(`const ${A} = ${h.indices}(${t.join(",")});`,`const ${b} = ${h.indices}(${xe.computeStrides(t).join(",")});`),R.join(` -`)},type:h,offsetToIndices:T,indicesToOffset:E,broadcastedIndicesToOffset:q,indices:k,indicesGet:B,indicesSet:N,set:(...R)=>{if(R.length!==o+1)throw new Error(`indices length must be ${o}`);let O=R[o];if(typeof O!="string")throw new Error("value must be string");let G=R.slice(0,o).map(w).join(",");return o===0?V("0u",O):o===1?V(G[0],O):(f.set=!0,f.setByIndices=!0,f.indicesToOffset=!0,`set_${e}(${G}, ${O})`)},setByOffset:V,setByIndices:(R,O)=>o<2?V(R,O):(f.setByIndices=!0,f.indicesToOffset=!0,`set_${e}ByIndices(${R}, ${O});`),get:ie,getByOffset:Y,getByIndices:le,usage:s,name:e,strides:b,shape:A,rank:o}},$e=(e,r,t,s=1)=>Ai(e,r,t,"input",s),tt=(e,r,t,s=1)=>Ai(e,r,t,"output",s),zp=(e,r,t)=>Ai(e,r,t,"atomicOutput",1),Vd=(e,r,t,s=1)=>Ai(e,r,t,"internal",s),Bp=class{constructor(e,r){this.normalizedDispatchGroup=e,this.limits=r,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e=="number"?`${e}u`:e}) { return; }`}mainStart(e=jn){let r=typeof e=="number"?e:e[0],t=typeof e=="number"?1:e[1],s=typeof e=="number"?1:e[2];if(r>this.limits.maxComputeWorkgroupSizeX||t>this.limits.maxComputeWorkgroupSizeY||s>this.limits.maxComputeWorkgroupSizeZ)throw new Error(`workgroup size [${r}, ${t}, ${s}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(r*t*s>this.limits.maxComputeInvocationsPerWorkgroup)throw new Error(`workgroup size [${r}, ${t}, ${s}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,n=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, - @builtin(local_invocation_id) local_id : vec3, - @builtin(local_invocation_index) local_idx : u32, - @builtin(workgroup_id) workgroup_id : vec3, - @builtin(num_workgroups) num_workgroups : vec3`,o=i?`let global_idx = global_id.x; - let workgroup_index = workgroup_id.x;`:`let workgroup_index = workgroup_id.z * num_workgroups[0] * num_workgroups[1] + - workgroup_id.y * num_workgroups[0] + workgroup_id.x; - let global_idx = workgroup_index * ${r*t*s}u + local_idx;`;return`@compute @workgroup_size(${r}, ${t}, ${s}) - fn main(${n}) { - ${o} - `}appendVariableUniforms(e){e.rank!==0&&(e.shape.startsWith("uniforms.")&&this.uniforms.push({name:e.shape.replace("uniforms.",""),type:"u32",length:e.rank}),e.strides.startsWith("uniforms.")&&this.uniforms.push({name:e.strides.replace("uniforms.",""),type:"u32",length:e.rank}))}declareVariable(e,r){if(e.usage==="internal")throw new Error("cannot use internal variable with declareVariable(). use registerInternalVariables() instead.");this.variables.push(e),this.appendVariableUniforms(e);let t=e.usage==="input"?"read":"read_write",s=e.usage==="atomicOutput"?"atomic":e.type.storage;return`@group(0) @binding(${r}) var ${e.name}: array<${s}>;`}declareVariables(...e){return e.map(r=>this.declareVariable(r,this.variableIndex++)).join(` -`)}registerInternalVariable(e){if(e.usage!=="internal")throw new Error("cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.");this.internalVariables.push(e),this.appendVariableUniforms(e)}registerInternalVariables(...e){return e.forEach(r=>this.registerInternalVariable(r)),this}registerUniform(e,r,t=1){return this.uniforms.push({name:e,type:r,length:t}),this}registerUniforms(e){return this.uniforms=this.uniforms.concat(e),this}uniformDeclaration(){if(this.uniforms.length===0)return"";let e=[];for(let{name:r,type:t,length:s}of this.uniforms)if(s&&s>4)t==="f16"?e.push(`@align(16) ${r}:array, ${Math.ceil(s/8)}>`):e.push(`${r}:array, ${Math.ceil(s/4)}>`);else{let i=s==null||s===1?t:`vec${s}<${t}>`;e.push(`${r}:${i}`)}return` - 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=r=>[12,10,1,6][["u32","f16","f32","i32"].indexOf(r)];return this.uniforms.map(r=>[e(r.type),r.length??1])}},Rp=(e,r)=>new Bp(e,r)}),Np,Wd,jp,Up,Vp,Wp,Nr,Gp,Kp,Gs=Ue(()=>{pt(),Mt(),Yt(),xt(),Np=(e,r)=>{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(r.length!==0&&r.length!==e[0].dims.length)throw new Error(`perm size ${r.length} does not match input rank ${e[0].dims.length}`)},Wd=(e,r)=>r.length!==0?r:[...new Array(e).keys()].reverse(),jp=(e,r)=>xe.sortBasedOnPerm(e,Wd(e.length,r)),Up=(e,r,t,s)=>{let i=`fn perm(i: ${s.type.indices}) -> ${t.type.indices} { - var a: ${t.type.indices};`;for(let n=0;n{let t=[],s=[];for(let i=0;i{let t=0;for(let s=0;s{let t=e.dataType,s=e.dims.length,i=Wd(s,r),n=jp(e.dims,i),o=e.dims,a=n,l=s<2||Wp(i,e.dims),d;if(l)return d=f=>{let P=$e("input",t,o,4),A=tt("output",t,a,4);return` - ${f.registerUniform("output_size","u32").declareVariables(P,A)} - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - output[global_idx] = input[global_idx]; - }`},{name:"TransposeCopy",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let f=xe.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64/4)},programUniforms:[{type:12,data:Math.ceil(f/4)}]}},getShaderSource:d};let{newShape:p,newPerm:u}=Vp(e.dims,i),h=xe.areEqual(u,[2,3,1]),w=xe.areEqual(u,[3,1,2]);if(p.length===2||h||w){o=h?[p[0],p[1]*p[2]]:w?[p[0]*p[1],p[2]]:p,a=[o[1],o[0]];let f=16;return d=P=>{let A=$e("a",t,o.length),b=tt("output",t,a.length);return` - ${P.registerUniform("output_size","u32").declareVariables(A,b)} - var tile : array, ${f}>; - ${P.mainStart([f,f,1])} - let stride = (uniforms.output_shape[1] - 1) / ${f} + 1; - let workgroup_id_x = workgroup_index % stride; - let workgroup_id_y = workgroup_index / stride; - let input_col = workgroup_id_y * ${f}u + local_id.x; - let input_row = workgroup_id_x * ${f}u + local_id.y; - if (input_row < uniforms.a_shape[0] && input_col < uniforms.a_shape[1]) { - tile[local_id.y][local_id.x] = ${A.getByIndices(`${A.type.indices}(input_row, input_col)`)}; - } - workgroupBarrier(); - - let output_col = workgroup_id_x * ${f}u + local_id.x; - let output_row = workgroup_id_y * ${f}u + local_id.y; - if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { - ${b.setByIndices(`${b.type.indices}(output_row, output_col)`,"tile[local_id.x][local_id.y]")} - } - }`},{name:"TransposeShared",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let P=xe.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(a[1]/f),y:Math.ceil(a[0]/f)},programUniforms:[{type:12,data:P},...nt(o,a)]}},getShaderSource:d}}return d=f=>{let P=$e("a",t,o.length),A=tt("output",t,a.length);return` - ${f.registerUniform("output_size","u32").declareVariables(P,A)} - - ${Up(i,s,P,A)} - - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${A.offsetToIndices("global_idx")}; - let aIndices = perm(indices); - - ${A.setByOffset("global_idx",P.getByIndices("aIndices"))} - }`},{name:"Transpose",shaderCache:{hint:`${r}`,inputDependencies:["rank"]},getRunData:()=>{let f=xe.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},...nt(o,a)]}},getShaderSource:d}},Gp=(e,r)=>{Np(e.inputs,r.perm),e.compute(Nr(e.inputs[0],r.perm))},Kp=e=>Dt({perm:e.perm})}),Hp,qp,Qp,Xp,Jp,Yp,Zp,eh,th,rh,ns,sh,nh,ih,oh,ah,lh,dh,ch,uh,ph,nv=Ue(()=>{pt(),Mt(),xt(),Kd(),Gs(),Hp={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"},qp={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"},Qp={max:"_A[offset]",min:"_A[offset]",mean:"0",sum:"0",prod:"1",sumSquare:"0",logSumExp:"0",l1:"0",l2:"0",logSum:"0"},Xp={max:"bestValue",min:"bestValue",sum:"bestValue",prod:"bestValue",sumSquare:"bestValue",logSumExp:"log(bestValue)",l1:"bestValue",l2:"sqrt(bestValue)",logSum:"log(bestValue)"},Jp=(e,r)=>{let t=[];for(let s=r-e;s{let t=[],s=e.length;for(let n=0;ne[n]);return[t,i]},Zp=(e,r)=>{let t=e.length+r.length,s=[],i=0;for(let n=0;n{for(let t=0;t{let t=[];if(!eh(e,r)){for(let s=0;st.push(s))}return t},rh=(e,r,t,s,i,n,o)=>{let a=t[0].dims,l=xe.size(n),d=xe.size(o),p=$e("_A",t[0].dataType,a),u=tt("output",i,n),h=64;l===1&&(h=256);let w=` - var aBestValues : array; - `,f=P=>` - ${P.registerUniform("reduceSize","u32").declareVariables(p,u)} - ${w} - fn DIV_CEIL(a : u32, b : u32) -> u32 { - return ((a - 1u) / b + 1u); - } - ${P.mainStart(h)} - - let outputIndex = global_idx / ${h}; - let offset = outputIndex * uniforms.reduceSize; - - var bestValue = f32(${Qp[s]}); - let Length = uniforms.reduceSize; - for (var k = local_idx; k < Length; k = k + ${h}) { - let candidate = f32(${p.getByOffset("offset + k")}); - bestValue = ${Hp[s]}; - } - aBestValues[local_idx] = bestValue; - workgroupBarrier(); - - var reduceSize = min(Length, ${h}u); - for (var currentSize = reduceSize / 2u; reduceSize > 1u; - currentSize = reduceSize / 2u) { - let interval = DIV_CEIL(reduceSize, 2u); - if (local_idx < currentSize) { - let candidate = aBestValues[local_idx + interval]; - bestValue = ${qp[s]}; - aBestValues[local_idx] = bestValue; - } - reduceSize = interval; - workgroupBarrier(); - } - - if (local_idx == 0u) { - ${u.setByOffset("outputIndex",`${s==="mean"?`${u.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${u.type.storage}(${Xp[s]})`}`)}; - } - }`;return{name:e,shaderCache:{hint:`${r};${h}`,inputDependencies:["type"]},getShaderSource:f,getRunData:()=>({outputs:[{dims:n,dataType:i}],dispatchGroup:{x:l},programUniforms:[{type:12,data:d}]})}},ns=(e,r,t,s)=>{let i=e.inputs.length===1?t:Gd(e.inputs,t),n=i.axes;n.length===0&&!i.noopWithEmptyAxes&&(n=e.inputs[0].dims.map((w,f)=>f));let o=xe.normalizeAxes(n,e.inputs[0].dims.length),a=o,l=e.inputs[0],d=th(a,e.inputs[0].dims.length);d.length>0&&(l=e.compute(Nr(e.inputs[0],d),{inputs:[0],outputs:[-1]})[0],a=Jp(a.length,l.dims.length));let[p,u]=Yp(l.dims,a),h=p;i.keepDims&&(h=Zp(p,o)),e.compute(rh(r,i.cacheKey,[l],s,e.inputs[0].dataType,h,u),{inputs:[l]})},sh=(e,r)=>{ns(e,"ReduceMeanShared",r,"mean")},nh=(e,r)=>{ns(e,"ReduceL1Shared",r,"l1")},ih=(e,r)=>{ns(e,"ReduceL2Shared",r,"l2")},oh=(e,r)=>{ns(e,"ReduceLogSumExpShared",r,"logSumExp")},ah=(e,r)=>{ns(e,"ReduceMaxShared",r,"max")},lh=(e,r)=>{ns(e,"ReduceMinShared",r,"min")},dh=(e,r)=>{ns(e,"ReduceProdShared",r,"prod")},ch=(e,r)=>{ns(e,"ReduceSumShared",r,"sum")},uh=(e,r)=>{ns(e,"ReduceSumSquareShared",r,"sumSquare")},ph=(e,r)=>{ns(e,"ReduceLogSumShared",r,"logSum")}}),is,hh,Ta,Gd,os,mh,_h,fh,gh,wh,yh,Mh,bh,vh,xh,as,Th,Eh,Ph,Ch,Sh,$h,kh,Ih,Ah,Fh,Kd=Ue(()=>{pt(),Mt(),Yt(),xt(),nv(),is=e=>{if(!e||e.length===0||e.length>2)throw new Error("Reduce op requires 1 or 2 inputs.");if(e.length===2&&e[1].dims.length!==1)throw new Error("Invalid axes input dims.")},hh=e=>["","",`var value = ${e.getByIndices("input_indices")};`,""],Ta=(e,r,t,s,i,n,o=!1,a=!1)=>{let l=[],d=t[0].dims,p=d.length,u=xe.normalizeAxes(i,p),h=!a&&u.length===0;d.forEach((P,A)=>{h||u.indexOf(A)>=0?o&&l.push(1):l.push(P)});let w=l.length,f=xe.size(l);return{name:e,shaderCache:r,getShaderSource:P=>{let A=[],b=$e("_A",t[0].dataType,p),y=tt("output",n,w),$=s(b,y,u),T=$[2];for(let g=0,M=0;g=0?(o&&M++,T=`for(var j${g}: u32 = 0; j${g} < ${d[g]}; j${g}++) { - ${$[2].includes("last_index")?`let last_index = j${g};`:""} - ${b.indicesSet("input_indices",g,`j${g}`)} - ${T} - }`):(A.push(`${b.indicesSet("input_indices",g,y.indicesGet("output_indices",M))};`),M++);return` - - ${P.registerUniform("output_size","u32").declareVariables(b,y)} - - ${P.mainStart()} - ${P.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - var input_indices: ${b.type.indices}; - let output_indices = ${y.offsetToIndices("global_idx")}; - - ${A.join(` -`)} - ${$[0]} // init ops for reduce max/min - ${$[1]} - ${T} - ${$[3]} - ${$.length===4?y.setByOffset("global_idx","value"):$.slice(4).join(` -`)} - }`},getRunData:()=>({outputs:[{dims:l,dataType:n}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:[{type:12,data:f},...nt(d,l)]})}},Gd=(e,r)=>{let t=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(s=>t.push(Number(s))),Dt({axes:t,keepDims:r.keepDims,noopWithEmptyAxes:r.noopWithEmptyAxes})},os=(e,r,t,s)=>{let i=e.inputs,n=i.length===1?t:Gd(i,t);e.compute(Ta(r,{hint:n.cacheKey,inputDependencies:["rank"]},[i[0]],n.noopWithEmptyAxes&&n.axes.length===0?hh:s,n.axes,i[0].dataType,n.keepDims,n.noopWithEmptyAxes),{inputs:[0]})},mh=(e,r)=>{is(e.inputs),os(e,"ReduceLogSum",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += ${t.getByIndices("input_indices")};`,"value = log(value);"])},_h=(e,r)=>{is(e.inputs),os(e,"ReduceL1",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += abs(${t.getByIndices("input_indices")});`,""])},fh=(e,r)=>{is(e.inputs),os(e,"ReduceL2",r,(t,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,"",`t = ${t.getByIndices("input_indices")}; value += (t * t);`,"value = sqrt(value);"])},gh=(e,r)=>{is(e.inputs),os(e,"ReduceLogSumExp",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += exp(${t.getByIndices("input_indices")});`,"value = log(value);"])},wh=(e,r)=>{is(e.inputs),os(e,"ReduceMax",r,(t,s,i)=>{let n=[];for(let o=0;o=0||i.length===0)&&n.push(t.indicesSet("input_indices",o,0));return[`${n.join(` -`)}`,`var value = ${t.getByIndices("input_indices")};`,`value = max(value, ${t.getByIndices("input_indices")});`,""]})},yh=(e,r)=>{is(e.inputs),os(e,"ReduceMean",r,(t,s,i)=>{let n=1;for(let o=0;o=0||i.length===0)&&(n*=e.inputs[0].dims[o]);return["var sum = f32(0);","",`sum += f32(${t.getByIndices("input_indices")});`,`let value = ${s.type.value}(sum / ${n});`]})},Mh=(e,r)=>{is(e.inputs),os(e,"ReduceMin",r,(t,s,i)=>{let n=[];for(let o=0;o=0||i.length===0)&&n.push(`input_indices[${o}] = 0;`);return[`${n.join(` -`)}`,`var value = ${t.getByIndices("input_indices")};`,`value = min(value, ${t.getByIndices("input_indices")});`,""]})},bh=(e,r)=>{is(e.inputs),os(e,"ReduceProd",r,(t,s)=>[`var value = ${s.type.storage}(1);`,"",`value *= ${t.getByIndices("input_indices")};`,""])},vh=(e,r)=>{is(e.inputs),os(e,"ReduceSum",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += ${t.getByIndices("input_indices")};`,""])},xh=(e,r)=>{is(e.inputs),os(e,"ReduceSumSquare",r,(t,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,"",`t = ${t.getByIndices("input_indices")}; value += t * t;`,""])},as=(e,r,t)=>{if(r.length===0)return t;let s=1,i=1;for(let n=0;n1024},Th=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?yh(e,r):sh(e,r)},Eh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?_h(e,r):nh(e,r)},Ph=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?fh(e,r):ih(e,r)},Ch=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?gh(e,r):oh(e,r)},Sh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?wh(e,r):ah(e,r)},$h=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?Mh(e,r):lh(e,r)},kh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?bh(e,r):dh(e,r)},Ih=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?vh(e,r):ch(e,r)},Ah=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?xh(e,r):uh(e,r)},Fh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?mh(e,r):ph(e,r)}}),Hd,Oh,Dh,qd,iv=Ue(()=>{pt(),Yt(),Kd(),Hd=e=>{if(!e||e.length===0||e.length>2)throw new Error("ArgMinMaxOp op requires 1 or 2 inputs.");if(e[0].dataType!==1)throw new Error("Invalid input type.")},Oh=(e,r)=>{Hd(e.inputs);let t=(s,i,n)=>{let o=[];for(let a=0;a=0||n.length===0)&&o.push(`input_indices[${a}] = 0;`);return[`${o.join(` -`)}`,`var value = ${s.getByIndices("input_indices")}; -var best_index : i32 = 0;`,`if (${s.getByIndices("input_indices")} ${r.selectLastIndex>0?"<=":"<"} value) { - value = ${s.getByIndices("input_indices")}; - best_index = i32(last_index); - }`,"",i.setByOffset("global_idx","best_index")]};e.compute(Ta("ArgMin",{hint:r.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},Dh=(e,r)=>{Hd(e.inputs);let t=(s,i,n)=>{let o=[];for(let a=0;a=0||n.length===0)&&o.push(`input_indices[${a}] = 0;`);return[`${o.join(` -`)}`,`var value = ${s.getByIndices("input_indices")}; -var best_index : i32 = 0;`,`if (${s.getByIndices("input_indices")} ${r.selectLastIndex>0?">=":">"} value) { - value = ${s.getByIndices("input_indices")}; - best_index = i32(last_index); - }`,"",i.setByOffset("global_idx","best_index")]};e.compute(Ta("argMax",{hint:r.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},qd=e=>Dt(e)}),Lh,Ea,zh,Bh,Rh,Fi,Nh,jh,Qd=Ue(()=>{pt(),Mt(),Bd(),xt(),Lh=(e,r)=>{let t=e[0],s=e[1],i=e[2],n=e[3],o=e[4],a=e[5];if(o&&a)throw new Error("Attention cannot have both past and attention_bias");if(t.dims.length!==3)throw new Error('Input "input" must have 3 dimensions');let l=t.dims[0],d=t.dims[1],p=t.dims[2];if(i.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimensions');if(s.dims.length!==2)throw new Error('Input "weights" is expected to have 2 dimensions');if(s.dims[0]!==p)throw new Error("Input 1 dimension 0 should have same length as dimension 2 of input 0");if(i.dims[0]!==s.dims[1])throw new Error('Input "bias" dimension 0 should have same length as dimension 1 of input "weights"');let u=i.dims[0]/3,h=u,w=h;if(r.qkvHiddenSizes.length>0){if(r.qkvHiddenSizes.length!==3)throw new Error("qkv_hidden_sizes attribute should have 3 elements");for(let $ of r.qkvHiddenSizes)if($%r.numHeads!==0)throw new Error("qkv_hidden_sizes should be divisible by num_heads");u=r.qkvHiddenSizes[0],h=r.qkvHiddenSizes[1],w=r.qkvHiddenSizes[2]}let f=d;if(u!==h)throw new Error("qkv_hidden_sizes first element should be same as the second");if(i.dims[0]!==u+h+w)throw new Error('Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes');let P=0;if(o){if(h!==w)throw new Error('Input "past" expect k_hidden_size == v_hidden_size');if(o.dims.length!==5)throw new Error('Input "past" must have 5 dimensions');if(o.dims[0]!==2)throw new Error('Input "past" first dimension must be 2');if(o.dims[1]!==l)throw new Error('Input "past" second dimension must be batch_size');if(o.dims[2]!==r.numHeads)throw new Error('Input "past" third dimension must be num_heads');if(o.dims[4]!==h/r.numHeads)throw new Error('Input "past" fifth dimension must be k_hidden_size / num_heads');r.pastPresentShareBuffer||(P=o.dims[3])}let A=f+P,b=-1,y=0;if(n)throw new Error("Mask not supported");if(o)throw new Error("past is not supported");if(a){if(a.dims.length!==4)throw new Error('Input "attention_bias" must have 4 dimensions');if(a.dims[0]!==l||a.dims[1]!==r.numHeads||a.dims[2]!==d||a.dims[3]!==A)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:l,sequenceLength:d,pastSequenceLength:P,kvSequenceLength:f,totalSequenceLength:A,maxSequenceLength:b,inputHiddenSize:p,hiddenSize:u,vHiddenSize:w,headSize:Math.floor(u/r.numHeads),vHeadSize:Math.floor(w/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:y,scale:r.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},Ea=(e,r,t)=>r&&e?` - let total_sequence_length_input = u32(${r.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; - let is_first_prompt: bool = is_subsequent_prompt == false && sequence_length == total_sequence_length_input; - total_sequence_length = u32(${e==null?void 0:e.getByOffset("batchIdx")}) + 1; - var past_sequence_length: u32 = 0; - if (is_first_prompt == false) { - past_sequence_length = total_sequence_length - sequence_length; - } - `:` - ${t?"let past_sequence_length = uniforms.past_sequence_length":""}; - let present_sequence_length = total_sequence_length; - `,zh=(e,r,t,s,i,n,o,a)=>{let l=Xt(o?1:n),d=64,p=n/l;p{let y=tt("x",e.dataType,e.dims,l),$=[y],T=o?$e("seq_lens",o.dataType,o.dims):void 0;T&&$.push(T);let g=a?$e("total_sequence_length_input",a.dataType,a.dims):void 0;g&&$.push(g);let M=Tr(e.dataType),E=[{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; - ${b.registerUniforms(E).declareVariables(...$)} - ${b.mainStart([d,1,1])} - let batchIdx = workgroup_id.z / uniforms.num_heads; - let headIdx = workgroup_id.z % uniforms.num_heads; - let sequence_length = uniforms.sequence_length; - var total_sequence_length = uniforms.total_sequence_length; - ${Ea(T,g,!1)} - let local_offset = local_idx * uniforms.elements_per_thread; - let offset = (global_idx / ${d}) * uniforms.total_sequence_length + local_offset; - let seq_causal_length = ${o?"u32(past_sequence_length + workgroup_id.y + 1)":"total_sequence_length"}; - var thread_max_vector = ${f}(-3.402823e+38f); - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - thread_max_vector = max(${f}(x[offset + i]), thread_max_vector); - } - thread_max[local_idx] = ${(()=>{switch(l){case 1:return"thread_max_vector";case 2:return"max(thread_max_vector.x, thread_max_vector.y)";case 4:return"max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))";default:throw new Error(`Unsupported components: ${l}`)}})()}; - workgroupBarrier(); - - var max_value = f32(-3.402823e+38f); - for (var i = 0u; i < ${d}; i++) { - max_value = max(thread_max[i], max_value); - } - - var sum_vector = ${f}(0); - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - sum_vector += exp(${f}(x[offset + i]) - max_value); - } - thread_sum[local_idx] = ${(()=>{switch(l){case 1:return"sum_vector";case 2:return"sum_vector.x + sum_vector.y";case 4:return"sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w";default:throw new Error(`Unsupported components: ${l}`)}})()}; - workgroupBarrier(); - - var sum: f32 = 0; - for (var i = 0u; i < ${d}; i++) { - sum += thread_sum[i]; - } - - if (sum == 0) { - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - x[offset + i] = ${y.type.value}(${M}(1.0) / ${M}(seq_causal_length)); - } - } else { - for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { - var f32input = ${f}(x[offset + i]); - x[offset + i] = ${y.type.value}(exp(f32input - max_value) / sum); - } - } - ${o?` - 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] = ${y.type.value}(${M}(0)); - }`:""}; - }`};return{name:"AttentionProbsSoftmax",shaderCache:{hint:`${d};${w};${l}`,inputDependencies:P},getShaderSource:A,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:r*t},programUniforms:h})}},Bh=(e,r,t,s,i,n,o,a,l)=>{let d=o+n.kvSequenceLength,p=[n.batchSize,n.numHeads,n.sequenceLength,d],u=e>1&&s,h=n.kvNumHeads?n.kvNumHeads:n.numHeads,w=u?[n.batchSize,h,d,n.headSize]:void 0,f=n.nReps?n.nReps:1,P=n.scale===0?1/Math.sqrt(n.headSize):n.scale,A=Xt(n.headSize),b=n.headSize/A,y=12,$={x:Math.ceil(d/y),y:Math.ceil(n.sequenceLength/y),z:n.batchSize*n.numHeads},T=[{type:12,data:n.sequenceLength},{type:12,data:b},{type:12,data:d},{type:12,data:n.numHeads},{type:12,data:n.headSize},{type:1,data:P},{type:12,data:o},{type:12,data:n.kvSequenceLength},{type:12,data:f}],g=u&&s&&xe.size(s.dims)>0,M=["type","type"];g&&M.push("type"),i&&M.push("type"),a&&M.push("type"),l&&M.push("type");let E=[{dims:p,dataType:r.dataType,gpuDataType:0}];u&&E.push({dims:w,dataType:r.dataType,gpuDataType:0});let k=B=>{let N=$e("q",r.dataType,r.dims,A),J=$e("key",t.dataType,t.dims,A),q=[N,J];if(g){let ae=$e("past_key",s.dataType,s.dims,A);q.push(ae)}i&&q.push($e("attention_bias",i.dataType,i.dims));let V=a?$e("seq_lens",a.dataType,a.dims):void 0;V&&q.push(V);let Y=l?$e("total_sequence_length_input",l.dataType,l.dims):void 0;Y&&q.push(Y);let H=tt("output",r.dataType,p),Q=[H];u&&Q.push(tt("present_key",r.dataType,w,A));let ie=Tr(1,A),le=[{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 = ${y}u; - - var tileQ: array<${N.type.storage}, ${y*y}>; - var tileK: array<${N.type.storage}, ${y*y}>; - ${B.registerUniforms(le).declareVariables(...q,...Q)} - ${B.mainStart([y,y,1])} - // x holds the N and y holds the M - let headIdx = workgroup_id.z % uniforms.num_heads; - let kvHeadIdx = ${f===1?"headIdx":"headIdx / uniforms.n_reps"}; - let kv_num_heads = ${f===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"}; - let batchIdx = workgroup_id.z / uniforms.num_heads; - let m = workgroup_id.y * TILE_SIZE; - let n = workgroup_id.x * TILE_SIZE; - let sequence_length = uniforms.M; - var total_sequence_length = uniforms.N; - ${Ea(V,Y,!0)} - let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; - let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; - ${g&&u?"let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;":""}; - let kOffset = absKvHeadIdx * uniforms.kv_sequence_length * uniforms.K; - ${u?"let presentKeyOffset = absKvHeadIdx * uniforms.N * uniforms.K;":""} - var value = ${ie}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) { - tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x]; - } - if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) { - var idx = TILE_SIZE * local_id.y + local_id.x; - ${g&&u?` - if (n + local_id.y < past_sequence_length) { - tileK[idx] = past_key[pastKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; - } else if (n + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { - tileK[idx] = key[kOffset + (n + local_id.y - past_sequence_length) * uniforms.K + w + local_id.x]; - }`:` - if (n + local_id.y < uniforms.kv_sequence_length) { - tileK[idx] = key[kOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; - }`} - ${u?`if (n + local_id.y < present_sequence_length) { - present_key[presentKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x] = tileK[idx]; - }`:""} - } - workgroupBarrier(); - - for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) { - value += ${ie}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]); - } - - workgroupBarrier(); - } - - if (global_id.y < uniforms.M && global_id.x < total_sequence_length) { - let headOffset = workgroup_id.z * uniforms.M * uniforms.N; - let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x; - var sum: f32 = ${(()=>{switch(A){case 1:return"value";case 2:return"value.x + value.y";case 4:return"value.x + value.y + value.z + value.w";default:throw new Error(`Unsupported components: ${A}`)}})()}; - output[outputIdx] = ${H.type.value} (sum * uniforms.alpha) + ${i?"attention_bias[outputIdx]":"0.0"}; - } - }`};return{name:"AttentionProbs",shaderCache:{hint:`${A};${i!==void 0};${s!==void 0};${e}`,inputDependencies:M},getRunData:()=>({outputs:E,dispatchGroup:$,programUniforms:T}),getShaderSource:k}},Rh=(e,r,t,s,i,n,o=void 0,a=void 0)=>{let l=n+i.kvSequenceLength,d=i.nReps?i.nReps:1,p=i.vHiddenSize*d,u=e>1&&s,h=i.kvNumHeads?i.kvNumHeads:i.numHeads,w=u?[i.batchSize,h,l,i.headSize]:void 0,f=[i.batchSize,i.sequenceLength,p],P=12,A={x:Math.ceil(i.vHeadSize/P),y:Math.ceil(i.sequenceLength/P),z:i.batchSize*i.numHeads},b=[{type:12,data:i.sequenceLength},{type:12,data:l},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:p},{type:12,data:n},{type:12,data:i.kvSequenceLength},{type:12,data:d}],y=u&&s&&xe.size(s.dims)>0,$=["type","type"];y&&$.push("type"),o&&$.push("type"),a&&$.push("type");let T=[{dims:f,dataType:r.dataType,gpuDataType:0}];u&&T.push({dims:w,dataType:r.dataType,gpuDataType:0});let g=M=>{let E=$e("probs",r.dataType,r.dims),k=$e("v",t.dataType,t.dims),B=[E,k];y&&B.push($e("past_value",s.dataType,s.dims));let N=o?$e("seq_lens",o.dataType,o.dims):void 0;o&&B.push(N);let J=a?$e("total_sequence_length_input",a.dataType,a.dims):void 0;a&&B.push(J);let q=[tt("output",r.dataType,f)];u&&q.push(tt("present_value",r.dataType,w));let V=[{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 = ${P}u; - var tileQ: array<${E.type.value}, ${P*P}>; - var tileV: array<${E.type.value}, ${P*P}>; - ${M.registerUniforms(V).declareVariables(...B,...q)} - ${M.mainStart([P,P,1])} - let headIdx = workgroup_id.z % uniforms.num_heads; - let batchIdx = workgroup_id.z / uniforms.num_heads; - let kvHeadIdx = ${d===1?"headIdx":"headIdx / uniforms.n_reps"}; - let kv_num_heads = ${d===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"}; - let m = global_id.y; - let n = global_id.x; - let sequence_length = uniforms.M; - var total_sequence_length = uniforms.K; - ${Ea(N,J,!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 - ${y&&u?"let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;":""}; - let vOffset = absKvHeadIdx * uniforms.N * uniforms.kv_sequence_length + n; - ${u?"let presentValueOffset = absKvHeadIdx * uniforms.N * uniforms.K + n;":""} - var value = ${E.type.storage}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (m < uniforms.M && w + local_id.x < uniforms.K) { - tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x]; - } - if (n < uniforms.N && w + local_id.y < uniforms.K) { - var idx = TILE_SIZE * local_id.y + local_id.x; - ${y&&u?` - if (w + local_id.y < past_sequence_length) { - tileV[idx] = past_value[pastValueOffset + (w + local_id.y) * uniforms.N]; - } else if (w + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { - tileV[idx] = v[vOffset + (w + local_id.y - past_sequence_length) * uniforms.N]; - } - `:` - if (w + local_id.y < uniforms.kv_sequence_length) { - tileV[idx] = v[vOffset + (w + local_id.y) * uniforms.N]; - }`} - ${u?` - if (w + local_id.y < present_sequence_length) { - present_value[presentValueOffset + (w + local_id.y) * uniforms.N] = tileV[idx]; - }`:""} - } - workgroupBarrier(); - for (var k: u32 = 0u; k < TILE_SIZE && w+k < total_sequence_length; k++) { - value += tileQ[TILE_SIZE * local_id.y + k] * tileV[TILE_SIZE * k + local_id.x]; - } - workgroupBarrier(); - } - - // we need to transpose output from BNSH_v to BSND_v - if (m < uniforms.M && n < uniforms.N) { - let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size - + headIdx * uniforms.N + n; - output[outputIdx] = value; - } - }`};return{name:"AttentionScore",shaderCache:{hint:`${s!==void 0};${e}`,inputDependencies:$},getRunData:()=>({outputs:T,dispatchGroup:A,programUniforms:b}),getShaderSource:g}},Fi=(e,r,t,s,i,n,o,a,l,d,p=void 0,u=void 0)=>{let h=Math.min(e.outputCount,1+(o?1:0)+(a?1:0)),w=h>1?d.pastSequenceLength:0,f=w+d.kvSequenceLength,P=l&&xe.size(l.dims)>0?l:void 0,A=[r,t];h>1&&o&&xe.size(o.dims)>0&&A.push(o),P&&A.push(P),p&&A.push(p),u&&A.push(u);let b=e.compute(Bh(h,r,t,o,P,d,w,p,u),{inputs:A,outputs:h>1?[-1,1]:[-1]})[0];e.compute(zh(b,d.batchSize,d.numHeads,w,d.sequenceLength,f,p,u),{inputs:p&&u?[b,p,u]:[b],outputs:[]});let y=[b,s];h>1&&a&&xe.size(a.dims)>0&&y.push(a),p&&y.push(p),u&&y.push(u),e.compute(Rh(h,b,s,a,d,w,p,u),{inputs:y,outputs:h>1?[0,2]:[0]})},Nh=(e,r)=>{let t=[r.batchSize,r.numHeads,r.sequenceLength,r.headSize],s=r.sequenceLength,i=r.inputHiddenSize,n=r.headSize,o=12,a={x:Math.ceil(r.headSize/o),y:Math.ceil(r.sequenceLength/o),z:r.batchSize*r.numHeads},l=[e.inputs[0],e.inputs[1],e.inputs[2]],d=[{type:12,data:s},{type:12,data:i},{type:12,data:n},{type:12,data:r.numHeads},{type:12,data:r.headSize},{type:12,data:r.hiddenSize},{type:12,data:r.hiddenSize+r.hiddenSize+r.vHiddenSize}],p=u=>{let h=tt("output_q",l[0].dataType,t),w=tt("output_k",l[0].dataType,t),f=tt("output_v",l[0].dataType,t),P=$e("input",l[0].dataType,l[0].dims),A=$e("weight",l[1].dataType,l[1].dims),b=$e("bias",l[2].dataType,l[2].dims),y=P.type.storage,$=[{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<${y}, ${o*o}>; - var tileWeightQ: array<${y}, ${o*o}>; - var tileWeightK: array<${y}, ${o*o}>; - var tileWeightV: array<${y}, ${o*o}>; - ${u.registerUniforms($).declareVariables(P,A,b,h,w,f)} - ${u.mainStart([o,o,1])} - let batchIndex = workgroup_id.z / uniforms.num_heads; - let headNumber = workgroup_id.z % uniforms.num_heads; - let m = global_id.y; - let n = global_id.x; - - let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K; - let biasOffsetQ = headNumber * uniforms.head_size; - let biasOffsetK = uniforms.hidden_size + biasOffsetQ; - let biasOffsetV = uniforms.hidden_size + biasOffsetK; - - var valueQ = ${y}(0); - var valueK = ${y}(0); - var valueV = ${y}(0); - for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { - if (m < uniforms.M && w + local_id.x < uniforms.K) { - tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x]; - } - if (n < uniforms.N && w + local_id.y < uniforms.K) { - let offset = n + (w + local_id.y) * uniforms.ldb; - tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset]; - tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset]; - tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset]; - } - workgroupBarrier(); - for (var k: u32 = 0u; k({outputs:[{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:a,programUniforms:d}),getShaderSource:p},{inputs:l,outputs:[-1,-1,-1]})},jh=(e,r)=>{let t=Lh(e.inputs,r),[s,i,n]=Nh(e,t);return Fi(e,s,i,n,e.inputs[4],void 0,void 0,void 0,e.inputs[5],t)}}),Uh,Vh,Wh,Gh,ov=Ue(()=>{ss(),pt(),Mt(),Yt(),xt(),Uh=(e,r)=>{if(!e||e.length!==5)throw new Error("BatchNormalization requires 5 inputs");let t=(s,i,n)=>{let o=i.length;if(o!==s.length)throw new Error(`${n}: num dimensions != ${o}`);i.forEach((a,l)=>{if(a!==s[l])throw new Error(`${n}: dim[${l}] do not match`)})};if(e[0].dims.length>1){let s=r.format==="NHWC"?r.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,r.spatial?2:void 0);t(e[1].dims,s,"Invalid input scale"),t(e[2].dims,s,"Invalid input B"),t(e[3].dims,s,"Invalid input mean"),t(e[4].dims,s,"Invalid input var")}else t(e[1].dims,[1],"Invalid input scale"),t(e[2].dims,[1],"Invalid input B"),t(e[3].dims,[1],"Invalid input mean"),t(e[4].dims,[1],"Invalid input var")},Vh=(e,r)=>{let{epsilon:t,spatial:s,format:i}=r,n=e[0].dims,o=s?Xt(n[n.length-1]):1,a=i==="NHWC"&&n.length>1?o:1,l=xe.size(n)/o,d=s,p=d?n.length:n,u=$e("x",e[0].dataType,e[0].dims,o),h=$e("scale",e[1].dataType,e[1].dims,a),w=$e("bias",e[2].dataType,e[2].dims,a),f=$e("inputMean",e[3].dataType,e[3].dims,a),P=$e("inputVar",e[4].dataType,e[4].dims,a),A=tt("y",e[0].dataType,p,o),b=()=>{let $="";if(s)$=`let cOffset = ${n.length===1?"0u":i==="NHWC"?`outputIndices[${n.length-1}] / ${o}`:"outputIndices[1]"};`;else if(i==="NCHW")$=` - ${A.indicesSet("outputIndices","0","0")} - let cOffset = ${A.indicesToOffset("outputIndices")};`;else{$=`var cIndices = ${h.type.indices}(0); - cIndices[0] = outputIndices[${n.length-1}];`;for(let T=1;T` - const epsilon = ${t}; - ${$.registerUniform("outputSize","u32").declareVariables(u,h,w,f,P,A)} - ${$.mainStart()} - ${$.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var outputIndices = ${A.offsetToIndices(`global_idx * ${o}`)}; - ${b()} - let scale = ${h.getByOffset("cOffset")}; - let bias = ${w.getByOffset("cOffset")}; - let inputMean = ${f.getByOffset("cOffset")}; - let inputVar = ${P.getByOffset("cOffset")}; - let x = ${u.getByOffset("global_idx")}; - let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; - ${A.setByOffset("global_idx","value")} - }`;return{name:"BatchNormalization",shaderCache:{hint:`${r.epsilon}_${r.format}_${s}_${o}`,inputDependencies:d?["rank","type","type","type","type"]:void 0},getShaderSource:y,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:d?[{type:12,data:l},...nt(n)]:[{type:12,data:l}]})}},Wh=e=>Dt(e),Gh=(e,r)=>{let{inputs:t,outputCount:s}=e,i=Wh({...r,outputCount:s});if(Vt.webgpu.validateInputContent&&Uh(t,i),r.trainingMode)throw new Error("BatchNormalization trainingMode is not supported yet.");e.compute(Vh(t,i))}}),Kh,Hh,qh,av=Ue(()=>{Mt(),xt(),Kh=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![320,640,1280].includes(e[0].dims[2]))throw new Error("number of channels should be 320, 640 or 1280");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},Hh=e=>{let r=e[0].dims,t=e[0].dims[2],s=xe.size(r)/4,i=e[0].dataType,n=$e("input",i,r,4),o=$e("bias",i,[t],4),a=$e("residual",i,r,4),l=tt("output",i,r,4);return{name:"BiasAdd",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)}}),getShaderSource:d=>` - const channels = ${t}u / 4; - ${d.declareVariables(n,o,a,l)} - - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes(s)} - let value = ${n.getByOffset("global_idx")} - + ${o.getByOffset("global_idx % channels")} + ${a.getByOffset("global_idx")}; - ${l.setByOffset("global_idx","value")} - }`}},qh=e=>{Kh(e.inputs),e.compute(Hh(e.inputs))}}),Qh,$t,Xh,Jh,Yh,Zh,em,tm,rm,sm,nm,im,om,am,lm,dm,Oi,cm,Pa,um,pm,hm,mm,_m,fm,gm,wm,ym,Mm,bm,vm,xm,Tm,Em,Pm,Xd,Cm,Jd,Yd,Sm,$m,km,Im,Am,Fm,Zd=Ue(()=>{pt(),Mt(),Yt(),xt(),Qh=(e,r,t,s,i,n,o)=>{let a=Math.ceil(r/4),l="";typeof i=="string"?l=`${i}(a)`:l=i("a");let d=$e("inputData",t,[a],4),p=tt("outputData",s,[a],4),u=[{name:"vec_size",type:"u32"}];return o&&u.push(...o),` - ${e.registerUniforms(u).declareVariables(d,p)} - - ${n??""} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - - let a = ${d.getByOffset("global_idx")}; - ${p.setByOffset("global_idx",l)} - }`},$t=(e,r,t,s,i,n=e.dataType,o,a)=>{let l=[{type:12,data:Math.ceil(xe.size(e.dims)/4)}];return o&&l.push(...o),{name:r,shaderCache:{hint:i,inputDependencies:["type"]},getShaderSource:d=>Qh(d,xe.size(e.dims),e.dataType,n,t,s,a),getRunData:d=>({outputs:[{dims:e.dims,dataType:n}],dispatchGroup:{x:Math.ceil(xe.size(d[0].dims)/64/4)},programUniforms:l})}},Xh=e=>{e.compute($t(e.inputs[0],"Abs","abs"))},Jh=e=>{e.compute($t(e.inputs[0],"Acos","acos"))},Yh=e=>{e.compute($t(e.inputs[0],"Acosh","acosh"))},Zh=e=>{e.compute($t(e.inputs[0],"Asin","asin"))},em=e=>{e.compute($t(e.inputs[0],"Asinh","asinh"))},tm=e=>{e.compute($t(e.inputs[0],"Atan","atan"))},rm=e=>{e.compute($t(e.inputs[0],"Atanh","atanh"))},sm=e=>Dt(e),nm=(e,r)=>{let t;switch(r.to){case 10:t="vec4";break;case 1:t="vec4";break;case 12:t="vec4";break;case 6:t="vec4";break;case 9:t="vec4";break;default:throw new RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${r.to}`)}e.compute($t(e.inputs[0],"Cast",t,void 0,r.cacheKey,r.to))},im=e=>{let r,t,s=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:r=s?e[1].getFloat32Array()[0]:-34028234663852886e22,t=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:r=s?e[1].getUint16Array()[0]:64511,t=i?e[2].getUint16Array()[0]:31743;break;default:throw new Error("Unsupport data type")}return Dt({min:r,max:t})},om=(e,r)=>{let t=r||im(e.inputs),s=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Clip",i=>`clamp(${i}, vec4<${s}>(uniforms.min), vec4<${s}>(uniforms.max))`,void 0,t.cacheKey,void 0,[{type:e.inputs[0].dataType,data:t.min},{type:e.inputs[0].dataType,data:t.max}],[{name:"min",type:s},{name:"max",type:s}]),{inputs:[0]})},am=e=>{e.compute($t(e.inputs[0],"Ceil","ceil"))},lm=e=>{e.compute($t(e.inputs[0],"Cos","cos"))},dm=e=>{e.compute($t(e.inputs[0],"Cosh","cosh"))},Oi=e=>Dt(e),cm=(e,r)=>{let t=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Elu",s=>`elu_vf32(${s})`,` - const elu_alpha_ = ${t}(${r.alpha}); - - fn elu_f32(a: ${t}) -> ${t} { - return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0); - } - - fn elu_vf32(v: vec4<${t}>) -> vec4<${t}> { - return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); - }`,r.cacheKey))},Pa=(e="f32")=>` -const r0: ${e} = 0.3275911; -const r1: ${e} = 0.254829592; -const r2: ${e} = -0.284496736; -const r3: ${e} = 1.421413741; -const r4: ${e} = -1.453152027; -const r5: ${e} = 1.061405429; - -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)); -}`,um=e=>{let r=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Erf",t=>`erf_vf32(${t})`,Pa(r)))},pm=e=>{e.compute($t(e.inputs[0],"Exp","exp"))},hm=e=>{e.compute($t(e.inputs[0],"Floor","floor"))},mm=e=>{let r=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Gelu",t=>`0.5 * ${t} * (1.0 + erf_vf32(${t} * 0.7071067811865475))`,Pa(r)))},_m=(e,r)=>{let t=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"LeakyRelu",s=>`select(leaky_relu_alpha_ * ${s}, ${s}, ${s} >= vec4<${t}>(0.0))`,`const leaky_relu_alpha_ = ${t}(${r.alpha});`,r.cacheKey))},fm=e=>{e.compute($t(e.inputs[0],"Not",r=>`!${r}`))},gm=e=>{e.compute($t(e.inputs[0],"Neg",r=>`-${r}`))},wm=e=>{e.compute($t(e.inputs[0],"Reciprocal",r=>`1.0/${r}`))},ym=e=>{let r=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Relu",t=>`select(vec4<${r}>(0.0), ${t}, ${t} > vec4<${r}>(0.0))`))},Mm=e=>{e.compute($t(e.inputs[0],"Sigmoid",r=>`(1.0 / (1.0 + exp(-${r})))`))},bm=e=>Dt(e),vm=(e,r)=>{let t=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"HardSigmoid",s=>`max(vec4<${t}>(0.0), min(vec4<${t}>(1.0), ${r.alpha} * ${s} + vec4<${t}>(${r.beta})))`,void 0,r.cacheKey))},xm=e=>{e.compute($t(e.inputs[0],"Sin","sin"))},Tm=e=>{e.compute($t(e.inputs[0],"Sinh","sinh"))},Em=e=>{e.compute($t(e.inputs[0],"Sqrt","sqrt"))},Pm=e=>{e.compute($t(e.inputs[0],"Tan","tan"))},Xd=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,Cm=e=>{e.compute($t(e.inputs[0],"Tanh",Xd))},Jd=(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 ${Xd("v")}; -} -`,Yd=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,Sm=e=>{let r=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"FastGelu",Yd,Jd(r),void 0,e.inputs[0].dataType))},$m=(e,r)=>{let t=Tr(e.inputs[0].dataType);return e.compute($t(e.inputs[0],"ThresholdedRelu",s=>`select(vec4<${t}>(0.0), ${s}, ${s} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${t}>(${r.alpha});`,r.cacheKey)),0},km=e=>{e.compute($t(e.inputs[0],"Log","log"))},Im=(e,r)=>` -const alpha = vec4<${e}>(${r}); -const one = ${e}(1.0); -const zero = ${e}(0.0); - -fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { - let v = x *alpha; - var x1 : vec4<${e}>; - for (var i = 0; i < 4; i = i + 1) { - if (v[i] >= zero) { - x1[i] = one / (one + exp(-v[i])); - } else { - x1[i] = one - one / (one + exp(v[i])); - } - } - return x * x1; -} -`,Am=e=>`quick_gelu_impl(${e})`,Fm=(e,r)=>{let t=Tr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"QuickGelu",Am,Im(t,r.alpha),r.cacheKey,e.inputs[0].dataType))}}),Om,Dm,Lm,lv=Ue(()=>{Mt(),xt(),Zd(),Om=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![2560,5120,10240].includes(e[0].dims[2]))throw new Error("hidden state should be 2560, 5120 or 10240");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},Dm=e=>{let r=e[0].dims.slice();r[2]=r[2]/2;let t=$e("input",e[0].dataType,e[0].dims,4),s=$e("bias",e[0].dataType,[e[0].dims[2]],4),i=tt("output",e[0].dataType,r,4),n=xe.size(r)/4,o=lr(e[0].dataType);return{name:"BiasSplitGelu",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)}}),getShaderSource:a=>` - const M_SQRT2 = sqrt(2.0); - const halfChannels = ${e[0].dims[2]/4/2}u; - - ${a.declareVariables(t,s,i)} - - ${Pa(o)} - - ${a.mainStart()} - ${a.guardAgainstOutOfBoundsWorkgroupSizes(n)} - let biasIdx = global_idx % halfChannels; - let batchIndex = global_idx / halfChannels; - let inputOffset = biasIdx + batchIndex * halfChannels * 2; - let valueLeft = input[inputOffset] + bias[biasIdx]; - let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels]; - let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); - - ${i.setByOffset("global_idx","valueLeft * geluRight")} - }`}},Lm=e=>{Om(e.inputs),e.compute(Dm(e.inputs))}}),zm,Bm,ls,Rm,Nm,jm,Um,Vm,Wm,Gm,Km,Hm,qm,dv=Ue(()=>{pt(),Mt(),xt(),zm=(e,r,t,s,i,n,o,a,l,d,p,u)=>{let h,w;typeof a=="string"?h=w=(y,$)=>`${a}((${y}),(${$}))`:typeof a=="function"?h=w=a:(h=a.scalar,w=a.vector);let f=tt("outputData",p,s.length,4),P=$e("aData",l,r.length,4),A=$e("bData",d,t.length,4),b;if(i)if(n){let y=xe.size(r)===1,$=xe.size(t)===1,T=r.length>0&&r[r.length-1]%4===0,g=t.length>0&&t[t.length-1]%4===0;y||$?b=f.setByOffset("global_idx",w(y?`${P.type.value}(${P.getByOffset("0")}.x)`:P.getByOffset("global_idx"),$?`${A.type.value}(${A.getByOffset("0")}.x)`:A.getByOffset("global_idx"))):b=` - let outputIndices = ${f.offsetToIndices("global_idx * 4u")}; - let offsetA = ${P.broadcastedIndicesToOffset("outputIndices",f)}; - let offsetB = ${A.broadcastedIndicesToOffset("outputIndices",f)}; - ${f.setByOffset("global_idx",w(o||T?P.getByOffset("offsetA / 4u"):`${P.type.value}(${P.getByOffset("offsetA / 4u")}[offsetA % 4u])`,o||g?A.getByOffset("offsetB / 4u"):`${A.type.value}(${A.getByOffset("offsetB / 4u")}[offsetB % 4u])`))} - `}else b=f.setByOffset("global_idx",w(P.getByOffset("global_idx"),A.getByOffset("global_idx")));else{if(!n)throw new Error("no necessary to use scalar implementation for element-wise binary op implementation.");let y=($,T,g="")=>{let M=`aData[indexA${T}][componentA${T}]`,E=`bData[indexB${T}][componentB${T}]`;return` - let outputIndices${T} = ${f.offsetToIndices(`global_idx * 4u + ${T}u`)}; - let offsetA${T} = ${P.broadcastedIndicesToOffset(`outputIndices${T}`,f)}; - let offsetB${T} = ${A.broadcastedIndicesToOffset(`outputIndices${T}`,f)}; - let indexA${T} = offsetA${T} / 4u; - let indexB${T} = offsetB${T} / 4u; - let componentA${T} = offsetA${T} % 4u; - let componentB${T} = offsetB${T} % 4u; - ${$}[${T}] = ${g}(${h(M,E)}); - `};p===9?b=` - var data = vec4(0); - ${y("data",0,"u32")} - ${y("data",1,"u32")} - ${y("data",2,"u32")} - ${y("data",3,"u32")} - outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:b=` - ${y("outputData[global_idx]",0)} - ${y("outputData[global_idx]",1)} - ${y("outputData[global_idx]",2)} - ${y("outputData[global_idx]",3)} - `}return` - ${e.registerUniform("vec_size","u32").declareVariables(P,A,f)} - - ${u??""} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${b} - }`},Bm=(e,r,t,s,i,n,o=t.dataType)=>{let a=t.dims.map(P=>Number(P)??1),l=s.dims.map(P=>Number(P)??1),d=!xe.areEqual(a,l),p=a,u=xe.size(a),h=!1,w=!1,f=[d];if(d){let P=Nn.calcShape(a,l,!1);if(!P)throw new Error("Can't perform binary op on the given tensors");p=P.slice(),u=xe.size(p);let A=xe.size(a)===1,b=xe.size(l)===1,y=a.length>0&&a[a.length-1]%4===0,$=l.length>0&&l[l.length-1]%4===0;f.push(A),f.push(b),f.push(y),f.push($);let T=1;for(let g=1;gP.toString()).join("_"),inputDependencies:["rank","rank"]},getShaderSource:P=>zm(P,a,l,p,h,d,w,i,t.dataType,s.dataType,o,n),getRunData:()=>({outputs:[{dims:p,dataType:o}],dispatchGroup:{x:Math.ceil(u/64/4)},programUniforms:[{type:12,data:Math.ceil(xe.size(p)/4)},...nt(a,l,p)]})}},ls=(e,r,t,s,i,n)=>{e.compute(Bm(r,i??"",e.inputs[0],e.inputs[1],t,s,n))},Rm=e=>{ls(e,"Add",(r,t)=>`${r}+${t}`)},Nm=e=>{ls(e,"Div",(r,t)=>`${r}/${t}`)},jm=e=>{ls(e,"Equal",{scalar:(r,t)=>`u32(${r}==${t})`,vector:(r,t)=>`vec4(${r}==${t})`},void 0,void 0,9)},Um=e=>{ls(e,"Mul",(r,t)=>`${r}*${t}`)},Vm=e=>{let r=$e("input",e.inputs[0].dataType,e.inputs[0].dims).type.value;ls(e,"Pow",{scalar:(t,s)=>`pow_custom(${t},${s})`,vector:(t,s)=>`pow_vector_custom(${t},${s})`},` - fn pow_custom(a : ${r}, b : ${r}) -> ${r} { - if (b == ${r}(0.0)) { - return ${r}(1.0); - } else if (a < ${r}(0.0) && f32(b) != floor(f32(b))) { - return ${r}(pow(f32(a), f32(b))); // NaN - } - return select(sign(a), ${r}(1.0), round(f32(abs(b) % ${r}(2.0))) != 1.0) * ${r}(${r==="i32"?"round":""}(pow(f32(abs(a)), f32(b)))); - } - fn pow_vector_custom(a : vec4<${r}>, b : vec4<${r}>) -> vec4<${r}> { - // TODO: implement vectorized pow - return vec4<${r}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); - } - `)},Wm=e=>{ls(e,"Sub",(r,t)=>`${r}-${t}`)},Gm=e=>{ls(e,"Greater",{scalar:(r,t)=>`u32(${r}>${t})`,vector:(r,t)=>`vec4(${r}>${t})`},void 0,void 0,9)},Km=e=>{ls(e,"Less",{scalar:(r,t)=>`u32(${r}<${t})`,vector:(r,t)=>`vec4(${r}<${t})`},void 0,void 0,9)},Hm=e=>{ls(e,"GreaterOrEqual",{scalar:(r,t)=>`u32(${r}>=${t})`,vector:(r,t)=>`vec4(${r}>=${t})`},void 0,void 0,9)},qm=e=>{ls(e,"LessOrEqual",{scalar:(r,t)=>`u32(${r}<=${t})`,vector:(r,t)=>`vec4(${r}<=${t})`},void 0,void 0,9)}}),Qm,Xm,Jm,Ym,Zm,e_,cv=Ue(()=>{pt(),Mt(),Yt(),xt(),Qm=(e,r)=>{if(!e||e.length<1)throw new Error("too few inputs");let t=0,s=e[t],i=s.dataType,n=s.dims.length;e.forEach((o,a)=>{if(a!==t){if(o.dataType!==i)throw new Error("input tensors should be one type");if(o.dims.length!==n)throw new Error("input tensors should have the same shape");o.dims.forEach((l,d)=>{if(d!==r&&l!==s.dims[d])throw new Error("non concat dimensions must match")})}})},Xm=(e,r)=>` - fn calculateInputIndex(index: u32) -> u32 { - let sizeInConcatAxis = array(${r}); - for (var i: u32 = 0u; i < ${e}; i += 1u ) { - if (index < sizeInConcatAxis[i]) { - return i; - } - } - return ${e}u; - }`,Jm=(e,r)=>{let t=e.length,s=[];for(let i=0;i{let i=xe.size(t),n=new Array(e.length),o=new Array(e.length),a=0,l=[],d=[],p=[{type:12,data:i}];for(let P=0;P`uniforms.sizeInConcatAxis${P}`).join(","),f=P=>` - - ${(()=>{P.registerUniform("outputSize","u32");for(let A=0;A(${w}); - ${h} -= sizeInConcatAxis[inputIndex - 1u]; - } - - ${Jm(o,u)} - }`;return{name:"Concat",shaderCache:{hint:`${r}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:t,dataType:s}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:p}),getShaderSource:f}},Zm=(e,r)=>{let t=e.inputs,s=t[0].dims,i=xe.normalizeAxis(r.axis,s.length);Qm(t,i);let n=s.slice();n[i]=t.reduce((a,l)=>a+(l.dims.length>i?l.dims[i]:0),0);let o=t.filter(a=>xe.size(a.dims)>0);e.compute(Ym(o,i,n,t[0].dataType),{inputs:o})},e_=e=>Dt({axis:e.axis})}),fn,gn,wn,ec,yn=Ue(()=>{pt(),Mt(),fn=(e,r,t="f32")=>{switch(e.activation){case"Relu":return`value = max(value, ${r}(0.0));`;case"Sigmoid":return`value = (${r}(1.0) / (${r}(1.0) + exp(-value)));`;case"Clip":return`value = clamp(value, ${r}(${t}(uniforms.clip_min)), ${r}(${t}(uniforms.clip_max)));`;case"HardSigmoid":return`value = max(${r}(0.0), min(${r}(1.0), ${t}(uniforms.alpha) * value + ${t}(uniforms.beta)));`;case"LeakyRelu":return`value = select(${t}(uniforms.alpha) * value, value, value >= ${r}(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 new Error(`Unsupported activation ${e.activation}`)}},gn=(e,r)=>{e.activation==="Clip"?r.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation==="HardSigmoid"?r.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation==="LeakyRelu"&&r.push({type:1,data:e.alpha})},wn=(e,r)=>{e.activation==="Clip"?r.push({name:"clip_max",type:"f32"},{name:"clip_min",type:"f32"}):e.activation==="HardSigmoid"?r.push({name:"alpha",type:"f32"},{name:"beta",type:"f32"}):e.activation==="LeakyRelu"&&r.push({name:"alpha",type:"f32"})},ec=e=>{let r=(e==null?void 0:e.activation)||"";if(r==="HardSigmoid"){let[t,s]=(e==null?void 0:e.activation_params)||[.2,.5];return{activation:r,alpha:t,beta:s}}else if(r==="Clip"){let[t,s]=(e==null?void 0:e.activation_params)||[Dp,Lp];return{activation:r,clipMax:s,clipMin:t}}else if(r==="LeakyRelu"){let[t]=(e==null?void 0:e.activation_params)||[.01];return{activation:r,alpha:t}}return{activation:r}}}),hr,t_,tc=Ue(()=>{hr=(e,r)=>{switch(e){case 1:return r;case 2:return`vec2<${r}>`;case 3:return`vec3<${r}>`;case 4:return`vec4<${r}>`;default:throw new Error(`${e}-component is not supported.`)}},t_=e=>` - ${e?"value = value + getBiasByOutputCoords(coords);":""} - `}),r_,uv=Ue(()=>{r_=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)); -} -fn getOutputIndexFromCoords(coords : vec4) -> i32 { - return dot(coords, vec4( - i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); -} -`}),Di,rc,sc=Ue(()=>{pt(),Mt(),xt(),yn(),Di=(e,r,t,s,i)=>{let n=s-t;return` - ${Array.from({length:t}).map((o,a)=>` - if (${rt(r.shape,a,r.rank)} != 1) { - ${r.indicesSet(e,a,rt(i,a+n,s))} - } else { - ${r.indicesSet(e,a,0)} - }`).join("")} -`},rc=(e,r,t,s,i=!1,n)=>{let o=e[0].dims,a=e[1].dims,l=o[o.length-2],d=a[a.length-1],p=o[o.length-1],u=Xt(d),h=Xt(p),w=Xt(l),f=xe.size(t)/u/w,P=e.length>2,A=s?s.slice(0,-2):t.slice(0,-2),b=[xe.size(A),l,d],y=[{type:12,data:f},{type:12,data:l},{type:12,data:d},{type:12,data:p}];gn(r,y),y.push(...nt(A,o,a)),P&&y.push(...nt(e[2].dims)),y.push(...nt(b));let $=T=>{let g=Vd("batch_dims",e[0].dataType,A.length),M=$e("a",e[0].dataType,o.length,h),E=$e("b",e[1].dataType,a.length,u),k=tt("output",e[0].dataType,b.length,u),B=lr(k.type.tensor),N=fn(r,k.type.value,B),J=[M,E],q="";if(P){let H=i?u:1;J.push($e("bias",e[2].dataType,e[2].dims.length,H)),q=`${i?`value += bias[col / ${H}];`:`value += ${k.type.value}(bias[row + i]);`}`}let V=[{name:"output_size",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"}];wn(r,V);let Y=()=>{let H=`var a_data: ${M.type.value};`;for(let Q=0;Q; - for (var k: u32 = 0u; k < uniforms.K; k = k + ${h}) { - ${Y()} - } - for (var i = 0u; i < ${w}u; i++) { - var value = values[i]; - ${q} - ${N} - let cur_indices = ${k.type.indices}(batch, row + i, col); - let offset = ${k.indicesToOffset("cur_indices")}; - ${k.setByOffset(`offset / ${u}`,"value")}; - } - } - `};return{name:"MatMulNaive",shaderCache:{hint:`${r.activation};${u};${h};${w};${i}`,inputDependencies:P?["rank","rank","rank"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:n?n(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(f/64)},programUniforms:y}),getShaderSource:$}}}),s_,n_,nc,ic,i_,oc,o_,Ca,ac=Ue(()=>{pt(),Mt(),xt(),yn(),sc(),tc(),s_=(e,r)=>e?` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - kStart + inputRow, - globalRowStart / innerElementSize + inputCol${r?", batchIndices":""}); - `:` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - globalRow + innerRow, - kStart / innerElementSize + inputCol${r?", batchIndices":""}); - `,n_=(e,r)=>e?` - let ACached0 = mm_Asub[k * innerElementSize][localRow]; - let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; - let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; - ${r===3?"":"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];"} - for (var i = 0; i < rowPerThread; i = i + 1) { - acc[i] = BCached0 * ACached0[i] + acc[i]; - acc[i] = BCached1 * ACached1[i] + acc[i]; - acc[i] = BCached2 * ACached2[i] + acc[i]; - ${r===3?"":"acc[i] = BCached3 * ACached3[i] + acc[i];"} - }`:` - for (var i = 0; i < rowPerThread; i = i + 1) { - let ACached = mm_Asub[tileRow + i][k]; - acc[i] = BCached0 * ACached.x + acc[i]; - acc[i] = BCached1 * ACached.y + acc[i]; - acc[i] = BCached2 * ACached.z + acc[i]; - ${r===3?"":"acc[i] = BCached3 * ACached.w + acc[i];"} - }`,nc=(e,r,t="f32",s,i=!1,n=32,o=!1,a=32)=>{let l=r[1]*e[1],d=r[0]*e[0],p=i?l:n,u=i?n:l,h=p/r[0],w=n/r[1];if(!((i&&h===4&&e[1]===4||!i&&(h===3||h===4))&&p%r[0]===0&&n%r[1]===0&&e[0]===4))throw new Error(`If transposeA ${i} is true, innerElementSize ${h} and workPerThread[1] ${e[1]} must be 4. - Otherwise, innerElementSize ${h} must be 3 or 4. - tileAWidth ${p} must be divisible by workgroupSize[0]${r[0]}. tileInner ${n} must be divisible by workgroupSize[1] ${r[1]}. colPerThread ${e[0]} must be 4.`);return` -var mm_Asub: array, ${p/h}>, ${u}>; -var mm_Bsub: array, ${d/e[0]}>, ${n}>; - -const rowPerThread = ${e[1]}; -const colPerThread = ${e[0]}; -const innerElementSize = ${h}; -const tileInner = ${n}; - -@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]}) -fn main(@builtin(local_invocation_id) localId : vec3, - @builtin(global_invocation_id) globalId : vec3, - @builtin(workgroup_id) workgroupId : vec3) { - let localRow = i32(localId.y); - let tileRow = localRow * rowPerThread; - let tileCol = i32(localId.x); - - let globalRow =i32(globalId.y) * rowPerThread; - let globalCol = i32(globalId.x); - let batch = ${o?"0":"i32(globalId.z)"}; - ${s?`let batchIndices = ${s.offsetToIndices("u32(batch)")};`:""} - let globalRowStart = i32(workgroupId.y) * ${l}; - - let num_tiles = ${o?`${Math.ceil(a/n)}`:"(uniforms.dim_inner - 1) / tileInner + 1"}; - var kStart = ${o?`i32(globalId.z) * ${a}`:"0"}; - - var acc: array, rowPerThread>; - - // Loop over shared dimension. - let tileRowB = localRow * ${w}; - for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let inputRow = tileRow + innerRow; - let inputCol = tileCol; - ${s_(i,s)} - } - - // Load one tile of B into local memory. - for (var innerRow = 0; innerRow < ${w}; innerRow = innerRow + 1) { - let inputRow = tileRowB + innerRow; - let inputCol = tileCol; - mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${s?", batchIndices":""}); - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - for (var k = 0; k < tileInner / innerElementSize; k = k + 1) { - let BCached0 = mm_Bsub[k * innerElementSize][tileCol]; - let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol]; - let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; - ${h===3?"":"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];"} - - ${n_(i,h)} - } - - workgroupBarrier(); - } - - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); - } -}`},ic=(e,r)=>e?` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - kStart + inputRow, - globalRowStart + inputCol${r?", batchIndices":""}); - `:` - mm_Asub[inputRow][inputCol] = mm_readA(batch, - globalRowStart + inputRow, - kStart + inputCol${r?", batchIndices":""}); - `,i_=e=>e?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];",oc=(e,r,t="f32",s,i=!1,n=32,o=!1,a=32,l=!1)=>{let d=e[1]*r[1],p=e[0]*r[0],u=i?d:n,h=i?n:d;if(!(h%r[1]===0&&u%r[0]===0&&n%r[1]===0))throw new Error(`tileAHight ${h} must be divisible by workgroupSize[1]${r[1]}, tileAWidth ${u} must be divisible by workgroupSize[0]${r[0]}, tileInner ${n} must be divisible by workgroupSize[1]${r[1]}`);let w=h/r[1],f=u/r[0],P=n/r[1],A=l?` - let localRow = i32(localId.y); - let localCol = i32(localId.x); - let globalRowStart = i32(workgroupId.y) * ${d}; - let globalColStart = i32(workgroupId.x) * ${p}; - - // Loop over shared dimension. - for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var inputRow = localRow; inputRow < ${h}; inputRow = inputRow + ${r[1]}) { - for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${r[0]}) { - ${ic(i,s)} - } - } - // Load one tile of B into local memory. - for (var inputRow = localRow; inputRow < ${n}; inputRow = inputRow + ${r[1]}) { - for (var inputCol = localCol; inputCol < ${p}; inputCol = inputCol + ${r[0]}) { - mm_Bsub[inputRow][inputCol] = mm_readB(batch, - kStart + inputRow, - globalColStart + inputCol${s?", batchIndices":""}); - } - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - var BCached : array<${t}, colPerThread>; - for (var k = 0; k < tileInner; k = k + 1) { - for (var inner = 0; inner < colPerThread; inner = inner + 1) { - BCached[inner] = mm_Bsub[k][localCol + inner * ${r[0]}]; - } - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let ACached = ${i?`mm_Asub[k][localRow + innerRow * ${r[1]}];`:`mm_Asub[localRow + innerRow * ${r[1]}][k];`} - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - acc[innerRow][innerCol] = acc[innerRow][innerCol] + - ACached * BCached[innerCol]; - } - } - } - workgroupBarrier(); - } - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - let gRow = globalRowStart + localRow + innerRow * ${r[1]}; - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - let gCol = globalColStart + localCol + innerCol * ${r[0]}; - mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); - } - } - `:` -let tileRow = i32(localId.y) * rowPerThread; -let tileCol = i32(localId.x) * colPerThread; - -let globalRow = i32(globalId.y) * rowPerThread; -let globalCol = i32(globalId.x) * colPerThread; -let globalRowStart = i32(workgroupId.y) * ${d}; - -let tileRowA = i32(localId.y) * ${w}; -let tileColA = i32(localId.x) * ${f}; -let tileRowB = i32(localId.y) * ${P}; -// Loop over shared dimension. -for (var t = 0; t < num_tiles; t = t + 1) { - // Load one tile of A into local memory. - for (var innerRow = 0; innerRow < ${w}; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < ${f}; innerCol = innerCol + 1) { - let inputRow = tileRowA + innerRow; - let inputCol = tileColA + innerCol; - ${ic(i,s)} - } - } - - // Load one tile of B into local memory. - for (var innerRow = 0; innerRow < ${P}; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - let inputRow = tileRowB + innerRow; - let inputCol = tileCol + innerCol; - mm_Bsub[inputRow][inputCol] = mm_readB(batch, - kStart + inputRow, - globalCol + innerCol${s?", batchIndices":""}); - } - } - kStart = kStart + tileInner; - workgroupBarrier(); - - // Compute acc values for a single thread. - var BCached : array<${t}, colPerThread>; - for (var k = 0; k < tileInner; k = k + 1) { - for (var inner = 0; inner < colPerThread; inner = inner + 1) { - BCached[inner] = mm_Bsub[k][tileCol + inner]; - } - - for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - ${i_(i)} - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; - } - } - } - - workgroupBarrier(); -} - -for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { - for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { - mm_write(batch, globalRow + innerRow, globalCol + innerCol, - acc[innerRow][innerCol]); - } -} -`;return` - var mm_Asub : array, ${h}>; - var mm_Bsub : array, ${n}>; - const rowPerThread = ${e[1]}; - const colPerThread = ${e[0]}; - const tileInner = ${n}; - -@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]}) -fn main(@builtin(local_invocation_id) localId : vec3, - @builtin(global_invocation_id) globalId : vec3, - @builtin(workgroup_id) workgroupId : vec3) { - let batch = ${o?"0":"i32(globalId.z)"}; - ${s?`let batchIndices = ${s.offsetToIndices("u32(batch)")};`:""} - let num_tiles = ${o?`${Math.ceil(a/n)}`:"(uniforms.dim_inner - 1) / tileInner + 1"}; - var kStart = ${o?`i32(globalId.z) * ${a}`:"0"}; - - var acc : array, rowPerThread>; - ${A} - } -`},o_=(e,r,t,s,i=!1)=>{let[n,o,a,l]=s,d=lr(s[0].type.tensor);return` - fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${n.type.indices}) -> ${hr(e,d)} { - var value = ${hr(e,d)}(0.0); - let col = colIn * ${e}; - if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) - { - var aIndices: ${o.type.indices}; - ${Di("aIndices",o,o.rank-2,n.rank,"batchIndices")} - ${o.indicesSet("aIndices",o.rank-2,"u32(row)")} - ${o.indicesSet("aIndices",o.rank-1,"u32(colIn)")} - value = ${o.getByIndices("aIndices")}; - } - return value; - } - - fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${n.type.indices}) -> ${hr(e,d)} { - var value = ${hr(e,d)}(0.0); - let col = colIn * ${e}; - if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) - { - var bIndices: ${a.type.indices}; - ${Di("bIndices",a,a.rank-2,n.rank,"batchIndices")} - ${a.indicesSet("bIndices",a.rank-2,"u32(row)")} - ${a.indicesSet("bIndices",a.rank-1,"u32(colIn)")} - value = ${a.getByIndices("bIndices")}; - } - return value; - } - - fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${hr(e,d)}) { - let col = colIn * ${e}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { - var value = valueIn; - let coords = vec3(batch, row, colIn); - ${r?`value = value + ${i?"bias[colIn]":`${hr(e,d)}(bias[row])`};`:""} - ${t} - ${l.setByIndices("vec3(coords)","value")} - } - } - `},Ca=(e,r,t,s,i=!1,n)=>{let o=e[0].dims,a=e[1].dims,l=o.slice(0,-2),d=a.slice(0,-2),p=s?s.slice(0,-2):t.slice(0,-2),u=xe.size(p),h=o[o.length-2],w=o[o.length-1],f=a[a.length-1],P=w%4===0&&f%4===0,A=h<=8?[4,1,1]:[4,4,1],b=[8,8,1],y=[Math.ceil(f/b[0]/A[0]),Math.ceil(h/b[1]/A[1]),Math.ceil(u/b[2]/A[2])],$=P?4:1,T=[...l,h,w/$],g=T.length,M=[...d,w,f/$],E=M.length,k=[u,h,f/$],B=[{type:6,data:h},{type:6,data:f},{type:6,data:w}];gn(r,B),B.push(...nt(p,T,M));let N=["rank","rank"],J=e.length>2;J&&(B.push(...nt(e[2].dims)),N.push("rank")),B.push(...nt(k));let q=V=>{let Y=p.length,H=Vd("batchDims",e[0].dataType,Y,1),Q=lr(e[0].dataType),ie=$e("a",e[0].dataType,g,$),le=$e("b",e[1].dataType,E,$),ae=tt("result",e[0].dataType,k.length,$),we=[ie,le];if(J){let X=i?$:1;we.push($e("bias",e[2].dataType,e[2].dims.length,X))}let R=[{name:"dim_a_outer",type:"i32"},{name:"dim_b_outer",type:"i32"},{name:"dim_inner",type:"i32"}];wn(r,R);let O=lr(ae.type.tensor),G=fn(r,ae.type.value,O),ne=o_($,J,G,[H,ie,le,ae],i);return` - ${V.registerUniforms(R).registerInternalVariables(H).declareVariables(...we,ae)} - ${ne} - ${P?nc(A,b,Q,H):oc(A,b,Q,H)} - `};return{name:"MatMul",shaderCache:{hint:`${A};${r.activation};${P};${i}`,inputDependencies:N},getRunData:()=>({outputs:[{dims:n?n(t):t,dataType:e[0].dataType}],dispatchGroup:{x:y[0],y:y[1],z:y[2]},programUniforms:B}),getShaderSource:q}}}),a_,l_,pv=Ue(()=>{pt(),ks(),xt(),yn(),tc(),uv(),ac(),a_=(e,r,t,s,i=!1,n,o=4,a=4,l=4,d="f32")=>{let p=B=>{switch(B){case 1:return"resData = x[xIndex];";case 3:return`resData = vec3<${d}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return"resData = x[xIndex / 4];";default:throw new Error(`innerElementSize ${B} is not supported.`)}},u=B=>{switch(B){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 new Error(`innerElementSize ${B} is not supported.`)}},h=e?` - let coord = vec4(batch, xRow, xCol, xCh); - `:` - let coord = vec4(batch, xCh, xRow, xCol); - `,w=e?` - let coords = vec4( - batch, - row / outWidth, - row % outWidth, - col); - `:` - let coords = vec4( - batch, - row, - col / outWidth, - col % outWidth); - `,f=e?"i32(uniforms.x_shape[1])":"i32(uniforms.x_shape[2])",P=e?"i32(uniforms.x_shape[2])":"i32(uniforms.x_shape[3])",A=e?"row":"col",b=e?"col":"row",y=` - let inChannels = i32(uniforms.w_shape[2]); - let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"}; - let outRow = ${A} / outWidth; - let outCol = ${A} % outWidth; - - let WRow = ${b} / (i32(uniforms.w_shape[1]) * inChannels); - let WCol = ${b} / inChannels % i32(uniforms.w_shape[1]); - 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 = ${b} % inChannels; - var resData = ${hr(o,d)}(0.0); - // The bounds checking is always needed since we use it to pad zero for - // the 'same' padding type. - if (xRow >= 0 && xRow < ${f} && xCol >= 0 && xCol < ${P}) { - ${h} - let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape)); - ${p(o)} - } - return resData;`,$=e?r&&s?` - let col = colIn * ${o}; - ${y}`:` - let col = colIn * ${o}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { - ${y} - } - return ${hr(o,d)}(0.0);`:s&&t?` - let col = colIn * ${o}; - ${y}`:` - let col = colIn * ${o}; - if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { - ${y} - } - return ${hr(o,d)}(0.0);`,T=e?s&&t?u(a):` - let col = colIn * ${a}; - if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { - ${u(a)} - } - return ${hr(a,d)}(0.0);`:` - let col = colIn * ${a}; - if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { - ${u(a)} - } - return ${hr(a,d)}(0.0);`,g=hr(l,d),M=hr(e?o:a,d),E=hr(e?a:o,d),k=fn(n,g,d);return` - fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${M} { - ${e?$:T} - } - - fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${E} { - ${e?T:$} - } - - fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${g}) { - let col = colIn * ${l}; - if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) - { - var value = valueIn; - let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"}; - ${w} - ${t_(i)} - ${k} - setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); - } - }`},l_=(e,r,t,s,i,n,o,a,l)=>{let d=r.format==="NHWC",p=d?e[0].dims[3]:e[0].dims[1],u=t[0],h=d?t[2]:t[3],w=d?t[1]:t[2],f=d?t[3]:t[1],P=d&&(p%4===0||p%3===0)&&f%4===0,A=d?f:h*w,b=d?h*w:f,y=[8,8,1],$=s<=8?[4,1,1]:[4,4,1],T=[Math.ceil(A/y[0]/$[0]),Math.ceil(b/y[1]/$[1]),Math.ceil(u/y[2]/$[2])];St("verbose",()=>`[conv2d_mm_webgpu] dispatch = ${T}`);let g=P?d&&p%4!==0?3:4:1,M=y[1]*$[1],E=y[0]*$[0],k=Math.max(y[0]*g,y[1]),B=s%M===0,N=i%E===0,J=n%k===0,q=P?[g,4,4]:[1,1,1],V=[{type:6,data:s},{type:6,data:i},{type:6,data:n},{type:6,data:[r.pads[0],r.pads[1]]},{type:6,data:r.strides},{type:6,data:r.dilations}];gn(r,V),V.push(...nt(e[0].dims,e[1].dims));let Y=["rank","rank"];o&&(V.push(...nt(e[2].dims)),Y.push("rank")),V.push(...nt(t));let H=Q=>{let ie=[{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}];wn(r,ie);let le=P?4:1,ae=lr(e[0].dataType),we=` - fn setOutputAtIndex(flatIndex : i32, value : ${P?`vec4<${ae}>`:ae}) { - result[flatIndex] = ${P?`vec4<${ae}>`:ae}(value); - } - fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${P?`vec4<${ae}>`:ae}) { - let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); - setOutputAtIndex(flatIndex ${P?"/ 4":""}, value); - }`,R=$e("x",e[0].dataType,e[0].dims.length,g===3?1:g),O=$e("w",e[1].dataType,e[1].dims.length,le),G=[R,O],ne=tt("result",e[0].dataType,t.length,le);if(o){let X=$e("bias",e[2].dataType,e[2].dims.length,le);G.push(X),we+=` - fn getBiasByOutputCoords(coords : vec4) -> ${P?`vec4<${ae}>`:ae} { - return bias[coords.${d?"w":"y"}${P?"/ 4":""}]; - }`}return` - ${r_("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 }; - ${Q.registerUniforms(ie).declareVariables(...G,ne)} - ${we} - ${a_(d,B,N,J,o,r,q[0],q[1],q[2],ae)} - ${P?nc($,y,ae,void 0,!d,k):oc($,y,ae,void 0,!d,k,!1,void 0,a)}`};return{name:"Conv2DMatMul",shaderCache:{hint:`${r.cacheKey};${g};${P};${B};${N};${J};${M};${E};${k}`,inputDependencies:Y},getRunData:()=>({outputs:[{dims:l?l(t):t,dataType:e[0].dataType}],dispatchGroup:{x:T[0],y:T[1],z:T[2]},programUniforms:V}),getShaderSource:H}}}),d_,lc,Li,c_,dc,u_,p_,h_,hv=Ue(()=>{pt(),ks(),Mt(),xt(),yn(),tc(),d_=e=>{let r=1;for(let t=0;ttypeof e=="number"?[e,e,e]:e,Li=(e,r)=>r<=1?e:e+(e-1)*(r-1),c_=(e,r,t,s=1)=>{let i=Li(r,s);return Math.floor((e[0]*(t-1)-t+i)/2)},dc=(e,r,t,s,i)=>{i==null&&(i=c_(e,r[0],s[0]));let n=[0,0,0,t];for(let o=0;o<3;o++)e[o]+2*i>=r[o]&&(n[o]=Math.trunc((e[o]-r[o]+2*i)/s[o]+1));return n},u_=(e,r,t,s,i,n,o,a,l,d)=>{let p,u,h,w;if(e==="VALID"&&(e=0),typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e};let f=dc([r,t,s,1],[a,l,d],1,[i,n,o],e);u=f[0],h=f[1],w=f[2]}else if(Array.isArray(e)){if(!e.every((P,A,b)=>P===b[0]))throw Error(`Unsupported padding parameter: ${e}`);p={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let f=dc([r,t,s,1],[a,l,d],1,[i,n,o],e[0]);u=f[0],h=f[1],w=f[2]}else if(e==="SAME_UPPER"){u=Math.ceil(r/i),h=Math.ceil(t/n),w=Math.ceil(s/o);let f=(u-1)*i+a-r,P=(h-1)*n+l-t,A=(w-1)*o+d-s,b=Math.floor(f/2),y=f-b,$=Math.floor(P/2),T=P-$,g=Math.floor(A/2),M=A-g;p={top:$,bottom:T,left:g,right:M,front:b,back:y}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:u,outHeight:h,outWidth:w}},p_=(e,r,t,s,i,n=!1,o="channelsLast")=>{let a,l,d,p,u;if(o==="channelsLast")[a,l,d,p,u]=e;else if(o==="channelsFirst")[a,u,l,d,p]=e;else throw new Error(`Unknown dataFormat ${o}`);let[h,,w,f,P]=r,[A,b,y]=lc(t),[$,T,g]=lc(s),M=Li(w,$),E=Li(f,T),k=Li(P,g),{padInfo:B,outDepth:N,outHeight:J,outWidth:q}=u_(i,l,d,p,A,b,y,M,E,k),V=n?h*u:h,Y=[0,0,0,0,0];return o==="channelsFirst"?Y=[a,V,N,J,q]:o==="channelsLast"&&(Y=[a,N,J,q,V]),{batchSize:a,dataFormat:o,inDepth:l,inHeight:d,inWidth:p,inChannels:u,outDepth:N,outHeight:J,outWidth:q,outChannels:V,padInfo:B,strideDepth:A,strideHeight:b,strideWidth:y,filterDepth:w,filterHeight:f,filterWidth:P,effectiveFilterDepth:M,effectiveFilterHeight:E,effectiveFilterWidth:k,dilationDepth:$,dilationHeight:T,dilationWidth:g,inShape:e,outShape:Y,filterShape:r}},h_=(e,r,t,s,i,n)=>{let o=n==="channelsLast";o?e[0].dims[3]:e[0].dims[1];let a=[64,1,1],l={x:t.map((A,b)=>b)},d=[Math.ceil(d_(l.x.map(A=>t[A]))/a[0]),1,1];St("verbose",()=>`[conv3d_naive_webgpu] dispatch = ${d}`);let p=1,u=xe.size(t),h=[{type:12,data:u},{type:12,data:s},{type:12,data:i},{type:12,data:r.strides},{type:12,data:r.dilations}];gn(r,h),h.push(...nt(e[0].dims,e[1].dims));let w=["rank","rank"],f=e.length===3;f&&(h.push(...nt(e[2].dims)),w.push("rank")),h.push(...nt(t));let P=A=>{let b=[{name:"output_size",type:"u32"},{name:"filter_dims",type:"u32",length:s.length},{name:"pads",type:"u32",length:i.length},{name:"strides",type:"u32",length:r.strides.length},{name:"dilations",type:"u32",length:r.dilations.length}];wn(r,b);let y=1,$=lr(e[0].dataType),T=$e("x",e[0].dataType,e[0].dims.length,p),g=$e("W",e[1].dataType,e[1].dims.length,y),M=[T,g],E=tt("result",e[0].dataType,t.length,y),k="";if(f){let J=$e("bias",e[2].dataType,e[2].dims.length,y);M.push(J),k+=` - fn getBiasByOutputCoords(coords : array) -> ${$} { - return bias[${o?rt("coords",4,5):rt("coords",1,5)}]; - }`}let B=hr(p,$),N=fn(r,B,$);return` - ${k} - fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { - let aIndices = array(d0, d1, d2, d3, d4); - return ${T.getByIndices("aIndices")}; - } - fn getW(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { - let aIndices = array(d0, d1, d2, d3, d4); - return ${g.getByIndices("aIndices")}; - } - ${A.registerUniforms(b).declareVariables(...M,E)} - ${A.mainStart()} - ${A.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let coords = ${E.offsetToIndices("global_idx")}; - let batch = ${rt("coords",0,T.rank)}; - let d2 = ${o?rt("coords",T.rank-1,T.rank):rt("coords",1,T.rank)}; - let xFRCCorner = vec3(${o?rt("coords",1,T.rank):rt("coords",2,T.rank)}, - ${o?rt("coords",2,T.rank):rt("coords",3,T.rank)}, - ${o?rt("coords",3,T.rank):rt("coords",4,T.rank)}) * uniforms.strides - uniforms.pads; - let xFCorner = xFRCCorner.x; - let xRCorner = xFRCCorner.y; - let xCCorner = xFRCCorner.z; - let xShapeY = ${o?rt("uniforms.x_shape",1,T.rank):rt("uniforms.x_shape",2,T.rank)}; - let xShapeZ = ${o?rt("uniforms.x_shape",2,T.rank):rt("uniforms.x_shape",3,T.rank)}; - let xShapeW = ${o?rt("uniforms.x_shape",3,T.rank):rt("uniforms.x_shape",4,T.rank)}; - let xShapeU = ${o?rt("uniforms.x_shape",4,T.rank):rt("uniforms.x_shape",1,T.rank)}; - let inputDepthNearestVec4 = (xShapeU / 4) * 4; - let inputDepthVec4Remainder = xShapeU % 4; - - var value = 0.0; - for (var wF = 0u; wF < uniforms.filter_dims[0]; wF++) { - let xF = xFCorner + wF * uniforms.dilations[0]; - if (xF < 0 || xF >= xShapeY) { - continue; - } - - for (var wR = 0u; wR < uniforms.filter_dims[1]; wR++) { - let xR = xRCorner + wR * uniforms.dilations[1]; - if (xR < 0 || xR >= xShapeZ) { - continue; - } - - for (var wC = 0u; wC < uniforms.filter_dims[2]; wC++) { - let xC = xCCorner + wC * uniforms.dilations[2]; - if (xC < 0 || xC >= xShapeW) { - continue; - } - - for (var d1 = 0u; d1 < inputDepthNearestVec4; d1 += 4) { - ${o?`let xValues = vec4( - getX(batch, xF, xR, xC, d1), - getX(batch, xF, xR, xC, d1 + 1), - getX(batch, xF, xR, xC, d1 + 2), - getX(batch, xF, xR, xC, d1 + 3)); - `:`let xValues = vec4( - getX(batch, d1, xF, xR, xC), - getX(batch, d1 + 1, xF, xR, xC), - getX(batch, d1 + 2, xF, xR, xC), - getX(batch, d1 + 3, xF, xR, xC)); - `} - let wValues = vec4( - getW(d2, d1, wF, wR, wC), - getW(d2, d1 + 1, wF, wR, wC), - getW(d2, d1 + 2, wF, wR, wC), - getW(d2, d1 + 3, wF, wR, wC)); - value += dot(xValues, wValues); - } - if (inputDepthVec4Remainder == 1) { - ${o?`value += getX(batch, xF, xR, xC, inputDepthNearestVec4) - * getW(d2, inputDepthNearestVec4, wF, wR, wC);`:`value += getX(batch, inputDepthNearestVec4, xF, xR, xC) - * getW(d2, inputDepthNearestVec4, wF, wR, wC);`} - } else if (inputDepthVec4Remainder == 2) { - ${o?`let xValues = vec2( - getX(batch, xF, xR, xC, inputDepthNearestVec4), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)); - `:`let xValues = vec2( - getX(batch, inputDepthNearestVec4, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC)); - `} - let wValues = vec2( - getW(d2, inputDepthNearestVec4, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC)); - value += dot(xValues, wValues); - } else if (inputDepthVec4Remainder == 3) { - ${o?`let xValues = vec3( - getX(batch, xF, xR, xC, inputDepthNearestVec4), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1), - getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)); - `:`let xValues = vec3( - getX(batch, inputDepthNearestVec4, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC), - getX(batch, inputDepthNearestVec4 + 2, xF, xR, xC)); - `} - let wValues = vec3( - getW(d2, inputDepthNearestVec4, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC), - getW(d2, inputDepthNearestVec4 + 2, wF, wR, wC)); - value += dot(xValues, wValues); - } - } - } - } - ${f?"value = value + getBiasByOutputCoords(coords)":""}; - ${N} - result[global_idx] = f32(value); - }`};return{name:"Conv3DNaive",shaderCache:{hint:`${r.cacheKey};${o};${p};${f}`,inputDependencies:w},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:d[0],y:d[1],z:d[2]},programUniforms:h}),getShaderSource:P}}}),m_,__,mv=Ue(()=>{pt(),Mt(),xt(),yn(),m_=(e,r,t,s)=>{let i=e.length>2,n=i?"value += b[output_channel];":"",o=e[0].dims,a=e[1].dims,l=r.format==="NHWC",d=l?t[3]:t[1],p=d/r.group,u=l&&p>=4?Xt(d):1,h=xe.size(t)/u,w=[{type:12,data:h},{type:12,data:r.dilations},{type:12,data:[r.strides[0],r.strides[1]]},{type:12,data:[r.pads[0],r.pads[1]]},{type:12,data:p}];gn(r,w),w.push(...nt(o,[a[0],a[1],a[2],a[3]/u]));let f=i?["rank","rank","rank"]:["rank","rank"];w.push(...nt([t[0],t[1],t[2],t[3]/u]));let P=A=>{let b=tt("output",e[0].dataType,t.length,u),y=lr(b.type.tensor),$=fn(r,b.type.value,y),T=$e("x",e[0].dataType,o.length),g=$e("w",e[1].dataType,a.length,u),M=[T,g];i&&M.push($e("b",e[2].dataType,e[2].dims,u));let E=[{name:"output_size",type:"u32"},{name:"dilations",type:"u32",length:r.dilations.length},{name:"strides",type:"u32",length:2},{name:"pads",type:"u32",length:2},{name:"output_channels_per_group",type:"u32"}];wn(r,E);let k=l?` - for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { - let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; - - if (xHeight < 0u || xHeight >= uniforms.x_shape[1]) { - continue; - } - - for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[1]; wWidth++) { - let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; - if (xWidth < 0u || xWidth >= uniforms.x_shape[2]) { - continue; - } - - for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[2]; wInChannel++) { - let input_channel = in_channel_offset + wInChannel; - let xVal = ${T.get("batch","xHeight","xWidth","input_channel")}; - let wVal = ${g.get("wHeight","wWidth","wInChannel","output_channel")}; - value += xVal * wVal; - } - } - } - `:` - for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) { - let input_channel = in_channel_offset + wInChannel; - for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) { - let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; - - if (xHeight < 0u || xHeight >= uniforms.x_shape[2]) { - continue; - } - - for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) { - let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; - if (xWidth < 0u || xWidth >= uniforms.x_shape[3]) { - continue; - } - - let xVal = ${T.get("batch","input_channel","xHeight","xWidth")}; - let wVal = ${g.get("output_channel","wInChannel","wHeight","wWidth")}; - value += xVal * wVal; - } - } - } - `;return` - ${A.registerUniforms(E).declareVariables(...M,b)} - - ${A.mainStart()} - ${A.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let outputIndices = ${b.offsetToIndices("global_idx")}; - let batch: u32 = outputIndices[0]; - let output_channel: u32 = outputIndices[${l?3:1}]; - let xRCCorner: vec2 = vec2(outputIndices[${l?1:2}], outputIndices[${l?2:3}]) * uniforms.strides - uniforms.pads; - let group_id: u32 = output_channel * ${u} / uniforms.output_channels_per_group; - var in_channel_offset = group_id * uniforms.w_shape[${l?2:1}]; - - var value: ${b.type.value} = ${b.type.value}(0); - ${k} - ${n} - ${$} - ${b.setByOffset("global_idx","value")} - }`};return{name:"GroupedConv",shaderCache:{hint:`${r.cacheKey}_${u}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:s?s(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:w}),getShaderSource:P}},__=(e,r,t,s)=>{let i=e.length>2,n=Xt(t[3]),o=Xt(t[2]),a=xe.size(t)/n/o,l=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/n],d=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/n],p=[t[0],t[1],t[2],t[3]/n],u=[{type:12,data:a},{type:6,data:[r.strides[0],r.strides[1]]},{type:6,data:[r.pads[0],r.pads[1]]}];gn(r,u),u.push(...nt(l,d,p));let h=(o-1)*r.strides[1]+d[1],w=f=>{let P=tt("output",e[0].dataType,p.length,n),A=lr(P.type.tensor),b=fn(r,P.type.value,A),y=$e("x",e[0].dataType,l.length,n),$=$e("w",e[1].dataType,d.length,n),T=[y,$];i&&T.push($e("b",e[2].dataType,e[2].dims,n));let g=i?"value += b[output_channel];":"",M=[{name:"output_size",type:"u32"},{name:"strides",type:"i32",length:2},{name:"pads",type:"i32",length:2}];return wn(r,M),` - ${f.registerUniforms(M).declareVariables(...T,P)} - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let width0 = uniforms.output_shape[3]; - let output_channel = global_idx % width0; - var index1 = global_idx / width0; - let width1 = uniforms.output_shape[2] / ${o}u; - let col = (index1 % width1) * ${o}u; - index1 = index1 / width1; - let row = index1 % uniforms.output_shape[1]; - let batch = index1 / uniforms.output_shape[1]; - - let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads; - - var x_vals: array<${y.type.value}, ${h}>; - var values: array<${P.type.value}, ${o}>; - let input_channel = output_channel; - // Use constant instead of uniform can give better performance for w's height/width. - for (var w_height: u32 = 0u; w_height < ${d[0]}; w_height++) { - let x_height = x_corner.x + i32(w_height); - if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) { - for (var i = 0; i < ${h}; i++) { - let x_width = x_corner.y + i; - if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) { - x_vals[i] = ${y.get("batch","u32(x_height)","u32(x_width)","input_channel")}; - } else { - x_vals[i] = ${y.type.value}(0); - } - } - for (var w_width: u32 = 0u; w_width < ${d[1]}; w_width++) { - let w_val = ${$.get("w_height","w_width","0","output_channel")}; - for (var i = 0u; i < ${o}u; i++) { - values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]); - } - } - } - } - - for (var i = 0u; i < ${o}u; i++) { - var value = values[i]; - ${g} - ${b} - ${P.set("batch","row","col + i","output_channel","value")}; - } - }`};return{name:"GroupedConv-Vectorize",shaderCache:{hint:`${r.cacheKey};${n};${o};${h};${d[0]};${d[1]}`,inputDependencies:i?["rank","rank","type"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:s?s(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:u}),getShaderSource:w}}}),f_,Sa,g_,$a,cc,uc,w_,y_,pc,_v=Ue(()=>{Mt(),pv(),hv(),ac(),mv(),yn(),sc(),Gs(),f_=(e,r,t,s,i,n)=>{let o=e[0],a=e.slice(n?1:2,n?3:4),l=a.length,d=r[0],p=r.slice(2).map((h,w)=>h+(h-1)*(t[w]-1)),u=a.map((h,w)=>h+s[w]+s[w+l]).map((h,w)=>Math.floor((h-p[w]+i[w])/i[w]));return u.splice(0,0,o),u.splice(n?3:1,0,d),u},Sa=[2,3,1,0],g_=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length>5)throw new Error("greater than 5D is not supported");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let t=e[0].dims[r.format==="NHWC"?e[0].dims.length-1:1],s=e[1].dims[1]*r.group;if(t!==s)throw new 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 new Error("invalid bias");let i=e[0].dims.length-2;if(r.dilations.length!==i)throw new Error(`dilations should be ${i}D`);if(r.strides.length!==i)throw new Error(`strides should be ${i}D`);if(r.pads.length!==i*2)throw new Error(`pads should be ${i*2}D`);if(r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape")},$a=(e,r)=>{let t=e.kernelShape.slice();t.length{let r=ec(e),t=e.format,s=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],i=e.dilations,n=e.group,o=e.kernel_shape,a=e.pads,l=e.strides,d=e.w_is_const();return{autoPad:s,format:t,dilations:i,group:n,kernelShape:o,pads:a,strides:l,wIsConst:d,...r,cacheKey:`${e.format};${r.activation};`}},uc=(e,r,t,s)=>{let i=t.format==="NHWC",n=f_(r[0].dims,r[1].dims,t.dilations,t.pads,t.strides,i);if(t.group!==1){let M=[r[0]];if(i){let E=e.kernelCustomData.wT??e.compute(Nr(r[1],Sa),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=E),M.push(E)}else M.push(r[1]);r.length===3&&M.push(r[2]),!e.adapterInfo.isArchitecture("ampere")&&i&&r[1].dims[0]===t.group&&r[1].dims[1]===1&&t.dilations[0]===1&&t.dilations[1]===1?e.compute(__(M,t,n,s),{inputs:M}):e.compute(m_(M,t,n,s),{inputs:M});return}let o=r.length===3,a=r[0].dims[i?1:2],l=r[0].dims[i?2:3],d=r[0].dims[i?3:1],p=r[1].dims[2],u=r[1].dims[3],h=n[i?1:2],w=n[i?2:3],f=n[i?3:1],P=i&&p===a&&u===l&&t.pads[0]===0&&t.pads[1]===0;if(P||p===1&&u===1&&t.dilations[0]===1&&t.dilations[1]===1&&t.strides[0]===1&&t.strides[1]===1&&t.pads[0]===0&&t.pads[1]===0){let M=n[0],E,k,B,N=[];if(i){let V=e.kernelCustomData.wT??e.compute(Nr(r[1],Sa),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];if(t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=V),P){let Y=a*l*d;E=r[0].reshape([1,M,Y]),k=V.reshape([1,Y,f]),B=[1,M,f]}else E=r[0].reshape([M,a*l,d]),k=V.reshape([1,d,f]),B=[M,h*w,f];N.push(E),N.push(k)}else E=r[0].reshape([M,d,a*l]),k=r[1].reshape([1,f,d]),B=[M,f,h*w],N.push(k),N.push(E);o&&N.push(r[2]);let J=B[2],q=N[0].dims[N[0].dims.length-1];J<8&&q<8?e.compute(rc(N,t,n,B,i,s),{inputs:N}):e.compute(Ca(N,t,n,B,i,s),{inputs:N});return}let A=!0,b=e.kernelCustomData.wT??e.compute(Nr(r[1],Sa),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=b);let y=[r[0],b];o&&y.push(r[2]);let $=i?h*w:f,T=i?f:h*w,g=p*u*d;e.compute(l_(y,t,n,$,T,g,o,A,s),{inputs:y})},w_=(e,r)=>{let t=r.format==="NHWC",s=[e.inputs[0].reshape(t?[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&&s.push(e.inputs[2]);let i=[0,r.pads[0],0,r.pads[1]],n=[1].concat(r.strides),o=[1].concat(r.dilations),a=[1].concat(r.kernelShape),l=$a({...r,pads:i,strides:n,dilations:o,kernelShape:a},s);uc(e,s,l,d=>t?[d[0],d[2],d[3]]:[d[0],d[1],d[3]])},y_=(e,r,t)=>{let s=t.format==="NHWC"?"channelsLast":"channelsFirst",i=$a(t,r),n=t.autoPad==="NOTSET"?t.pads:t.autoPad,o=p_(r[0].dims,r[1].dims,t.strides,t.dilations,n,!1,s);e.compute(h_(r,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],s))},pc=(e,r)=>{if(g_(e.inputs,r),e.inputs[0].dims.length===3)w_(e,r);else if(e.inputs[0].dims.length===5)y_(e,e.inputs,r);else{let t=$a(r,e.inputs);uc(e,e.inputs,t)}}}),M_,fv=Ue(()=>{pt(),ks(),Mt(),xt(),M_=(e,r,t)=>{let s=e.length>2,i=r.outputShape,n=r.format==="NHWC",o=r.group,a=e[1].dims,l=a[2]/o,d=a[3],p=n?Xt(l):1,u=n&&d===1&&l>=4,h=u?Math.floor(l/4)*4:Math.floor(l/p)*p,w=l-h,f=n?Xt(d):1,P=n?d===1?p:f:1,A=xe.size(i)/f,b=[Math.ceil(A/64),1,1];St("verbose",()=>`[conv2d_backprop_webgpu] dispatch = ${b}`);let y=["rank","rank"],$=[r.strides[0],r.strides[1]],T=[r.kernelShape[n?1:2],r.kernelShape[n?2:3]],g=[r.dilations[0],r.dilations[1]],M=[T[0]+(r.dilations[0]<=1?0:(r.kernelShape[n?1:2]-1)*(r.dilations[0]-1)),T[1]+(r.dilations[1]<=1?0:(r.kernelShape[n?2:3]-1)*(r.dilations[1]-1))],E=[M[0]-1-Math.floor((r.pads[0]+r.pads[2])/2),M[1]-1-Math.floor((r.pads[1]+r.pads[3])/2)],k=[{type:12,data:A},{type:12,data:$},{type:12,data:T},{type:12,data:g},{type:12,data:M},{type:6,data:E},{type:12,data:h},{type:12,data:l},{type:12,data:d},...nt(e[0].dims,e[1].dims)];s&&(k.push(...nt(e[2].dims)),y.push("rank")),k.push(...nt(i));let B=N=>{let J=[{name:"output_size",type:"u32"},{name:"strides",type:"u32",length:$.length},{name:"filter_dims",type:"u32",length:T.length},{name:"dilations",type:"u32",length:T.length},{name:"effective_filter_dims",type:"u32",length:M.length},{name:"pads",type:"i32",length:E.length},{name:"input_channels_per_group_int",type:"u32"},{name:"input_channels_per_group",type:"u32"},{name:"output_channels_per_group",type:"u32"}],q=lr(e[0].dataType),V=n?1:2,Y=n?2:3,H=n?3:1,Q=$e("W",e[1].dataType,e[1].dims.length,P),ie=$e("Dy",e[0].dataType,e[0].dims.length,p),le=[ie,Q];s&&le.push($e("bias",e[2].dataType,[i[H]].length,f));let ae=tt("result",e[0].dataType,i.length,f),we=()=>{let G="";if(u)p===4?G+=` - let xValue = ${ie.getByOffset("x_offset")}; - let wValue = ${Q.getByOffset("w_offset")}; - dotProd = dotProd + dot(xValue, wValue); - x_offset += 1u; - w_offset += 1u;`:p===2?G+=` - dotProd = dotProd + dot(vec4<${q}>(${ie.getByOffset("x_offset")}, ${ie.getByOffset("x_offset + 1u")}), vec4<${q}>(${Q.getByOffset("w_offset")}, ${Q.getByOffset("w_offset + 1u")})); - x_offset += 2u; - w_offset += 2u;`:p===1&&(G+=` - dotProd = dotProd + dot(vec4<${q}>(${ie.getByOffset("x_offset")}, ${ie.getByOffset("x_offset + 1u")}, ${ie.getByOffset("x_offset + 2u")}, ${ie.getByOffset("x_offset + 3u")}), vec4<${q}>(${Q.getByOffset("w_offset")}, ${Q.getByOffset("w_offset + 1u")}, ${Q.getByOffset("w_offset + 2u")}, ${Q.getByOffset("w_offset + 3u")})); - x_offset += 4u; - w_offset += 4u;`);else if(G+=` - let xValue = ${n?ie.getByOffset(`${ie.indicesToOffset(`${ie.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}`):ie.get("batch","inputChannel","idyR","idyC")}; - `,p===1)G+=` - let w_offset = ${Q.indicesToOffset(`${Q.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel, wOutChannel)`)}; - let wValue = ${Q.getByOffset(`w_offset / ${P}`)}; - dotProd = dotProd + xValue * wValue;`;else for(let ne=0;ne{if(w===0)return"";if(!u)throw new Error(`packInputAs4 ${u} is not true.`);let G="";if(p===1){G+="dotProd = dotProd";for(let ne=0;ne(i32(r), i32(c)) - uniforms.pads; - let dyRCorner = dyCorner.x; - let dyCCorner = dyCorner.y; - let groupId = d1 / uniforms.output_channels_per_group; - let wOutChannel = d1 - groupId * uniforms.output_channels_per_group; - // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). - // ? = to be determined. : = across all values in that axis. - var dotProd = ${ae.type.value}(0.0); - var wR: u32 = 0; - if (uniforms.dilations.x == 1) { - // Minimum wR >= 0 that satisfies (dyRCorner + wR) % (uniforms.strides.x) == 0 - wR = u32(((dyRCorner + i32(uniforms.strides.x) - 1) / i32(uniforms.strides.x)) * i32(uniforms.strides.x) - dyRCorner); - } - for (; wR < uniforms.effective_filter_dims.x; wR = wR + 1) { - if (wR % uniforms.dilations.x != 0) { - continue; - } - let dyR = (${q}(dyRCorner) + ${q}(wR)) / ${q}(uniforms.strides[0]); - let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x; - if (dyR < 0.0 || dyR >= ${q}(uniforms.Dy_shape[${V}]) || fract(dyR) > 0.0 || - wRPerm < 0) { - continue; - } - let idyR: u32 = u32(dyR); - var wC: u32 = 0; - if (uniforms.dilations.y == 1) { - // Minimum wC >= 0 that satisfies (dyCCorner + wC) % (uniforms.strides.y) == 0 - wC = u32(((dyCCorner + i32(uniforms.strides.y) - 1) / i32(uniforms.strides.y)) * i32(uniforms.strides.y) - dyCCorner); - } - for (; wC < uniforms.effective_filter_dims.y; wC = wC + 1) { - if (wC % uniforms.dilations.y != 0) { - continue; - } - let dyC = (${q}(dyCCorner) + ${q}(wC)) / ${q}(uniforms.strides.y); - let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y; - if (dyC < 0.0 || dyC >= ${q}(uniforms.Dy_shape[${Y}]) || - fract(dyC) > 0.0 || wCPerm < 0) { - continue; - } - let idyC: u32 = u32(dyC); - var inputChannel = groupId * uniforms.input_channels_per_group; - ${u?` - var x_offset = ${ie.indicesToOffset(`${ie.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}; - var w_offset = ${Q.indicesToOffset(`${Q.type.indices}(wRPerm, wCPerm, inputChannel, wOutChannel)`)} / ${P}; - `:""} - for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group_int; d2 = d2 + ${u?4:p}) { - ${we()} - inputChannel = inputChannel + ${u?4:p}; - } - ${R()} - wC = wC + uniforms.strides.y - 1; - } - wR = wR + uniforms.strides[0] - 1; - } - let value = dotProd${s?` + bias[d1 / ${f}]`:""}; - ${ae.setByOffset("global_idx","value")}; - `;return` - ${N.registerUniforms(J).declareVariables(...le,ae)} - ${N.mainStart()} - ${N.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}; - ${O}}`};return{name:"ConvTranspose2D",shaderCache:{hint:`${r.cacheKey};${p}${P}${f}${u}${w}`,inputDependencies:y},getRunData:()=>({dispatchGroup:{x:b[0],y:b[1],z:b[2]},outputs:[{dims:t?t(i):i,dataType:e[0].dataType}],programUniforms:k}),getShaderSource:B}}}),b_,v_,x_,hc,T_,E_,mc,P_,C_,gv=Ue(()=>{fv(),yn(),Gs(),b_=(e,r,t,s,i,n)=>(e-1)*r+t+(s-1)*i+1-n,v_=(e,r,t,s,i)=>{let n=Math.floor(e/2);r==="SAME_UPPER"?(t[s]=n,t[i]=e-n):r==="SAME_LOWER"&&(t[s]=e-n,t[i]=n)},x_=(e,r,t,s,i,n,o,a,l,d)=>{let p=e.length-2,u=d.length===0;l.length{let t=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((u,h)=>u*h,1)===0){t.length=0;for(let u=2;uu+h,0)===0){let u=r[0].dims.length-2;l=new Array(u).fill(1)}let d=e.strides.slice();if(d.reduce((u,h)=>u+h,0)===0){let u=r[0].dims.length-2;d=new Array(u).fill(1)}x_(a,t,l,e.autoPad,e.group,i,d,s,o,n);let p=Object.assign({},e);return Object.assign(p,{kernelShape:t,pads:i,outputPadding:o,outputShape:n,dilations:l,strides:d}),p},T_=e=>{let r=ec(e),t=e.format,s=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][typeof e.autoPad>"u"?0:e.autoPad],i=e.dilations,n=e.group,o=e.kernelShape,a=e.pads,l=e.strides,d=e.wIsConst(),p=e.outputPadding,u=e.outputShape;return{autoPad:s,format:t,dilations:i,group:n,kernelShape:o,outputPadding:p,outputShape:u,pads:a,strides:l,wIsConst:d,...r,cacheKey:`${e.format};${r.activation};`}},E_=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error("currently only support 2-dimensional conv");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let t=e[0].dims[r.format==="NHWC"?e[0].dims.length-1:1],s=e[1].dims[0];if(t!==s)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");let i=e[1].dims[1]*r.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==i))throw new Error("invalid bias");let n=e[0].dims.length-2;if(r.dilations.reduce((o,a)=>o+a,0)>0&&r.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(r.strides.reduce((o,a)=>o+a,0)>0&&r.strides.length!==n)throw new Error(`strides should be ${n}D`);if(r.pads.reduce((o,a)=>o+a,0)>0&&r.pads.length!==n*2)throw new Error(`pads should be ${n*2}D`);if(r.outputPadding.length!==n&&r.outputPadding.length!==0)throw new Error(`output_padding should be ${n}D`);if(r.kernelShape.reduce((o,a)=>o+a,0)>0&&r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(r.outputShape.length!==0&&r.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape")},mc=(e,r,t,s)=>{let i=e.kernelCustomData.wT??e.compute(Nr(r[1],[2,3,0,1]),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let n=[r[0],i];r.length===3&&n.push(r[2]),e.compute(M_(n,t,s),{inputs:n})},P_=(e,r)=>{let t=r.format==="NHWC",s=[e.inputs[0].reshape(t?[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&&s.push(e.inputs[2]);let i=r.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let n=r.dilations;(n.length===0||n[0]===0)&&(n=[1]);let o=r.strides;(o.length===0||o[0]===0)&&(o=[1]);let a=r.pads;a.length===0&&(a=[0,0]),a=[0,a[0],0,a[1]],o=[1].concat(o),n=[1].concat(n),i=[1].concat(i);let l=r.outputPadding;l=[0].concat(l);let d=hc({...r,pads:a,strides:o,dilations:n,kernelShape:i,outputPadding:l},s);mc(e,s,d,p=>t?[p[0],p[2],p[3]]:[p[0],p[1],p[3]])},C_=(e,r)=>{if(E_(e.inputs,r),e.inputs[0].dims.length===3)P_(e,r);else{let t=hc(r,e.inputs);mc(e,e.inputs,t)}}}),S_,$_,k_,wv=Ue(()=>{pt(),Mt(),Yt(),xt(),S_=(e,r,t,s)=>{let i=xe.size(r),n=r.length,o=$e("input",e,n),a=tt("output",e,n),l=t.dataType===6?t.getInt32Array()[0]:Number(t.getBigInt64Array()[0]),d=xe.normalizeAxis(l,n),p=u=>{let h=` i32(${o.indicesGet("inputIndices","uniforms.axis")}) `,w=rt("uniforms.input_shape","uniforms.axis",n),f=s.reverse?h+(s.exclusive?" + 1":""):"0",P=s.reverse?w:h+(s.exclusive?"":" + 1");return` - ${u.registerUniform("outputSize","u32").registerUniform("axis","u32").declareVariables(o,a)} - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var inputIndices = ${a.offsetToIndices("global_idx")}; - var sum = ${a.type.value}(0); - let first : i32 = ${f}; - let last : i32 = ${P}; - for (var i : i32 = first; i < last; i++) { - ${o.indicesSet("inputIndices","uniforms.axis","u32(i)")}; - sum = sum + ${o.getByIndices("inputIndices")}; - } - ${a.setByOffset("global_idx","sum")}; - }`};return{name:"CumSum",shaderCache:{hint:s.cacheKey,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:r,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:d},...nt(r,r)]}),getShaderSource:p}},$_=(e,r)=>{let t=e.inputs[0].dims,s=e.inputs[0].dataType,i=e.inputs[1];e.compute(S_(s,t,i,r),{inputs:[0]})},k_=e=>{let r=e.exclusive===1,t=e.reverse===1;return Dt({exclusive:r,reverse:t})}}),I_,A_,F_,O_,D_,yv=Ue(()=>{pt(),Mt(),Yt(),xt(),I_=e=>{if(!e||e.length!==1)throw new Error("DepthToSpace requires 1 input.");if(e[0].dims.length!==4)throw new Error("DepthToSpace requires 4D input.")},A_=(e,r,t,s)=>{let i=[];i.push(`fn perm(i: ${s.type.indices}) -> ${t.type.indices} { - var a: ${t.type.indices};`);for(let n=0;n{let t,s,i,n,o,a,l=r.format==="NHWC",d=r.blocksize,p=r.mode==="DCR";l?([t,s,i,n]=e.dims,o=p?[t,s,i,d,d,n/d**2]:[t,s,i,n/d**2,d,d],a=p?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([t,s,i,n]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=p?[t,d,d,n/d**2,s,i]:[t,n/d**2,d,d,s,i],a=p?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let u=e.reshape(o),h=u.dims.length,w=e.dataType,f=$e("a",w,h),P=tt("output",w,h),A=b=>` - ${b.registerUniform("output_size","u32").declareVariables(f,P)} - - ${A_(a,h,f,P)} - - ${b.mainStart()} - ${b.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${P.offsetToIndices("global_idx")}; - let aIndices = perm(indices); - - ${P.setByOffset("global_idx",f.getByIndices("aIndices"))} - }`;return{name:"DepthToSpace",shaderCache:{hint:`${e.dims};${r.blocksize};${r.mode}`,inputDependencies:["rank"]},getRunData:b=>{let y=l?[t,s*d,i*d,n/d**2]:[t,n/d**2,s*d,i*d],$=xe.size(y),T=u.dims,g=xe.sortBasedOnPerm(T,a);return{outputs:[{dims:y,dataType:b[0].dataType}],dispatchGroup:{x:Math.ceil($/64)},programUniforms:[{type:12,data:$},...nt(T,g)]}},getShaderSource:A}},O_=(e,r)=>{I_(e.inputs),e.compute(F_(e.inputs[0],r))},D_=e=>Dt({blocksize:e.blocksize,mode:e.mode,format:e.format})}),ka,zi,_c,L_,z_,B_,R_,fc,N_,j_,U_,Mv=Ue(()=>{pt(),Mt(),Yt(),xt(),ka="[a-zA-Z]|\\.\\.\\.",zi="("+ka+")+",_c="^"+zi+"$",L_="("+zi+",)*"+zi,z_="^"+L_+"$",B_=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,r){let t=this.symbolToIndices.get(e);t===void 0?t=[r]:t.push(r),this.symbolToIndices.set(e,t)}},R_=class{constructor(e,r){var i;this.equation=r,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=new Array,this.outputDims=[];let[t,s]=r.includes("->")?r.split("->",2):[r,""];if(!t.match(RegExp(z_)))throw new Error("Invalid LHS term");if(t.split(",").forEach((n,o)=>{let a=e[o].dims.slice();if(!n.match(RegExp(_c)))throw new Error("Invalid LHS term");let l=this.processTerm(n,!0,a,o);this.lhs.push(l)}),s==="")s+=[...this.symbolToInfo.entries()].filter(([n,o])=>o.count===1||n==="...").map(([n])=>n).join("");else if(!s.match(RegExp(zi)))throw new Error("Invalid RHS");(i=s.match(RegExp(ka,"g")))==null||i.forEach(n=>{if(n==="...")this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let o=this.symbolToInfo.get(n);if(o===void 0)throw new Error("Invalid RHS symbol");this.outputDims.push(o.dimValue)}}),this.rhs=this.processTerm(s,!1,this.outputDims)}addSymbol(e,r,t){let s=this.symbolToInfo.get(e);if(s!==void 0){if(s.dimValue!==r&&s.count!==1)throw new Error("Dimension mismatch");s.count++,s.inputIndices.push(t)}else s={count:1,dimValue:r,inputIndices:[t]};this.symbolToInfo.set(e,s)}processTerm(e,r,t,s=-1){let i=t.length,n=!1,o=[],a=0;if(!e.match(RegExp(_c))&&!r&&e!=="")throw new Error("Invalid LHS term");let l=e.match(RegExp(ka,"g")),d=new B_(s);return l==null||l.forEach((p,u)=>{if(p==="..."){if(n)throw new Error("Only one ellipsis is allowed per input term");n=!0;let h=i-l.length+1;if(h<0)throw new Error("Ellipsis out of bounds");if(o=t.slice(a,a+h),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw new Error("Ellipsis dimensions mismatch")}else if(r)this.hasEllipsis=!0,this.ellipsisDims=o;else throw new Error("Ellipsis must be specified in the LHS");for(let w=0;we+"_max",N_=(e,r,t,s)=>{let i=e.map(d=>d.length).map((d,p)=>$e(`input${p}`,r,d)),n=xe.size(s),o=tt("output",r,s.length),a=[...t.symbolToInfo.keys()].filter(d=>!t.rhs.symbolToIndices.has(d)),l=d=>{let p=[],u="var prod = 1.0;",h="var sum = 0.0;",w="sum += prod;",f=[],P=[],A=[],b=[],y=t.symbolToInfo.size===t.rhs.symbolToIndices.size;t.symbolToInfo.forEach((T,g)=>{var M;if(t.rhs.symbolToIndices.has(g)){let E=(M=t.rhs.symbolToIndices.get(g))==null?void 0:M[0];E!==void 0&&t.lhs.forEach((k,B)=>{if(T.inputIndices.includes(B)){let N=k.symbolToIndices.get(g);if(N===void 0)throw new Error("Invalid symbol error");N.forEach(J=>{p.push(`${i[B].indicesSet(`input${B}Indices`,J,o.indicesGet("outputIndices",E))}`)})}})}else t.lhs.forEach((E,k)=>{if(T.inputIndices.includes(k)){let B=E.symbolToIndices.get(g);if(B===void 0)throw new Error("Invalid symbol error");B.forEach(N=>{f.push(`${i[k].indicesSet(`input${k}Indices`,N,`${g}`)}`)}),b.push(`prod *= ${i[k].getByIndices(`input${k}Indices`)};`)}}),P.push(`for(var ${g}: u32 = 0; ${g} < uniforms.${fc(g)}; ${g}++) {`),A.push("}")});let $=y?[...p,`let sum = ${i.map((T,g)=>T.getByIndices(`input${g}Indices`)).join(" * ")};`]:[...p,h,...P,...f,u,...b,w,...A];return` - ${d.registerUniforms(a.map(T=>({name:`${fc(T)}`,type:"u32"}))).registerUniform("outputSize","u32").declareVariables(...i,o)} - - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - var outputIndices = ${o.offsetToIndices("global_idx")}; - ${i.map((T,g)=>`var input${g}Indices: ${i[g].type.indices};`).join(` -`)} - ${$.join(` -`)}; - ${o.setByOffset("global_idx","sum")}; - }`};return{name:"Einsum",shaderCache:{hint:t.equation,inputDependencies:e.map(()=>"rank")},getRunData:()=>{let d=a.filter(u=>t.symbolToInfo.has(u)).map(u=>{var h;return{type:12,data:((h=t.symbolToInfo.get(u))==null?void 0:h.dimValue)||0}});d.push({type:12,data:n});let p=e.map((u,h)=>[...nt(u)]).reduce((u,h)=>u.concat(h),d);return p.push(...nt(s)),{outputs:[{dims:s,dataType:r}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:p}},getShaderSource:l}},j_=(e,r)=>{let t=new R_(e.inputs,r.equation),s=t.outputDims,i=e.inputs.map((n,o)=>n.dims);e.compute(N_(i,e.inputs[0].dataType,t,s))},U_=e=>{let r=e.equation.replace(/\s+/g,"");return Dt({equation:r})}}),V_,gc,W_,G_,K_,bv=Ue(()=>{pt(),Mt(),xt(),V_=e=>{if(!e||e.length!==2)throw new Error("Expand requires 2 input.");let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),s=t.length{let t=e.length-r.length,s=[];for(let i=0;ie.length>r.length?gc(e,r):gc(r,e),G_=e=>{let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),s=W_(r,t),i=e[0].dataType,n=i===9||xe.size(r)===1,o=i===9||r.length>0&&r[r.length-1]%4===0?4:1,a=n||s.length>0&&s[s.length-1]%4===0?4:1,l=Math.ceil(xe.size(s)/a),d=u=>{let h=$e("input",i,r.length,o),w=tt("output",i,s.length,a),f;if(i===9){let P=(A,b,y="")=>` - let outputIndices${b} = ${w.offsetToIndices(`outputOffset + ${b}u`)}; - let offset${b} = ${h.broadcastedIndicesToOffset(`outputIndices${b}`,w)}; - let index${b} = offset${b} / 4u; - let component${b} = offset${b} % 4u; - ${A}[${b}] = ${y}(${h.getByOffset(`index${b}`)}[component${b}]); - `;f=` - let outputOffset = global_idx * ${a}; - var data = vec4(0); - ${P("data",0,"u32")} - ${P("data",1,"u32")} - ${P("data",2,"u32")} - ${P("data",3,"u32")} - ${w.setByOffset("global_idx","data")} - }`}else f=` - let outputIndices = ${w.offsetToIndices(`global_idx * ${a}`)}; - let inputOffset = ${h.broadcastedIndicesToOffset("outputIndices",w)}; - let data = ${w.type.value}(${h.getByOffset(`inputOffset / ${o}`)}); - ${w.setByOffset("global_idx","data")} - }`;return` - ${u.registerUniform("vec_size","u32").declareVariables(h,w)} - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${f}`},p=[{type:12,data:l},...nt(r,s)];return{name:"Expand",shaderCache:{hint:`${s.length};${o}${a}`,inputDependencies:["rank"]},getShaderSource:d,getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:p})}},K_=e=>{V_(e.inputs),e.compute(G_(e.inputs),{inputs:[0]})}}),H_,q_,vv=Ue(()=>{pt(),Mt(),xt(),Zd(),H_=e=>{let r=e[0].dataType,t=xe.size(e[0].dims),s=xe.size(e[1].dims),i=s%4===0,n=o=>{let a=$e("x",r,[1],4),l=$e("bias",r,[1],4),d=tt("y",r,[1],4),p=[{name:"output_vec_size",type:"u32"},{name:"bias_size",type:"u32"}],u=w=>` - let bias${w}_offset: u32 = (global_idx * 4 + ${w}) % uniforms.bias_size; - let bias${w} = ${l.getByOffset(`bias${w}_offset / 4`)}[bias${w}_offset % 4];`,h=i?` - let bias = ${l.getByOffset("global_idx % (uniforms.bias_size / 4)")};`:`${u(0)}${u(1)}${u(2)}${u(3)} - let bias = ${a.type.value}(bias0, bias1, bias2, bias3);`;return`${o.registerUniforms(p).declareVariables(a,l,d)} - - ${Jd(Tr(r))} - - ${o.mainStart(jn)} - ${o.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_vec_size")} - - let x = ${a.getByOffset("global_idx")}; - ${h} - let x_in = x + bias; - ${d.setByOffset("global_idx",Yd("x_in"))} - }`};return{name:"FastGeluWithBias",shaderCache:{hint:`${i}`,inputDependencies:["type","type"]},getShaderSource:n,getRunData:o=>({outputs:[{dims:o[0].dims,dataType:o[0].dataType}],programUniforms:[{type:12,data:Math.ceil(t/4)},{type:12,data:s}],dispatchGroup:{x:Math.ceil(t/jn/4)}})}},q_=e=>{e.inputs.length<2||xe.size(e.inputs[1].dims)===0?Sm(e):e.compute(H_(e.inputs))}}),Q_,X_,J_,Y_,xv=Ue(()=>{pt(),Mt(),Yt(),xt(),Q_=e=>{if(!e||e.length!==2)throw new Error("Gather requires 2 inputs.")},X_=(e,r)=>{let t=e[0].dims,s=e[1].dims,i=t.length,n=xe.normalizeAxis(r.axis,i),o=t.slice(0);o.splice(n,1,...s);let a=t[n],l=e[0].dataType===9?4:1,d=Math.ceil(xe.size(o)/l),p=[{type:12,data:d},{type:6,data:a},{type:12,data:n},...nt(e[0].dims,e[1].dims,o)],u=h=>{let w=$e("data",e[0].dataType,e[0].dims.length,l),f=$e("inputIndices",e[1].dataType,e[1].dims.length),P=tt("output",e[0].dataType,o.length,l),A=y=>{let $=s.length,T=`var indicesIndices${y} = ${f.type.indices}(0);`;for(let g=0;g<$;g++)T+=`${$>1?`indicesIndices${y}[${g}]`:`indicesIndices${y}`} = ${o.length>1?`outputIndices${y}[uniforms.axis + ${g}]`:`outputIndices${y}`};`;T+=` - var idx${y} = ${f.getByIndices(`indicesIndices${y}`)}; - if (idx${y} < 0) { - idx${y} = idx${y} + uniforms.axisDimLimit; - } - var dataIndices${y} : ${w.type.indices}; - `;for(let g=0,M=0;g1?`dataIndices${y}[${g}]`:`dataIndices${y}`} = u32(idx${y});`,M+=$):(T+=`${i>1?`dataIndices${y}[${g}]`:`dataIndices${y}`} = ${o.length>1?`outputIndices${y}[${M}]`:`outputIndices${y}`};`,M++);return T},b;if(e[0].dataType===9){let y=($,T,g="")=>` - let outputIndices${T} = ${P.offsetToIndices(`outputOffset + ${T}u`)}; - ${A(T)}; - let offset${T} = ${w.indicesToOffset(`dataIndices${T}`)}; - let index${T} = offset${T} / 4u; - let component${T} = offset${T} % 4u; - ${$}[${T}] = ${g}(${w.getByOffset(`index${T}`)}[component${T}]); - `;b=` - let outputOffset = global_idx * ${l}; - var value = vec4(0); - ${y("value",0,"u32")} - ${y("value",1,"u32")} - ${y("value",2,"u32")} - ${y("value",3,"u32")} - ${P.setByOffset("global_idx","value")} - `}else b=` - let outputIndices = ${P.offsetToIndices("global_idx")}; - ${A("")}; - let value = ${w.getByIndices("dataIndices")}; - ${P.setByOffset("global_idx","value")}; - `;return` - ${h.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(w,f,P)} - ${h.mainStart()} - ${h.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - ${b} - }`};return{name:"Gather",shaderCache:{hint:r.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:p}),getShaderSource:u}},J_=e=>Dt({axis:e.axis}),Y_=(e,r)=>{let t=e.inputs;Q_(t),e.compute(X_(e.inputs,r))}}),Z_,ef,tf,Tv=Ue(()=>{pt(),Mt(),xt(),Z_=(e,r,t,s,i,n,o,a,l)=>{let d=[{type:12,data:n},{type:12,data:s},{type:12,data:i},{type:12,data:t},{type:12,data:o},{type:12,data:a},{type:12,data:l}],p=[n];d.push(...nt(r.dims,p));let u=h=>{let w=$e("indices_data",r.dataType,r.dims.length),f=tt("input_slice_offsets_data",12,1,1),P=[w,f],A=[{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:t.length},{name:"num_slices_per_batch",type:"u32"},{name:"input_batch_stride",type:"u32"},{name:"num_slice_dims",type:"u32"}];return` - ${h.registerUniforms(A).declareVariables(...P)} - ${h.mainStart()} - ${h.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let batch_idx = global_idx / uniforms.num_slices_per_batch; - let base_offset = batch_idx * uniforms.input_batch_stride; - - let slice_indices_base_offset = global_idx * uniforms.num_slice_dims; - var relative_slice_offset = 0; - for (var dim_idx = 0u; dim_idx < uniforms.num_slice_dims; dim_idx ++) { - var index = i32(indices_data[dim_idx + slice_indices_base_offset].x); - let input_dim_idx = uniforms.batch_dims + dim_idx; - if (index < 0) { - ${i.length===1?"index += i32(uniforms.input_dims);":"index += i32(uniforms.input_dims[input_dim_idx]);"} - } - ${t.length===1?"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data);":"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data[dim_idx]);"} - } - - input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); - }`};return e.compute({name:"computeSliceOffsets",shaderCache:{hint:`${i.length}_${t.length}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:p,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:d}),getShaderSource:u},{inputs:[r],outputs:[-1]})[0]},ef=(e,r)=>{let t=e.inputs,s=t[0].dims,i=t[0].dataType,n=t[1].dims,o=n[n.length-1],a=xe.sizeToDimension(n,n.length-1),l=xe.sizeFromDimension(s,r.batchDims+o),d=xe.sizeToDimension(s,r.batchDims),p=xe.sizeFromDimension(s,r.batchDims),u=a/d,h=new Array(o),w=l;for(let T=0;Ts.length)throw new Error("last dimension of indices must not be larger than rank of input tensor");let A=n.slice(0,-1).concat(s.slice(P)),b=xe.size(A),y=[{type:12,data:b},{type:12,data:l},...nt(t[0].dims,f.dims,A)],$=T=>{let g=$e("data",t[0].dataType,t[0].dims.length),M=$e("slice_offsets",12,f.dims.length),E=tt("output",t[0].dataType,A.length);return` - ${T.registerUniform("output_size","u32").registerUniform("slice_size","u32").declareVariables(g,M,E)} - ${T.mainStart()} - ${T.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:r.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:A,dataType:i}],dispatchGroup:{x:Math.ceil(b/64)},programUniforms:y}),getShaderSource:$},{inputs:[t[0],f]})},tf=e=>({batchDims:e.batch_dims,cacheKey:""})}),rf,sf,nf,of,Ev=Ue(()=>{pt(),Mt(),Yt(),xt(),rf=(e,r)=>{if(e.length<3||e.length>4)throw new Error("GatherBlockQuantized requires 3 or 4 inputs.");let t=xe.normalizeAxis(r.quantizeAxis,e[0].dims.length),s=r.blockSize,i=e[0],n=e[2],o=e.length===4?e[3]:void 0;if(n.dims.length!==i.dims.length||!i.dims.map((a,l)=>l===t?Math.ceil(a/s)===n.dims[l]:a===n.dims[l]).reduce((a,l)=>a&&l,!0))throw new 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 new Error("Zero point must have the same data type as the input tensor.");if(o.dims.length!==n.dims.length||!o.dims.map((a,l)=>a===n.dims[l]).reduce((a,l)=>a&&l,!0))throw new Error("Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.")}},sf=(e,r)=>{let t=e[0].dims,s=e[1].dims,i=t.length,n=xe.normalizeAxis(r.gatherAxis,i),o=xe.normalizeAxis(r.quantizeAxis,i),a=t.slice(0);a.splice(n,1,...s);let l=xe.size(a),d=e[2].dataType,p=e[0].dataType===22,u=[{type:12,data:l},{type:12,data:o},{type:12,data:n},{type:12,data:r.blockSize},...nt(...e.map((w,f)=>w.dims),a)],h=w=>{let f=$e("data",e[0].dataType,e[0].dims.length),P=$e("inputIndices",e[1].dataType,e[1].dims.length),A=$e("scales",e[2].dataType,e[2].dims.length),b=e.length>3?$e("zeroPoint",e[3].dataType,e[3].dims.length):void 0,y=tt("output",d,a.length),$=[f,P,A];b&&$.push(b);let T=[{name:"output_size",type:"u32"},{name:"quantize_axis",type:"u32"},{name:"gather_axis",type:"u32"},{name:"block_size",type:"u32"}];return` - ${w.registerUniforms(T).declareVariables(...$,y)} - ${w.mainStart()} - let output_indices = ${y.offsetToIndices("global_idx")}; - var indices_indices = ${P.type.indices}(0); - ${s.length>1?` - for (var i: u32 = 0; i < ${s.length}; i++) { - let index = ${y.indicesGet("output_indices","uniforms.gather_axis + i")}; - ${P.indicesSet("indices_indices","i","index")}; - }`:`indices_indices = ${y.indicesGet("output_indices","uniforms.gather_axis")};`}; - var data_indices = ${f.type.indices}(0); - for (var i: u32 = 0; i < uniforms.gather_axis; i++) { - let index = ${y.indicesGet("output_indices","i")}; - ${f.indicesSet("data_indices","i","index")}; - } - var index_from_indices = ${P.getByIndices("indices_indices")}; - if (index_from_indices < 0) { - index_from_indices += ${t[n]}; - } - ${f.indicesSet("data_indices","uniforms.gather_axis","u32(index_from_indices)")}; - for (var i = uniforms.gather_axis + 1; i < ${a.length}; i++) { - let index = ${y.indicesGet("output_indices",`i + ${s.length} - 1`)}; - ${f.indicesSet("data_indices","i","index")}; - } - let data_offset = ${f.indicesToOffset("data_indices")}; - let data_index = data_offset % 8; - // Convert 4-bit packed data to 8-bit packed data. - let packed_4bit_quantized_data = ${f.getByOffset("data_offset / 8")}; - let packed_8bit_quantized_data = (packed_4bit_quantized_data >> (4 * (data_index % 2))) & 0x0f0f0f0f; - let quantized_data_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_quantized_data)); - let quantized_data = quantized_data_vec[data_index / 2]; - var scale_indices = data_indices; - let quantize_axis_index = ${A.indicesGet("data_indices","uniforms.quantize_axis")} / uniforms.block_size; - ${A.indicesSet("scale_indices","uniforms.quantize_axis","quantize_axis_index")}; - var scale = ${A.getByIndices("scale_indices")}; - ${b?` - let zero_point_indices = scale_indices; - let zero_point_offset = ${b.indicesToOffset("zero_point_indices")}; - let zero_point_index = zero_point_offset % 8; - let packed_4bit_zero_points = ${b.getByOffset("zero_point_offset / 8")}; - let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; - let zero_point_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_zero_points)); - let zero_point = zero_point_vec[zero_point_index / 2];`:"var zero_point = 0"}; - let dequantized_data = ${Tr(d)}(quantized_data - zero_point) * scale; - ${y.setByOffset("global_idx","dequantized_data")}; - }`};return{name:"GatherBlockQuantized",shaderCache:{hint:`${r.cacheKey};${e.filter((w,f)=>f!==1).map(w=>w.dims.join("_")).join(";")}`,inputDependencies:Array.from({length:e.length},(w,f)=>"rank")},getRunData:()=>({outputs:[{dims:a,dataType:d}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:h}},nf=(e,r)=>{let t=e.inputs;rf(t,r),e.compute(sf(e.inputs,r))},of=e=>Dt({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),af,lf,df,cf,Pv=Ue(()=>{pt(),Mt(),Yt(),xt(),af=e=>{if(!e||e.length!==2)throw new Error("GatherElements requires 2 inputs.");if(e[0].dims.length<1)throw new Error("GatherElements requires that the data input be rank >= 1.");if(e[0].dims.length!==e[1].dims.length)throw new Error(`GatherElements requires that the data input and - indices input tensors be of same rank.`)},lf=(e,r)=>{let t=e[0].dims,s=e[0].dataType,i=t.length,n=e[1].dims,o=e[1].dataType,a=xe.normalizeAxis(r.axis,i),l=t[a],d=n.slice(0),p=xe.size(d),u=$e("input",s,i),h=$e("indicesInput",o,n.length),w=tt("output",s,d.length),f=[{type:12,data:p},{type:6,data:l},{type:12,data:a}];return f.push(...nt(t,n,d)),{name:"GatherElements",shaderCache:{inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:d,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:f}),getShaderSource:P=>` - ${P.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(u,h,w)} - ${P.mainStart()} - ${P.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - - let outputIndices = ${w.offsetToIndices("global_idx")}; - - var idx = ${h.getByOffset("global_idx")}; - if (idx < 0) { - idx = idx + uniforms.axisDimLimit; - } - var inputIndices = ${u.type.indices}(outputIndices); - ${u.indicesSet("inputIndices","uniforms.axis","u32(idx)")}; - let value = ${u.getByIndices("inputIndices")}; - - ${w.setByOffset("global_idx","value")}; - }`}},df=e=>Dt({axis:e.axis}),cf=(e,r)=>{let t=e.inputs;af(t),e.compute(lf(e.inputs,r))}}),uf,pf,hf,mf,Cv=Ue(()=>{pt(),Mt(),xt(),uf=e=>{if(!e)throw new Error("Input is missing");if(e.length<2||e.length>3)throw new Error("Invaid input number.");if(e.length===3&&e[2].dims.length>2)throw new Error("Invalid input shape of C");if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("Input types are mismatched")},pf=(e,r)=>{let t=e[0].dims.slice(),s=e[1].dims.slice(),[i,n,o]=Op.getShapeOfGemmResult(t,r.transA,s,r.transB,e.length===3?e[2].dims:void 0),a=[i,n];if(!a)throw new Error("Can't use gemm on the given tensors");let l=16,d=Math.ceil(n/l),p=Math.ceil(i/l),u=!0,h=xe.size(a),w=[{type:12,data:u?d:h},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:1,data:r.alpha},{type:1,data:r.beta}],f=["type","type"];e.length===3&&(w.push(...nt(e[2].dims)),f.push("rank")),w.push(...nt(a));let P=b=>{let y="";r.transA&&r.transB?y="value += a[k * uniforms.M + m] * b[n * uniforms.K + k];":r.transA&&!r.transB?y="value += a[k * uniforms.M + m] * b[k * uniforms.N + n];":!r.transA&&r.transB?y="value += a[m * uniforms.K + k] * b[n * uniforms.K + k];":!r.transA&&!r.transB&&(y="value += a[m * uniforms.K + k] * b[k * uniforms.N + n];");let $=r.alpha===1?"":"value *= uniforms.alpha;",T=$e("a",e[0].dataType,e[0].dims),g=$e("b",e[1].dataType,e[1].dims),M=T.type.value,E=null,k=[T,g];e.length===3&&(E=$e("c",e[2].dataType,e[2].dims.length),k.push(E));let B=tt("output",e[0].dataType,a.length);k.push(B);let N=[{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` - ${b.registerUniforms(N).declareVariables(...k)} - - ${b.mainStart()} - ${b.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let m = global_idx / uniforms.N; - let n = global_idx % uniforms.N; - - var value = ${M}(0); - for (var k: u32 = 0u; k < uniforms.K; k++) { - ${y} - } - - ${$} - ${E!=null?`let cOffset = ${E.broadcastedIndicesToOffset("vec2(m, n)",B)}; value += ${M}(uniforms.beta) * ${E.getByOffset("cOffset")};`:""} - output[global_idx] = value; - }`},A=b=>{let y=$e("a",e[0].dataType,e[0].dims),$=$e("b",e[1].dataType,e[1].dims),T=null,g=[y,$];e.length===3&&(T=$e("c",e[2].dataType,e[2].dims.length),g.push(T));let M=tt("output",e[0].dataType,a.length);g.push(M);let E=[{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"}],k="",B="";r.transA&&r.transB?(B=` - var col = tile_row_start + local_id.x; - var row = k_start + local_id.y; - if (col < uniforms.M && row < uniforms.K) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; - } else { - tile_a[local_id.y][local_id.x] = ${y.type.value}(0); - } - - col = k_start + local_id.x; - row = tile_col_start + local_id.y; - if (col < uniforms.K && row < uniforms.N) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; - } else { - tile_b[local_id.y][local_id.x] = ${$.type.value}(0); - } - `,k="value += tile_a[k][local_id.y] * tile_b[local_id.x][k];"):r.transA&&!r.transB?(B=` - var col = tile_row_start + local_id.x; - var row = k_start + local_id.y; - if (col < uniforms.M && row < uniforms.K) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; - } else { - tile_a[local_id.y][local_id.x] = ${y.type.value}(0); - } - - col = tile_col_start + local_id.x; - row = k_start + local_id.y; - if (col < uniforms.N && row < uniforms.K) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; - } else { - tile_b[local_id.y][local_id.x] = ${$.type.value}(0); - } - `,k="value += tile_a[k][local_id.y] * tile_b[k][local_id.x];"):!r.transA&&r.transB?(B=` - var col = k_start + local_id.x; - var row = tile_row_start + local_id.y; - if (col < uniforms.K && row < uniforms.M) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; - } else { - tile_a[local_id.y][local_id.x] = ${y.type.value}(0); - } - - col = k_start + local_id.x; - row = tile_col_start + local_id.y; - if (col < uniforms.K && row < uniforms.N) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; - } else { - tile_b[local_id.y][local_id.x] = ${$.type.value}(0); - } - `,k="value += tile_a[local_id.y][k] * tile_b[local_id.x][k];"):!r.transA&&!r.transB&&(B=` - var col = k_start + local_id.x; - var row = tile_row_start + local_id.y; - if (col < uniforms.K && row < uniforms.M) { - tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; - } else { - tile_a[local_id.y][local_id.x] = ${y.type.value}(0); - } - - col = tile_col_start + local_id.x; - row = k_start + local_id.y; - if (col < uniforms.N && row < uniforms.K) { - tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; - } else { - tile_b[local_id.y][local_id.x] = ${$.type.value}(0); - } - `,k="value += tile_a[local_id.y][k] * tile_b[k][local_id.x];");let N=r.alpha===1?"":"value *= uniforms.alpha;";return` - ${b.registerUniforms(E).declareVariables(...g)} - var tile_a: array, ${l}>; - var tile_b: array, ${l}>; - ${b.mainStart([l,l,1])} - let tile_col_start = (workgroup_index % uniforms.num_tile_n) * ${l}; - let tile_row_start = (workgroup_index / uniforms.num_tile_n) * ${l}; - let num_tiles = (uniforms.K - 1) / ${l} + 1; - var k_start = 0u; - var value = ${M.type.value}(0); - for (var t: u32 = 0u; t < num_tiles; t++) { - ${B} - k_start = k_start + ${l}; - workgroupBarrier(); - - for (var k: u32 = 0u; k < ${l}; k++) { - ${k} - } - workgroupBarrier(); - } - - ${N} - let m = tile_row_start + local_id.y; - let n = tile_col_start + local_id.x; - ${T!=null?`let cOffset = ${T.broadcastedIndicesToOffset("vec2(m, n)",M)}; value += ${M.type.value}(uniforms.beta) * ${T.getByOffset("cOffset")};`:""} - if (m < uniforms.M && n < uniforms.N) { - output[m * uniforms.N + n] = value; - } - }`};return u?{name:"GemmShared",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:d*p},programUniforms:w}),getShaderSource:A}:{name:"Gemm",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:w}),getShaderSource:P}},hf=e=>{let r=e.transA,t=e.transB,s=e.alpha,i=e.beta;return{transA:r,transB:t,alpha:s,beta:i,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},mf=(e,r)=>{uf(e.inputs),e.compute(pf(e.inputs,r))}}),vs,Is,Mn,bn,_f,ff,gf,wf,yf,Mf,bf,vf,xf,Tf,Sv=Ue(()=>{pt(),Mt(),Yt(),xt(),[vs,Is,Mn,bn]=[0,1,2,3],_f=e=>{if(e[0].dims.length!==4)throw new Error("only 4-D tensor is supported.");if(e[0].dims.length!==e[1].dims.length)throw new Error("input dimensions must be equal to grid dimensions");if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw new Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw new Error("grid batch size must match input batch size")},ff=` - fn gs_get_cubic_coeffs(x: f32) -> vec4 { - let cubic_alpha = -0.75f; - let x_abs = abs(x); - var coeffs: vec4; - coeffs[0] = (((cubic_alpha * (x_abs + 1) - 5 * cubic_alpha) * (x_abs + 1) + 8 * cubic_alpha) * (x_abs + 1) - 4 * cubic_alpha); - coeffs[1] = (((cubic_alpha + 2) * x_abs - (cubic_alpha + 3)) * x_abs * x_abs + 1); - coeffs[2] = (((cubic_alpha + 2) * (1 - x_abs) - (cubic_alpha + 3)) * (1 - x_abs) * (1 - x_abs) + 1); - coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); - return coeffs; - } -`,gf=e=>` - fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { - var v: vec4; - var coeffs = gs_get_cubic_coeffs(x); - for (var i = 0; i < 4; i++) { - v[i] = coeffs[0] * p[i][0] + coeffs[1] * p[i][1] + coeffs[2] * p[i][2] + coeffs[3] * p[i][3]; - } - coeffs = gs_get_cubic_coeffs(y); - let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); - return pixel; - } -`,wf=e=>` - fn gs_denormalize(n: f32, length: i32) -> f32 { - ${e.alignCorners===0?` - // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] - return ((n + 1.0) * f32(length) - 1.0) / 2.0; - `:` - // alignCorners: true => [-1, 1] to [0, length - 1] - return (n + 1.0) / 2.0 * (f32(length - 1)); - `} - } -`,yf=e=>` - ${e.paddingMode==="reflection"?` - fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { - var dx = 0.0; - var fx = f32(x); - let range = x_max - x_min; - if (fx < x_min) { - dx = x_min - fx; - let n = u32(dx / range); - let r = dx - f32(n) * range; - if (n % 2 == 0) { - fx = x_min + r; - } else { - fx = x_max - r; - } - } else if (fx > x_max) { - dx = fx - x_max; - let n = u32(dx / range); - let r = dx - f32(n) * range; - if (n % 2 == 0) { - fx = x_max - r; - } else { - fx = x_min + r; - } - } - return u32(fx); - }`:""} -`,Mf=(e,r,t)=>` - fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${r} { - var pixel = ${r}(0); - var indices = vec4(0); - indices[${vs}] = batch; - indices[${Is}] = channel;`+(()=>{switch(t.paddingMode){case"zeros":return` - if (r >= 0 && r < H && c >=0 && c < W) { - indices[${Mn}] = u32(r); - indices[${bn}] = u32(c); - } - `;case"border":return` - indices[${Mn}] = u32(clamp(r, 0, H - 1)); - indices[${bn}] = u32(clamp(c, 0, W - 1)); - `;case"reflection":return` - indices[${Mn}] = gs_reflect(r, border[1], border[3]); - indices[${bn}] = gs_reflect(c, border[0], border[2]); - `;default:throw new Error(`padding mode ${t.paddingMode} is not supported`)}})()+` - return ${e.getByIndices("indices")}; - } -`,bf=(e,r,t)=>(()=>{switch(t.mode){case"nearest":return` - let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${vs}], indices[${Is}], 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[${vs}], indices[${Is}], border); - let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${vs}], indices[${Is}], border); - let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${vs}], indices[${Is}], border); - let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${vs}], indices[${Is}], border); - - let dx2 = ${r}(f32(x2) - x); - let dx1 = ${r}(x - f32(x1)); - let dy2 = ${r}(f32(y2) - y); - let dy1 = ${r}(y - f32(y1)); - let result = dy2 * (dx2 * p11 + dx1 * p12) + dy1 * (dx2 * p21 + dx1 * p22); - `;case"bicubic":return` - let x0 = i32(floor(x)) - 1; - let y0 = i32(floor(y)) - 1; - var p: mat4x4<${r}>; - 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[${vs}], indices[${Is}], border); - } - } - - let dx = x - f32(x0 + 1); - let dy = y - f32(y0 + 1); - let result = gs_bicubic_interpolate(p, dx, dy); - `;default:throw new Error(`mode ${t.mode} is not supported`)}})()+`${e.setByOffset("global_idx","result")}`,vf=(e,r)=>{let t=$e("x",e[0].dataType,e[0].dims.length),s=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=$e("grid",e[1].dataType,s.length,2),n=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];r.format==="NHWC"&&(n=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[vs,Is,Mn,bn]=[0,3,1,2]);let o=tt("output",e[0].dataType,n.length),a=t.type.value,l=xe.size(n),d=[{type:12,data:l},...nt(e[0].dims,s,n)],p=u=>` - ${u.registerUniform("output_size","u32").declareVariables(t,i,o)} - ${ff} - ${gf(a)} - ${wf(r)} - ${yf(r)} - ${Mf(t,a,r)} - - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let H_in = i32(uniforms.x_shape[${Mn}]); - let W_in = i32(uniforms.x_shape[${bn}]); - - ${r.alignCorners===0?` - let x_min = -0.5; - let x_max = f32(W_in) - 0.5; - let y_min = -0.5; - let y_max = f32(H_in) - 0.5; - `:` - let x_min = 0.0; - let x_max = f32(W_in) - 1.0; - let y_min = 0.0; - let y_max = f32(H_in) - 1.0; - `}; - let border = vec4(x_min, y_min, x_max, y_max); - - let indices = ${o.offsetToIndices("global_idx")}; - var grid_indices = vec3(indices[${vs}], indices[${Mn}], indices[${bn}]); - let nxy = ${i.getByIndices("grid_indices")}; - var x = gs_denormalize(f32(nxy[0]), W_in); - var y = gs_denormalize(f32(nxy[1]), H_in); - - ${bf(o,a,r)} - }`;return{name:"GridSample",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:["type","type"]},getRunData:u=>{let h=xe.size(n);return{outputs:[{dims:n,dataType:u[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:d}},getShaderSource:p}},xf=(e,r)=>{_f(e.inputs),e.compute(vf(e.inputs,r))},Tf=e=>Dt({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),kr,Ef,Pf,wc,Cf,Bi,Sf,$f=Ue(()=>{pt(),Mt(),Yt(),Bd(),Qd(),xt(),Gs(),kr=(e,r)=>e.length>r&&e[r].dims.length>0?e[r]:void 0,Ef=(e,r)=>{let t=e[0],s=kr(e,1),i=kr(e,2),n=kr(e,3),o=kr(e,4),a=kr(e,5),l=kr(e,6),d=kr(e,7);if(t.dims.length!==3&&t.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let p=t.dims[0],u=t.dims[1],h=t.dims.length===3?t.dims[2]:r.numHeads*t.dims[4],w=u,f=0,P=0,A=Math.floor(h/r.numHeads);if(l&&d&&xe.size(l.dims)&&xe.size(d.dims)){if(l.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(l.dims[0]!==p||l.dims[1]!==r.numHeads||l.dims[3]!==A)throw new Error('Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)');if(d.dims[0]!==p||d.dims[1]!==r.numHeads||d.dims[3]!==A)throw new Error('Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)');if(l.dims[2]!==d.dims[2])throw new Error('Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)');if(d.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');f=l.dims[2],P=l.dims[2]}else if(l&&xe.size(l.dims)||d&&xe.size(d.dims))throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let b;if(s&&xe.size(s.dims)>0){if(t.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(s.dims.length<3||s.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(s.dims.length===3){if(s.dims[2]!==t.dims[2])throw new Error('Input "query" and "key" shall have same dim 2 (hidden_size)');b=2,w=s.dims[1]}else if(s.dims.length===5){if(s.dims[2]!==r.numHeads||s.dims[3]!==2||s.dims[4]!==A)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(i)throw new Error('Expect "value" be none when "key" has packed kv format.');b=5,w=s.dims[1]}else{if(s.dims[1]!==r.numHeads||s.dims[3]!==A)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');b=0,w=s.dims[2]}}else{if(t.dims.length!==5)throw new Error('Input "query" is expected to have 5 dimensions when key is empty');if(t.dims[2]!==r.numHeads||t.dims[3]!==3)throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');b=3}if(n&&xe.size(n.dims)>0){if(n.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimension');if(s&&s.dims.length===5&&s.dims[3]===2)throw new Error("bias is not allowed for packed kv.")}let y=f+w,$=0;if(o&&xe.size(o.dims)>0){$=8;let E=o.dims;throw E.length===1?E[0]===p?$=1:E[0]===3*p+2&&($=3):E.length===2&&E[0]===p&&E[1]===y&&($=5),$===8?new Error('Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)'):new Error("Mask not supported")}let T=!1,g=h;if(i&&xe.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(t.dims[0]!==i.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(i.dims.length===3){if(w!==i.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');g=i.dims[2]}else{if(w!==i.dims[2])throw new Error('Input "key" and "value" shall have the same dim 2 (kv_sequence_length)');g=i.dims[1]*i.dims[3],T=!0}}let M=!1;if(o&&xe.size(o.dims)>0)throw new Error("Key padding mask is not supported");if(a&&xe.size(a.dims)>0){if(a.dims.length!==4)throw new Error('Input "attention_bias" is expected to have 4 dimensions');if(a.dims[0]!==p||a.dims[1]!==r.numHeads||a.dims[2]!==u||a.dims[3]!==y)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:p,sequenceLength:u,pastSequenceLength:f,kvSequenceLength:w,totalSequenceLength:y,maxSequenceLength:P,inputHiddenSize:0,hiddenSize:h,vHiddenSize:g,headSize:A,vHeadSize:Math.floor(g/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:$,scale:r.scale,broadcastResPosBias:M,passPastInKv:T,qkvFormat:b}},Pf=e=>Dt({...e}),wc=Dt({perm:[0,2,1,3]}),Cf=(e,r,t,s,i,n,o)=>{let a=[s,i,n],l=xe.size(a),d=[{type:12,data:l},{type:12,data:o},{type:12,data:n}],p=u=>{let h=tt("qkv_with_bias",r.dataType,a),w=$e("qkv",r.dataType,a),f=$e("bias",t.dataType,a),P=[{name:"output_size",type:"u32"},{name:"bias_offset",type:"u32"},{name:"hidden_size",type:"u32"}];return` - ${u.registerUniforms(P).declareVariables(w,f,h)} - ${u.mainStart()} - ${u.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:a,dataType:r.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:d}),getShaderSource:p},{inputs:[r,t],outputs:[-1]})[0]},Bi=(e,r,t,s,i,n,o,a)=>{let l=n;if(o&&xe.size(o.dims)>0){if(s===1)throw new Error("AddBiasReshape is not implemented. Please export your model with packed QKV or KV");return l=Cf(e,n,o,r,s,t*i,a),l=l.reshape([r,s,t,i]),t===1||s===1?l:e.compute(Nr(l,wc.perm),{inputs:[l],outputs:[-1]})[0]}else return n.dims.length===3&&(l=n.reshape([r,s,t,i])),t===1||s===1?l:e.compute(Nr(l,wc.perm),{inputs:[l],outputs:[-1]})[0]},Sf=(e,r)=>{let t=Ef(e.inputs,r),s=e.inputs[0],i=kr(e.inputs,1),n=kr(e.inputs,2),o=kr(e.inputs,3),a=kr(e.inputs,4),l=kr(e.inputs,5),d=kr(e.inputs,6),p=kr(e.inputs,7);if(s.dims.length===5)throw new Error("Packed QKV is not implemented");if((i==null?void 0:i.dims.length)===5)throw new Error("Packed KV is not implemented");let u=i&&n&&i.dims.length===4&&n.dims.length===4,h=Bi(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,s,o,0);if(u)return Fi(e,h,i,n,a,void 0,d,p,l,t);if(!i||!n)throw new Error("key and value must be provided");let w=Bi(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.headSize,i,o,t.hiddenSize),f=Bi(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.vHeadSize,n,o,2*t.hiddenSize);Fi(e,h,w,f,a,void 0,d,p,l,t)}}),kf,If,Af,Ff,yc,Of,Df,Lf=Ue(()=>{pt(),Mt(),Yt(),xt(),kf=e=>{if(!e||e.length<1)throw new Error("too few inputs")},If=(e,r)=>{let t=[],s=r.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(i=>t.push(Number(i))),s=t.length),Dt({numOutputs:s,axis:r.axis,splitSizes:t})},Af=e=>` -fn calculateOutputIndex(index: u32) -> u32 { - for (var i: u32 = 0u; i < ${e}u; i += 1u ) { - if (index < ${rt("uniforms.size_in_split_axis","i",e)}) { - return i; - } - } - return ${e}u; -}`,Ff=e=>{let r=e.length,t=[];for(let s=0;s{let t=e[0].dims,s=xe.size(t),i=e[0].dataType,n=xe.normalizeAxis(r.axis,t.length),o=new Array(r.numOutputs),a=$e("input",i,t.length),l=new Array(r.numOutputs),d=[],p=[],u=0,h=[{type:12,data:s}];for(let f=0;f` - ${f.registerUniform("input_size","u32").registerUniform("size_in_split_axis","u32",l.length).declareVariables(a,...o)} - ${Af(l.length)} - ${Ff(o)} - - ${f.mainStart()} - ${f.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.input_size")} - - var indices = ${a.offsetToIndices("global_idx")}; - var index = ${a.indicesGet("indices",n)}; - let output_number = calculateOutputIndex(index); - if (output_number != 0) { - index -= ${rt("uniforms.size_in_split_axis","output_number - 1u",l.length)}; - ${a.indicesSet("indices",n,"index")}; - } - writeBufferData(output_number, indices, global_idx); - }`;return{name:"Split",shaderCache:{hint:r.cacheKey,inputDependencies:["rank"]},getShaderSource:w,getRunData:()=>({outputs:d,dispatchGroup:{x:Math.ceil(s/64)},programUniforms:h})}},Of=(e,r)=>{kf(e.inputs);let t=e.inputs.length===1?r:If(e.inputs,r);e.compute(yc(e.inputs,t),{inputs:[0]})},Df=e=>{let r=e.axis,t=e.splitSizes,s=e.numOutputs<0?t.length:e.numOutputs;if(s!==t.length)throw new Error("numOutputs and splitSizes lengh must be equal");return Dt({axis:r,numOutputs:s,splitSizes:t})}}),zf,Bf,Mc,Rf,$v=Ue(()=>{Yt(),Qd(),$f(),Lf(),Gs(),zf=(e,r)=>{if(r.doRotary)throw new Error("GroupQuerryAttention do_rotary attribute is not supported");if(r.doRotary&&e.length<=7)throw new Error("cos_cache and sin_cache inputs are required if do_rotary is specified");let t=e[0],s=e[1],i=e[2],n=e[3],o=e[4];if(r.localWindowSize!==-1)throw new Error("Local attention is not supported");if(r.softcap!==0)throw new Error("Softcap is not supported");if(r.rotaryInterleaved!==0)throw new Error("Rotary interleaved is not supported");if(r.smoothSoftmax)throw new Error("Smooth softmax is not supported");if(t.dims.length!==3&&t.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let a=!1,l=t.dims[0],d=t.dims[1],p=t.dims.length===3?a?t.dims[2]/3:t.dims[2]:r.numHeads*t.dims[4],u=d,h=0,w=!s||s.dims.length===0,f=Math.floor(w?p/(r.numHeads+2*r.kvNumHeads):p/r.numHeads);w&&(p=f*r.numHeads);let P=n&&n.dims.length!==0,A=o&&o.dims.length!==0;if(P&&n.dims.length===4&&n.dims[0]===l&&n.dims[1]!==r.kvNumHeads&&n.dims[2]===r.kvNumHeads&&n.dims[3]===f)throw new Error("BSNH pastKey/pastValue is not supported");if(P&&A){if(n.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(o.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');h=n.dims[2]}else if(P||A)throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let b=1;if(s&&s.dims.length>0){if(t.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(s.dims.length<3||s.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(s.dims.length===3){if(t.dims[2]%s.dims[2]!==0)throw new Error('Dimension 2 of "query" should be a multiple of "key"');u=s.dims[1]}else if(s.dims.length===5){if(s.dims[2]!==r.numHeads||s.dims[3]!==2||s.dims[4]!==f)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(i)throw new Error('Expect "value" be none when "key" has packed kv format.');u=s.dims[1]}else{if(s.dims[1]!==r.numHeads||s.dims[3]!==f)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');u=s.dims[2]}}else{if(t.dims.length!==3&&t.dims.length!==5)throw new Error('Input "query" is expected to have 3 or 5 dimensions when key is empty');if(t.dims.length===5&&(t.dims[2]!==r.numHeads||t.dims[3]!==3))throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');b=3}let y=0,$=!1,T=r.kvNumHeads?f*r.kvNumHeads:p;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(t.dims[0]!==i.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(i.dims.length===3){if(u!==i.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');T=i.dims[2]}else{if(u!==i.dims[2])throw new Error('Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)');T=i.dims[1]*i.dims[3],$=!0}}let g=e.length>4?e[5]:void 0;if(g&&g.dims.length!==1&&g.dims[0]!==l)throw new Error('Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size');return{batchSize:l,sequenceLength:d,pastSequenceLength:h,kvSequenceLength:u,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:p,vHiddenSize:T,headSize:f,vHeadSize:Math.floor(T/r.kvNumHeads),numHeads:r.numHeads,kvNumHeads:r.kvNumHeads,nReps:r.numHeads/r.kvNumHeads,pastPresentShareBuffer:!1,maskType:y,scale:r.scale,broadcastResPosBias:!1,passPastInKv:$,qkvFormat:b}},Bf=Dt({perm:[0,2,1,3]}),Mc=(e,r,t)=>{let s=r,i=t.kvNumHeads;return r.dims.length===3&&t.kvSequenceLength!==0&&(s=r.reshape([t.batchSize,t.kvSequenceLength,i,t.headSize]),s=e.compute(Nr(s,Bf.perm),{inputs:[s],outputs:[-1]})[0]),s},Rf=(e,r)=>{var A;let t=zf(e.inputs,r);if(e.inputs[0].dims.length===5)throw new Error("Packed QKV is not implemented");if(((A=e.inputs[1])==null?void 0:A.dims.length)===5)throw new Error("Packed KV is not implemented");let s=e.inputs[0],i=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,n=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,a=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,l=e.inputs.length>4?e.inputs[5]:void 0,d=e.inputs.length>5?e.inputs[6]:void 0,p=t.kvNumHeads?t.kvNumHeads:t.numHeads,u=Dt({axis:2,numOutputs:3,splitSizes:[t.numHeads*t.headSize,p*t.headSize,p*t.headSize]}),[h,w,f]=!i&&!n?e.compute(yc([s],u),{inputs:[s],outputs:[-1,-1,-1]}):[s,i,n],P=Bi(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,h,void 0,0);Fi(e,P,Mc(e,w,t),Mc(e,f,t),void 0,void 0,o,a,void 0,t,l,d)}}),bc,Nf,jf,Uf,kv=Ue(()=>{pt(),Mt(),Gs(),xt(),bc=(e,r,t,s,i,n,o,a)=>{let l=Xt(n),d=l===1?"f32":`vec${l}f`,p=l===1?"vec2f":`mat2x${l}f`,u=i*o,h=64;u===1&&(h=256);let w=[i,o,n/l],f=[i,o,2],P=["rank","type","type"],A=[];A.push(...nt(w,f));let b=y=>{let $=$e("x",r.dataType,3,l),T=$e("scale",t.dataType,t.dims),g=$e("bias",s.dataType,s.dims),M=tt("output",1,3,2),E=[$,T,g,M];return` - var workgroup_shared : array<${p}, ${h}>; - const workgroup_size = ${h}u; - ${y.declareVariables(...E)} - ${y.mainStart(h)} - let batch = workgroup_index / uniforms.x_shape[1]; - let channel = workgroup_index % uniforms.x_shape[1]; - let hight = uniforms.x_shape[2]; - // initialize workgroup memory - var sum = ${d}(0); - var squared_sum = ${d}(0); - for (var h = local_idx; h < hight; h += workgroup_size) { - let value = ${d}(${$.get("batch","channel","h")}); - sum += value; - squared_sum += value * value; - } - workgroup_shared[local_idx] = ${p}(sum, squared_sum); - workgroupBarrier(); - - for (var currSize = workgroup_size >> 1; currSize > 0; currSize = currSize >> 1) { - if (local_idx < currSize) { - workgroup_shared[local_idx] = workgroup_shared[local_idx] + workgroup_shared[local_idx + currSize]; - } - workgroupBarrier(); - } - if (local_idx == 0) { - let sum_final = ${Ws("workgroup_shared[0][0]",l)} / f32(hight * ${l}); - let squared_sum_final = ${Ws("workgroup_shared[0][1]",l)} / f32(hight * ${l}); - - let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${a})); - 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:`${l};${a};${h}`,inputDependencies:P},getRunData:()=>({outputs:[{dims:f,dataType:1}],dispatchGroup:{x:u},programUniforms:A}),getShaderSource:b},{inputs:[r,t,s],outputs:[-1]})[0]},Nf=(e,r,t)=>{let s=r[0].dims,i=s,n=2,o=s[0],a=s[1],l=xe.sizeFromDimension(s,n),d=Xt(l),p=xe.size(i)/d,u=bc(e,r[0],r[1],r[2],o,l,a,t.epsilon),h=[o,a,l/d],w=[o,a],f=["type","none"],P=A=>{let b=$e("x",r[0].dataType,h.length,d),y=$e("scale_shift",1,w.length,2),$=tt("output",r[0].dataType,h.length,d),T=[b,y,$];return` - ${A.registerUniform("output_size","u32").declareVariables(...T)} - ${A.mainStart()} - ${A.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let outputIndices = ${$.offsetToIndices("global_idx")}; - let batch = outputIndices[0]; - let channel = outputIndices[1]; - let scale_shift = ${y.getByIndices("vec2(batch, channel)")}; - let value = ${b.getByOffset("global_idx")} * ${$.type.value}(scale_shift.x) + ${$.type.value}(scale_shift.y); - ${$.setByOffset("global_idx","value")}; - }`};e.compute({name:"InstanceNormalization",shaderCache:{hint:`${d}`,inputDependencies:f},getRunData:()=>({outputs:[{dims:i,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:[{type:12,data:p},...nt(h,w,h)]}),getShaderSource:P},{inputs:[r[0],u]})},jf=(e,r,t)=>{let s=r[0].dims,i=s,n=s[0],o=s[s.length-1],a=xe.sizeFromDimension(s,1)/o,l=Xt(o),d=xe.size(i)/l,p=[{type:12,data:a},{type:12,data:Math.floor(o/l)}],u=["type","type"],h=!1,w=[0,s.length-1];for(let b=0;bs[w[y]])),P=bc(e,f,r[1],r[2],n,a,o,t.epsilon),A=b=>{let y=lr(r[0].dataType),$=l===1?"vec2f":`mat${l}x2f`,T=E=>{let k=E===0?"x":"y",B=l===1?"f32":`vec${l}f`;switch(l){case 1:return`${y}(${B}(scale.${k}))`;case 2:return`vec2<${y}>(${B}(scale[0].${k}, scale[1].${k}))`;case 4:return`vec4<${y}>(${B}(scale[0].${k}, scale[1].${k}, scale[2].${k}, scale[3].${k}))`;default:throw new Error(`Not supported compoents ${l}`)}},g=$e("input",r[0].dataType,r[0].dims,l),M=tt("output",r[0].dataType,i,l);return` - @group(0) @binding(0) var input : array<${g.type.storage}>; - @group(0) @binding(1) var scale_input : array<${$}>; - @group(0) @binding(2) var output : array<${M.type.storage}>; - struct Uniforms {H: u32, C : u32}; - @group(0) @binding(3) var uniforms: Uniforms; - - ${b.mainStart()} - let current_image_number = global_idx / (uniforms.C * uniforms.H); - let current_channel_number = global_idx % uniforms.C; - - let scale_offset = current_image_number * uniforms.C + current_channel_number; - let scale = scale_input[scale_offset]; - output[global_idx] = fma(input[global_idx], ${T(0)}, ${T(1)}); - }`};e.compute({name:"InstanceNormalizationNHWC",shaderCache:{hint:`${l}`,inputDependencies:u},getRunData:()=>({outputs:[{dims:i,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(d/64)},programUniforms:p}),getShaderSource:A},{inputs:[r[0],P]})},Uf=(e,r)=>{r.format==="NHWC"?jf(e,e.inputs,r):Nf(e,e.inputs,r)}}),Vf,Wf,Gf,Iv=Ue(()=>{pt(),Mt(),xt(),Vf=e=>{if(!e||e.length<2)throw new Error("layerNorm requires at least 2 inputs.")},Wf=(e,r,t)=>{let s=r.simplified,i=e[0].dims,n=e[1],o=!s&&e[2],a=i,l=xe.normalizeAxis(r.axis,i.length),d=xe.sizeToDimension(i,l),p=xe.sizeFromDimension(i,l),u=xe.size(n.dims),h=o?xe.size(o.dims):0;if(u!==p||o&&h!==p)throw new Error(`Size of X.shape()[axis:] == ${p}. - Size of scale and bias (if provided) must match this. - Got scale size of ${u} and bias size of ${h}`);let w=[];for(let g=0;g1,y=t>2,$=g=>{let M=lr(e[0].dataType),E=[$e("x",e[0].dataType,e[0].dims,f),$e("scale",n.dataType,n.dims,f)];o&&E.push($e("bias",o.dataType,o.dims,f)),E.push(tt("output",e[0].dataType,a,f)),b&&E.push(tt("mean_data_output",1,w)),y&&E.push(tt("inv_std_output",1,w));let k=[{name:"norm_count",type:"u32"},{name:"norm_size",type:"f32"},{name:"norm_size_vectorized",type:"u32"},{name:"epsilon",type:"f32"}];return` - ${g.registerUniforms(k).declareVariables(...E)} - ${g.mainStart()} - ${g.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.norm_count")} - let offset = global_idx * uniforms.norm_size_vectorized; - var mean_vector = ${Ud("f32",f)}; - var mean_square_vector = ${Ud("f32",f)}; - - for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { - let value = ${Un(M,f,"x[h + offset]")}; - mean_vector += value; - mean_square_vector += value * value; - } - let mean = ${Ws("mean_vector",f)} / uniforms.norm_size; - let inv_std_dev = inverseSqrt(${Ws("mean_square_vector",f)} / uniforms.norm_size ${s?"":"- mean * mean"} + uniforms.epsilon); - - for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { - let f32input = ${Un(M,f,"x[j + offset]")}; - let f32scale = ${Un(M,f,"scale[j]")}; - output[j + offset] = ${E[0].type.value}((f32input ${s?"":"- mean"}) * inv_std_dev * f32scale - ${o?`+ ${Un(M,f,"bias[j]")}`:""} - ); - } - - ${b?"mean_data_output[global_idx] = mean":""}; - ${y?"inv_std_output[global_idx] = inv_std_dev":""}; - }`},T=[{dims:a,dataType:e[0].dataType}];return b&&T.push({dims:w,dataType:1}),y&&T.push({dims:w,dataType:1}),{name:"LayerNormalization",shaderCache:{hint:`${f};${t};${s}`,inputDependencies:P},getRunData:()=>({outputs:T,dispatchGroup:{x:Math.ceil(d/64)},programUniforms:A}),getShaderSource:$}},Gf=(e,r)=>{Vf(e.inputs),e.compute(Wf(e.inputs,r,e.outputCount))}}),Kf,Hf,Av=Ue(()=>{Mt(),sc(),ac(),Kf=e=>{if(!e||e.length!==2)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.")},Hf=e=>{Kf(e.inputs);let r=Nn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!r)throw new Error("Can't use matmul on the given tensors");let t=r[r.length-1],s=e.inputs[0].dims[e.inputs[0].dims.length-1];if(t<8&&s<8)e.compute(rc(e.inputs,{activation:""},r));else{let i=r[r.length-2],n=xe.size(e.inputs[0].dims.slice(0,-2)),o=xe.size(e.inputs[1].dims.slice(0,-2));if(n!==1&&i===1&&o===1){let a=e.inputs[0].reshape([1,n,s]),l=e.inputs[1].reshape([1,s,t]),d=[1,n,t],p=[a,l];e.compute(Ca(p,{activation:""},r,d),{inputs:p})}else e.compute(Ca(e.inputs,{activation:""},r))}}}),qf,Qf,Xf,Jf,Yf,Fv=Ue(()=>{pt(),Mt(),Yt(),xt(),qf=(e,r)=>{if(e.length<3||e.length>4)throw new Error("MatMulNBits requires 3 or 4 inputs");let t=e[0],s=t.dims.length;if(t.dims[s-1]!==r.k)throw new Error("The last dim of input shape does not match the k value");let i=Math.floor((r.k+r.blockSize-1)/r.blockSize),n=r.blockSize/8*r.bits,o=e[1];if(!xe.areEqual(o.dims,[r.n,i,n]))throw new Error("The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize");let a=e[2].dims;if(xe.size(a)!==r.n*i)throw new Error("scales input size error.");if(e.length===4){let l=e[3].dims,d=r.bits>4?r.n*i:r.n*Math.floor((i+1)/2);if(xe.size(l)!==d)throw new Error("zeroPoints input size error.")}},Qf=(e,r)=>{let t=e[0].dims,s=t.length,i=t[s-2],n=r.k,o=r.n,a=t.slice(0,s-2),l=xe.size(a),d=e[1].dims[2]/4,p=e[0].dataType,u=Xt(r.k),h=Xt(d),w=Xt(o),f=a.concat([i,o]),P=i>1&&o/w%2===0?2:1,A=xe.size(f)/w/P,b=64,y=[],$=[l,i,n/u],T=xe.convertShape(e[1].dims).slice();T.splice(-1,1,d/h),y.push(...nt($)),y.push(...nt(T)),y.push(...nt(e[2].dims)),e.length===4&&y.push(...nt(xe.convertShape(e[3].dims)));let g=[l,i,o/w];y.push(...nt(g));let M=E=>{let k=$.length,B=$e("a",e[0].dataType,k,u),N=$e("b",12,T.length,h),J=$e("scales",e[2].dataType,e[2].dims.length),q=[B,N,J],V=e.length===4?$e("zero_points",12,e[3].dims.length):void 0;V&&q.push(V);let Y=g.length,H=tt("output",e[0].dataType,Y,w),Q=lr(e[0].dataType),ie=(()=>{switch(u){case 1:return`array<${Q}, 8>`;case 2:return`mat4x2<${Q}>`;case 4:return`mat2x4<${Q}>`;default:throw new Error(`${u}-component is not supported.`)}})(),le=()=>{let R=` - // reuse a data - var input_offset = ${B.indicesToOffset(`${B.type.indices}(batch, row, word_offset)`)}; - var a_data: ${ie}; - for (var j: u32 = 0; j < ${8/u}; j++) { - a_data[j] = ${B.getByOffset("input_offset")}; - input_offset++; - } - `;for(let O=0;O> 4) & b_mask); - b_quantized_values = ${ie}(${Array.from({length:4},(G,ne)=>`${Q}(b_value_lower[${ne}]), ${Q}(b_value_upper[${ne}])`).join(", ")}); - b_dequantized_values = ${u===1?`${ie}(${Array.from({length:8},(G,ne)=>`(b_quantized_values[${ne}] - ${V?`zero_point${O}`:"zero_point"}) * scale${O}`).join(", ")});`:`(b_quantized_values - ${ie}(${Array(8).fill(`${V?`zero_point${O}`:"zero_point"}`).join(",")})) * scale${O};`}; - workgroup_shared[local_id.x * ${P} + ${Math.floor(O/w)}]${w>1?`[${O%w}]`:""} += ${Array.from({length:8/u},(G,ne)=>`${u===1?`a_data[${ne}] * b_dequantized_values[${ne}]`:`dot(a_data[${ne}], b_dequantized_values[${ne}])`}`).join(" + ")}; - `;return R},ae=()=>{let R=` - var col_index = col * ${w}; - ${V?` - let zero_point_bytes_per_col = (nBlocksPerCol + 1) / 2; - var zero_point_byte_count: u32; - var zero_point_word_index: u32; - var zero_point_byte_offset: u32; - let zero_point_nibble_offset: u32 = block & 0x1u; - var zero_point_bits_offset: u32; - var zero_point_word: u32;`:` - // The default zero point is 8 for unsigned 4-bit quantization. - let zero_point = ${Q}(8);`} - `;for(let O=0;O> 0x1u); - zero_point_word_index = zero_point_byte_count >> 0x2u; - zero_point_byte_offset = zero_point_byte_count & 0x3u; - zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); - zero_point_word = ${V.getByOffset("zero_point_word_index")} >> zero_point_bits_offset; - let zero_point${O} = ${Q}((zero_point_word) & 0xFu);`:""} - col_index += 1;`;return R},we=()=>{let R=`col_index = col * ${w};`;for(let O=0;O; - var b_value_upper: vec4; - var b_quantized_values: ${ie}; - var b_dequantized_values: ${ie};`,R};return` - var workgroup_shared: array<${H.type.value}, ${P*b}>; - ${E.declareVariables(...q,H)} - ${E.mainStart([b,1,1])} - let output_indices = ${H.offsetToIndices(`(global_idx / ${b}) * ${P}`)}; - let col = output_indices[2]; - let row = output_indices[1]; - let batch = output_indices[0]; - let nBlocksPerCol = uniforms.b_shape[1]; - - for (var block = local_id.x; block < nBlocksPerCol; block += ${b}) { - //process one block - var word_offset: u32 = block * ${r.blockSize/u}; - ${ae()} - for (var word: u32 = 0; word < ${d}; word += ${h}) { - ${we()} - for (var i: u32 = 0; i < ${h}; i++) { - ${le()} - word_offset += ${8/u}; - } - } - } - workgroupBarrier(); - - if (local_id.x < ${P}) { - var output_value: ${H.type.value} = ${H.type.value}(0); - var workgroup_shared_offset: u32 = local_id.x; - for (var b: u32 = 0u; b < ${b}u; b++) { - output_value += workgroup_shared[workgroup_shared_offset]; - workgroup_shared_offset += ${P}; - } - ${H.setByIndices(`${H.type.indices}(batch, row, col + local_id.x)`,"output_value")}; - } - }`};return{name:"MatMulNBits",shaderCache:{hint:`${r.blockSize};${r.bits};${u};${h};${w};${P};${b}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:f,dataType:p}],dispatchGroup:{x:A},programUniforms:y}),getShaderSource:M}},Xf=(e,r)=>{let t=e[0].dims,s=t.length,i=t[s-2],n=r.k,o=r.n,a=t.slice(0,s-2),l=xe.size(a),d=e[1].dims[2]/4,p=e[0].dataType,u=Xt(r.k),h=Xt(d),w=a.concat([i,o]),f=128,P=o%8===0?8:o%4===0?4:1,A=f/P,b=A*h*8,y=b/u,$=b/r.blockSize,T=xe.size(w)/P,g=[],M=[l,i,n/u],E=xe.convertShape(e[1].dims).slice();E.splice(-1,1,d/h),g.push(...nt(M)),g.push(...nt(E)),g.push(...nt(e[2].dims)),e.length===4&&g.push(...nt(xe.convertShape(e[3].dims)));let k=[l,i,o];g.push(...nt(k));let B=N=>{let J=M.length,q=$e("a",e[0].dataType,J,u),V=$e("b",12,E.length,h),Y=$e("scales",e[2].dataType,e[2].dims.length),H=[q,V,Y],Q=e.length===4?$e("zero_points",12,e[3].dims.length):void 0;Q&&H.push(Q);let ie=k.length,le=tt("output",e[0].dataType,ie),ae=lr(e[0].dataType),we=()=>{switch(u){case 1:return` - let a_data0 = vec4<${ae}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); - let a_data1 = vec4<${ae}>(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<${ae}>(sub_a[word_offset], sub_a[word_offset + 1]); - let a_data1 = vec4<${ae}>(sub_a[word_offset + 2], sub_a[word_offset + 3]);`;case 4:return` - let a_data0 = sub_a[word_offset]; - let a_data1 = sub_a[word_offset + 1];`;default:throw new Error(`${u}-component is not supported.`)}};return` - var sub_a: array<${q.type.value}, ${y}>; - var inter_results: array, ${P}>; - ${N.declareVariables(...H,le)} - ${N.mainStart([A,P,1])} - let output_indices = ${le.offsetToIndices(`workgroup_index * ${P}`)}; - let col = output_indices[2]; - let row = output_indices[1]; - let batch = output_indices[0]; - let n_blocks_per_col = uniforms.b_shape[1]; - let num_tiles = (n_blocks_per_col - 1) / ${$} + 1; - - // Loop over shared dimension. - for (var tile: u32 = 0; tile < num_tiles; tile += 1) { - let a_col_start = tile * ${y}; - // load one tile A data into shared memory. - for (var a_offset = local_idx; a_offset < ${y}; a_offset += ${f}) - { - let a_col = a_col_start + a_offset; - if (a_col < uniforms.a_shape[2]) - { - sub_a[a_offset] = ${q.getByIndices(`${q.type.indices}(batch, row, a_col)`)}; - } else { - sub_a[a_offset] = ${q.type.value}(0); - } - } - workgroupBarrier(); - - // each thread process one block - let b_row = col + local_id.y; - let block = tile * ${$} + local_id.x; - ${Q?` - let zero_point_bytes_per_col = (n_blocks_per_col + 1) / 2; - let zero_point_byte_count = b_row * zero_point_bytes_per_col + (block >> 0x1u); - let zero_point_word_index = zero_point_byte_count >> 0x2u; - let zero_point_byte_offset = zero_point_byte_count & 0x3u; - let zero_point_nibble_offset: u32 = block & 0x1u; - let zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); - let zero_point_word = ${Q.getByOffset("zero_point_word_index")} >> zero_point_bits_offset; - let zero_point = ${ae}((zero_point_word) & 0xFu);`:` - // The default zero point is 8 for unsigned 4-bit quantization. - let zero_point = ${ae}(8);`} - let scale = ${Y.getByOffset("b_row * n_blocks_per_col + block")}; - let b_data = ${V.getByIndices(`${V.type.indices}(b_row, block, 0)`)}; - var word_offset = local_id.x * ${r.blockSize/u}; - for (var i: u32 = 0; i < ${h}; i++) { - ${we()} - let b_value = ${h===1?"b_data":"b_data[i]"}; - let b_value_lower = unpack4xU8(b_value & 0x0F0F0F0Fu); - let b_value_upper = unpack4xU8((b_value >> 4) & 0x0F0F0F0Fu); - let b_quantized_values = mat2x4<${ae}>(${Array.from({length:4},(R,O)=>`${ae}(b_value_lower[${O}]), ${ae}(b_value_upper[${O}])`).join(", ")}); - let b_dequantized_values = (b_quantized_values - mat2x4<${ae}>(${Array(8).fill("zero_point").join(",")})) * scale; - inter_results[local_id.y][local_id.x] += ${Array.from({length:2},(R,O)=>`${`dot(a_data${O}, b_dequantized_values[${O}])`}`).join(" + ")}; - word_offset += ${8/u}; - } - workgroupBarrier(); - } - - if (local_idx < ${P}) { - var output_value: ${le.type.value} = ${le.type.value}(0); - for (var b = 0u; b < ${A}; b++) { - output_value += inter_results[local_idx][b]; - } - if (col + local_idx < uniforms.output_shape[2]) - { - ${le.setByIndices(`${le.type.indices}(batch, row, col + local_idx)`,"output_value")} - } - } - }`};return{name:"BlockwiseMatMulNBits32",shaderCache:{hint:`${r.blockSize};${u};${h};${A};${P}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:w,dataType:p}],dispatchGroup:{x:T},programUniforms:g}),getShaderSource:B}},Jf=(e,r)=>{qf(e.inputs,r),r.blockSize===32&&e.adapterInfo.isVendor("intel")&&e.adapterInfo.isArchitecture("gen-12lp")?e.compute(Xf(e.inputs,r)):e.compute(Qf(e.inputs,r))},Yf=e=>Dt(e)}),Zf,eg,tg,rg,sg,ng,ig,og,ag,Ov=Ue(()=>{pt(),Mt(),xt(),Zf=e=>{if(!e||e.length<1)throw new Error("Too few inputs");if(e[0].dataType!==1&&e[0].dataType!==10)throw new Error("Input type must be float or float16.");if(e.length>=2){let r=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(r=e[3].dims[0]*2===e[1].dims[0]),!r)throw new Error("The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].")}},eg=(e,r,t)=>{let s="";for(let i=r-1;i>=0;--i)s+=` - k = i32(${e.indicesGet("indices",i)}) - ${rt("uniforms.pads",i,t)}; - if (k < 0) { - break; - } - if (k >= i32(${rt("uniforms.x_shape",i,r)})) { - break; - } - offset += k * i32(${rt("uniforms.x_strides",i,r)}); - `;return` - value = ${e.type.value}(uniforms.constant_value); - for (var i = 0; i < 1; i++) { - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - } - `},tg=(e,r,t)=>{let s="";for(let i=r-1;i>=0;--i)s+=` - k = i32(${e.indicesGet("indices",i)}) - ${rt("uniforms.pads",i,t)}; - if (k < 0) { - k = -k; - } - { - let _2n_1 = 2 * (i32(${rt("uniforms.x_shape",i,r)}) - 1); - k = k % _2n_1; - if(k >= i32(${rt("uniforms.x_shape",i,r)})) { - k = _2n_1 - k; - } - } - offset += k * i32(${rt("uniforms.x_strides",i,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},rg=(e,r,t)=>{let s="";for(let i=r-1;i>=0;--i)s+=` - k = i32(${e.indicesGet("indices",i)}) - ${rt("uniforms.pads",i,t)}; - if (k < 0) { - k = 0; - } - if (k >= i32(${rt("uniforms.x_shape",i,r)})) { - k = i32(${rt("uniforms.x_shape",i,r)}) - 1; - } - offset += k * i32(${rt("uniforms.x_strides",i,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},sg=(e,r,t)=>{let s="";for(let i=r-1;i>=0;--i)s+=` - k = i32(${e.indicesGet("indices",i)}) - ${rt("uniforms.pads",i,t)}; - if (k < 0) { - k += i32(${rt("uniforms.x_shape",i,r)}]); - } - if (k >= i32(${rt("uniforms.x_shape",i,r)})) { - k -= i32(${rt("uniforms.x_shape",i,r)}); - } - offset += k * i32(${rt("uniforms.x_strides",i,r)}); - `;return` - var offset = 0; - var k = 0; - ${s} - value = x[offset]; - `},ng=(e,r,t)=>{switch(t.mode){case 0:return eg(e,r,t.pads.length);case 1:return tg(e,r,t.pads.length);case 2:return rg(e,r,t.pads.length);case 3:return sg(e,r,t.pads.length);default:throw new Error("Invalid mode")}},ig=(e,r)=>{let t=xe.padShape(e[0].dims.slice(),r.pads),s=e[0].dims,i=xe.size(t),n=[{type:12,data:i},{type:6,data:r.pads}],o=e.length>=3&&e[2].data;r.mode===0&&n.push({type:o?e[2].dataType:1,data:r.value}),n.push(...nt(e[0].dims,t));let a=["rank"],l=d=>{let p=tt("output",e[0].dataType,t.length),u=$e("x",e[0].dataType,s.length),h=u.type.value,w=ng(p,s.length,r),f=[{name:"output_size",type:"u32"},{name:"pads",type:"i32",length:r.pads.length}];return r.mode===0&&f.push({name:"constant_value",type:o?h:"f32"}),` - ${d.registerUniforms(f).declareVariables(u,p)} - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - - let indices = ${p.offsetToIndices("global_idx")}; - - var value = ${h}(0); - ${w} - output[global_idx] = value; - }`};return{name:"Pad",shaderCache:{hint:`${r.mode}${o}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(xe.size(t)/64)},programUniforms:n}),getShaderSource:l}},og=(e,r)=>{if(e.length>1){let t=e[1].getBigInt64Array(),s=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,n=new Int32Array(2*i).fill(0);if(e.length>=4){let a=e[3].getBigInt64Array();for(let l=0;ln[Number(l)]=Number(a));let o=[];return n.forEach(a=>o.push(a)),{mode:r.mode,value:s,pads:o}}else return r},ag=(e,r)=>{Zf(e.inputs);let t=og(e.inputs,r);e.compute(ig(e.inputs,t),{inputs:[0]})}}),Ri,vc,xc,Tc,Ec,lg,dg,Pc,Cc,cg,ug,Sc,pg,hg,$c,mg,_g,fg,gg,Dv=Ue(()=>{ss(),pt(),Mt(),xt(),Ri=e=>{if(Vt.webgpu.validateInputContent&&(!e||e.length!==1))throw new Error("Pool ops requires 1 input.")},vc=(e,r,t)=>{let s=r.format==="NHWC",i=e.dims.slice();s&&i.splice(1,0,i.pop());let n=Object.hasOwnProperty.call(r,"dilations"),o=r.kernelShape.slice(),a=r.strides.slice(),l=n?r.dilations.slice():[],d=r.pads.slice();va.adjustPoolAttributes(t,i,o,a,l,d);let p=va.computePoolOutputShape(t,i,a,l,o,d,r.autoPad),u=Object.assign({},r);n?Object.assign(u,{kernelShape:o,strides:a,pads:d,dilations:l,cacheKey:r.cacheKey}):Object.assign(u,{kernelShape:o,strides:a,pads:d,cacheKey:r.cacheKey});let h=p.slice();return h.push(h.splice(1,1)[0]),[u,s?h:p]},xc=(e,r)=>{let t=r.format==="NHWC",s=xe.size(e),i=xe.size(r.kernelShape),n=[{type:12,data:s},{type:12,data:i}],o=[{name:"outputSize",type:"u32"},{name:"kernelSize",type:"u32"}];if(r.kernelShape.length<=2){let a=r.kernelShape[r.kernelShape.length-1],l=r.strides[r.strides.length-1],d=r.pads[r.pads.length/2-1],p=r.pads[r.pads.length-1],u=!!(d+p);n.push({type:12,data:a},{type:12,data:l},{type:12,data:d},{type:12,data:p}),o.push({name:"kw",type:"u32"},{name:"sw",type:"u32"},{name:"pwStart",type:"u32"},{name:"pwEnd",type:"u32"});let h=!1;if(r.kernelShape.length===2){let w=r.kernelShape[r.kernelShape.length-2],f=r.strides[r.strides.length-2],P=r.pads[r.pads.length/2-2],A=r.pads[r.pads.length-2];h=!!(P+A),n.push({type:12,data:w},{type:12,data:f},{type:12,data:P},{type:12,data:A}),o.push({name:"kh",type:"u32"},{name:"sh",type:"u32"},{name:"phStart",type:"u32"},{name:"phEnd",type:"u32"})}return[n,o,!0,u,h]}else{if(t)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let a=xe.computeStrides(r.kernelShape);n.push({type:12,data:a},{type:12,data:r.pads},{type:12,data:r.strides}),o.push({name:"kernelStrides",type:"u32",length:a.length},{name:"pads",type:"u32",length:r.pads.length},{name:"strides",type:"u32",length:r.strides.length});let l=r.pads.reduce((d,p)=>d+p);return[n,o,!!l,!1,!1]}},Tc=(e,r,t,s,i,n,o,a,l,d,p,u)=>{let h=i.format==="NHWC",w=r.type.value,f=tt("output",r.type.tensor,s);if(i.kernelShape.length<=2){let P="",A="",b="",y=t-(h?2:1);if(p?P=` - for (var i: u32 = 0u; i < uniforms.kw; i++) { - xIndices[${y}] = indices[${y}] * uniforms.sw - uniforms.pwStart + i; - if (xIndices[${y}] < 0 || xIndices[${y}] - >= uniforms.x_shape[${y}]) { - pad++; - continue; - } - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`:P=` - for (var i: u32 = 0u; i < uniforms.kw; i++) { - xIndices[${y}] = indices[${y}] * uniforms.sw - uniforms.pwStart + i; - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`,i.kernelShape.length===2){let $=t-(h?3:2);u?A=` - for (var j: u32 = 0u; j < uniforms.kh; j++) { - xIndices[${$}] = indices[${$}] * uniforms.sh - uniforms.phStart + j; - if (xIndices[${$}] < 0 || xIndices[${$}] >= uniforms.x_shape[${$}]) { - pad += i32(uniforms.kw); - continue; - } - `:A=` - for (var j: u32 = 0u; j < uniforms.kh; j++) { - xIndices[${$}] = indices[${$}] * uniforms.sh - uniforms.phStart + j; - `,b=` - } - `}return` - ${e.registerUniforms(l).declareVariables(r,f)} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - - let indices = ${f.offsetToIndices("global_idx")}; - var xIndices = ${f.offsetToIndices("global_idx")}; - - var value = ${w}(${a}); - var pad = 0; - ${A} - ${P} - ${b} - ${o} - - output[global_idx] = value; - }`}else{if(h)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let P=i.kernelShape.length,A=i.pads.length,b="";return d?b=` - if (xIndices[j] >= uniforms.x_shape[j]) { - pad++; - isPad = true; - break; - } - } - if (!isPad) { - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - }`:b=` - } - let x_val = x[${r.indicesToOffset("xIndices")}]; - ${n} - `,` - ${e.registerUniforms(l).declareVariables(r,f)} - - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - let indices = ${f.offsetToIndices("global_idx")}; - var xIndices = ${f.offsetToIndices("global_idx")}; - - var offsets: array; - - var value = ${w}(${a}); - var pad = 0; - var isPad = false; - - for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { - var offset = i; - for (var j = 0u; j < ${P-1}u; j++) { - offsets[j] = offset / ${rt("uniforms.kernelStrides","j",P)}; - offset -= offsets[j] * ${rt("uniforms.kernelStrides","j",P)}; - } - offsets[${P-1}] = offset; - - isPad = false; - for (var j = ${t-P}u; j < ${t}u; j++) { - xIndices[j] = indices[j] * ${rt("uniforms.strides",`j - ${t-P}u`,P)} - + offsets[j - ${t-P}u] - ${rt("uniforms.pads","j - 2u",A)}; - ${b} - } - ${o} - - output[global_idx] = value; - }`}},Ec=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,lg=e=>`${Ec(e)};${e.countIncludePad}`,dg=e=>`${Ec(e)};${e.storageOrder};${e.dilations}`,Pc=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}),Cc=(e,r,t,s)=>{let[i,n]=vc(r,s,t),o=$e("x",r.dataType,r.dims.length),a=o.type.value,l="value += x_val;",d="";i.countIncludePad?d+=`value /= ${a}(uniforms.kernelSize);`:d+=`value /= ${a}(i32(uniforms.kernelSize) - pad);`;let[p,u,h,w,f]=xc(n,i);p.push(...nt(r.dims,n));let P=["rank"];return{name:e,shaderCache:{hint:`${s.cacheKey};${h};${w};${f}`,inputDependencies:P},getRunData:()=>({outputs:[{dims:n,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(xe.size(n)/64)},programUniforms:p}),getShaderSource:A=>Tc(A,o,r.dims.length,n.length,i,l,d,0,u,h,w,f)}},cg=e=>{let r=e.count_include_pad!==0,t=Pc(e);if(t.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");let s={countIncludePad:r,...t,cacheKey:""};return{...s,cacheKey:lg(s)}},ug=(e,r)=>{Ri(e.inputs),e.compute(Cc("AveragePool",e.inputs[0],!1,r))},Sc={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},pg=e=>{let r=e.format;return{format:r,...Sc,cacheKey:r}},hg=(e,r)=>{Ri(e.inputs),e.compute(Cc("GlobalAveragePool",e.inputs[0],!0,r))},$c=(e,r,t,s)=>{let[i,n]=vc(r,s,t),o=` - value = max(x_val, value); - `,a="",l=$e("x",r.dataType,r.dims.length),d=["rank"],[p,u,h,w,f]=xc(n,i);return p.push(...nt(r.dims,n)),{name:e,shaderCache:{hint:`${s.cacheKey};${h};${w};${f}`,inputDependencies:d},getRunData:()=>({outputs:[{dims:n,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(xe.size(n)/64)},programUniforms:p}),getShaderSource:P=>Tc(P,l,r.dims.length,n.length,i,o,a,r.dataType===10?-65504:-1e5,u,h,w,f)}},mg=(e,r)=>{Ri(e.inputs),e.compute($c("MaxPool",e.inputs[0],!1,r))},_g=e=>{let r=e.storage_order,t=e.dilations,s=Pc(e);if(r!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(s.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");let i={storageOrder:r,dilations:t,...s,cacheKey:""};return{...i,cacheKey:dg(i)}},fg=e=>{let r=e.format;return{format:r,...Sc,cacheKey:r}},gg=(e,r)=>{Ri(e.inputs),e.compute($c("GlobalMaxPool",e.inputs[0],!0,r))}}),wg,yg,Mg,bg,Lv=Ue(()=>{pt(),Mt(),Yt(),xt(),wg=(e,r)=>{if(e.length<2||e.length>3)throw new Error("DequantizeLinear requires 2 or 3 inputs.");if(e.length===3&&e[1].dims===e[2].dims)throw new Error("x-scale and x-zero-point must have the same shape.");if(e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("x and x-zero-point must have the same data type.");if(e[0].dataType===6&&e.length>2)throw new 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 new 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 new Error("x and x-zero-point must have the same data type.");if(e[1].dims.length!==e[2].dims.length)throw new Error("scale and zero-point inputs must have the same rank.");if(!e[1].dims.map((t,s)=>t===e[2].dims[s]).reduce((t,s)=>t&&s,!0))throw new Error("scale and zero-point inputs must have the same shape.")}if(r.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw new Error("blockSize must be set only for block quantization.");if(!e[1].dims.map((i,n)=>n===r.axis||i===e[0].dims[n]).reduce((i,n)=>i&&n,!0))throw new 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 new Error("For block qunatization the scale input rank must be the same as the x rank.");let t=e[0].dims[r.axis],s=e[1].dims[r.axis];if(r.blockSizeMath.ceil(t/(s-1)-1))throw new Error("blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].")}},yg=(e,r)=>{let t=xe.normalizeAxis(r.axis,e[0].dims.length),s=e[0].dataType,i=s===3,n=e[0].dims,o=e[1].dataType,a=xe.size(n),l=s===3||s===2,d=l?[Math.ceil(xe.size(e[0].dims)/4)]:e[0].dims,p=e[1].dims,u=e.length>2?e[2]:void 0,h=u?l?[Math.ceil(xe.size(u.dims)/4)]:u.dims:void 0,w=p.length===0||p.length===1&&p[0]===1,f=w===!1&&p.length===1,P=Xt(a),A=w&&(!l||P===4),b=A?P:1,y=A&&!l?P:1,$=$e("input",l?12:s,d.length,y),T=$e("scale",o,p.length),g=u?$e("zero_point",l?12:s,h.length):void 0,M=tt("output",o,n.length,b),E=[$,T];g&&E.push(g);let k=[d,p];u&&k.push(h);let B=[{type:12,data:a/b},{type:12,data:t},{type:12,data:r.blockSize},...nt(...k,n)],N=J=>{let q=[{name:"output_size",type:"u32"},{name:"axis",type:"u32"},{name:"block_size",type:"u32"}];return` - ${J.registerUniforms(q).declareVariables(...E,M)} - ${J.mainStart()} - ${J.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let output_indices = ${M.offsetToIndices("global_idx")}; - - // Set input x - ${l?` - let input = ${$.getByOffset("global_idx / 4")}; - let x_vec = ${i?"unpack4xI8(input)":"unpack4xU8(input)"}; - let x_value = ${b===1?"x_vec[global_idx % 4]":"x_vec"};`:`let x_value = ${$.getByOffset("global_idx")};`}; - - // Set scale input - ${w?`let scale_value= ${T.getByOffset("0")}`:f?` - let scale_index = ${M.indicesGet("output_indices","uniforms.axis")}; - let scale_value= ${T.getByOffset("scale_index")};`:` - var scale_indices: ${T.type.indices} = output_indices; - let index = ${T.indicesGet("scale_indices","uniforms.axis")} / uniforms.block_size; - ${T.indicesSet("scale_indices","uniforms.axis","index")}; - let scale_value= ${T.getByIndices("scale_indices")};`}; - - // Set zero-point input - ${g?w?l?` - let zero_point_input = ${g.getByOffset("0")}; - let zero_point_vec = ${i?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value= zero_point_vec[0]`:`let zero_point_value = ${g.getByOffset("0")}`:f?l?` - let zero_point_index = ${M.indicesGet("output_indices","uniforms.axis")}; - let zero_point_input = ${g.getByOffset("zero_point_index / 4")}; - let zero_point_vec = ${i?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value = zero_point_vec[zero_point_index % 4]`:` - let zero_point_index = ${M.indicesGet("output_indices","uniforms.axis")}; - let zero_point_value = ${g.getByOffset("zero_point_index")};`:l?` - let zero_point_offset = ${T.indicesToOffset("scale_indices")}; - let zero_point_input = ${g.getByOffset("zero_point_offset / 4")}; - let zero_point_vec = ${i?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; - let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${g.getByIndices("scale_indices")};`:`let zero_point_value = ${l?i?"i32":"u32":$.type.value}(0);`}; - // Compute and write output - ${M.setByOffset("global_idx",`${M.type.value}(x_value - zero_point_value) * scale_value`)}; - }`};return{name:"DequantizeLinear",shaderCache:{hint:r.cacheKey,inputDependencies:g?["rank","rank","rank"]:["rank","rank"]},getShaderSource:N,getRunData:()=>({outputs:[{dims:n,dataType:o}],dispatchGroup:{x:Math.ceil(a/b/64),y:1,z:1},programUniforms:B})}},Mg=(e,r)=>{wg(e.inputs,r),e.compute(yg(e.inputs,r))},bg=e=>Dt({axis:e.axis,blockSize:e.blockSize})}),vg,xg,Tg,zv=Ue(()=>{ss(),pt(),xt(),vg=(e,r,t)=>{let s=e===r,i=er&&t>0;if(s||i||n)throw new Error("Range these inputs' contents are invalid.")},xg=(e,r,t,s)=>{let i=Math.abs(Math.ceil((r-e)/t)),n=[i],o=i,a=[{type:12,data:o},{type:s,data:e},{type:s,data:t},...nt(n)],l=d=>{let p=tt("output",s,n.length),u=p.type.value,h=[{name:"outputSize",type:"u32"},{name:"start",type:u},{name:"delta",type:u}];return` - ${d.registerUniforms(h).declareVariables(p)} - ${d.mainStart()} - ${d.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - output[global_idx] = uniforms.start + ${u}(global_idx) * uniforms.delta; - }`};return{name:"Range",shaderCache:{hint:`${s}`},getShaderSource:l,getRunData:()=>({outputs:[{dims:n,dataType:s}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:a})}},Tg=e=>{let r=0,t=0,s=0;e.inputs[0].dataType===6?(r=e.inputs[0].getInt32Array()[0],t=e.inputs[1].getInt32Array()[0],s=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(r=e.inputs[0].getFloat32Array()[0],t=e.inputs[1].getFloat32Array()[0],s=e.inputs[2].getFloat32Array()[0]),Vt.webgpu.validateInputContent&&vg(r,t,s),e.compute(xg(r,t,s,e.inputs[0].dataType),{inputs:[]})}}),Eg,Pg,Cg,Sg,Bv=Ue(()=>{pt(),Mt(),Yt(),xt(),Eg=(e,r,t,s)=>{if(e!=="none"&&s!=="i32"&&s!=="u32"&&s!=="f32")throw new Error(`Input ${s} is not supported with reduction ${e}.`);let i=`{ - var oldValue = 0; - loop { - let newValueF32 =`,n=`; - let newValue = bitcast(newValueF32); - let res = atomicCompareExchangeWeak(&${r}, oldValue, newValue); - if res.exchanged { - break; - } - oldValue = res.old_value; - } - }`;switch(e){case"none":return`${r}=${t};`;case"add":return s==="i32"||s==="u32"?`atomicAdd(&${r}, bitcast<${s}>(${t}));`:` - ${i}bitcast<${s}>(oldValue) + (${t})${n}`;case"max":return s==="i32"||s==="u32"?`atomicMax(&${r}, bitcast<${s}>(${t}));`:` - ${i}max(bitcast(oldValue), (${t}))${n}`;case"min":return s==="i32"||s==="u32"?`atomicMin(&${r}, bitcast<${s}>(${t}));`:`${i}min(bitcast<${s}>(oldValue), (${t}))${n}`;case"mul":return`${i}(bitcast<${s}>(oldValue) * (${t}))${n}`;default:throw new Error(`Reduction ${e} is not supported.`)}},Pg=(e,r)=>{let t=e[0].dims,s=e[1].dims,i=t,n=1,o=Math.ceil(xe.size(s)/n),a=s[s.length-1],l=xe.sizeFromDimension(t,a),d=[{type:12,data:o},{type:12,data:a},{type:12,data:l},...nt(e[1].dims,e[2].dims,i)],p=u=>{let h=$e("indices",e[1].dataType,e[1].dims.length),w=$e("updates",e[2].dataType,e[2].dims.length,n),f=r.reduction!=="none"&&r.reduction!==""?zp("output",e[0].dataType,i.length):tt("output",e[0].dataType,i.length,n);return` - ${u.registerUniform("output_size","u32").registerUniform("last_index_dimension","u32").registerUniform("num_updates_elements","u32").declareVariables(h,w,f)} - ${u.mainStart()} - ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - var hasDuplicates = false; - if (${r.reduction==="none"}) { - let n = ${xe.size(s)}; - for (var i = 0; i < n; i = i + 1) { - for (var j = i + 1; j < n; j = j + 1) { - var index_i = i32(indices[i].x); - var index_j = i32(indices[j].x); - if (index_i == index_j) { - hasDuplicates = true; - break; - } - } - if (hasDuplicates) { - break; - } - } - } - - var data_offset = 0u; - var indices_start = uniforms.last_index_dimension * global_idx; - if (${r.reduction==="none"} && hasDuplicates) { - if (global_idx != 0u) { - return; - } - indices_start = 0u; - } - let indices_end = indices_start + uniforms.last_index_dimension; - for (var i = indices_start; i < indices_end; i++) { - var index = i32(indices[i].x); - ${e[0].dims.length===1?` - let element_count_dim = uniforms.output_strides; - let dim_value = uniforms.output_shape;`:` - let element_count_dim = uniforms.output_strides[i - indices_start]; - let dim_value = uniforms.output_shape[i - indices_start + uniforms.last_index_dimension];`} - if (index >= 0) { - if (index >= i32(dim_value)) { - index = i32(dim_value - 1); - } - } else { - if (index < -i32(dim_value)) { - index = 0; - } else { - index += i32(dim_value); - } - } - data_offset += u32((u32(index) * element_count_dim)); - } - - for (var i = 0u; i < uniforms.num_updates_elements; i++) { - let value = updates[uniforms.num_updates_elements * global_idx + i]; - ${Eg(r.reduction,"output[data_offset + i]","value",f.type.value)} - } - - }`};return{name:"ScatterND",shaderCache:{hint:`${r.cacheKey}_${r.reduction}`,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:d}),getShaderSource:p}},Cg=e=>Dt({reduction:e.reduction}),Sg=(e,r)=>{e.compute(Pg(e.inputs,r),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),$g,kg,Ig,kc,Ag,Fg,Og,Dg,Lg,zg,Bg,Rg,Ic,Ng,jg,Ug,Vg,Wg,Gg,Kg,Rv=Ue(()=>{pt(),Mt(),Yt(),xt(),$g=(e,r)=>{if(e.every(t=>t>0||(()=>{throw new Error("Resize requires scales input values to be positive")})),e.length>0){if(r.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 new 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(r.mode==="cubic"&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw new Error("Resize requires scales input size to be 2 or 4 for cubic mode")}},kg=(e,r,t)=>{r.every(i=>i>=0&&i{throw new Error("Resize requires axes input values to be positive and less than rank")}));let s=new Array(t).fill(1);return r.forEach((i,n)=>s[i]=e[n]),s},Ig=(e,r,t,s,i,n)=>{let[o,a,l]=t>10?[1,2,3]:[-1,e.length>1?1:-1,-1],d=e[0].dims.length;if(o>0&&e.length>o&&e[o].dims.length>0)e[o].getFloat32Array().forEach(p=>n.push(p));else if(r.coordinateTransformMode==="tf_crop_and_resize")throw new Error("Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize");if(a>0&&e.length>a&&e[a].dims.length===1&&e[a].dims[0]>0){if(e[a].getFloat32Array().forEach(p=>s.push(p)),s.length!==0&&s.length!==d&&t>=18&&s.length!==r.axes.length)throw new Error("Resize requires scales input size to be same as input rank or axes size for opset 18 and up");$g(s,r),r.axes.length>0&&kg(s,r.axes,d).forEach((p,u)=>s[u]=p)}if(l>0&&e.length>l&&e[l].dims.length===1&&e[l].dims[0]>0&&(e[l].getBigInt64Array().forEach(p=>i.push(Number(p))),i.length!==0&&i.length!==d&&t>=18&&i.length!==r.axes.length))throw new Error("Resize requires sizes input size to be same as input rank or axes size for opset 18 and up");if(r.axes.length>0){if(s.length!==0&&s.length!==r.axes.length)throw new Error('Resize requires "scales" input size to be of axes rank when axes attributes is specified');if(i.length!==0&&i.length!==r.axes.length)throw new Error('Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified')}if(typeof s<"u"&&typeof i<"u"&&s.length>0&&i.length>d)throw new Error("Resize requires only of scales or sizes to be specified")},kc=(e,r,t,s)=>` - // 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 - // offset-by-one error later in floor(). - let big = (${e}) * (${r}); - let whole = ${s}(big / (${t})); - let fract = ${s}(big % (${t})) / ${s}(${t}); - return whole + fract; -`,Ag=(e,r)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32, - lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${r} { `+(()=>{switch(e){case"asymmetric":return` - if (xScale < 1.0 || floor(xScale) != xScale) { - return ${r}(xResized) / ${r}(xScale); - } else { - ${kc("xResized","lengthOriginal","lengthResized",r)} - } - `;case"pytorch_half_pixel":return`if (lengthResized > 1) { - return (${r}(xResized) + 0.5) / ${r}(xScale) - 0.5; - } else { - return 0.0; - }`;case"tf_half_pixel_for_nn":return`return (${r}(xResized) + 0.5) / ${r}(xScale);`;case"align_corners":return`if (lengthResized == 1) { - return 0.0; - } else { - ${kc("xResized","lengthOriginal - 1","lengthResized - 1",r)} - }`;case"tf_crop_and_resize":return`if (lengthResized > 1) { - return ${r}(roiStart) * ${r}(lengthOriginal - 1) + - (${r}(xResized) * ${r}(roiEnd - roiStart) * ${r}(lengthOriginal - 1)) / - ${r}(lengthResized - 1); - } else { - return 0.5 * ${r}(roiStart + roiEnd) * ${r}(lengthOriginal - 1); - }`;case"half_pixel_symmetric":return`const outputWidth = ${r}xScale * ${r}(lengthResized); - const adjustment = ${r}(lengthResized) / outputWidth; - const center = ${r}(lengthOriginal) / 2; - const offset = center * (1 - adjustment); - return offset + ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;case"half_pixel":return`return ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;default:throw new Error(`Coordinate transform mode ${e} is not supported`)}})()+"}",Fg=(e,r,t)=>`fn getNearestPixelFromOriginal(xOriginal: ${t}, isDownSample: bool) -> ${t} {`+(()=>{switch(e){case"round_prefer_ceil":return"if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }";case"floor":return"return floor(xOriginal);";case"ceil":return"return ceil(xOriginal);";case"round_prefer_floor":return"if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }";case"simple":default:if(r<11)return"if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }";throw new Error(`Nearest mode ${e} is not supported`)}})()+"}",Og=(e,r,t)=>{let s=new Array(t).fill(0).concat(new Array(t).fill(1)),i=e.length===0?s:e.slice();return r.length>0?(r.forEach((n,o)=>{s[n]=i[o],s[o+t]=i[r.length+o]}),s):i},Dg=(e,r,t,s)=>{let i=[];if(t.length>0)if(s.length>0){if(e.forEach(n=>i.push(n)),Math.max(...s)>e.length)throw new Error("axes is out of bound");s.forEach((n,o)=>i[n]=t[o])}else t.forEach(n=>i.push(n));else{if(r.length===0)throw new Error("Resize requires either scales or sizes.");i=e.map((n,o)=>Math.round(n*r[o]))}return i},Lg=(e,r,t)=>{let s=(()=>{switch(t.keepAspectRatioPolicy){case"not_larger":return t.axes.length>0?Math.min(...t.axes.map(n=>r[n]),Number.MAX_VALUE):Math.min(...r,Number.MAX_VALUE);case"not_smaller":return t.axes.length>0?Math.max(...t.axes.map(n=>r[n]),Number.MIN_VALUE):Math.max(...r,Number.MIN_VALUE);default:throw new Error(`Keep aspect ratio policy ${t.keepAspectRatioPolicy} is not supported`)}})();r.fill(1,0,r.length);let i=e.slice();return t.axes.length>0?(t.axes.forEach(n=>r[n]=s),t.axes.forEach(n=>i[n]=Math.round(e[n]*r[n]))):(r.fill(s,0,r.length),i.forEach((n,o)=>i[o]=Math.round(n*r[o]))),i},zg=(e,r,t,s,i)=>` - fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${t.length}> { - var original_indices: array<${e.type.value}, ${t.length}>; - for (var i:u32 = 0; i < ${t.length}; i++) { - var output_index = ${e.indicesGet("output_indices","i")}; - var scale = ${rt("uniforms.scales","i",s)}; - var roi_low = ${rt("uniforms.roi","i",i)}; - var roi_hi = ${rt("uniforms.roi",`i + ${r.length}`,i)}; - if (scale == 1.0) { - original_indices[i] = ${e.type.value}(output_index); - } else { - var input_shape_i = ${rt("uniforms.input_shape","i",r.length)}; - var output_shape_i = ${rt("uniforms.output_shape","i",t.length)}; - original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, - input_shape_i, roi_low, roi_hi); - } - } - return original_indices; - }`,Bg=(e,r,t,s,i,n,o)=>` - fn calculateInputIndicesFromOutputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} { - var input_indices: ${e.type.indices}; - for (var i:u32 = 0; i < ${s.length}; i++) { - var output_index = ${r.indicesGet("output_indices","i")}; - var input_index: u32; - var scale = ${rt("uniforms.scales","i",i)}; - if (scale == 1.0) { - input_index = output_index; - } else { - var roi_low = ${rt("uniforms.roi","i",n)}; - var roi_hi = ${rt("uniforms.roi",`i + ${t.length}`,n)}; - var input_shape_i = ${rt("uniforms.input_shape","i",t.length)}; - var output_shape_i = ${rt("uniforms.output_shape","i",s.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 < ${r.type.value}(input_shape_i))) { - if (original_idx < 0) { - input_index = 0; - } else if (original_idx > ${r.type.value}(input_shape_i - 1)) { - input_index = input_shape_i - 1; - } else { - input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1)); - } - } else { - input_index = u32(original_idx); - } - } - ${e.indicesSet("input_indices","i","input_index")} - } - return input_indices; - }`,Rg=(e,r)=>` - fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { - for (var i:u32 = 0; i < ${r.length}; i++) { - var input_index = ${e.indicesGet("input_indices","i")}; - if (input_index < 0 || input_index >= ${rt("uniforms.input_shape","i",r.length)}) { - return false; - } - } - return true; - }`,Ic=(e,r,t,s)=>e.rank>s?` - ${e.indicesSet("input_indices",r,"channel")}; - ${e.indicesSet("input_indices",t,"batch")}; -`:"",Ng=(e,r,t,s,i)=>{let[n,o,a,l]=t.length===2?[-1,0,1,-1]:[0,2,3,1],d=e.type.value;return` - fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${d} { - var input_indices: ${e.type.indices}; - ${e.indicesSet("input_indices",o,`max(0, min(row, ${t[o]} - 1))`)}; - ${e.indicesSet("input_indices",a,`max(0, min(col, ${t[a]} - 1))`)}; - ${Ic(e,l,n,2)} - return ${e.getByIndices("input_indices")}; - } - - fn bilinearInterpolation(output_indices: ${r.type.indices}) -> ${d} { - var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); - var row:${d} = originalIndices[${o}]; - var col:${d} = originalIndices[${a}]; - ${s?`if (row < 0 || row > (${t[o]} - 1) || col < 0 || col > (${t[a]} - 1)) { - return ${i}; - }`:""}; - row = max(0, min(row, ${t[o]} - 1)); - col = max(0, min(col, ${t[a]} - 1)); - var row1: u32 = u32(row); - var col1: u32 = u32(col); - var row2: u32 = u32(row + 1); - var col2: u32 = u32(col + 1); - var channel: u32 = ${t.length>2?`u32(originalIndices[${l}])`:"0"}; - var batch: u32 = ${t.length>2?`u32(originalIndices[${n}])`:"0"}; - var x11: ${d} = getInputValue(batch, channel, row1, col1); - var x12: ${d} = getInputValue(batch, channel, row1, col2); - var x21: ${d} = getInputValue(batch, channel, row2, col1); - var x22: ${d} = getInputValue(batch, channel, row2, col2); - var dx1: ${d} = abs(row - ${d}(row1)); - var dx2: ${d} = abs(${d}(row2) - row); - var dy1: ${d} = abs(col - ${d}(col1)); - var dy2: ${d} = abs(${d}(col2) - col); - if (row1 == row2) { - dx1 = 0.5; - dx2 = 0.5; - } - if (col1 == col2) { - dy1 = 0.5; - dy2 = 0.5; - } - return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1); - }`},jg=(e,r,t,s,i,n,o,a,l,d)=>{let p=t.length===2,[u,h]=p?[0,1]:[2,3],w=e.type.value,f=P=>{let A=P===u?"row":"col";return` - fn ${A}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${r.type.indices}) -> ${w} { - var output_index = ${r.indicesGet("output_indices",P)}; - var originalIdx: ${w} = getOriginalCoordinateFromResizedCoordinate(output_index, ${i[P]}, - ${s[P]}, ${t[P]}, ${n[P]}, ${n[P]} + ${t.length}); - var fractOriginalIdx: ${w} = originalIdx - floor(originalIdx); - var coefs = getCubicInterpolationCoefs(fractOriginalIdx); - - if (${a} && (originalIdx < 0 || originalIdx > (${t[P]} - 1))) { - return ${l}; - } - var data: array<${w}, 4> = array<${w}, 4>(0.0, 0.0, 0.0, 0.0); - for (var i: i32 = -1; i < 3; i++) { - var ${A}: ${w} = originalIdx + ${w}(i); - if (${A} < 0 || ${A} >= ${t[P]}) { - ${d?`coefs[i + 1] = 0.0; - continue;`:a?`return ${l};`:`${A} = max(0, min(${A}, ${t[P]} - 1));`}; - } - var input_indices_copy: ${e.type.indices} = input_indices; - ${e.indicesSet("input_indices_copy",P,`u32(${A})`)}; - data[i + 1] = ${P===u?e.getByIndices("input_indices_copy"):"rowCubicInterpolation(input_indices_copy, output_indices)"}; - } - return cubicInterpolation1D(data, coefs); - }`};return` - ${f(u)}; - ${f(h)}; - fn getCubicInterpolationCoefs(s: ${w}) -> array<${w}, 4> { - var absS = abs(s); - var coeffs: array<${w}, 4> = array<${w}, 4>(0.0, 0.0, 0.0, 0.0); - var oneMinusAbsS: ${w} = 1.0 - absS; - var twoMinusAbsS: ${w} = 2.0 - absS; - var onePlusAbsS: ${w} = 1.0 + absS; - coeffs[0] = ((${o} * onePlusAbsS - 5 * ${o}) * onePlusAbsS + 8 * ${o}) * onePlusAbsS - 4 * ${o}; - coeffs[1] = ((${o} + 2) * absS - (${o} + 3)) * absS * absS + 1; - coeffs[2] = ((${o} + 2) * oneMinusAbsS - (${o} + 3)) * oneMinusAbsS * oneMinusAbsS + 1; - coeffs[3] = ((${o} * twoMinusAbsS - 5 * ${o}) * twoMinusAbsS + 8 * ${o}) * twoMinusAbsS - 4 * ${o}; - return coeffs; - } - - fn cubicInterpolation1D(x: array<${w}, 4>, coefs: array<${w}, 4>) -> ${w} { - var coefsSum: ${w} = coefs[0] + coefs[1] + coefs[2] + coefs[3]; - return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum; - } - - fn bicubicInterpolation(output_indices: ${r.type.indices}) -> ${w} { - var input_indices: ${e.type.indices} = output_indices; - return colCubicInterpolation(input_indices, output_indices); - } - `},Ug=(e,r,t,s,i)=>{let[n,o,a,l,d]=t.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],p=e.type.value;return` - fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${p} { - var input_indices: ${e.type.indices}; - ${e.indicesSet("input_indices",o,`max(0, min(depth, ${t[o]} - 1))`)}; - ${e.indicesSet("input_indices",a,`max(0, min(height, ${t[a]} - 1))`)}; - ${e.indicesSet("input_indices",l,`max(0, min(width, ${t[l]} - 1))`)}; - ${Ic(e,d,n,3)} - return ${e.getByIndices("input_indices")}; - } - - fn trilinearInterpolation(output_indices: ${r.type.indices}) -> ${p} { - var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); - var depth:${p} = originalIndices[${o}]; - var height:${p} = originalIndices[${a}]; - var width:${p} = originalIndices[${l}]; - ${s?`if (depth < 0 || depth > (${t[o]} - 1) || height < 0 || height > (${t[a]} - 1) || width < 0 || (width > ${t[l]} - 1)) { - return ${i}; - }`:""}; - - depth = max(0, min(depth, ${t[o]} - 1)); - height = max(0, min(height, ${t[a]} - 1)); - width = max(0, min(width, ${t[l]} - 1)); - var depth1: u32 = u32(depth); - var height1: u32 = u32(height); - var width1: u32 = u32(width); - var depth2: u32 = u32(depth + 1); - var height2: u32 = u32(height + 1); - var width2: u32 = u32(width + 1); - var channel: u32 = ${t.length>3?`u32(originalIndices[${d}])`:"0"}; - var batch: u32 = ${t.length>3?`u32(originalIndices[${n}])`:"0"}; - - var x111: ${p} = getInputValue(batch, channel, depth1, height1, width1); - var x112: ${p} = getInputValue(batch, channel, depth1, height1, width2); - var x121: ${p} = getInputValue(batch, channel, depth1, height2, width1); - var x122: ${p} = getInputValue(batch, channel, depth1, height2, width2); - var x211: ${p} = getInputValue(batch, channel, depth2, height1, width1); - var x212: ${p} = getInputValue(batch, channel, depth2, height1, width2); - var x221: ${p} = getInputValue(batch, channel, depth2, height2, width1); - var x222: ${p} = getInputValue(batch, channel, depth2, height2, width2); - var dx1: ${p} = abs(depth - ${p}(depth1)); - var dx2: ${p} = abs(${p}(depth2) - depth); - var dy1: ${p} = abs(height - ${p}(height1)); - var dy2: ${p} = abs(${p}(height2) - height); - var dz1: ${p} = abs(width - ${p}(width1)); - var dz2: ${p} = abs(${p}(width2) - width); - if (depth1 == depth2) { - dx1 = 0.5; - dx2 = 0.5; - } - if (height1 == height2) { - dy1 = 0.5; - dy2 = 0.5; - } - if (width1 == width2) { - dz1 = 0.5; - dz2 = 0.5; - } - 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); - }`},Vg=(e,r,t,s,i,n)=>{let o=e.dims,a=Og(n,r.axes,o.length),l=Dg(o,s,i,r.axes),d=s.slice();s.length===0&&(d=o.map((y,$)=>y===0?1:l[$]/y),r.keepAspectRatioPolicy!=="stretch"&&(l=Lg(o,d,r)));let p=tt("output",e.dataType,l.length),u=$e("input",e.dataType,o.length),h=xe.size(l),w=o.length===l.length&&o.every((y,$)=>y===l[$]),f=r.coordinateTransformMode==="tf_crop_and_resize",P=r.extrapolationValue,A=u.type.value,b=y=>` - ${w?"":` - ${Ag(r.coordinateTransformMode,A)}; - ${(()=>{switch(r.mode){case"nearest":return` - ${Rg(u,o)}; - ${Fg(r.nearestMode,t,A)}; - ${Bg(u,p,o,l,d.length,a.length,f)}; - `;case"linear":return` - ${zg(p,o,l,d.length,a.length)}; - ${(()=>{if(o.length===2||o.length===4)return`${Ng(u,p,o,f,P)}`;if(o.length===3||o.length===5)return`${Ug(u,p,o,f,P)}`;throw Error("Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.")})()}; - `;case"cubic":return` - ${(()=>{if(o.length===2||o.length===4)return`${jg(u,p,o,l,d,a,r.cubicCoeffA,f,r.extrapolationValue,r.excludeOutside)}`;throw Error("Cubic mode only supports input dims 2 and 4 are supported in linear mode.")})()}; - `;default:throw Error("Invalid resize mode")}})()}; - `} - ${y.registerUniform("output_size","u32").registerUniform("scales","f32",d.length).registerUniform("roi","f32",a.length).declareVariables(u,p)} - ${y.mainStart()} - ${y.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - ${w?"output[global_idx] = input[global_idx];":` - let output_indices = ${p.offsetToIndices("global_idx")}; - var input_indices: ${u.type.indices}; - ${(()=>{switch(r.mode){case"nearest":return`input_indices = calculateInputIndicesFromOutputIndices(output_indices); - if (checkInputIndices(input_indices)) { - output[global_idx] = ${u.getByIndices("input_indices")}; - } else { - output[global_idx] = ${r.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: ${r.mode}`)}})()}; -`} - }`;return{name:"Resize",shaderCache:{hint:`${r.cacheKey}|${t}|${d.length>0?r.mode==="cubic"?d:d.length:""}|${i.length>0?i:""}|${a.length>0?a:""}|${w}|${r.mode==="nearest"?o.length:o}`,inputDependencies:["rank"]},getShaderSource:b,getRunData:()=>({outputs:[{dims:l,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:[{type:12,data:h},{type:1,data:d},{type:1,data:a},...nt(o,l)]})}},Wg=e=>{let r=e.customDataBuffer;return new Uint32Array(r,r.byteOffset,1)[0]},Gg=(e,r)=>{let t=[],s=[],i=[],n=Wg(e);if(r.antialias!==0)throw Error("Only default value (0) for Antialias attribute is supported");Ig(e.inputs,r,n,t,s,i),e.compute(Vg(e.inputs[0],r,n,t,s,i),{inputs:[0]})},Kg=e=>{let r=e.antialias,t=e.axes,s=e.coordinateTransformMode,i=e.cubicCoeffA,n=e.excludeOutside!==0,o=e.extrapolationValue,a=e.keepAspectRatioPolicy,l=e.mode,d=e.nearestMode===""?"simple":e.nearestMode;return Dt({antialias:r,axes:t,coordinateTransformMode:s,cubicCoeffA:i,excludeOutside:n,extrapolationValue:o,keepAspectRatioPolicy:a,mode:l,nearestMode:d})}}),Hg,qg,Qg,Nv=Ue(()=>{pt(),Mt(),Yt(),xt(),Hg=(e,r)=>{let[t,s,i,n]=e,{numHeads:o,rotaryEmbeddingDim:a}=r;if(t.dims.length!==3&&t.dims.length!==4)throw new Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${t.dims.length}`);if(!xe.areEqual(s.dims,[])&&!xe.areEqual(s.dims,[1])&&s.dims.length!==2)throw new Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${s.dims.length}`);if(i.dims.length!==2)throw new Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(n.dims.length!==2)throw new Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${n.dims.length}`);if(!xe.areEqual(i.dims,n.dims))throw new Error("Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape");if(a>0&&o===0)throw new Error("num_heads must be provided if rotary_embedding_dim is specified");let l=t.dims[0],d=t.dims[t.dims.length-2],p=i.dims[0],u=xe.sizeFromDimension(t.dims,1)/d,h=a===0?i.dims[1]*2:u/o;if(a>h)throw new Error("rotary_embedding_dim must be less than or equal to head_size");if(s.dims.length===2){if(l!==s.dims[0])throw new Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${s.dims[0]}`);if(d!==s.dims[1])throw new Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${s.dims[1]}`)}if(h/2!==i.dims[1]&&a/2!==i.dims[1])throw new Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(d>p)throw new Error("Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported")},qg=(e,r)=>{let{interleaved:t,numHeads:s,rotaryEmbeddingDim:i,scale:n}=r,o=e[0].dims[0],a=xe.sizeFromDimension(e[0].dims,1),l=e[0].dims[e[0].dims.length-2],d=a/l,p=e[2].dims[1],u=i===0?p*2:d/s,h=new Array(o,l,d/u,u-p),w=xe.computeStrides(h),f=[{type:1,data:n},{type:12,data:h},{type:12,data:w},...e[0].dims.length===3?new Array({type:12,data:[a,d,u,1]}):[],...e[0].dims.length===4?new Array({type:12,data:[a,u,l*u,1]}):[],...nt(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],P=A=>{let b=$e("input",e[0].dataType,e[0].dims.length),y=$e("position_ids",e[1].dataType,e[1].dims.length),$=$e("cos_cache",e[2].dataType,e[2].dims.length),T=$e("sin_cache",e[3].dataType,e[3].dims.length),g=tt("output",e[0].dataType,e[0].dims.length);return A.registerUniforms([{name:"scale",type:"f32"},{name:"global_shape",type:"u32",length:h.length},{name:"global_strides",type:"u32",length:w.length},{name:"input_output_strides",type:"u32",length:w.length}]),` - ${A.declareVariables(b,y,$,T,g)} - - ${A.mainStart(jn)} - let half_rotary_emb_dim = uniforms.${$.name}_shape[1]; - let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; - let size = uniforms.global_shape[0] * uniforms.global_strides[0]; - ${A.guardAgainstOutOfBoundsWorkgroupSizes("size")} - - if (bsnh[3] < half_rotary_emb_dim) { - let position_ids_idx = - ${y.broadcastedIndicesToOffset("bsnh.xy",tt("",y.type.tensor,2))}; - let position_id = - u32(${y.getByOffset("position_ids_idx")}) + select(0, bsnh[1], position_ids_idx == 0); - let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${t}); - let j = i + select(half_rotary_emb_dim, 1, ${t}); - let re = ${b.getByOffset("i")} * ${$.get("position_id","bsnh[3]")} - - ${b.getByOffset("j")} * ${T.get("position_id","bsnh[3]")}; - ${g.setByOffset("i","re")} - let im = ${b.getByOffset("i")} * ${T.get("position_id","bsnh[3]")} + - ${b.getByOffset("j")} * ${$.get("position_id","bsnh[3]")}; - ${g.setByOffset("j","im")} - } else { - let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; - ${g.setByOffset("k",b.getByOffset("k"))} - } - }`};return{name:"RotaryEmbedding",shaderCache:{hint:Dt({interleaved:t}).cacheKey,inputDependencies:["rank","rank","rank","rank"]},getShaderSource:P,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(xe.size(h)/jn)},programUniforms:f})}},Qg=(e,r)=>{Hg(e.inputs,r),e.compute(qg(e.inputs,r))}}),Xg,Jg,Yg,jv=Ue(()=>{pt(),Mt(),xt(),Xg=e=>{if(!e||e.length<3)throw new Error("layerNorm requires at least 3 inputs.");let r=e[0],t=e[1],s=e[2];if(r.dataType!==t.dataType||r.dataType!==s.dataType)throw new Error("All inputs must have the same data type");if(r.dims.length!==3&&r.dims.length!==2)throw new Error("Input must be 2D or 3D");if(t.dims.length!==3&&t.dims.length!==2)throw new Error("Skip must be 2D or 3D");let i=r.dims[r.dims.length-1],n=r.dims[r.dims.length-2];if(t.dims[t.dims.length-1]!==i)throw new Error("Skip must have the same hidden size as input");if(t.dims[t.dims.length-2]!==n)throw new Error("Skip must have the same sequence length as input");if(s.dims.length!==1)throw new Error("Gamma must be 1D");if(s.dims[s.dims.length-1]!==i)throw new Error("Gamma must have the same hidden size as input");if(e.length>3){let o=e[3];if(o.dims.length!==1)throw new Error("Beta must be 1D");if(o.dims[o.dims.length-1]!==i)throw new Error("Beta must have the same hidden size as input")}if(e.length>4){let o=e[4];if(o.dims.length!==1)throw new Error("Bias must be 1D");if(o.dims[o.dims.length-1]!==i)throw new Error("Bias must have the same hidden size as input")}},Jg=(e,r,t,s)=>{let i=r.simplified,n=e[0].dims,o=xe.size(n),a=n,l=o,d=n.slice(-1)[0],p=s?n.slice(0,-1).concat(1):[],u=!i&&e.length>3,h=e.length>4,w=s&&t>1,f=s&&t>2,P=t>3,A=64,b=Xt(d),y=[{type:12,data:l},{type:12,data:b},{type:12,data:d},{type:1,data:r.epsilon}],$=g=>{let M=[{name:"output_size",type:"u32"},{name:"components",type:"u32"},{name:"hidden_size",type:"u32"},{name:"epsilon",type:"f32"}],E=[$e("x",e[0].dataType,e[0].dims,b),$e("skip",e[1].dataType,e[1].dims,b),$e("gamma",e[2].dataType,e[2].dims,b)];u&&E.push($e("beta",e[3].dataType,e[3].dims,b)),h&&E.push($e("bias",e[4].dataType,e[4].dims,b)),E.push(tt("output",e[0].dataType,a,b)),w&&E.push(tt("mean_output",1,p)),f&&E.push(tt("inv_std_output",1,p)),P&&E.push(tt("input_skip_bias_sum",e[0].dataType,a,b));let k=lr(e[0].dataType),B=lr(1,b);return` - - ${g.registerUniforms(M).declareVariables(...E)} - var sum_shared : array<${B}, ${A}>; - var sum_squared_shared : array<${B}, ${A}>; - - ${g.mainStart([A,1,1])} - let ix = local_id.x; - let iy = global_id.x / ${A}; - - let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components; - var stride = hidden_size_vectorized / ${A}; - let offset = ix * stride + iy * hidden_size_vectorized; - let offset1d = stride * ix; - if (ix == ${A-1}) { - stride = hidden_size_vectorized - stride * ix; - } - for (var i: u32 = 0; i < stride; i++) { - let skip_value = skip[offset + i]; - let bias_value = ${h?"bias[offset1d + i]":k+"(0.0)"}; - let input_value = x[offset + i]; - let value = input_value + skip_value + bias_value; - ${P?"input_skip_bias_sum[offset + i] = value;":""} - output[offset + i] = value; - let f32_value = ${Un(k,b,"value")}; - sum_shared[ix] += f32_value; - sum_squared_shared[ix] += f32_value * f32_value; - } - workgroupBarrier(); - - var reduce_size : u32 = ${A}; - for (var curr_size = reduce_size >> 1; curr_size > 0; curr_size = reduce_size >> 1) { - reduce_size = curr_size + (reduce_size & 1); - if (ix < curr_size) { - sum_shared[ix] += sum_shared[ix + reduce_size]; - sum_squared_shared[ix] += sum_squared_shared[ix + reduce_size]; - } - workgroupBarrier(); - } - - let sum = sum_shared[0]; - let square_sum = sum_squared_shared[0]; - let mean = ${Ws("sum",b)} / f32(uniforms.hidden_size); - let inv_std_dev = inverseSqrt(${Ws("square_sum",b)} / f32(uniforms.hidden_size) ${i?"":"- mean * mean"} + uniforms.epsilon); - ${w?"mean_output[global_idx] = mean;":""} - ${f?"inv_std_output[global_idx] = inv_std_dev;":""} - - for (var i: u32 = 0; i < stride; i++) { - output[offset + i] = (output[offset + i] ${i?"":`- ${k}(mean)`}) * - ${k}(inv_std_dev) * gamma[offset1d + i] - ${u?"+ beta[offset1d + i]":""}; - } - }`},T=[{dims:a,dataType:e[0].dataType}];return t>1&&T.push({dims:p,dataType:1}),t>2&&T.push({dims:p,dataType:1}),t>3&&T.push({dims:n,dataType:e[0].dataType}),{name:"SkipLayerNormalization",shaderCache:{hint:`${b};${w};${f};${P}`,inputDependencies:e.map((g,M)=>"type")},getShaderSource:$,getRunData:()=>({outputs:T,dispatchGroup:{x:Math.ceil(l/d)},programUniforms:y})}},Yg=(e,r)=>{Xg(e.inputs);let t=[0];e.outputCount>1&&t.push(-3),e.outputCount>2&&t.push(-3),e.outputCount>3&&t.push(3),e.compute(Jg(e.inputs,r,e.outputCount,!1),{outputs:t})}}),Zg,Ni,ew,Ac,tw,rw,sw,nw,Uv=Ue(()=>{pt(),Mt(),Yt(),xt(),Zg=(e,r)=>{if(!e||e.length<1)throw new Error("too few inputs");if(r.axes.length!==0){if(r.axes.length!==r.starts.length||r.axes.length!==r.ends.length)throw new Error("axes, starts and ends must have the same length")}else if(r.starts.length!==r.ends.length)throw new Error("starts and ends must have the same length");e.slice(1).forEach((t,s)=>{if(e[s+1].dataType!==6&&e[s+1].dataType!==7)throw new Error(`Input ${s} must be an array of int32 or int64`)})},Ni=(e,r)=>{let t=[];if(e.length>r)if(e[r].dataType===7)e[r].getBigInt64Array().forEach(s=>t.push(Number(s)));else if(e[r].dataType===6)e[r].getInt32Array().forEach(s=>t.push(Number(s)));else throw new Error(`Input ${r} must be an array of int32 or int64`);return t},ew=(e,r)=>{if(e.length>1){let t=Ni(e,1),s=Ni(e,2),i=Ni(e,3);return i.length===0&&(i=[...Array(e[0].dims.length).keys()]),Dt({starts:t,ends:s,axes:i})}else return r},Ac=(e,r,t,s,i)=>{let n=e;return e<0&&(n+=t[s[r]]),i[r]<0?Math.max(0,Math.min(n,t[s[r]]-1)):Math.max(0,Math.min(n,t[s[r]]))},tw=(e,r,t)=>`fn calculateInputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} { - var input_indices: ${e.type.indices}; - var carry = 0u; - for (var i = ${t.length}; i >= 0; i--) { - let input_shape_i = ${rt("uniforms.input_shape","i",t.length)}; - let steps_i = ${rt("uniforms.steps","i",t.length)}; - let signs_i = ${rt("uniforms.signs","i",t.length)}; - let starts_i = ${rt("uniforms.starts","i",t.length)}; - var output_index = ${r.indicesGet("output_indices","i")}; - var input_index = output_index * steps_i + starts_i + carry; - carry = input_index / input_shape_i; - input_index = input_index % input_shape_i; - if (signs_i < 0) { - input_index = input_shape_i - input_index - 1u + starts_i; - } - ${e.indicesSet("input_indices","i","input_index")}; - } - return input_indices; - }`,rw=(e,r)=>{let t=e[0].dims,s=xe.size(t),i=r.axes.length>0?xe.normalizeAxes(r.axes,t.length):[...Array(t.length).keys()],n=Ni(e,4);n.forEach(b=>b!==0||(()=>{throw new Error("step cannot be 0")})),n.length===0&&(n=Array(i.length).fill(1));let o=r.starts.map((b,y)=>Ac(b,y,t,i,n)),a=r.ends.map((b,y)=>Ac(b,y,t,i,n));if(i.length!==o.length||i.length!==a.length)throw new Error("start, ends and axes should have the same number of elements");if(i.length!==t.length)for(let b=0;bMath.sign(b));n.forEach((b,y,$)=>{if(b<0){let T=(a[y]-o[y])/b,g=o[y],M=g+T*n[y];o[y]=M,a[y]=g,$[y]=-b}});let d=t.slice(0);i.forEach((b,y)=>{d[b]=Math.ceil((a[b]-o[b])/n[b])});let p={dims:d,dataType:e[0].dataType},u=tt("output",e[0].dataType,d.length),h=$e("input",e[0].dataType,e[0].dims.length),w=xe.size(d),f=[{name:"outputSize",type:"u32"},{name:"starts",type:"u32",length:o.length},{name:"signs",type:"i32",length:l.length},{name:"steps",type:"u32",length:n.length}],P=[{type:12,data:w},{type:12,data:o},{type:6,data:l},{type:12,data:n},...nt(e[0].dims,d)],A=b=>` - ${b.registerUniforms(f).declareVariables(h,u)} - ${tw(h,u,t)} - ${b.mainStart()} - ${b.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} - let output_indices = ${u.offsetToIndices("global_idx")}; - let input_indices = calculateInputIndices(output_indices); - ${u.setByOffset("global_idx",h.getByIndices("input_indices"))} - }`;return{name:"Slice",shaderCache:{hint:`${l.length}_${o.length}_${n.length}`,inputDependencies:["rank"]},getShaderSource:A,getRunData:()=>({outputs:[p],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:P})}},sw=(e,r)=>{Zg(e.inputs,r);let t=ew(e.inputs,r);e.compute(rw(e.inputs,t),{inputs:[0]})},nw=e=>{let r=e.starts,t=e.ends,s=e.axes;return Dt({starts:r,ends:t,axes:s})}}),iw,ow,aw,lw,Vv=Ue(()=>{pt(),Mt(),Yt(),Gs(),xt(),iw=e=>{if(!e||e.length!==1)throw new Error("Softmax op requires 1 input.")},ow=(e,r)=>{let t=e.inputs[0],s=t.dims,i=xe.size(s),n=s.length,o=xe.normalizeAxis(r.axis,n),a=ok),d[o]=n-1,d[n-1]=o,l=e.compute(Nr(t,d),{inputs:[t],outputs:[-1]})[0]):l=t;let p=l.dims,u=p[n-1],h=i/u,w=Xt(u),f=u/w,P=64;h===1&&(P=256);let A=(E,k)=>k===4?`max(max(${E}.x, ${E}.y), max(${E}.z, ${E}.w))`:k===2?`max(${E}.x, ${E}.y)`:k===3?`max(max(${E}.x, ${E}.y), ${E}.z)`:E,b=$e("x",l.dataType,l.dims,w),y=tt("result",l.dataType,l.dims,w),$=b.type.value,T=lr(l.dataType)==="f32"?`var threadMax = ${$}(-3.402823e+38f);`:`var threadMax = ${$}(-65504.0h);`,g=E=>` - var rowMaxShared : ${$}; - var rowSumShared : ${$}; - var threadShared : array<${$}, ${P}>; - - fn getValue(row: i32, col: i32, row_stride: i32) -> ${$} { - let index = row * row_stride + col; - return x[index]; - } - - fn setValue(row: i32, col: i32, row_stride: i32, value: ${$}) { - let index = row * row_stride + col; - result[index] = value; - } - ${E.registerUniform("packedCols","i32").declareVariables(b,y)} - ${E.mainStart(P)} - let gindex = i32(global_idx); - let lindex = i32(local_idx); - const wg = ${P}; - let row = gindex / wg; - let cols = uniforms.packedCols; - let row_stride : i32 = uniforms.packedCols; - - // find the rows max - ${T} - for (var col = lindex; col < cols; col += wg) { - let value = getValue(row, col, row_stride); - threadMax = max(threadMax, value); - } - if (lindex < cols) { - threadShared[lindex] = threadMax; - } - workgroupBarrier(); - - var reduceSize = min(cols, wg); - for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) { - reduceSize = currSize + (reduceSize & 1); - if (lindex < currSize) { - threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]); - } - workgroupBarrier(); - } - if (lindex == 0) { - rowMaxShared = ${$}(${A("threadShared[0]",w)}); - } - workgroupBarrier(); - - // find the rows sum - var threadSum = ${$}(0.0); - for (var col = lindex; col < cols; col += wg) { - let subExp = exp(getValue(row, col, row_stride) - rowMaxShared); - threadSum += subExp; - } - threadShared[lindex] = threadSum; - workgroupBarrier(); - - for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) { - if (lindex < currSize) { - threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize]; - } - workgroupBarrier(); - } - if (lindex == 0) { - rowSumShared = ${$}(${Ws("threadShared[0]",w)}); - } - workgroupBarrier(); - - // calculate final value for each element in the row - for (var col = lindex; col < cols; col += wg) { - let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; - setValue(row, col, row_stride, value); - } - }`,M=e.compute({name:"Softmax",shaderCache:{hint:`${w};${P}`,inputDependencies:["type"]},getRunData:()=>({outputs:[{dims:p,dataType:l.dataType}],dispatchGroup:{x:h},programUniforms:[{type:6,data:f}]}),getShaderSource:g},{inputs:[l],outputs:[a?-1:0]})[0];a&&e.compute(Nr(M,d),{inputs:[M]})},aw=(e,r)=>{iw(e.inputs),ow(e,r)},lw=e=>Dt({axis:e.axis})}),Fc,dw,cw,uw,pw,Wv=Ue(()=>{pt(),Mt(),xt(),Fc=e=>Array.from(e.getBigInt64Array(),Number),dw=e=>{if(!e||e.length!==2)throw new Error("Tile requires 2 inputs.");if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw new Error("Tile only support float, float16, int32, and uint32 data types");if(e[1].dataType!==7)throw new Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw new Error("Tile `repeats` input should be 1-D");if(Fc(e[1]).length!==e[0].dims.length)throw new Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},cw=(e,r)=>{let t=[];for(let s=0;s{let t=e[0].dims,s=r??Fc(e[1]),i=cw(t,s),n=xe.size(i),o=e[0].dataType,a=$e("input",o,t.length),l=tt("output",o,i.length),d=p=>` - const inputShape = ${a.indices(...t)}; - ${p.registerUniform("output_size","u32").declareVariables(a,l)} - ${p.mainStart()} - ${p.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} - let output_indices = ${l.offsetToIndices("global_idx")}; - var input_indices: ${a.type.indices}; - for (var i = 0; i < ${t.length}; i++) { - let input_dim_i = ${a.indicesGet("uniforms.input_shape","i")}; - let input_dim_value = ${l.indicesGet("output_indices","i")} % input_dim_i; - - ${a.indicesSet("input_indices","i","input_dim_value")} - } - ${l.setByOffset("global_idx",a.getByIndices("input_indices"))} - }`;return{name:"Tile",shaderCache:{hint:`${s}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:[{type:12,data:n},...nt(e[0].dims,i)]}),getShaderSource:d}},pw=e=>{dw(e.inputs),e.compute(uw(e.inputs),{inputs:[0]})}}),hw,mw,_w,Gv=Ue(()=>{pt(),Mt(),xt(),hw=(e,r,t,s,i)=>{let n=tt("output_data",i,t.length,4),o=$e("a_data",r[1].dataType,r[1].dims.length,4),a=$e("b_data",r[2].dataType,r[2].dims.length,4),l=$e("c_data",r[0].dataType,r[0].dims.length,4),d,p=(u,h,w)=>`select(${h}, ${u}, ${w})`;if(!s)d=n.setByOffset("global_idx",p(o.getByOffset("global_idx"),a.getByOffset("global_idx"),l.getByOffset("global_idx")));else{let u=(h,w,f="")=>{let P=`a_data[index_a${w}][component_a${w}]`,A=`b_data[index_b${w}][component_b${w}]`,b=`bool(c_data[index_c${w}] & (0xffu << (component_c${w} * 8)))`;return` - let output_indices${w} = ${n.offsetToIndices(`global_idx * 4u + ${w}u`)}; - let offset_a${w} = ${o.broadcastedIndicesToOffset(`output_indices${w}`,n)}; - let offset_b${w} = ${a.broadcastedIndicesToOffset(`output_indices${w}`,n)}; - let offset_c${w} = ${l.broadcastedIndicesToOffset(`output_indices${w}`,n)}; - let index_a${w} = offset_a${w} / 4u; - let index_b${w} = offset_b${w} / 4u; - let index_c${w} = offset_c${w} / 4u; - let component_a${w} = offset_a${w} % 4u; - let component_b${w} = offset_b${w} % 4u; - let component_c${w} = offset_c${w} % 4u; - ${h}[${w}] = ${f}(${p(P,A,b)}); - `};i===9?d=` - var data = vec4(0); - ${u("data",0,"u32")} - ${u("data",1,"u32")} - ${u("data",2,"u32")} - ${u("data",3,"u32")} - output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:d=` - ${u("output_data[global_idx]",0)} - ${u("output_data[global_idx]",1)} - ${u("output_data[global_idx]",2)} - ${u("output_data[global_idx]",3)} - `}return` - ${e.registerUniform("vec_size","u32").declareVariables(l,o,a,n)} - ${e.mainStart()} - ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} - ${d} - }`},mw=e=>{let r=e[1].dims,t=e[2].dims,s=e[0].dims,i=e[1].dataType,n=!(xe.areEqual(r,t)&&xe.areEqual(t,s)),o=r,a=xe.size(r);if(n){let d=Nn.calcShape(Nn.calcShape(r,t,!1),s,!1);if(!d)throw new Error("Can't perform where op on the given tensors");o=d,a=xe.size(o)}let l=Math.ceil(a/4);return{name:"Where",shaderCache:{inputDependencies:["rank","rank","rank"]},getShaderSource:d=>hw(d,e,o,n,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(a/64/4)},programUniforms:[{type:12,data:l},...nt(s,r,t,o)]})}},_w=e=>{e.compute(mw(e.inputs))}}),fw,Kv=Ue(()=>{iv(),Qd(),ov(),av(),lv(),dv(),cv(),_v(),gv(),wv(),yv(),Mv(),bv(),vv(),xv(),Tv(),Ev(),Pv(),Cv(),Sv(),$v(),kv(),Iv(),Av(),Fv(),$f(),Ov(),Dv(),Lv(),zv(),Bv(),Kd(),Rv(),Nv(),jv(),Uv(),Vv(),Lf(),Wv(),Gs(),Zd(),Gv(),fw=new Map([["Abs",[Xh]],["Acos",[Jh]],["Acosh",[Yh]],["Add",[Rm]],["ArgMax",[Dh,qd]],["ArgMin",[Oh,qd]],["Asin",[Zh]],["Asinh",[em]],["Atan",[tm]],["Atanh",[rm]],["Attention",[jh]],["AveragePool",[ug,cg]],["BatchNormalization",[Gh]],["BiasAdd",[qh]],["BiasSplitGelu",[Lm]],["Cast",[nm,sm]],["Ceil",[am]],["Clip",[om]],["Concat",[Zm,e_]],["Conv",[pc,cc]],["ConvTranspose",[C_,T_]],["Cos",[lm]],["Cosh",[dm]],["CumSum",[$_,k_]],["DepthToSpace",[O_,D_]],["DequantizeLinear",[Mg,bg]],["Div",[Nm]],["Einsum",[j_,U_]],["Elu",[cm,Oi]],["Equal",[jm]],["Erf",[um]],["Exp",[pm]],["Expand",[K_]],["FastGelu",[q_]],["Floor",[hm]],["FusedConv",[pc,cc]],["Gather",[Y_,J_]],["GatherElements",[cf,df]],["GatherBlockQuantized",[nf,of]],["GatherND",[ef,tf]],["Gelu",[mm]],["Gemm",[mf,hf]],["GlobalAveragePool",[hg,pg]],["GlobalMaxPool",[gg,fg]],["Greater",[Gm]],["GreaterOrEqual",[Hm]],["GridSample",[xf,Tf]],["GroupQueryAttention",[Rf]],["HardSigmoid",[vm,bm]],["InstanceNormalization",[Uf]],["LayerNormalization",[Gf]],["LeakyRelu",[_m,Oi]],["Less",[Km]],["LessOrEqual",[qm]],["Log",[km]],["MatMul",[Hf]],["MatMulNBits",[Jf,Yf]],["MaxPool",[mg,_g]],["Mul",[Um]],["MultiHeadAttention",[Sf,Pf]],["Neg",[gm]],["Not",[fm]],["Pad",[ag]],["Pow",[Vm]],["QuickGelu",[Fm,Oi]],["Range",[Tg]],["Reciprocal",[wm]],["ReduceMin",[$h]],["ReduceMean",[Th]],["ReduceMax",[Sh]],["ReduceSum",[Ih]],["ReduceProd",[kh]],["ReduceL1",[Eh]],["ReduceL2",[Ph]],["ReduceLogSum",[Fh]],["ReduceLogSumExp",[Ch]],["ReduceSumSquare",[Ah]],["Relu",[ym]],["Resize",[Gg,Kg]],["RotaryEmbedding",[Qg]],["ScatterND",[Sg,Cg]],["Sigmoid",[Mm]],["Sin",[xm]],["Sinh",[Tm]],["Slice",[sw,nw]],["SkipLayerNormalization",[Yg]],["Split",[Of,Df]],["Sqrt",[Em]],["Softmax",[aw,lw]],["Sub",[Wm]],["Tan",[Pm]],["Tanh",[Cm]],["ThresholdedRelu",[$m,Oi]],["Tile",[pw]],["Transpose",[Gp,Kp]],["Where",[_w]]])}),gw,Hv=Ue(()=>{ss(),ks(),xt(),gw=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,r){this.repo.set(e,r)}run(e,r,t,s,i){rs(e.programInfo.name);let n=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let a=[];for(let d of r)a.push({binding:a.length,resource:{buffer:d.buffer}});for(let d of t)a.push({binding:a.length,resource:{buffer:d.buffer}});i&&a.push({binding:a.length,resource:i});let l=n.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:a,label:e.programInfo.name});if(this.backend.sessionStatus==="capturing"){let d={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:l,dispatchGroup:s};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(d)}o.setPipeline(e.computePipeline),o.setBindGroup(0,l),o.dispatchWorkgroups(...s),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(),Hr(e.programInfo.name)}dispose(){}build(e,r){rs(e.name);let t=this.backend.device,s=[];[{feature:"shader-f16",extension:"f16"},{feature:"subgroups",extension:"subgroups"}].forEach(d=>{t.features.has(d.feature)&&s.push(`enable ${d.extension};`)});let i=Rp(r,this.backend.device.limits),n=e.getShaderSource(i),o=`${s.join(` -`)} -${i.additionalImplementations} -${n}`,a=t.createShaderModule({code:o,label:e.name});St("verbose",()=>`[WebGPU] ${e.name} shader code: ${o}`);let l=t.createComputePipeline({compute:{module:a,entryPoint:"main"},layout:"auto",label:e.name});return Hr(e.name),{programInfo:e,computePipeline:l,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let r=typeof e=="number"?e:e.x,t=typeof e=="number"?1:e.y||1,s=typeof e=="number"?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(r<=i&&t<=i&&s<=i)return[r,t,s];let n=r*t*s,o=Math.ceil(Math.sqrt(n));if(o>i){if(o=Math.ceil(Math.cbrt(n)),o>i)throw new Error("Total dispatch size exceeds WebGPU maximum.");return[o,o,o]}else return[o,o,1]}}}),ww,yw,Mw,bw,qv=Ue(()=>{ss(),pt(),ks(),Cp(),sv(),Kv(),Hv(),ww=(e,r)=>{if(r.length!==e.length)throw new Error(`inputDependencies length ${r.length} is not equal to inputTensors length ${e.length}.`);let t=[];for(let s=0;s{var i,n;let s=e.name;return(i=e.shaderCache)!=null&&i.hint&&(s+="["+e.shaderCache.hint+"]"),s+=":"+t+`:${ww(r,((n=e.shaderCache)==null?void 0:n.inputDependencies)??new Array(r.length).fill("dims"))}`,s},Mw=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},bw=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 new 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,r){this.env=e;let t=[],s={requiredLimits:{maxComputeWorkgroupStorageSize:r.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:r.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:r.limits.maxStorageBufferBindingSize,maxBufferSize:r.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:r.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:r.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:r.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:r.limits.maxComputeWorkgroupSizeZ},requiredFeatures:t},i=n=>r.features.has(n)&&t.push(n)&&!0;i("chromium-experimental-timestamp-query-inside-passes")||i("timestamp-query"),i("shader-f16"),i("subgroups"),this.device=await r.requestDevice(s),this.adapterInfo=new Mw(r.info||await r.requestAdapterInfo()),this.gpuDataManager=Ip(this),this.programManager=new gw(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,Ld(e.logLevel,!!e.debug),this.device.onuncapturederror=n=>{n.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${n.error.message}`)},Object.defineProperty(this.env.webgpu,"device",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,"adapter",{value:r,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<"u"&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),r={};this.queryType==="at-passes"&&(r.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(r)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;rs(),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(()=>{var s;let r=new BigUint64Array(e.getMappedRange()),t=this.pendingQueries.get(e);for(let i=0;i"u"&&(this.queryTimeBase=w);let P=Number(w-this.queryTimeBase),A=Number(f-this.queryTimeBase);if(!Number.isSafeInteger(P)||!Number.isSafeInteger(A))throw new RangeError("incorrect timestamp range");if((s=this.env.webgpu.profiling)!=null&&s.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:u.map(b=>({dims:b.dims,dataType:mn(b.dataType)})),outputsMetadata:h.map(b=>({dims:b.dims,dataType:mn(b.dataType)})),kernelId:o,kernelType:l,kernelName:d,programName:p,startTime:P,endTime:A});else{let b="";u.forEach(($,T)=>{b+=`input[${T}]: [${$.dims}] | ${mn($.dataType)}, `});let y="";h.forEach(($,T)=>{y+=`output[${T}]: [${$.dims}] | ${mn($.dataType)}, `}),console.log(`[profiling] kernel "${o}|${l}|${d}|${p}" ${b}${y}execution time: ${A-P} ns`)}ki("GPU",`${p}::${w}::${f}`)}e.unmap(),this.pendingQueries.delete(e)}),Hr()}run(e,r,t,s,i,n){rs(e.name);let o=[];for(let y=0;y$):t;if(p.length!==a.length)throw new Error(`Output size ${p.length} must be equal to ${a.length}.`);let u=[],h=[];for(let y=0;y=n)throw new Error(`Invalid output index: ${p[y]}`);if(p[y]===-3)continue;let $=p[y]===-1,T=p[y]===-2,g=$||T?i(a[y].dataType,a[y].dims):s(p[y],a[y].dataType,a[y].dims);if(u.push(g),g.data===0)continue;let M=this.gpuDataManager.get(g.data);if(!M)throw new Error(`no GPU data for output: ${g.data}`);if($&&this.temporaryData.push(M),T){let E=this.kernelPersistentData.get(this.currentKernelId);E||(E=[],this.kernelPersistentData.set(this.currentKernelId,E)),E.push(M)}h.push(M)}if(o.length!==r.length||h.length!==u.length){if(h.length===0)return Hr(e.name),u;throw new Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let w;if(d){let y=0,$=[];d.forEach(E=>{let k=typeof E.data=="number"?[E.data]:E.data;if(k.length===0)return;let B=E.type===10?2:4,N,J;E.type===10?(J=k.length>4?16:k.length>2?8:k.length*B,N=k.length>4?16:B*k.length):(J=k.length<=2?k.length*B:16,N=16),y=Math.ceil(y/J)*J,$.push(y);let q=E.type===10?8:4;y+=k.length>4?Math.ceil(k.length/q)*N:k.length*B});let T=16;y=Math.ceil(y/T)*T;let g=new ArrayBuffer(y);d.forEach((E,k)=>{let B=$[k],N=typeof E.data=="number"?[E.data]:E.data;if(E.type===6)new Int32Array(g,B,N.length).set(N);else if(E.type===12)new Uint32Array(g,B,N.length).set(N);else if(E.type===10)new Uint16Array(g,B,N.length).set(N);else if(E.type===1)new Float32Array(g,B,N.length).set(N);else throw new Error(`Unsupported uniform type: ${mn(E.type)}`)});let M=this.gpuDataManager.create(y,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(M.buffer,0,g,0,y),this.gpuDataManager.release(M.id),w={offset:0,size:y,buffer:M.buffer}}let f=this.programManager.normalizeDispatchGroupSize(l),P=f[1]===1&&f[2]===1,A=yw(e,r,P),b=this.programManager.getArtifact(A);if(b||(b=this.programManager.build(e,f),this.programManager.setArtifact(A,b),St("info",()=>`[artifact] key: ${A}, programName: ${e.name}`)),d&&b.uniformVariablesInfo){if(d.length!==b.uniformVariablesInfo.length)throw new Error(`Uniform variables count mismatch: expect ${b.uniformVariablesInfo.length}, got ${d.length} in program "${b.programInfo.name}".`);for(let y=0;y`[ProgramManager] run "${e.name}" (key=${A}) with ${f[0]}x${f[1]}x${f[2]}`),this.queryType!=="none"||this.sessionStatus==="capturing"){let y={kernelId:this.currentKernelId,programName:b.programInfo.name,inputTensorViews:r,outputTensorViews:u};this.pendingKernels.push(y),this.sessionStatus==="capturing"&&this.capturedPendingKernels.get(this.currentSessionId).push(y)}return this.programManager.run(b,o,h,f,w),Hr(e.name),u}upload(e,r){this.gpuDataManager.upload(e,r)}memcpy(e,r){this.gpuDataManager.memcpy(e,r)}async download(e,r){await this.gpuDataManager.download(e,r)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,r,t,s){let i=fw.get(e);if(!i)throw new Error(`kernel not implemented: ${e}`);let n={kernelType:e,kernelName:s,kernelEntry:i[0],attributes:[i[1],t]};this.kernels.set(r,n)}releaseKernel(e){let r=this.kernelPersistentData.get(e);if(r){for(let t of r)this.gpuDataManager.release(t.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,r,t){let s=this.kernels.get(e);if(!s)throw new Error(`kernel not created: ${e}`);let i=s.kernelType,n=s.kernelName,o=s.kernelEntry,a=s.attributes;if(this.currentKernelId!==null)throw new Error(`kernel "[${i}] ${n}" is not allowed to be called recursively`);this.currentKernelId=e,a[0]&&(a[1]=a[0](a[1]),a[0]=void 0),St("info",()=>`[WebGPU] Start to run kernel "[${i}] ${n}"...`);let l=this.env.debug;this.temporaryData=[];try{return l&&this.device.pushErrorScope("validation"),o(r,a[1]),0}catch(d){return t.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${n}" failed. ${d}`)),1}finally{l&&t.push(this.device.popErrorScope().then(d=>d?`GPU validation error for kernel "[${i}] ${n}": ${d.message}`:null));for(let d of this.temporaryData)this.gpuDataManager.release(d.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,r,t,s){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let n=i.get(r),o=this.gpuDataManager.registerExternalBuffer(t,s,n);return i.set(r,[o,t]),o}unregisterBuffers(e){let r=this.sessionExternalDataMapping.get(e);r&&(r.forEach(t=>this.gpuDataManager.unregisterExternalBuffer(t[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let r=this.gpuDataManager.get(e);if(!r)throw new Error(`no GPU data for buffer: ${e}`);return r.buffer}createDownloader(e,r,t){return async()=>{let s=await jd(this,e,r);return zd(s.buffer,t)}}writeTimestamp(e){this.queryType==="inside-passes"&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){var e;this.queryType="none",(((e=this.env.webgpu.profiling)==null?void 0:e.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(){St("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(){St("info","captureEnd"),this.flush(),this.sessionStatus="default"}replay(){St("info","replay"),this.sessionStatus="replaying";let e=this.capturedCommandList.get(this.currentSessionId),r=this.capturedPendingKernels.get(this.currentSessionId),t=e.length;this.pendingKernels=[];for(let s=0;s=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()}}}),vw,Oc,xw,Dc,Lc,zc,Tw,Ew,Qv=Ue(()=>{ks(),vw=1,Oc=()=>vw++,xw=new Map([["float32",32],["float16",16],["int32",32],["uint32",32],["int64",64],["uint64",64],["int8",8],["uint8",8],["int4",4],["uint4",4]]),Dc=(e,r)=>{let t=xw.get(e);if(!t)throw new Error("Unsupported data type.");return r.length>0?Math.ceil(r.reduce((s,i)=>s*i)*t/8):0},Lc=class{constructor(e){this.sessionId=e.sessionId,this.mlContext=e.context,this.mlTensor=e.tensor,this.dataType=e.dataType,this.tensorShape=e.shape}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return Dc(this.dataType,this.tensorShape)}destroy(){St("verbose",()=>"[WebNN] TensorWrapper.destroy"),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e){return e?this.mlContext.readTensor(this.mlTensor,e):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,r,t){return this.mlContext===e&&this.dataType===r&&this.tensorShape.length===t.length&&this.tensorShape.every((s,i)=>s===t[i])}},zc=class{constructor(e,r){this.tensorManager=e,this.wrapper=r}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,r,t,s){let i=this.tensorManager.getMLContext(e);if(this.wrapper){if(this.wrapper.canReuseTensor(i,r,t))return this.wrapper.tensor;if(s){if(this.wrapper.byteLength!==Dc(r,t))throw new Error("Unable to copy data to tensor with different size.");this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let n=typeof MLTensorUsage>"u"?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,r,t,n,!0,!0),s&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){if(this.wrapper)if(e.byteLength===this.wrapper.byteLength){this.wrapper.write(e);return}else St("verbose",()=>"Data size does not match tensor size. Releasing tensor."),this.releaseTensor();this.activeUpload?this.activeUpload.set(e):this.activeUpload=new Uint8Array(e)}async download(e){if(this.activeUpload)if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(this.activeUpload):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(this.activeUpload);return}else return this.activeUpload.buffer;if(!this.wrapper)throw new Error("Tensor has not been created.");return e?this.wrapper.read(e):this.wrapper.read()}},Tw=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let r=this.backend.getMLContext(e);if(!r)throw new Error("MLContext not found for session.");return r}reserveTensorId(){let e=Oc();return this.tensorTrackersById.set(e,new zc(this)),e}releaseTensorId(e){let r=this.tensorTrackersById.get(e);r&&(this.tensorTrackersById.delete(e),r.tensorWrapper&&this.releaseTensor(r.tensorWrapper))}async ensureTensor(e,r,t,s,i){St("verbose",()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${r}, dataType: ${t}, shape: ${s}, copyOld: ${i}}`);let n=this.tensorTrackersById.get(r);if(!n)throw new Error("Tensor not found.");return n.ensureTensor(e,t,s,i)}upload(e,r){let t=this.tensorTrackersById.get(e);if(!t)throw new Error("Tensor not found.");t.upload(r)}async download(e,r){St("verbose",()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${r==null?void 0:r.byteLength}}`);let t=this.tensorTrackersById.get(e);if(!t)throw new Error("Tensor not found.");return t.download(r)}releaseTensorsForSession(e){for(let r of this.freeTensors)r.sessionId===e&&r.destroy();this.freeTensors=this.freeTensors.filter(r=>r.sessionId!==e)}registerTensor(e,r,t,s){let i=this.getMLContext(e),n=Oc(),o=new Lc({sessionId:e,context:i,tensor:r,dataType:t,shape:s});return this.tensorTrackersById.set(n,new zc(this,o)),this.externalTensors.add(o),n}async getCachedTensor(e,r,t,s,i,n){let o=this.getMLContext(e);for(let[l,d]of this.freeTensors.entries())if(d.canReuseTensor(o,r,t)){St("verbose",()=>`[WebNN] Reusing tensor {dataType: ${r}, shape: ${t}}`);let p=this.freeTensors.splice(l,1)[0];return p.sessionId=e,p}St("verbose",()=>`[WebNN] MLContext.createTensor {dataType: ${r}, shape: ${t}}`);let a=await o.createTensor({dataType:r,shape:t,dimensions:t,usage:s,writable:i,readable:n});return new Lc({sessionId:e,context:o,tensor:a,dataType:r,shape:t})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},Ew=(...e)=>new Tw(...e)}),Ia,Pw,Cw,Xv=Ue(()=>{pt(),hn(),Cp(),Qv(),ks(),Ia=new Map([[1,"float32"],[10,"float16"],[6,"int32"],[12,"uint32"],[7,"int64"],[13,"uint64"],[22,"int4"],[21,"uint4"],[3,"int8"],[2,"uint8"],[9,"uint8"]]),Pw=(e,r)=>{if(e===r)return!0;if(e===void 0||r===void 0)return!1;let t=Object.keys(e).sort(),s=Object.keys(r).sort();return t.length===s.length&&t.every((i,n)=>i===s[n]&&e[i]===r[i])},Cw=class{constructor(e){this.tensorManager=Ew(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,Ld(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw new Error("No active session");return this.activeSessionId}onRunStart(e){St("verbose",()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){St("verbose",()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let r=this.temporarySessionTensorIds.get(e);if(r){for(let t of r)St("verbose",()=>`[WebNN] releasing temporary tensor {tensorId: ${t}}`),this.tensorManager.releaseTensorId(t);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(s=>s.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let s=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:s}),s}}else if(e===void 0){let t=this.mlContextCache.findIndex(s=>s.options===void 0&&s.gpuDevice===void 0);if(t!==-1)return this.mlContextCache[t].mlContext;{let s=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:s}),s}}let r=this.mlContextCache.findIndex(t=>Pw(t.options,e));if(r!==-1)return this.mlContextCache[r].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,r){this.mlContextBySessionId.set(e,r);let t=this.sessionIdsByMLContext.get(r);t||(t=new Set,this.sessionIdsByMLContext.set(r,t)),t.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let r=this.mlContextBySessionId.get(e);if(!r)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let t=this.sessionIdsByMLContext.get(r);if(t.delete(e),t.size===0){this.sessionIdsByMLContext.delete(r);let s=this.mlContextCache.findIndex(i=>i.mlContext===r);s!==-1&&this.mlContextCache.splice(s,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){St("verbose",()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,r,t,s,i){let n=Ia.get(t);if(!n)throw new Error(`Unsupported ONNX data type: ${t}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,r,n,s,i)}async createTemporaryTensor(e,r,t){St("verbose",()=>`[WebNN] createTemporaryTensor {onnxDataType: ${r}, shape: ${t}}`);let s=Ia.get(r);if(!s)throw new Error(`Unsupported ONNX data type: ${r}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,s,t,!1);let n=this.temporarySessionTensorIds.get(e);return n?n.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,r){if(!ar().shouldTransferToMLTensor)throw new Error("Trying to upload to a MLTensor while shouldTransferToMLTensor is false");St("verbose",()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${r.byteLength}}`),this.tensorManager.upload(e,r)}async downloadTensor(e,r){return this.tensorManager.download(e,r)}createMLTensorDownloader(e,r){return async()=>{let t=await this.tensorManager.download(e);return zd(t,r)}}registerMLTensor(e,r,t,s){let i=Ia.get(t);if(!i)throw new Error(`Unsupported ONNX data type: ${t}`);let n=this.tensorManager.registerTensor(e,r,i,s);return St("verbose",()=>`[WebNN] registerMLTensor {tensor: ${r}, dataType: ${i}, dimensions: ${s}} -> {tensorId: ${n}}`),n}registerMLConstant(e,r,t,s,i,n){if(!n)throw new Error("External mounted files are not available.");let o=e;e.startsWith("./")&&(o=e.substring(2));let a=n.get(o);if(!a)throw new Error(`File with name ${o} not found in preloaded files.`);if(r+t>a.byteLength)throw new Error("Out of bounds: data offset and length exceed the external file data size.");let l=a.slice(r,r+t).buffer,d;switch(i.dataType){case"float32":d=new Float32Array(l);break;case"float16":d=typeof Float16Array<"u"&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case"int32":d=new Int32Array(l);break;case"uint32":d=new Uint32Array(l);break;case"int64":d=new BigInt64Array(l);break;case"uint64":d=new BigUint64Array(l);break;case"int8":d=new Int8Array(l);break;case"int4":case"uint4":case"uint8":d=new Uint8Array(l);break;default:throw new Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return St("verbose",()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}}`),s.constant(i,d)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,r){let t=this.sessionGraphInputs.get(e);return t?t.includes(r):!1}flush(){}}}),Sw={};Ci(Sw,{init:()=>kw});var Aa,$w,kw,Jv=Ue(()=>{pt(),qv(),ks(),Mt(),Xv(),Aa=class yb{constructor(r,t,s,i){this.module=r,this.dataType=t,this.data=s,this.dims=i}getFloat32Array(){if(this.dataType!==1)throw new Error("Invalid data type");let r=xe.size(this.dims);return r===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,r)}getBigInt64Array(){if(this.dataType!==7)throw new Error("Invalid data type");let r=xe.size(this.dims);return r===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,r)}getInt32Array(){if(this.dataType!==6)throw new Error("Invalid data type");let r=xe.size(this.dims);return r===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,r)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw new Error("Invalid data type");let r=xe.size(this.dims);return r===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,r)}reshape(r){if(xe.size(r)!==xe.size(this.dims))throw new Error("Invalid new shape");return new yb(this.module,this.dataType,this.data,r)}},$w=class{constructor(e,r,t){this.module=e,this.backend=r,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=r.adapterInfo;let s=e.PTR_SIZE,i=t/e.PTR_SIZE,n=s===4?"i32":"i64";this.opKernelContext=Number(e.getValue(s*i++,n));let o=Number(e.getValue(s*i++,n));this.outputCount=Number(e.getValue(s*i++,n)),this.customDataOffset=Number(e.getValue(s*i++,"*")),this.customDataSize=Number(e.getValue(s*i++,n));let a=[];for(let l=0;ltypeof a=="number"?this.inputs[a]:a))??this.inputs,s=(r==null?void 0:r.outputs)??[],i=(a,l,d)=>new Aa(this.module,l,this.output(a,d),d),n=(a,l)=>{let d=_n(a,l);if(!d)throw new Error(`Unsupported data type: ${a}`);let p=d>0?this.backend.gpuDataManager.create(d).id:0;return new Aa(this.module,a,p,l)};return this.backend.run(e,t,s,i,n,this.outputCount)}output(e,r){let t=this.module.stackSave();try{let s=this.module.PTR_SIZE,i=s===4?"i32":"i64",n=this.module.stackAlloc((1+r.length)*s);this.module.setValue(n,r.length,i);for(let o=0;o{let i=r.jsepInit;if(!i)throw new Error("Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.");if(e==="webgpu"){let n=new bw;await n.initialize(t,s),i("webgpu",[n,o=>n.alloc(Number(o)),o=>n.free(o),(o,a,l,d=!1)=>{if(d)St("verbose",()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(o)}, dst=${Number(a)}, size=${Number(l)}`),n.memcpy(Number(o),Number(a));else{St("verbose",()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(o)}, gpuDataId=${Number(a)}, size=${Number(l)}`);let p=r.HEAPU8.subarray(Number(o>>>0),Number(o>>>0)+Number(l));n.upload(Number(a),p)}},async(o,a,l)=>{St("verbose",()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${o}, dataOffset=${a}, size=${l}`),await n.download(Number(o),()=>r.HEAPU8.subarray(Number(a)>>>0,Number(a+l)>>>0))},(o,a,l)=>n.createKernel(o,Number(a),l,r.UTF8ToString(r._JsepGetNodeName(Number(a)))),o=>n.releaseKernel(o),(o,a,l,d)=>{St("verbose",()=>`[WebGPU] jsepRun: sessionHandle=${l}, kernel=${o}, contextDataOffset=${a}`);let p=new $w(r,n,Number(a));return n.computeKernel(Number(o),p,d)},()=>n.captureBegin(),()=>n.captureEnd(),()=>n.replay()])}else{let n=new Cw(t);i("webnn",[n,()=>n.reserveTensorId(),o=>n.releaseTensorId(o),async(o,a,l,d,p)=>n.ensureTensor(o,a,l,d,p),(o,a)=>{n.uploadTensor(o,a)},async(o,a)=>n.downloadTensor(o,a)])}}}),Iw,Bc,Rc,Ks,Aw,Fa,Nc,jc,Uc,Vc,Wc,Gc,Fw=Ue(()=>{tv(),rv(),pt(),hn(),kd(),bp(),Iw=(e,r)=>{ar()._OrtInit(e,r)!==0&&At("Can't initialize onnxruntime.")},Bc=async e=>{Iw(e.wasm.numThreads,ya(e.logLevel))},Rc=async(e,r)=>{{let t=(Jv(),ma(Sw)).init;if(r==="webgpu"){if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not supported in current environment");let s=e.webgpu.adapter;if(s){if(typeof s.limits!="object"||typeof s.features!="object"||typeof s.requestDevice!="function")throw new Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let i=e.webgpu.powerPreference;if(i!==void 0&&i!=="low-power"&&i!=="high-performance")throw new Error(`Invalid powerPreference setting: "${i}"`);let n=e.webgpu.forceFallbackAdapter;if(n!==void 0&&typeof n!="boolean")throw new Error(`Invalid forceFallbackAdapter setting: "${n}"`);if(s=await navigator.gpu.requestAdapter({powerPreference:i,forceFallbackAdapter:n}),!s)throw new Error('Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.')}await t("webgpu",ar(),e,s)}if(r==="webnn"){if(typeof navigator>"u"||!navigator.ml)throw new Error("WebNN is not supported in current environment");await t("webnn",ar(),e)}}},Ks=new Map,Aw=e=>{let r=ar(),t=r.stackSave();try{let s=r.PTR_SIZE,i=r.stackAlloc(2*s);r._OrtGetInputOutputCount(e,i,i+s)!==0&&At("Can't get session input/output count.");let n=s===4?"i32":"i64";return[Number(r.getValue(i,n)),Number(r.getValue(i+s,n))]}finally{r.stackRestore(t)}},Fa=e=>{let r=ar(),t=r._malloc(e.byteLength);if(t===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return r.HEAPU8.set(e,t),[t,e.byteLength]},Nc=async(e,r)=>{var u,h,w;let t,s,i=ar();Array.isArray(e)?[t,s]=e:e.buffer===i.HEAPU8.buffer?[t,s]=[e.byteOffset,e.byteLength]:[t,s]=Fa(e);let n=0,o=0,a=0,l=[],d=[],p=[];try{if([o,l]=Mp(r),(r==null?void 0:r.externalData)&&i.mountExternalData){let g=[];for(let M of r.externalData){let E=typeof M=="string"?M:M.path;g.push(Dd(typeof M=="string"?M:M.data).then(k=>{i.mountExternalData(E,k)}))}await Promise.all(g)}for(let g of(r==null?void 0:r.executionProviders)??[])if((typeof g=="string"?g:g.name)==="webnn"){if(i.shouldTransferToMLTensor=!1,typeof g!="string"){let M=g,E=M==null?void 0:M.context,k=M==null?void 0:M.gpuDevice,B=M==null?void 0:M.deviceType,N=M==null?void 0:M.powerPreference;E?i.currentContext=E:k?i.currentContext=await i.jsepCreateMLContext(k):i.currentContext=await i.jsepCreateMLContext({deviceType:B,powerPreference:N})}else i.currentContext=await i.jsepCreateMLContext();break}n=await i._OrtCreateSession(t,s,o),n===0&&At("Can't create a session."),(u=i.jsepOnCreateSession)==null||u.call(i),i.currentContext&&(i.jsepRegisterMLContext(n,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[f,P]=Aw(n),A=!!(r!=null&&r.enableGraphCapture),b=[],y=[],$=[];for(let g=0;gg==="gpu-buffer"||g==="ml-tensor")&&(a=i._OrtCreateBinding(n),a===0&&At("Can't create IO binding."),T={handle:a,outputPreferredLocations:$,outputPreferredLocationsEncoded:$.map(g=>Od(g))}),Ks.set(n,[n,d,p,T,A,!1]),[n,b,y]}catch(f){throw d.forEach(P=>i._OrtFree(P)),p.forEach(P=>i._OrtFree(P)),a!==0&&i._OrtReleaseBinding(a)!==0&&At("Can't release IO binding."),n!==0&&i._OrtReleaseSession(n)!==0&&At("Can't release session."),f}finally{i._free(t),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&At("Can't release session options."),l.forEach(f=>i._free(f)),(w=i.unmountExternalData)==null||w.call(i)}},jc=e=>{var l;let r=ar(),t=Ks.get(e);if(!t)throw new Error(`cannot release session. invalid session id: ${e}`);let[s,i,n,o,a]=t;o&&(a&&r._OrtClearBoundOutputs(o.handle)!==0&&At("Can't clear bound outputs."),r._OrtReleaseBinding(o.handle)!==0&&At("Can't release IO binding.")),(l=r.jsepOnReleaseSession)==null||l.call(r,e),i.forEach(d=>r._OrtFree(d)),n.forEach(d=>r._OrtFree(d)),r._OrtReleaseSession(s)!==0&&At("Can't release session."),Ks.delete(e)},Uc=async(e,r,t,s,i,n=!1)=>{if(!e){r.push(0);return}let o=ar(),a=o.PTR_SIZE,l=e[0],d=e[1],p=e[3],u=p,h,w;if(l==="string"&&(p==="gpu-buffer"||p==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(n&&p!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${i} when enableGraphCapture is true.`);if(p==="gpu-buffer"){let A=e[2].gpuBuffer;w=_n(Rn(l),d);let b=o.jsepRegisterBuffer;if(!b)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');h=b(s,i,A,w)}else if(p==="ml-tensor"){let A=e[2].mlTensor;w=_n(Rn(l),d);let b=o.jsepRegisterMLTensor;if(!b)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');h=b(s,A,Rn(l),d)}else{let A=e[2];if(Array.isArray(A)){w=a*A.length,h=o._malloc(w),t.push(h);for(let b=0;bo.setValue(P+y*a,b,a===4?"i32":"i64"));let A=o._OrtCreateTensor(Rn(l),h,w,P,d.length,Od(u));A===0&&At(`Can't create tensor for input/output. session=${s}, index=${i}.`),r.push(A)}finally{o.stackRestore(f)}},Vc=async(e,r,t,s,i,n)=>{var J,q,V;let o=ar(),a=o.PTR_SIZE,l=Ks.get(e);if(!l)throw new Error(`cannot run inference. invalid session id: ${e}`);let d=l[0],p=l[1],u=l[2],h=l[3],w=l[4],f=l[5],P=r.length,A=s.length,b=0,y=[],$=[],T=[],g=[],M=o.stackSave(),E=o.stackAlloc(P*a),k=o.stackAlloc(P*a),B=o.stackAlloc(A*a),N=o.stackAlloc(A*a);try{[b,y]=_p(n);for(let Q=0;QMe*K,1);R=mn(ne);let He=h==null?void 0:h.outputPreferredLocations[s[Q]];if(R==="string"){if(He==="gpu-buffer"||He==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let Me=[];for(let K=0;K0){let Me=o.jsepGetBuffer;if(!Me)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let K=Me(O),U=_n(ne,ke);if(U===void 0||!Ad(R))throw new Error(`Unsupported data type: ${R}`);we=!0,H.push([R,_e,{gpuBuffer:K,download:o.jsepCreateDownloader(K,U,R),dispose:()=>{o._OrtReleaseTensor(ie)!==0&&At("Can't release tensor.")}},"gpu-buffer"])}else if(He==="ml-tensor"&&ke>0){let Me=o.jsepEnsureTensor;if(!Me)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(_n(ne,ke)===void 0||!Fd(R))throw new Error(`Unsupported data type: ${R}`);let K=await Me(e,O,ne,_e,!1);we=!0,H.push([R,_e,{mlTensor:K,download:o.jsepCreateMLTensorDownloader(O,R),dispose:()=>{o.jsepReleaseTensorId(O),o._OrtReleaseTensor(ie)}},"ml-tensor"])}else{let Me=Id(R),K=new Me(ke);new Uint8Array(K.buffer,K.byteOffset,K.byteLength).set(o.HEAPU8.subarray(O,O+K.byteLength)),H.push([R,_e,K,"cpu"])}}finally{o.stackRestore(le),R==="string"&&O&&o._free(O),we||o._OrtReleaseTensor(ie),(V=o.jsepOnRunEnd)==null||V.call(o,d)}}return h&&!w&&(o._OrtClearBoundOutputs(h.handle)!==0&&At("Can't clear bound outputs."),Ks.set(e,[d,p,u,h,w,!1])),H}finally{o.stackRestore(M),$.forEach(Y=>o._OrtReleaseTensor(Y)),T.forEach(Y=>o._OrtReleaseTensor(Y)),g.forEach(Y=>o._free(Y)),b!==0&&o._OrtReleaseRunOptions(b),y.forEach(Y=>o._free(Y))}},Wc=e=>{let r=ar(),t=Ks.get(e);if(!t)throw new Error("invalid session id");let s=t[0],i=r._OrtEndProfiling(s);i===0&&At("Can't get an profile file name."),r._OrtFree(i)},Gc=e=>{let r=[];for(let t of e){let s=t[2];!Array.isArray(s)&&"buffer"in s&&r.push(s.buffer)}return r}}),Hs,Or,Vn,ji,Ui,Oa,Kc,Da,vn,xn,Ow,Dw,Lw,zw,Bw,Rw,Nw,jw,Uw=Ue(()=>{ss(),Fw(),hn(),Pd(),Hs=()=>!!Vt.wasm.proxy&&typeof document<"u",Vn=!1,ji=!1,Ui=!1,Da=new Map,vn=(e,r)=>{let t=Da.get(e);t?t.push(r):Da.set(e,[r])},xn=()=>{if(Vn||!ji||Ui||!Or)throw new Error("worker not ready")},Ow=e=>{switch(e.data.type){case"init-wasm":Vn=!1,e.data.err?(Ui=!0,Kc[1](e.data.err)):(ji=!0,Kc[0]()),Oa&&(URL.revokeObjectURL(Oa),Oa=void 0);break;case"init-ep":case"copy-from":case"create":case"release":case"run":case"end-profiling":{let r=Da.get(e.data.type);e.data.err?r.shift()[1](e.data.err):r.shift()[0](e.data.out);break}}},Dw=async()=>{if(!ji){if(Vn)throw new Error("multiple calls to 'initWasm()' detected.");if(Ui)throw new Error("previous call to 'initWasm()' failed.");if(Vn=!0,Hs())return new Promise((e,r)=>{Or==null||Or.terminate(),up().then(([t,s])=>{try{Or=s,Or.onerror=n=>r(n),Or.onmessage=Ow,Kc=[e,r];let i={type:"init-wasm",in:Vt};!i.in.wasm.wasmPaths&&(t||vd)&&(i.in.wasm.wasmPaths={wasm:new URL("/assets/ort-wasm-simd-threaded.jsep-BAR87mbD.wasm",self.location.href).href}),Or.postMessage(i),Oa=t}catch(i){r(i)}},r)});try{await $d(Vt.wasm),await Bc(Vt),ji=!0}catch(e){throw Ui=!0,e}finally{Vn=!1}}},Lw=async e=>{if(Hs())return xn(),new Promise((r,t)=>{vn("init-ep",[r,t]);let s={type:"init-ep",in:{epName:e,env:Vt}};Or.postMessage(s)});await Rc(Vt,e)},zw=async e=>Hs()?(xn(),new Promise((r,t)=>{vn("copy-from",[r,t]);let s={type:"copy-from",in:{buffer:e}};Or.postMessage(s,[e.buffer])})):Fa(e),Bw=async(e,r)=>{if(Hs()){if(r!=null&&r.preferredOutputLocation)throw new Error('session option "preferredOutputLocation" is not supported for proxy.');return xn(),new Promise((t,s)=>{vn("create",[t,s]);let i={type:"create",in:{model:e,options:{...r}}},n=[];e instanceof Uint8Array&&n.push(e.buffer),Or.postMessage(i,n)})}else return Nc(e,r)},Rw=async e=>{if(Hs())return xn(),new Promise((r,t)=>{vn("release",[r,t]);let s={type:"release",in:e};Or.postMessage(s)});jc(e)},Nw=async(e,r,t,s,i,n)=>{if(Hs()){if(t.some(o=>o[3]!=="cpu"))throw new Error("input tensor on GPU is not supported for proxy.");if(i.some(o=>o))throw new Error("pre-allocated output tensor is not supported for proxy.");return xn(),new Promise((o,a)=>{vn("run",[o,a]);let l=t,d={type:"run",in:{sessionId:e,inputIndices:r,inputs:l,outputIndices:s,options:n}};Or.postMessage(d,Gc(l))})}else return Vc(e,r,t,s,i,n)},jw=async e=>{if(Hs())return xn(),new Promise((r,t)=>{vn("end-profiling",[r,t]);let s={type:"end-profiling",in:e};Or.postMessage(s)});Wc(e)}}),Hc,Vw,Ww,Yv=Ue(()=>{ss(),Uw(),pt(),fd(),bp(),Hc=(e,r)=>{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 new Error(`invalid data location: ${e.location} for ${r()}`)}},Vw=e=>{switch(e[3]){case"cpu":return new ts(e[0],e[2],e[1]);case"gpu-buffer":{let r=e[0];if(!Ad(r))throw new Error(`not supported data type: ${r} for deserializing GPU tensor`);let{gpuBuffer:t,download:s,dispose:i}=e[2];return ts.fromGpuBuffer(t,{dataType:r,dims:e[1],download:s,dispose:i})}case"ml-tensor":{let r=e[0];if(!Fd(r))throw new Error(`not supported data type: ${r} for deserializing MLTensor tensor`);let{mlTensor:t,download:s,dispose:i}=e[2];return ts.fromMLTensor(t,{dataType:r,dims:e[1],download:s,dispose:i})}default:throw new Error(`invalid data location: ${e[3]}`)}},Ww=class{async fetchModelAndCopyToWasmMemory(e){return zw(await Dd(e))}async loadModel(e,r){rs();let t;typeof e=="string"?t=await this.fetchModelAndCopyToWasmMemory(e):t=e,[this.sessionId,this.inputNames,this.outputNames]=await Bw(t,r),Hr()}async dispose(){return Rw(this.sessionId)}async run(e,r,t){rs();let s=[],i=[];Object.entries(e).forEach(u=>{let h=u[0],w=u[1],f=this.inputNames.indexOf(h);if(f===-1)throw new Error(`invalid input '${h}'`);s.push(w),i.push(f)});let n=[],o=[];Object.entries(r).forEach(u=>{let h=u[0],w=u[1],f=this.outputNames.indexOf(h);if(f===-1)throw new Error(`invalid output '${h}'`);n.push(w),o.push(f)});let a=s.map((u,h)=>Hc(u,()=>`input "${this.inputNames[i[h]]}"`)),l=n.map((u,h)=>u?Hc(u,()=>`output "${this.outputNames[o[h]]}"`):null),d=await Nw(this.sessionId,i,a,o,l,t),p={};for(let u=0;uQc,initializeFlags:()=>qc,wasmBackend:()=>Kw});var qc,Qc,Kw,Zv=Ue(()=>{ss(),Uw(),Yv(),qc=()=>{if((typeof Vt.wasm.initTimeout!="number"||Vt.wasm.initTimeout<0)&&(Vt.wasm.initTimeout=0),Vt.wasm.simd===!1&&console.warn('Deprecated property "env.wasm.simd" is set to false. non-SIMD build is no longer provided, and this setting will be ignored.'),typeof Vt.wasm.proxy!="boolean"&&(Vt.wasm.proxy=!1),typeof Vt.wasm.trace!="boolean"&&(Vt.wasm.trace=!1),typeof Vt.wasm.numThreads!="number"||!Number.isInteger(Vt.wasm.numThreads)||Vt.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)Vt.wasm.numThreads=1;else{let e=typeof navigator>"u"?Bb("node:os").cpus().length:navigator.hardwareConcurrency;Vt.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Qc=class{async init(e){qc(),await Dw(),await Lw(e)}async createInferenceSessionHandler(e,r){let t=new Ww;return await t.loadModel(e,r),Promise.resolve(t)}},Kw=new Qc});ss(),ss(),ss();var ex="1.22.0-dev.20250306-ccf8fdd9ea",tx=ep;{let e=(Zv(),ma(Gw)).wasmBackend;un("webgpu",e,5),un("webnn",e,5),un("cpu",e,10),un("wasm",e,10)}Object.defineProperty(Vt.versions,"web",{value:ex,enumerable:!0});/** -* @license -* Copyright 2021 Google LLC. All Rights Reserved. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============================================================================= -*//** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - *//** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */var rx=Object.freeze({__proto__:null,get InferenceSession(){return _d},get TRACE(){return ki},get TRACE_FUNC_BEGIN(){return rs},get TRACE_FUNC_END(){return Hr},get Tensor(){return ts},default:tx,get env(){return Vt},get registerBackend(){return un}}),As={},sx={"onnxruntime-common":e=>{e.exports=Ob},"onnxruntime-web":e=>{e.exports=rx},"?2ce3":()=>{},"?7a2c":()=>{},"?a42a":()=>{},"?2b25":()=>{},"?569f":()=>{},"?3f59":()=>{},"?154a":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(e,r,t)=>{t.r(r),t.d(r,{Environment:()=>Ae,Interpreter:()=>Ie,Template:()=>Ve,parse:()=>R,tokenize:()=>u});var s=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",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator",Macro:"Macro",EndMacro:"EndMacro"}),i=Object.freeze({set:s.Set,for:s.For,in:s.In,is:s.Is,if:s.If,else:s.Else,endif:s.EndIf,elif:s.ElseIf,endfor:s.EndFor,and:s.And,or:s.Or,not:s.Not,"not in":s.NotIn,macro:s.Macro,endmacro:s.EndMacro,true:s.BooleanLiteral,false:s.BooleanLiteral,none:s.NullLiteral,True:s.BooleanLiteral,False:s.BooleanLiteral,None:s.NullLiteral}),n=class{constructor(D,Z){this.value=D,this.type=Z}};function o(D){return/\w/.test(D)}function a(D){return/[0-9]/.test(D)}var l=[["{%",s.OpenStatement],["%}",s.CloseStatement],["{{",s.OpenExpression],["}}",s.CloseExpression],["(",s.OpenParen],[")",s.CloseParen],["{",s.OpenCurlyBracket],["}",s.CloseCurlyBracket],["[",s.OpenSquareBracket],["]",s.CloseSquareBracket],[",",s.Comma],[".",s.Dot],[":",s.Colon],["|",s.Pipe],["<=",s.ComparisonBinaryOperator],[">=",s.ComparisonBinaryOperator],["==",s.ComparisonBinaryOperator],["!=",s.ComparisonBinaryOperator],["<",s.ComparisonBinaryOperator],[">",s.ComparisonBinaryOperator],["+",s.AdditiveBinaryOperator],["-",s.AdditiveBinaryOperator],["*",s.MultiplicativeBinaryOperator],["/",s.MultiplicativeBinaryOperator],["%",s.MultiplicativeBinaryOperator],["=",s.Equals]],d=new Map([["n",` -`],["t"," "],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]);function p(D,Z={}){return D.endsWith(` -`)&&(D=D.slice(0,-1)),D=D.replace(/{#.*?#}/gs,"{##}"),Z.lstrip_blocks&&(D=D.replace(/^[ \t]*({[#%])/gm,"$1")),Z.trim_blocks&&(D=D.replace(/([#%]})\n/g,"$1")),D.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}function u(D,Z={}){var ve,Re,Fe;const z=[],ee=p(D,Z);let ce=0;const be=je=>{let Qe="";for(;je(ee[ce]);){if(ee[ce]==="\\"){if(++ce,ce>=ee.length)throw new SyntaxError("Unexpected end of input");const Xe=ee[ce++],ut=d.get(Xe);if(ut===void 0)throw new SyntaxError(`Unexpected escaped character: ${Xe}`);Qe+=ut;continue}if(Qe+=ee[ce++],ce>=ee.length)throw new SyntaxError("Unexpected end of input")}return Qe};e:for(;ce0){z.push(new n(Xe,s.Text));continue}}be(Xe=>/\s/.test(Xe));const Qe=ee[ce];if(Qe==="-"||Qe==="+"){const Xe=(Re=z.at(-1))==null?void 0:Re.type;if(Xe===s.Text||Xe===void 0)throw new SyntaxError(`Unexpected character: ${Qe}`);switch(Xe){case s.Identifier:case s.NumericLiteral:case s.BooleanLiteral:case s.NullLiteral:case s.StringLiteral:case s.CloseParen:case s.CloseSquareBracket:break;default:{++ce;const ut=be(a);z.push(new n(`${Qe}${ut}`,ut.length>0?s.NumericLiteral:s.UnaryOperator));continue}}}for(const[Xe,ut]of l)if(ee.slice(ce,ce+Xe.length)===Xe){z.push(new n(Xe,ut)),ce+=Xe.length;continue e}if(Qe==="'"||Qe==='"'){++ce;const Xe=be(ut=>ut!==Qe);z.push(new n(Xe,s.StringLiteral)),++ce;continue}if(a(Qe)){const Xe=be(a);z.push(new n(Xe,s.NumericLiteral));continue}if(o(Qe)){const Xe=be(o),ut=Object.hasOwn(i,Xe)?i[Xe]:s.Identifier;ut===s.In&&((Fe=z.at(-1))==null?void 0:Fe.type)===s.Not?(z.pop(),z.push(new n("not in",s.NotIn))):z.push(new n(Xe,ut));continue}throw new SyntaxError(`Unexpected character: ${Qe}`)}return z}var h=class{constructor(){re(this,"type","Statement")}},w=class extends h{constructor(Z){super();re(this,"type","Program");this.body=Z}},f=class extends h{constructor(Z,z,ee){super();re(this,"type","If");this.test=Z,this.body=z,this.alternate=ee}},P=class extends h{constructor(Z,z,ee,ce){super();re(this,"type","For");this.loopvar=Z,this.iterable=z,this.body=ee,this.defaultBlock=ce}},A=class extends h{constructor(Z,z){super();re(this,"type","Set");this.assignee=Z,this.value=z}},b=class extends h{constructor(Z,z,ee){super();re(this,"type","Macro");this.name=Z,this.args=z,this.body=ee}},y=class extends h{constructor(){super(...arguments);re(this,"type","Expression")}},$=class extends y{constructor(Z,z,ee){super();re(this,"type","MemberExpression");this.object=Z,this.property=z,this.computed=ee}},T=class extends y{constructor(Z,z){super();re(this,"type","CallExpression");this.callee=Z,this.args=z}},g=class extends y{constructor(Z){super();re(this,"type","Identifier");this.value=Z}},M=class extends y{constructor(Z){super();re(this,"type","Literal");this.value=Z}},E=class extends M{constructor(){super(...arguments);re(this,"type","NumericLiteral")}},k=class extends M{constructor(){super(...arguments);re(this,"type","StringLiteral")}},B=class extends M{constructor(){super(...arguments);re(this,"type","BooleanLiteral")}},N=class extends M{constructor(){super(...arguments);re(this,"type","NullLiteral")}},J=class extends M{constructor(){super(...arguments);re(this,"type","ArrayLiteral")}},q=class extends M{constructor(){super(...arguments);re(this,"type","TupleLiteral")}},V=class extends M{constructor(){super(...arguments);re(this,"type","ObjectLiteral")}},Y=class extends y{constructor(Z,z,ee){super();re(this,"type","BinaryExpression");this.operator=Z,this.left=z,this.right=ee}},H=class extends y{constructor(Z,z){super();re(this,"type","FilterExpression");this.operand=Z,this.filter=z}},Q=class extends y{constructor(Z,z){super();re(this,"type","SelectExpression");this.iterable=Z,this.test=z}},ie=class extends y{constructor(Z,z,ee){super();re(this,"type","TestExpression");this.operand=Z,this.negate=z,this.test=ee}},le=class extends y{constructor(Z,z){super();re(this,"type","UnaryExpression");this.operator=Z,this.argument=z}},ae=class extends y{constructor(Z=void 0,z=void 0,ee=void 0){super();re(this,"type","SliceExpression");this.start=Z,this.stop=z,this.step=ee}},we=class extends y{constructor(Z,z){super();re(this,"type","KeywordArgumentExpression");this.key=Z,this.value=z}};function R(D){const Z=new w([]);let z=0;function ee(Be,et){const it=D[z++];if(!it||it.type!==Be)throw new Error(`Parser Error: ${et}. ${it.type} !== ${Be}.`);return it}function ce(){switch(D[z].type){case s.Text:return Re();case s.OpenStatement:return Fe();case s.OpenExpression:return je();default:throw new SyntaxError(`Unexpected token type: ${D[z].type}`)}}function be(...Be){return z+Be.length<=D.length&&Be.some((et,it)=>et!==D[z+it].type)}function ve(...Be){return z+Be.length<=D.length&&Be.every((et,it)=>et===D[z+it].type)}function Re(){return new k(ee(s.Text,"Expected text token").value)}function Fe(){ee(s.OpenStatement,"Expected opening statement token");let Be;switch(D[z].type){case s.Set:++z,Be=Qe(),ee(s.CloseStatement,"Expected closing statement token");break;case s.If:++z,Be=Xe(),ee(s.OpenStatement,"Expected {% token"),ee(s.EndIf,"Expected endif token"),ee(s.CloseStatement,"Expected %} token");break;case s.Macro:++z,Be=ut(),ee(s.OpenStatement,"Expected {% token"),ee(s.EndMacro,"Expected endmacro token"),ee(s.CloseStatement,"Expected %} token");break;case s.For:++z,Be=nr(),ee(s.OpenStatement,"Expected {% token"),ee(s.EndFor,"Expected endfor token"),ee(s.CloseStatement,"Expected %} token");break;default:throw new SyntaxError(`Unknown statement type: ${D[z].type}`)}return Be}function je(){ee(s.OpenExpression,"Expected opening expression token");const Be=jt();return ee(s.CloseExpression,"Expected closing expression token"),Be}function Qe(){const Be=jt();if(ve(s.Equals)){++z;const et=Qe();return new A(Be,et)}return Be}function Xe(){var rr,zt,Ir,ps,hs,Er,ms,_s;const Be=jt();ee(s.CloseStatement,"Expected closing statement token");const et=[],it=[];for(;!(((rr=D[z])==null?void 0:rr.type)===s.OpenStatement&&(((zt=D[z+1])==null?void 0:zt.type)===s.ElseIf||((Ir=D[z+1])==null?void 0:Ir.type)===s.Else||((ps=D[z+1])==null?void 0:ps.type)===s.EndIf));)et.push(ce());if(((hs=D[z])==null?void 0:hs.type)===s.OpenStatement&&((Er=D[z+1])==null?void 0:Er.type)!==s.EndIf)if(++z,ve(s.ElseIf))ee(s.ElseIf,"Expected elseif token"),it.push(Xe());else for(ee(s.Else,"Expected else token"),ee(s.CloseStatement,"Expected closing statement token");!(((ms=D[z])==null?void 0:ms.type)===s.OpenStatement&&((_s=D[z+1])==null?void 0:_s.type)===s.EndIf);)it.push(ce());return new f(Be,et,it)}function ut(){const Be=mr();if(Be.type!=="Identifier")throw new SyntaxError("Expected identifier following macro statement");const et=qr();ee(s.CloseStatement,"Expected closing statement token");const it=[];for(;be(s.OpenStatement,s.EndMacro);)it.push(ce());return new b(Be,et,it)}function wt(Be=!1){const et=Be?mr:jt,it=[et()],rr=ve(s.Comma);for(;rr&&(++z,it.push(et()),!!ve(s.Comma)););return rr?new q(it):it[0]}function nr(){const Be=wt(!0);if(!(Be instanceof g||Be instanceof q))throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${Be.type} instead`);ee(s.In,"Expected `in` keyword following loop variable");const et=jt();ee(s.CloseStatement,"Expected closing statement token");const it=[];for(;be(s.OpenStatement,s.EndFor)&&be(s.OpenStatement,s.Else);)it.push(ce());const rr=[];if(ve(s.OpenStatement,s.Else))for(++z,++z,ee(s.CloseStatement,"Expected closing statement token");be(s.OpenStatement,s.EndFor);)rr.push(ce());return new P(Be,et,it,rr)}function jt(){return dr()}function dr(){const Be=ds();if(ve(s.If)){++z;const et=ds();if(ve(s.Else)){++z;const it=ds();return new f(et,[Be],[it])}else return new Q(Be,et)}return Be}function ds(){let Be=Fs();for(;ve(s.Or);){const et=D[z];++z;const it=Fs();Be=new Y(et,Be,it)}return Be}function Fs(){let Be=Dr();for(;ve(s.And);){const et=D[z];++z;const it=Dr();Be=new Y(et,Be,it)}return Be}function Dr(){let Be;for(;ve(s.Not);){const et=D[z];++z;const it=Dr();Be=new le(et,it)}return Be??cs()}function cs(){let Be=Os();for(;ve(s.ComparisonBinaryOperator)||ve(s.In)||ve(s.NotIn);){const et=D[z];++z;const it=Os();Be=new Y(et,Be,it)}return Be}function Os(){let Be=Ts();for(;ve(s.AdditiveBinaryOperator);){const et=D[z];++z;const it=Ts();Be=new Y(et,Be,it)}return Be}function jr(){const Be=xs(mr());return ve(s.OpenParen)?dt(Be):Be}function dt(Be){let et=new T(Be,qr());return et=xs(et),ve(s.OpenParen)&&(et=dt(et)),et}function qr(){ee(s.OpenParen,"Expected opening parenthesis for arguments list");const Be=Ur();return ee(s.CloseParen,"Expected closing parenthesis for arguments list"),Be}function Ur(){const Be=[];for(;!ve(s.CloseParen);){let et=jt();if(ve(s.Equals)){if(++z,!(et instanceof g))throw new SyntaxError("Expected identifier for keyword argument");const it=jt();et=new we(et,it)}Be.push(et),ve(s.Comma)&&++z}return Be}function us(){const Be=[];let et=!1;for(;!ve(s.CloseSquareBracket);)ve(s.Colon)?(Be.push(void 0),++z,et=!0):(Be.push(jt()),ve(s.Colon)&&(++z,et=!0));if(Be.length===0)throw new SyntaxError("Expected at least one argument for member/slice expression");if(et){if(Be.length>3)throw new SyntaxError("Expected 0-3 arguments for slice expression");return new ae(...Be)}return Be[0]}function xs(Be){for(;ve(s.Dot)||ve(s.OpenSquareBracket);){const et=D[z];++z;let it;const rr=et.type!==s.Dot;if(rr)it=us(),ee(s.CloseSquareBracket,"Expected closing square bracket");else if(it=mr(),it.type!=="Identifier")throw new SyntaxError("Expected identifier following dot operator");Be=new $(Be,it,rr)}return Be}function Ts(){let Be=Es();for(;ve(s.MultiplicativeBinaryOperator);){const et=D[z];++z;const it=Es();Be=new Y(et,Be,it)}return Be}function Es(){let Be=Ds();for(;ve(s.Is);){++z;const et=ve(s.Not);et&&++z;let it=mr();if(it instanceof B?it=new g(it.value.toString()):it instanceof N&&(it=new g("none")),!(it instanceof g))throw new SyntaxError("Expected identifier for the test");Be=new ie(Be,et,it)}return Be}function Ds(){let Be=jr();for(;ve(s.Pipe);){++z;let et=mr();if(!(et instanceof g))throw new SyntaxError("Expected identifier for the filter");ve(s.OpenParen)&&(et=dt(et)),Be=new H(Be,et)}return Be}function mr(){const Be=D[z];switch(Be.type){case s.NumericLiteral:return++z,new E(Number(Be.value));case s.StringLiteral:return++z,new k(Be.value);case s.BooleanLiteral:return++z,new B(Be.value.toLowerCase()==="true");case s.NullLiteral:return++z,new N(null);case s.Identifier:return++z,new g(Be.value);case s.OpenParen:{++z;const et=wt();if(D[z].type!==s.CloseParen)throw new SyntaxError(`Expected closing parenthesis, got ${D[z].type} instead`);return++z,et}case s.OpenSquareBracket:{++z;const et=[];for(;!ve(s.CloseSquareBracket);)et.push(jt()),ve(s.Comma)&&++z;return++z,new J(et)}case s.OpenCurlyBracket:{++z;const et=new Map;for(;!ve(s.CloseCurlyBracket);){const it=jt();ee(s.Colon,"Expected colon between key and value in object literal");const rr=jt();et.set(it,rr),ve(s.Comma)&&++z}return++z,new V(et)}default:throw new SyntaxError(`Unexpected token: ${Be.type}`)}}for(;z=0?(Z=(Z??(Z=0))<0?Math.max(D.length+Z,0):Math.min(Z,D.length),z=(z??(z=D.length))<0?Math.max(D.length+z,0):Math.min(z,D.length)):(Z=(Z??(Z=D.length-1))<0?Math.max(D.length+Z,-1):Math.min(Z,D.length-1),z=(z??(z=-1))<-1?Math.max(D.length+z,-1):Math.min(z,D.length-1));const be=[];for(let ve=Z;ce*veZ.toUpperCase())}var X=class{constructor(D=void 0){re(this,"type","RuntimeValue");re(this,"value");re(this,"builtins",new Map);this.value=D}__bool__(){return new ke(!!this.value)}},ye=class extends X{constructor(){super(...arguments);re(this,"type","NumericValue")}},_e=class extends X{constructor(){super(...arguments);re(this,"type","StringValue");re(this,"builtins",new Map([["upper",new pe(()=>new _e(this.value.toUpperCase()))],["lower",new pe(()=>new _e(this.value.toLowerCase()))],["strip",new pe(()=>new _e(this.value.trim()))],["title",new pe(()=>new _e(ne(this.value)))],["length",new ye(this.value.length)],["rstrip",new pe(()=>new _e(this.value.trimEnd()))],["lstrip",new pe(()=>new _e(this.value.trimStart()))],["split",new pe(Z=>{const z=Z[0]??new Pe;if(!(z instanceof _e||z instanceof Pe))throw new Error("sep argument must be a string or null");const ee=Z[1]??new ye(-1);if(!(ee instanceof ye))throw new Error("maxsplit argument must be a number");let ce=[];if(z instanceof Pe){const be=this.value.trimStart();for(const{0:ve,index:Re}of be.matchAll(/\S+/g)){if(ee.value!==-1&&ce.length>=ee.value&&Re!==void 0){ce.push(ve+be.slice(Re+ve.length));break}ce.push(ve)}}else{if(z.value==="")throw new Error("empty separator");ce=this.value.split(z.value),ee.value!==-1&&ce.length>ee.value&&ce.push(ce.splice(ee.value).join(z.value))}return new K(ce.map(be=>new _e(be)))})]]))}},ke=class extends X{constructor(){super(...arguments);re(this,"type","BooleanValue")}},He=class extends X{constructor(){super(...arguments);re(this,"type","ObjectValue");re(this,"builtins",new Map([["get",new pe(([Z,z])=>{if(!(Z instanceof _e))throw new Error(`Object key must be a string: got ${Z.type}`);return this.value.get(Z.value)??z??new Pe})],["items",new pe(()=>new K(Array.from(this.value.entries()).map(([Z,z])=>new K([new _e(Z),z]))))]]))}__bool__(){return new ke(this.value.size>0)}},Me=class extends He{constructor(){super(...arguments);re(this,"type","KeywordArgumentsValue")}},K=class extends X{constructor(){super(...arguments);re(this,"type","ArrayValue");re(this,"builtins",new Map([["length",new ye(this.value.length)]]))}__bool__(){return new ke(this.value.length>0)}},U=class extends K{constructor(){super(...arguments);re(this,"type","TupleValue")}},pe=class extends X{constructor(){super(...arguments);re(this,"type","FunctionValue")}},Pe=class extends X{constructor(){super(...arguments);re(this,"type","NullValue")}},Te=class extends X{constructor(){super(...arguments);re(this,"type","UndefinedValue")}},Ae=class{constructor(D){re(this,"variables",new Map([["namespace",new pe(D=>{if(D.length===0)return new He(new Map);if(D.length!==1||!(D[0]instanceof He))throw new Error("`namespace` expects either zero arguments or a single object argument");return D[0]})]]));re(this,"tests",new Map([["boolean",D=>D.type==="BooleanValue"],["callable",D=>D instanceof pe],["odd",D=>{if(D.type!=="NumericValue")throw new Error(`Cannot apply test "odd" to type: ${D.type}`);return D.value%2!==0}],["even",D=>{if(D.type!=="NumericValue")throw new Error(`Cannot apply test "even" to type: ${D.type}`);return D.value%2===0}],["false",D=>D.type==="BooleanValue"&&!D.value],["true",D=>D.type==="BooleanValue"&&D.value],["none",D=>D.type==="NullValue"],["string",D=>D.type==="StringValue"],["number",D=>D.type==="NumericValue"],["integer",D=>D.type==="NumericValue"&&Number.isInteger(D.value)],["iterable",D=>D.type==="ArrayValue"||D.type==="StringValue"],["mapping",D=>D.type==="ObjectValue"],["lower",D=>{const Z=D.value;return D.type==="StringValue"&&Z===Z.toLowerCase()}],["upper",D=>{const Z=D.value;return D.type==="StringValue"&&Z===Z.toUpperCase()}],["none",D=>D.type==="NullValue"],["defined",D=>D.type!=="UndefinedValue"],["undefined",D=>D.type==="UndefinedValue"],["equalto",(D,Z)=>D.value===Z.value],["eq",(D,Z)=>D.value===Z.value]]));this.parent=D}set(D,Z){return this.declareVariable(D,Le(Z))}declareVariable(D,Z){if(this.variables.has(D))throw new SyntaxError(`Variable already declared: ${D}`);return this.variables.set(D,Z),Z}setVariable(D,Z){return this.variables.set(D,Z),Z}resolve(D){if(this.variables.has(D))return this;if(this.parent)return this.parent.resolve(D);throw new Error(`Unknown variable: ${D}`)}lookupVariable(D){try{return this.resolve(D).variables.get(D)??new Te}catch{return new Te}}},Ie=class{constructor(D){re(this,"global");this.global=D??new Ae}run(D){return this.evaluate(D,this.global)}evaluateBinaryExpression(D,Z){const z=this.evaluate(D.left,Z);switch(D.operator.value){case"and":return z.__bool__().value?this.evaluate(D.right,Z):z;case"or":return z.__bool__().value?z:this.evaluate(D.right,Z)}const ee=this.evaluate(D.right,Z);switch(D.operator.value){case"==":return new ke(z.value==ee.value);case"!=":return new ke(z.value!=ee.value)}if(z instanceof Te||ee instanceof Te)throw new Error("Cannot perform operation on undefined values");if(z instanceof Pe||ee instanceof Pe)throw new Error("Cannot perform operation on null values");if(z instanceof ye&&ee instanceof ye)switch(D.operator.value){case"+":return new ye(z.value+ee.value);case"-":return new ye(z.value-ee.value);case"*":return new ye(z.value*ee.value);case"/":return new ye(z.value/ee.value);case"%":return new ye(z.value%ee.value);case"<":return new ke(z.value":return new ke(z.value>ee.value);case">=":return new ke(z.value>=ee.value);case"<=":return new ke(z.value<=ee.value)}else if(z instanceof K&&ee instanceof K)switch(D.operator.value){case"+":return new K(z.value.concat(ee.value))}else if(ee instanceof K){const ce=ee.value.find(be=>be.value===z.value)!==void 0;switch(D.operator.value){case"in":return new ke(ce);case"not in":return new ke(!ce)}}if(z instanceof _e||ee instanceof _e)switch(D.operator.value){case"+":return new _e(z.value.toString()+ee.value.toString())}if(z instanceof _e&&ee instanceof _e)switch(D.operator.value){case"in":return new ke(ee.value.includes(z.value));case"not in":return new ke(!ee.value.includes(z.value))}if(z instanceof _e&&ee instanceof He)switch(D.operator.value){case"in":return new ke(ee.value.has(z.value));case"not in":return new ke(!ee.value.has(z.value))}throw new SyntaxError(`Unknown operator "${D.operator.value}" between ${z.type} and ${ee.type}`)}evaluateArguments(D,Z){const z=[],ee=new Map;for(const ce of D)if(ce.type==="KeywordArgumentExpression"){const be=ce;ee.set(be.key.value,this.evaluate(be.value,Z))}else{if(ee.size>0)throw new Error("Positional arguments must come before keyword arguments");z.push(this.evaluate(ce,Z))}return[z,ee]}evaluateFilterExpression(D,Z){const z=this.evaluate(D.operand,Z);if(D.filter.type==="Identifier"){const ee=D.filter;if(ee.value==="tojson")return new _e(Ne(z));if(z instanceof K)switch(ee.value){case"list":return z;case"first":return z.value[0];case"last":return z.value[z.value.length-1];case"length":return new ye(z.value.length);case"reverse":return new K(z.value.reverse());case"sort":return new K(z.value.sort((ce,be)=>{if(ce.type!==be.type)throw new Error(`Cannot compare different types: ${ce.type} and ${be.type}`);switch(ce.type){case"NumericValue":return ce.value-be.value;case"StringValue":return ce.value.localeCompare(be.value);default:throw new Error(`Cannot compare type: ${ce.type}`)}}));case"join":return new _e(z.value.map(ce=>ce.value).join(""));default:throw new Error(`Unknown ArrayValue filter: ${ee.value}`)}else if(z instanceof _e)switch(ee.value){case"length":return new ye(z.value.length);case"upper":return new _e(z.value.toUpperCase());case"lower":return new _e(z.value.toLowerCase());case"title":return new _e(ne(z.value));case"capitalize":return new _e(z.value.charAt(0).toUpperCase()+z.value.slice(1));case"trim":return new _e(z.value.trim());case"indent":return new _e(z.value.split(` -`).map((ce,be)=>be===0||ce.length===0?ce:" "+ce).join(` -`));case"join":case"string":return z;default:throw new Error(`Unknown StringValue filter: ${ee.value}`)}else if(z instanceof ye)switch(ee.value){case"abs":return new ye(Math.abs(z.value));default:throw new Error(`Unknown NumericValue filter: ${ee.value}`)}else if(z instanceof He)switch(ee.value){case"items":return new K(Array.from(z.value.entries()).map(([ce,be])=>new K([new _e(ce),be])));case"length":return new ye(z.value.size);default:throw new Error(`Unknown ObjectValue filter: ${ee.value}`)}throw new Error(`Cannot apply filter "${ee.value}" to type: ${z.type}`)}else if(D.filter.type==="CallExpression"){const ee=D.filter;if(ee.callee.type!=="Identifier")throw new Error(`Unknown filter: ${ee.callee.type}`);const ce=ee.callee.value;if(ce==="tojson"){const[,be]=this.evaluateArguments(ee.args,Z),ve=be.get("indent")??new Pe;if(!(ve instanceof ye||ve instanceof Pe))throw new Error("If set, indent must be a number");return new _e(Ne(z,ve.value))}else if(ce==="join"){let be;if(z instanceof _e)be=Array.from(z.value);else if(z instanceof K)be=z.value.map(je=>je.value);else throw new Error(`Cannot apply filter "${ce}" to type: ${z.type}`);const[ve,Re]=this.evaluateArguments(ee.args,Z),Fe=ve.at(0)??Re.get("separator")??new _e("");if(!(Fe instanceof _e))throw new Error("separator must be a string");return new _e(be.join(Fe.value))}if(z instanceof K){switch(ce){case"selectattr":case"rejectattr":{const be=ce==="selectattr";if(z.value.some(Xe=>!(Xe instanceof He)))throw new Error(`\`${ce}\` can only be applied to array of objects`);if(ee.args.some(Xe=>Xe.type!=="StringLiteral"))throw new Error(`arguments of \`${ce}\` must be strings`);const[ve,Re,Fe]=ee.args.map(Xe=>this.evaluate(Xe,Z));let je;if(Re){const Xe=Z.tests.get(Re.value);if(!Xe)throw new Error(`Unknown test: ${Re.value}`);je=Xe}else je=(...Xe)=>Xe[0].__bool__().value;const Qe=z.value.filter(Xe=>{const ut=Xe.value.get(ve.value),wt=ut?je(ut,Fe):!1;return be?wt:!wt});return new K(Qe)}case"map":{const[,be]=this.evaluateArguments(ee.args,Z);if(be.has("attribute")){const ve=be.get("attribute");if(!(ve instanceof _e))throw new Error("attribute must be a string");const Re=be.get("default"),Fe=z.value.map(je=>{if(!(je instanceof He))throw new Error("items in map must be an object");return je.value.get(ve.value)??Re??new Te});return new K(Fe)}else throw new Error("`map` expressions without `attribute` set are not currently supported.")}}throw new Error(`Unknown ArrayValue filter: ${ce}`)}else if(z instanceof _e){switch(ce){case"indent":{const[be,ve]=this.evaluateArguments(ee.args,Z),Re=be.at(0)??ve.get("width")??new ye(4);if(!(Re instanceof ye))throw new Error("width must be a number");const Fe=be.at(1)??ve.get("first")??new ke(!1),je=be.at(2)??ve.get("blank")??new ke(!1),Qe=z.value.split(` -`),Xe=" ".repeat(Re.value),ut=Qe.map((wt,nr)=>!Fe.value&&nr===0||!je.value&&wt.length===0?wt:Xe+wt);return new _e(ut.join(` -`))}}throw new Error(`Unknown StringValue filter: ${ce}`)}else throw new Error(`Cannot apply filter "${ce}" to type: ${z.type}`)}throw new Error(`Unknown filter: ${D.filter.type}`)}evaluateTestExpression(D,Z){const z=this.evaluate(D.operand,Z),ee=Z.tests.get(D.test.value);if(!ee)throw new Error(`Unknown test: ${D.test.value}`);const ce=ee(z);return new ke(D.negate?!ce:ce)}evaluateUnaryExpression(D,Z){const z=this.evaluate(D.argument,Z);switch(D.operator.value){case"not":return new ke(!z.value);default:throw new SyntaxError(`Unknown operator: ${D.operator.value}`)}}evalProgram(D,Z){return this.evaluateBlock(D.body,Z)}evaluateBlock(D,Z){let z="";for(const ee of D){const ce=this.evaluate(ee,Z);ce.type!=="NullValue"&&ce.type!=="UndefinedValue"&&(z+=ce.value)}return new _e(z)}evaluateIdentifier(D,Z){return Z.lookupVariable(D.value)}evaluateCallExpression(D,Z){const[z,ee]=this.evaluateArguments(D.args,Z);ee.size>0&&z.push(new Me(ee));const ce=this.evaluate(D.callee,Z);if(ce.type!=="FunctionValue")throw new Error(`Cannot call something that is not a function: got ${ce.type}`);return ce.value(z,Z)}evaluateSliceExpression(D,Z,z){if(!(D instanceof K||D instanceof _e))throw new Error("Slice object must be an array or string");const ee=this.evaluate(Z.start,z),ce=this.evaluate(Z.stop,z),be=this.evaluate(Z.step,z);if(!(ee instanceof ye||ee instanceof Te))throw new Error("Slice start must be numeric or undefined");if(!(ce instanceof ye||ce instanceof Te))throw new Error("Slice stop must be numeric or undefined");if(!(be instanceof ye||be instanceof Te))throw new Error("Slice step must be numeric or undefined");return D instanceof K?new K(G(D.value,ee.value,ce.value,be.value)):new _e(G(Array.from(D.value),ee.value,ce.value,be.value).join(""))}evaluateMemberExpression(D,Z){const z=this.evaluate(D.object,Z);let ee;if(D.computed){if(D.property.type==="SliceExpression")return this.evaluateSliceExpression(z,D.property,Z);ee=this.evaluate(D.property,Z)}else ee=new _e(D.property.value);let ce;if(z instanceof He){if(!(ee instanceof _e))throw new Error(`Cannot access property with non-string: got ${ee.type}`);ce=z.value.get(ee.value)??z.builtins.get(ee.value)}else if(z instanceof K||z instanceof _e)if(ee instanceof ye)ce=z.value.at(ee.value),z instanceof _e&&(ce=new _e(z.value.at(ee.value)));else if(ee instanceof _e)ce=z.builtins.get(ee.value);else throw new Error(`Cannot access property with non-string/non-number: got ${ee.type}`);else{if(!(ee instanceof _e))throw new Error(`Cannot access property with non-string: got ${ee.type}`);ce=z.builtins.get(ee.value)}return ce instanceof X?ce:new Te}evaluateSet(D,Z){const z=this.evaluate(D.value,Z);if(D.assignee.type==="Identifier"){const ee=D.assignee.value;Z.setVariable(ee,z)}else if(D.assignee.type==="MemberExpression"){const ee=D.assignee,ce=this.evaluate(ee.object,Z);if(!(ce instanceof He))throw new Error("Cannot assign to member of non-object");if(ee.property.type!=="Identifier")throw new Error("Cannot assign to member with non-identifier property");ce.value.set(ee.property.value,z)}else throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(D.assignee)}`);return new Pe}evaluateIf(D,Z){const z=this.evaluate(D.test,Z);return this.evaluateBlock(z.__bool__().value?D.body:D.alternate,Z)}evaluateFor(D,Z){const z=new Ae(Z);let ee,ce;if(D.iterable.type==="SelectExpression"){const je=D.iterable;ce=this.evaluate(je.iterable,z),ee=je.test}else ce=this.evaluate(D.iterable,z);if(!(ce instanceof K))throw new Error(`Expected iterable type in for loop: got ${ce.type}`);const be=[],ve=[];for(let je=0;jewt.setVariable(D.loopvar.value,Xe);else if(D.loopvar.type==="TupleLiteral"){const wt=D.loopvar;if(Xe.type!=="ArrayValue")throw new Error(`Cannot unpack non-iterable type: ${Xe.type}`);const nr=Xe;if(wt.value.length!==nr.value.length)throw new Error(`Too ${wt.value.length>nr.value.length?"few":"many"} items to unpack`);ut=jt=>{for(let dr=0;dr0?be[je-1]:new Te],["nextitem",je{var ve;const ce=new Ae(ee);z=z.slice();let be;((ve=z.at(-1))==null?void 0:ve.type)==="KeywordArgumentsValue"&&(be=z.pop());for(let Re=0;Rethis.evaluate(z,Z)));case"TupleLiteral":return new U(D.value.map(z=>this.evaluate(z,Z)));case"ObjectLiteral":{const z=new Map;for(const[ee,ce]of D.value){const be=this.evaluate(ee,Z);if(!(be instanceof _e))throw new Error(`Object keys must be strings: got ${be.type}`);z.set(be.value,this.evaluate(ce,Z))}return new He(z)}case"Identifier":return this.evaluateIdentifier(D,Z);case"CallExpression":return this.evaluateCallExpression(D,Z);case"MemberExpression":return this.evaluateMemberExpression(D,Z);case"UnaryExpression":return this.evaluateUnaryExpression(D,Z);case"BinaryExpression":return this.evaluateBinaryExpression(D,Z);case"FilterExpression":return this.evaluateFilterExpression(D,Z);case"TestExpression":return this.evaluateTestExpression(D,Z);default:throw new SyntaxError(`Unknown node type: ${D.type}`)}}};function Le(D){switch(typeof D){case"number":return new ye(D);case"string":return new _e(D);case"boolean":return new ke(D);case"undefined":return new Te;case"object":return D===null?new Pe:Array.isArray(D)?new K(D.map(Le)):new He(new Map(Object.entries(D).map(([Z,z])=>[Z,Le(z)])));case"function":return new pe((Z,z)=>{const ee=D(...Z.map(ce=>ce.value))??null;return Le(ee)});default:throw new Error(`Cannot convert to runtime value: ${D}`)}}function Ne(D,Z,z){const ee=z??0;switch(D.type){case"NullValue":case"UndefinedValue":return"null";case"NumericValue":case"StringValue":case"BooleanValue":return JSON.stringify(D.value);case"ArrayValue":case"ObjectValue":{const ce=Z?" ".repeat(Z):"",be=` -`+ce.repeat(ee),ve=be+ce;if(D.type==="ArrayValue"){const Re=D.value.map(Fe=>Ne(Fe,Z,ee+1));return Z?`[${ve}${Re.join(`,${ve}`)}${be}]`:`[${Re.join(", ")}]`}else{const Re=Array.from(D.value.entries()).map(([Fe,je])=>{const Qe=`"${Fe}": ${Ne(je,Z,ee+1)}`;return Z?`${ve}${Qe}`:Qe});return Z?`{${Re.join(",")}${be}}`:`{${Re.join(", ")}}`}}default:throw new Error(`Cannot convert to JSON: ${D.type}`)}}var Ve=class{constructor(D){re(this,"parsed");const Z=u(D,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=R(Z)}render(D){const Z=new Ae;if(Z.set("false",!1),Z.set("true",!0),Z.set("raise_exception",ce=>{throw new Error(ce)}),Z.set("range",O),D)for(const[ce,be]of Object.entries(D))Z.set(ce,be);return new Ie(Z).run(this.parsed).value}}},"./src/backends/onnx.js":(e,r,t)=>{var s;t.r(r),t.d(r,{Tensor:()=>a.Tensor,createInferenceSession:()=>A,deviceToExecutionProviders:()=>f,isONNXProxy:()=>$,isONNXTensor:()=>b});var i=t("./src/env.js"),n=t("?2ce3"),o=t("onnxruntime-web"),a=t("onnxruntime-common");const l=Object.freeze({auto:null,gpu:null,cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:{name:"webnn",deviceType:"cpu"},"webnn-npu":{name:"webnn",deviceType:"npu"},"webnn-gpu":{name:"webnn",deviceType:"gpu"},"webnn-cpu":{name:"webnn",deviceType:"cpu"}}),d=[];let p,u;const h=Symbol.for("onnxruntime");if(h in globalThis)u=globalThis[h];else if(i.apis.IS_NODE_ENV){switch(u=n??(s||(s=t.t(n,2))),process.platform){case"win32":d.push("dml");break;case"linux":process.arch==="x64"&&d.push("cuda");break}d.push("cpu"),p=["cpu"]}else u=o,i.apis.IS_WEBNN_AVAILABLE&&d.push("webnn-npu","webnn-gpu","webnn-cpu","webnn"),i.apis.IS_WEBGPU_AVAILABLE&&d.push("webgpu"),d.push("wasm"),p=["wasm"];const w=u.InferenceSession;function f(T=null){if(!T)return p;switch(T){case"auto":return d;case"gpu":return d.filter(g=>["webgpu","cuda","dml","webnn-gpu"].includes(g))}if(d.includes(T))return[l[T]??T];throw new Error(`Unsupported device: "${T}". Should be one of: ${d.join(", ")}.`)}let P=null;async function A(T,g,M){P&&await P;const E=w.create(T,g);P??(P=E);const k=await E;return k.config=M,k}function b(T){return T instanceof u.Tensor}const y=u==null?void 0:u.env;y!=null&&y.wasm&&(!(typeof ServiceWorkerGlobalScope<"u"&&self instanceof ServiceWorkerGlobalScope)&&!y.wasm.wasmPaths&&(y.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${i.env.version}/dist/`),y.wasm.proxy=!1),y!=null&&y.webgpu&&(y.webgpu.powerPreference="high-performance");function $(){var T;return(T=y==null?void 0:y.wasm)==null?void 0:T.proxy}i.env.backends.onnx=y},"./src/base/feature_extraction_utils.js":(e,r,t)=>{t.r(r),t.d(r,{FeatureExtractor:()=>o,validate_audio_inputs:()=>a});var s=t("./src/utils/constants.js"),i=t("./src/utils/generic.js"),n=t("./src/utils/hub.js");class o extends i.Callable{constructor(d){super(),this.config=d}static async from_pretrained(d,p){const u=await(0,n.getModelJSON)(d,s.FEATURE_EXTRACTOR_NAME,!0,p);return new this(u)}}function a(l,d){var p;if(!(l instanceof Float32Array||l instanceof Float64Array))throw new Error(`${d} expects input to be a Float32Array or a Float64Array, but got ${((p=l==null?void 0:l.constructor)==null?void 0:p.name)??typeof l} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}},"./src/base/image_processors_utils.js":(e,r,t)=>{t.r(r),t.d(r,{ImageProcessor:()=>T,center_to_corners_format:()=>u,post_process_instance_segmentation:()=>$,post_process_object_detection:()=>h,post_process_panoptic_segmentation:()=>y,post_process_semantic_segmentation:()=>w});var s=t("./src/utils/generic.js"),i=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");t("./src/utils/image.js");var o=t("./src/utils/core.js"),a=t("./src/utils/hub.js"),l=t("./src/utils/constants.js");function d(g,M,E=0,k=null){const B=g/M;let N=(0,n.bankers_round)(B)*M;return k!==null&&N>k&&(N=Math.floor(B)*M),NM&&O.push(ne)}else{let ne=(0,n.max)(R.data)[1];if(ne===V-1||(G=(0,n.softmax)(R.data),G[ne]ye*Q[(_e+1)%2])),ie.boxes.push(X),ie.classes.push(ne),ie.scores.push(G[ne])}}Y.push(ie)}return Y}function w(g,M=null){const E=g.logits,k=E.dims[0];if(M!==null&&M.length!==k)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const B=[];for(let N=0;NQ[O]&&(Q[O]=R[O],ie[O]=we)}const le=new Array(q.dims[0]);for(let we=0;wewe!==void 0);B.push({segmentation:H,labels:ae})}return B}function f(g,M,E,k){const B=[],N=[],J=[];for(let q=0;qE&&(B.push(Y),N.push(ie),J.push(H))}return[B,N,J]}function P(g,M,E,k=.5,B=.8){const N=[];let J=0,q=0;const V=M[E].data;for(let H=0;H=k&&++q;let Y=J>0&&q>0;return Y&&(Y=J/q>B),[Y,N]}function A(g,M,E,k,B,N=null,J=null){const[q,V]=J??g[0].dims,Y=new i.Tensor("int32",new Int32Array(q*V),[q,V]),H=[];if(J!==null)for(let we=0;weie[G]&&(Q[G]=we,ie[G]=O[G])}let le=0;const ae=Y.data;for(let we=0;we200)throw new Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(g,M)/Math.min(g,M)}`);let N=Math.round(g/E)*E,J=Math.round(M/E)*E;if(N*J>B){const q=Math.sqrt(g*M/B);N=Math.floor(g/q/E)*E,J=Math.floor(M/q/E)*E}else if(N*JN?Y=Math.floor(N*V/B):N>B&&(V=Math.floor(B*Y/N)),await M.resize(Y,V,{resample:k}))}async crop_margin(M,E=200){const k=M.clone().grayscale(),B=(0,n.min)(k.data)[0],J=(0,n.max)(k.data)[0]-B;if(J===0)return M;const q=E/255;let V=k.width,Y=k.height,H=0,Q=0;const ie=k.data;for(let le=0;lethis.preprocess(N)));return{pixel_values:(0,i.stack)(k.map(N=>N.pixel_values),0),original_sizes:k.map(N=>N.original_size),reshaped_input_sizes:k.map(N=>N.reshaped_input_size)}}static async from_pretrained(M,E){const k=await(0,a.getModelJSON)(M,l.IMAGE_PROCESSOR_NAME,!0,E);return new this(k)}}},"./src/base/processing_utils.js":(e,r,t)=>{t.r(r),t.d(r,{Processor:()=>o});var s=t("./src/utils/constants.js"),i=t("./src/utils/generic.js"),n=t("./src/utils/hub.js");class o extends i.Callable{constructor(l,d){super(),this.config=l,this.components=d}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(l,d={}){if(!this.tokenizer)throw new Error("Unable to apply chat template without a tokenizer.");return this.tokenizer.apply_chat_template(l,{tokenize:!1,...d})}batch_decode(...l){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.batch_decode(...l)}decode(...l){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.decode(...l)}async _call(l,...d){for(const p of[this.image_processor,this.feature_extractor,this.tokenizer])if(p)return p(l,...d);throw new Error("No image processor, feature extractor, or tokenizer found.")}static async from_pretrained(l,d){const[p,u]=await Promise.all([this.uses_processor_config?(0,n.getModelJSON)(l,s.PROCESSOR_NAME,!0,d):{},Promise.all(this.classes.filter(h=>h in this).map(async h=>{const w=await this[h].from_pretrained(l,d);return[h.replace(/_class$/,""),w]})).then(Object.fromEntries)]);return new this(p,u)}}re(o,"classes",["image_processor_class","tokenizer_class","feature_extractor_class"]),re(o,"uses_processor_config",!1)},"./src/configs.js":(e,r,t)=>{t.r(r),t.d(r,{AutoConfig:()=>d,PretrainedConfig:()=>l,getKeyValueShapes:()=>a});var s=t("./src/utils/core.js"),i=t("./src/utils/hub.js");async function n(p,u){return await(0,i.getModelJSON)(p,"config.json",!0,u)}function o(p){const u={};let h={};switch(p.model_type){case"llava":case"paligemma":case"gemma3":case"florence2":case"llava_onevision":case"idefics3":case"ultravox":case"smolvlm":h=o(p.text_config);break;case"moondream1":h=o(p.phi_config);break;case"musicgen":h=o(p.decoder);break;case"multi_modality":h=o(p.language_config);break;case"gpt2":case"gptj":case"jais":case"codegen":case"gpt_bigcode":u.num_heads="n_head",u.num_layers="n_layer",u.hidden_size="n_embd";break;case"gpt_neox":case"stablelm":case"opt":case"falcon":u.num_heads="num_attention_heads",u.num_layers="num_hidden_layers",u.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":u.num_heads="num_key_value_heads",u.num_layers="num_hidden_layers",u.hidden_size="hidden_size",u.num_attention_heads="num_attention_heads";break;case"gemma":case"gemma2":case"gemma3_text":case"glm":case"helium":u.num_heads="num_key_value_heads",u.num_layers="num_hidden_layers",u.dim_kv="head_dim";break;case"openelm":u.num_heads="num_kv_heads",u.num_layers="num_transformer_layers",u.dim_kv="head_dim";break;case"gpt_neo":case"donut-swin":u.num_heads="num_heads",u.num_layers="num_layers",u.hidden_size="hidden_size";break;case"bloom":u.num_heads="n_head",u.num_layers="n_layer",u.hidden_size="hidden_size";break;case"mpt":u.num_heads="n_heads",u.num_layers="n_layers",u.hidden_size="d_model";break;case"exaone":u.num_heads="num_key_value_heads",u.num_layers="num_layers",u.dim_kv="head_dim",u.num_attention_heads="num_attention_heads";break;case"t5":case"mt5":case"longt5":u.num_decoder_layers="num_decoder_layers",u.num_decoder_heads="num_heads",u.decoder_dim_kv="d_kv",u.num_encoder_layers="num_layers",u.num_encoder_heads="num_heads",u.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":u.num_decoder_layers="decoder_layers",u.num_decoder_heads="decoder_attention_heads",u.decoder_hidden_size="d_model",u.num_encoder_layers="encoder_layers",u.num_encoder_heads="encoder_attention_heads",u.encoder_hidden_size="d_model";break;case"speecht5":u.num_decoder_layers="decoder_layers",u.num_decoder_heads="decoder_attention_heads",u.decoder_hidden_size="hidden_size",u.num_encoder_layers="encoder_layers",u.num_encoder_heads="encoder_attention_heads",u.encoder_hidden_size="hidden_size";break;case"trocr":u.num_encoder_layers=u.num_decoder_layers="decoder_layers",u.num_encoder_heads=u.num_decoder_heads="decoder_attention_heads",u.encoder_hidden_size=u.decoder_hidden_size="d_model";break;case"musicgen_decoder":u.num_encoder_layers=u.num_decoder_layers="num_hidden_layers",u.num_encoder_heads=u.num_decoder_heads="num_attention_heads",u.encoder_hidden_size=u.decoder_hidden_size="hidden_size";break;case"moonshine":u.num_decoder_layers="decoder_num_hidden_layers",u.num_decoder_heads="decoder_num_key_value_heads",u.num_encoder_layers="encoder_num_hidden_layers",u.num_encoder_heads="encoder_num_key_value_heads",u.encoder_hidden_size=u.decoder_hidden_size="hidden_size";break;case"vision-encoder-decoder":const f=o(p.decoder),P="num_decoder_layers"in f,A=(0,s.pick)(p,["model_type","is_encoder_decoder"]);return P?(A.num_decoder_layers=f.num_decoder_layers,A.num_decoder_heads=f.num_decoder_heads,A.decoder_hidden_size=f.decoder_hidden_size,A.num_encoder_layers=f.num_encoder_layers,A.num_encoder_heads=f.num_encoder_heads,A.encoder_hidden_size=f.encoder_hidden_size):(A.num_layers=f.num_layers,A.num_heads=f.num_heads,A.hidden_size=f.hidden_size),A}const w={...h,...(0,s.pick)(p,["model_type","multi_query","is_encoder_decoder"])};for(const f in u)w[f]=p[u[f]];return w}function a(p,{prefix:u="past_key_values",batch_size:h=1}={}){const w={},f=p.normalized_config;if(f.is_encoder_decoder&&"num_encoder_heads"in f&&"num_decoder_heads"in f){const P=f.encoder_dim_kv??f.encoder_hidden_size/f.num_encoder_heads,A=f.decoder_dim_kv??f.decoder_hidden_size/f.num_decoder_heads,b=[h,f.num_encoder_heads,0,P],y=[h,f.num_decoder_heads,0,A];for(let $=0;${var k,B;t.r(r),t.d(r,{apis:()=>A,env:()=>M});var s=t("?569f"),i=t("?3f59"),n=t("?154a");const o="3.4.1",a=typeof window<"u"&&typeof window.document<"u",l=typeof self<"u"&&((k=self.constructor)==null?void 0:k.name)==="DedicatedWorkerGlobalScope",d=typeof self<"u"&&"caches"in self,p=typeof navigator<"u"&&"gpu"in navigator,u=typeof navigator<"u"&&"ml"in navigator,h=typeof process<"u",w=h&&((B=process==null?void 0:process.release)==null?void 0:B.name)==="node",f=!E(s),P=!E(i),A=Object.freeze({IS_BROWSER_ENV:a,IS_WEBWORKER_ENV:l,IS_WEB_CACHE_AVAILABLE:d,IS_WEBGPU_AVAILABLE:p,IS_WEBNN_AVAILABLE:u,IS_PROCESS_AVAILABLE:h,IS_NODE_ENV:w,IS_FS_AVAILABLE:f,IS_PATH_AVAILABLE:P}),b=f&&P;let y="./";if(b){const N=Object({url:self.location.href}).url;N?y=i.dirname(i.dirname(n.fileURLToPath(N))):typeof __dirname<"u"&&(y=i.dirname(__dirname))}const $=b?i.join(y,"/.cache/"):null,T="/models/",g=b?i.join(y,T):T,M={version:o,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!(a||l),localModelPath:g,useFS:f,useBrowserCache:d,useFSCache:f,cacheDir:$,useCustomCache:!1,customCache:null};function E(N){return Object.keys(N).length===0}},"./src/generation/configuration_utils.js":(e,r,t)=>{t.r(r),t.d(r,{GenerationConfig:()=>i});var s=t("./src/utils/core.js");class i{constructor(o){re(this,"max_length",20);re(this,"max_new_tokens",null);re(this,"min_length",0);re(this,"min_new_tokens",null);re(this,"early_stopping",!1);re(this,"max_time",null);re(this,"do_sample",!1);re(this,"num_beams",1);re(this,"num_beam_groups",1);re(this,"penalty_alpha",null);re(this,"use_cache",!0);re(this,"temperature",1);re(this,"top_k",50);re(this,"top_p",1);re(this,"typical_p",1);re(this,"epsilon_cutoff",0);re(this,"eta_cutoff",0);re(this,"diversity_penalty",0);re(this,"repetition_penalty",1);re(this,"encoder_repetition_penalty",1);re(this,"length_penalty",1);re(this,"no_repeat_ngram_size",0);re(this,"bad_words_ids",null);re(this,"force_words_ids",null);re(this,"renormalize_logits",!1);re(this,"constraints",null);re(this,"forced_bos_token_id",null);re(this,"forced_eos_token_id",null);re(this,"remove_invalid_values",!1);re(this,"exponential_decay_length_penalty",null);re(this,"suppress_tokens",null);re(this,"streamer",null);re(this,"begin_suppress_tokens",null);re(this,"forced_decoder_ids",null);re(this,"guidance_scale",null);re(this,"num_return_sequences",1);re(this,"output_attentions",!1);re(this,"output_hidden_states",!1);re(this,"output_scores",!1);re(this,"return_dict_in_generate",!1);re(this,"pad_token_id",null);re(this,"bos_token_id",null);re(this,"eos_token_id",null);re(this,"encoder_no_repeat_ngram_size",0);re(this,"decoder_start_token_id",null);re(this,"generation_kwargs",{});Object.assign(this,(0,s.pick)(o,Object.getOwnPropertyNames(this)))}}},"./src/generation/logits_process.js":(e,r,t)=>{t.r(r),t.d(r,{ClassifierFreeGuidanceLogitsProcessor:()=>b,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>d,LogitsProcessor:()=>n,LogitsProcessorList:()=>a,LogitsWarper:()=>o,MinLengthLogitsProcessor:()=>f,MinNewTokensLengthLogitsProcessor:()=>P,NoBadWordsLogitsProcessor:()=>A,NoRepeatNGramLogitsProcessor:()=>h,RepetitionPenaltyLogitsProcessor:()=>w,SuppressTokensAtBeginLogitsProcessor:()=>p,TemperatureLogitsWarper:()=>y,TopKLogitsWarper:()=>T,TopPLogitsWarper:()=>$,WhisperTimeStampLogitsProcessor:()=>u});var s=t("./src/utils/generic.js");t("./src/utils/tensor.js");var i=t("./src/utils/maths.js");class n extends s.Callable{_call(M,E){throw Error("`_call` should be implemented in a subclass")}}class o extends s.Callable{_call(M,E){throw Error("`_call` should be implemented in a subclass")}}class a extends s.Callable{constructor(){super(),this.processors=[]}push(M){this.processors.push(M)}extend(M){this.processors.push(...M)}_call(M,E){let k=E;for(const B of this.processors)k=B(M,k);return k}[Symbol.iterator](){return this.processors.values()}}class l extends n{constructor(M){super(),this.bos_token_id=M}_call(M,E){for(let k=0;k=1&&N[N.length-1]>=this.timestamp_begin,q=N.length<2||N[N.length-2]>=this.timestamp_begin;if(J&&(q?B.subarray(this.timestamp_begin).fill(-1/0):B.subarray(0,this.eos_token_id).fill(-1/0)),M[k].length===this.begin_index&&this.max_initial_timestamp_index!==null){const Q=this.timestamp_begin+this.max_initial_timestamp_index;B.subarray(Q+1).fill(-1/0)}const V=(0,i.log_softmax)(B),Y=Math.log(V.subarray(this.timestamp_begin).map(Math.exp).reduce((Q,ie)=>Q+ie)),H=(0,i.max)(V.subarray(0,this.timestamp_begin))[0];Y>H&&B.subarray(0,this.timestamp_begin).fill(-1/0)}return E}}class h extends n{constructor(M){super(),this.no_repeat_ngram_size=M}getNgrams(M){const E=M.length,k=[];for(let N=0;N1 to use the classifier free guidance processor, got guidance scale ${M}.`);this.guidance_scale=M}_call(M,E){if(E.dims[0]!==2*M.length)throw new Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${E.dims[0]} for the logits and ${M.length} for the input ids.`);const k=M.length,B=E.slice([0,k],null),N=E.slice([k,E.dims[0]],null);for(let J=0;J1)throw new Error(`\`top_p\` must be a float > 0 and < 1, but is ${M}`);if(!Number.isInteger(k)||k<1)throw new Error(`\`min_tokens_to_keep\` must be a positive integer, but is ${k}`);this.top_p=M,this.filter_value=E,this.min_tokens_to_keep=k}}class T extends o{constructor(M,{filter_value:E=-1/0,min_tokens_to_keep:k=1}={}){if(super(),!Number.isInteger(M)||M<0)throw new Error(`\`top_k\` must be a positive integer, but is ${M}`);this.top_k=Math.max(M,k),this.filter_value=E}}},"./src/generation/logits_sampler.js":(e,r,t)=>{t.r(r),t.d(r,{LogitsSampler:()=>o});var s=t("./src/utils/generic.js"),i=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");t("./src/generation/configuration_utils.js");class o extends s.Callable{constructor(u){super(),this.generation_config=u}async _call(u){return this.sample(u)}async sample(u){throw Error("sample should be implemented in subclasses.")}getLogits(u,h){let w=u.dims.at(-1),f=u.data;if(h===-1)f=f.slice(-w);else{let P=h*w;f=f.slice(P,P+w)}return f}randomSelect(u){let h=0;for(let f=0;f1)return new d(u);if(u.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${u.num_return_sequences}.`);return new a(u)}}class a extends o{async sample(u){const h=(0,n.max)(u.data)[1];return[[BigInt(h),0]]}}class l extends o{async sample(u){let h=u.dims.at(-1);this.generation_config.top_k>0&&(h=Math.min(this.generation_config.top_k,h));const[w,f]=await(0,i.topk)(u,h),P=(0,n.softmax)(w.data);return Array.from({length:this.generation_config.num_beams},()=>{const A=this.randomSelect(P);return[f.data[A],Math.log(P[A])]})}}class d extends o{async sample(u){let h=u.dims.at(-1);this.generation_config.top_k>0&&(h=Math.min(this.generation_config.top_k,h));const[w,f]=await(0,i.topk)(u,h),P=(0,n.softmax)(w.data);return Array.from({length:this.generation_config.num_beams},(A,b)=>[f.data[b],Math.log(P[b])])}}},"./src/generation/stopping_criteria.js":(e,r,t)=>{t.r(r),t.d(r,{EosTokenCriteria:()=>a,InterruptableStoppingCriteria:()=>l,MaxLengthCriteria:()=>o,StoppingCriteria:()=>i,StoppingCriteriaList:()=>n});var s=t("./src/utils/generic.js");class i extends s.Callable{_call(p,u){throw Error("StoppingCriteria needs to be subclassed")}}class n extends s.Callable{constructor(){super(),this.criteria=[]}push(p){this.criteria.push(p)}extend(p){p instanceof n?p=p.criteria:p instanceof i&&(p=[p]),this.criteria.push(...p)}_call(p,u){const h=new Array(p.length).fill(!1);for(const w of this.criteria){const f=w(p,u);for(let P=0;Pu.length>=this.max_length)}}class a extends i{constructor(p){super(),Array.isArray(p)||(p=[p]),this.eos_token_id=p}_call(p,u){return p.map(h=>{const w=h.at(-1);return this.eos_token_id.some(f=>w==f)})}}class l extends i{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(p,u){return new Array(p.length).fill(this.interrupted)}}},"./src/generation/streamers.js":(e,r,t)=>{t.r(r),t.d(r,{BaseStreamer:()=>o,TextStreamer:()=>l,WhisperTextStreamer:()=>d});var s=t("./src/utils/core.js"),i=t("./src/tokenizers.js"),n=t("./src/env.js");class o{put(u){throw Error("Not implemented")}end(){throw Error("Not implemented")}}const a=n.apis.IS_PROCESS_AVAILABLE?p=>process.stdout.write(p):p=>console.log(p);class l extends o{constructor(u,{skip_prompt:h=!1,callback_function:w=null,token_callback_function:f=null,skip_special_tokens:P=!0,decode_kwargs:A={},...b}={}){super(),this.tokenizer=u,this.skip_prompt=h,this.callback_function=w??a,this.token_callback_function=f,this.decode_kwargs={skip_special_tokens:P,...A,...b},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(u){var A;if(u.length>1)throw Error("TextStreamer only supports batch size of 1");const h=this.next_tokens_are_prompt;if(h&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;const w=u[0];(A=this.token_callback_function)==null||A.call(this,w),this.token_cache=(0,s.mergeArrays)(this.token_cache,w);const f=this.tokenizer.decode(this.token_cache,this.decode_kwargs);let P;h||f.endsWith(` -`)?(P=f.slice(this.print_len),this.token_cache=[],this.print_len=0):f.length>0&&(0,i.is_chinese_char)(f.charCodeAt(f.length-1))?(P=f.slice(this.print_len),this.print_len+=P.length):(P=f.slice(this.print_len,f.lastIndexOf(" ")+1),this.print_len+=P.length),this.on_finalized_text(P,!1)}end(){let u;this.token_cache.length>0?(u=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len),this.token_cache=[],this.print_len=0):u="",this.next_tokens_are_prompt=!0,this.on_finalized_text(u,!0)}on_finalized_text(u,h){var w,f;u.length>0&&((w=this.callback_function)==null||w.call(this,u)),h&&this.callback_function===a&&n.apis.IS_PROCESS_AVAILABLE&&((f=this.callback_function)==null||f.call(this,` -`))}}class d extends l{constructor(u,{skip_prompt:h=!1,callback_function:w=null,token_callback_function:f=null,on_chunk_start:P=null,on_chunk_end:A=null,on_finalize:b=null,time_precision:y=.02,skip_special_tokens:$=!0,decode_kwargs:T={}}={}){super(u,{skip_prompt:h,skip_special_tokens:$,callback_function:w,token_callback_function:f,decode_kwargs:T}),this.timestamp_begin=u.timestamp_begin,this.on_chunk_start=P,this.on_chunk_end=A,this.on_finalize=b,this.time_precision=y,this.waiting_for_timestamp=!1}put(u){var w,f;if(u.length>1)throw Error("WhisperTextStreamer only supports batch size of 1");const h=u[0];if(h.length===1){const P=Number(h[0])-this.timestamp_begin;if(P>=0){const A=P*this.time_precision;this.waiting_for_timestamp?(w=this.on_chunk_end)==null||w.call(this,A):(f=this.on_chunk_start)==null||f.call(this,A),this.waiting_for_timestamp=!this.waiting_for_timestamp,u=[[]]}}return super.put(u)}end(){var u;super.end(),(u=this.on_finalize)==null||u.call(this)}}},"./src/models.js":(e,r,t)=>{t.r(r),t.d(r,{ASTForAudioClassification:()=>Ua,ASTModel:()=>ja,ASTPreTrainedModel:()=>Gi,AlbertForMaskedLM:()=>j,AlbertForQuestionAnswering:()=>F,AlbertForSequenceClassification:()=>ue,AlbertModel:()=>Cn,AlbertPreTrainedModel:()=>Ss,AutoModel:()=>Tu,AutoModelForAudioClassification:()=>tb,AutoModelForAudioFrameClassification:()=>sb,AutoModelForAudioTextToText:()=>pb,AutoModelForCTC:()=>eb,AutoModelForCausalLM:()=>V0,AutoModelForDepthEstimation:()=>ab,AutoModelForDocumentQuestionAnswering:()=>nb,AutoModelForImageClassification:()=>H0,AutoModelForImageFeatureExtraction:()=>cb,AutoModelForImageMatting:()=>ib,AutoModelForImageSegmentation:()=>q0,AutoModelForImageTextToText:()=>ub,AutoModelForImageToImage:()=>ob,AutoModelForMaskGeneration:()=>Z0,AutoModelForMaskedLM:()=>W0,AutoModelForNormalEstimation:()=>lb,AutoModelForObjectDetection:()=>J0,AutoModelForPoseEstimation:()=>db,AutoModelForQuestionAnswering:()=>G0,AutoModelForSemanticSegmentation:()=>Q0,AutoModelForSeq2SeqLM:()=>R0,AutoModelForSequenceClassification:()=>z0,AutoModelForSpeechSeq2Seq:()=>N0,AutoModelForTextToSpectrogram:()=>j0,AutoModelForTextToWaveform:()=>U0,AutoModelForTokenClassification:()=>B0,AutoModelForUniversalSegmentation:()=>X0,AutoModelForVision2Seq:()=>K0,AutoModelForXVector:()=>rb,AutoModelForZeroShotObjectDetection:()=>Y0,BartForConditionalGeneration:()=>Wt,BartForSequenceClassification:()=>Ot,BartModel:()=>kt,BartPretrainedModel:()=>Ct,BaseModelOutput:()=>Pe,BeitForImageClassification:()=>kl,BeitModel:()=>$l,BeitPreTrainedModel:()=>na,BertForMaskedLM:()=>Ie,BertForQuestionAnswering:()=>Ve,BertForSequenceClassification:()=>Le,BertForTokenClassification:()=>Ne,BertModel:()=>Ae,BertPreTrainedModel:()=>Te,BlenderbotForConditionalGeneration:()=>Zt,BlenderbotModel:()=>Gt,BlenderbotPreTrainedModel:()=>gs,BlenderbotSmallForConditionalGeneration:()=>ws,BlenderbotSmallModel:()=>Zr,BlenderbotSmallPreTrainedModel:()=>gr,BloomForCausalLM:()=>No,BloomModel:()=>Ro,BloomPreTrainedModel:()=>wi,CLIPModel:()=>Zi,CLIPPreTrainedModel:()=>js,CLIPSegForImageSegmentation:()=>eo,CLIPSegModel:()=>nn,CLIPSegPreTrainedModel:()=>sn,CLIPTextModel:()=>Yc,CLIPTextModelWithProjection:()=>Ja,CLIPVisionModel:()=>Zc,CLIPVisionModelWithProjection:()=>Qn,CamembertForMaskedLM:()=>xs,CamembertForQuestionAnswering:()=>Ds,CamembertForSequenceClassification:()=>Ts,CamembertForTokenClassification:()=>Es,CamembertModel:()=>us,CamembertPreTrainedModel:()=>Ur,CausalLMOutput:()=>Fn,CausalLMOutputWithPast:()=>Cx,ChineseCLIPModel:()=>rl,ChineseCLIPPreTrainedModel:()=>tl,ClapAudioModelWithProjection:()=>yM,ClapModel:()=>gM,ClapPreTrainedModel:()=>Wl,ClapTextModelWithProjection:()=>wM,CodeGenForCausalLM:()=>Vr,CodeGenModel:()=>In,CodeGenPreTrainedModel:()=>ti,CohereForCausalLM:()=>vo,CohereModel:()=>bo,CoherePreTrainedModel:()=>ci,ConvBertForMaskedLM:()=>jt,ConvBertForQuestionAnswering:()=>Fs,ConvBertForSequenceClassification:()=>dr,ConvBertForTokenClassification:()=>ds,ConvBertModel:()=>nr,ConvBertPreTrainedModel:()=>wt,ConvNextForImageClassification:()=>hy,ConvNextModel:()=>py,ConvNextPreTrainedModel:()=>ru,ConvNextV2ForImageClassification:()=>_y,ConvNextV2Model:()=>my,ConvNextV2PreTrainedModel:()=>su,DPTForDepthEstimation:()=>qw,DPTModel:()=>an,DPTPreTrainedModel:()=>Pr,DacDecoderModel:()=>a0,DacDecoderOutput:()=>n0,DacEncoderModel:()=>o0,DacEncoderOutput:()=>s0,DacModel:()=>i0,DacPreTrainedModel:()=>Jl,DebertaForMaskedLM:()=>et,DebertaForQuestionAnswering:()=>zt,DebertaForSequenceClassification:()=>it,DebertaForTokenClassification:()=>rr,DebertaModel:()=>Be,DebertaPreTrainedModel:()=>mr,DebertaV2ForMaskedLM:()=>hs,DebertaV2ForQuestionAnswering:()=>_s,DebertaV2ForSequenceClassification:()=>Er,DebertaV2ForTokenClassification:()=>ms,DebertaV2Model:()=>ps,DebertaV2PreTrainedModel:()=>Ir,DecisionTransformerModel:()=>NM,DecisionTransformerPreTrainedModel:()=>RM,DeiTForImageClassification:()=>c,DeiTModel:()=>ca,DeiTPreTrainedModel:()=>da,DepthAnythingForDepthEstimation:()=>Xw,DepthAnythingPreTrainedModel:()=>Qw,DepthProForDepthEstimation:()=>ty,DepthProPreTrainedModel:()=>ey,DetrForObjectDetection:()=>Al,DetrForSegmentation:()=>ia,DetrModel:()=>Il,DetrObjectDetectionOutput:()=>oa,DetrPreTrainedModel:()=>xi,DetrSegmentationOutput:()=>Fl,Dinov2ForImageClassification:()=>gy,Dinov2Model:()=>fy,Dinov2PreTrainedModel:()=>nu,Dinov2WithRegistersForImageClassification:()=>yy,Dinov2WithRegistersModel:()=>wy,Dinov2WithRegistersPreTrainedModel:()=>iu,DistilBertForMaskedLM:()=>Js,DistilBertForQuestionAnswering:()=>Xs,DistilBertForSequenceClassification:()=>qs,DistilBertForTokenClassification:()=>Qs,DistilBertModel:()=>Ps,DistilBertPreTrainedModel:()=>Qr,DonutSwinModel:()=>uy,DonutSwinPreTrainedModel:()=>cy,EfficientNetForImageClassification:()=>PM,EfficientNetModel:()=>EM,EfficientNetPreTrainedModel:()=>_u,ElectraForMaskedLM:()=>Os,ElectraForQuestionAnswering:()=>qr,ElectraForSequenceClassification:()=>jr,ElectraForTokenClassification:()=>dt,ElectraModel:()=>cs,ElectraPreTrainedModel:()=>Dr,EsmForMaskedLM:()=>Zs,EsmForSequenceClassification:()=>en,EsmForTokenClassification:()=>Lr,EsmModel:()=>Ys,EsmPreTrainedModel:()=>fs,ExaoneForCausalLM:()=>mt,ExaoneModel:()=>mo,ExaonePreTrainedModel:()=>Us,FalconForCausalLM:()=>fM,FalconModel:()=>_M,FalconPreTrainedModel:()=>pu,FastViTForImageClassification:()=>wl,FastViTModel:()=>gl,FastViTPreTrainedModel:()=>Zo,Florence2ForConditionalGeneration:()=>Qi,Florence2PreTrainedModel:()=>Qa,GLPNForDepthEstimation:()=>dy,GLPNModel:()=>ly,GLPNPreTrainedModel:()=>tu,GPT2LMHeadModel:()=>Yn,GPT2Model:()=>ol,GPT2PreTrainedModel:()=>to,GPTBigCodeForCausalLM:()=>co,GPTBigCodeModel:()=>ll,GPTBigCodePreTrainedModel:()=>Oe,GPTJForCausalLM:()=>kn,GPTJModel:()=>lo,GPTJPreTrainedModel:()=>ao,GPTNeoForCausalLM:()=>io,GPTNeoModel:()=>no,GPTNeoPreTrainedModel:()=>Zn,GPTNeoXForCausalLM:()=>oo,GPTNeoXModel:()=>al,GPTNeoXPreTrainedModel:()=>ei,Gemma2ForCausalLM:()=>Po,Gemma2Model:()=>Eo,Gemma2PreTrainedModel:()=>pi,Gemma3ForCausalLM:()=>So,Gemma3Model:()=>Co,Gemma3PreTrainedModel:()=>hi,GemmaForCausalLM:()=>To,GemmaModel:()=>xo,GemmaPreTrainedModel:()=>ui,GlmForCausalLM:()=>ft,GlmModel:()=>ho,GlmPreTrainedModel:()=>ii,GraniteForCausalLM:()=>Mo,GraniteModel:()=>yo,GranitePreTrainedModel:()=>di,GroundingDinoForObjectDetection:()=>by,GroundingDinoPreTrainedModel:()=>My,GroupViTModel:()=>fl,GroupViTPreTrainedModel:()=>_l,HeliumForCausalLM:()=>ni,HeliumModel:()=>po,HeliumPreTrainedModel:()=>si,HieraForImageClassification:()=>C,HieraModel:()=>v,HieraPreTrainedModel:()=>m,HubertForCTC:()=>Jy,HubertForSequenceClassification:()=>Yy,HubertModel:()=>Xy,HubertPreTrainedModel:()=>hx,IJepaForImageClassification:()=>qo,IJepaModel:()=>Ho,IJepaPreTrainedModel:()=>vi,Idefics3ForConditionalGeneration:()=>Hn,Idefics3PreTrainedModel:()=>Xa,ImageMattingOutput:()=>mb,JAISLMHeadModel:()=>so,JAISModel:()=>ro,JAISPreTrainedModel:()=>$n,JinaCLIPModel:()=>sl,JinaCLIPPreTrainedModel:()=>Jn,JinaCLIPTextModel:()=>nl,JinaCLIPVisionModel:()=>il,LiteWhisperForConditionalGeneration:()=>Wa,LlamaForCausalLM:()=>uo,LlamaModel:()=>ri,LlamaPreTrainedModel:()=>on,LlavaForConditionalGeneration:()=>Kn,LlavaOnevisionForConditionalGeneration:()=>Ha,LlavaPreTrainedModel:()=>Ka,LongT5ForConditionalGeneration:()=>qe,LongT5Model:()=>We,LongT5PreTrainedModel:()=>Ce,M2M100ForConditionalGeneration:()=>Iy,M2M100Model:()=>ky,M2M100PreTrainedModel:()=>lu,MBartForCausalLM:()=>xr,MBartForConditionalGeneration:()=>fr,MBartForSequenceClassification:()=>Yr,MBartModel:()=>vr,MBartPreTrainedModel:()=>Ut,MPNetForMaskedLM:()=>zr,MPNetForQuestionAnswering:()=>Fr,MPNetForSequenceClassification:()=>En,MPNetForTokenClassification:()=>Bs,MPNetModel:()=>Tn,MPNetPreTrainedModel:()=>Xr,MT5ForConditionalGeneration:()=>ht,MT5Model:()=>Ze,MT5PreTrainedModel:()=>Ke,MarianMTModel:()=>$y,MarianModel:()=>Sy,MarianPreTrainedModel:()=>au,MaskFormerForInstanceSegmentation:()=>ay,MaskFormerModel:()=>oy,MaskFormerPreTrainedModel:()=>eu,MaskedLMOutput:()=>wr,Metric3DForDepthEstimation:()=>sy,Metric3DPreTrainedModel:()=>ry,Metric3Dv2ForDepthEstimation:()=>iy,Metric3Dv2PreTrainedModel:()=>ny,MgpstrForSceneTextRecognition:()=>GM,MgpstrModelOutput:()=>VM,MgpstrPreTrainedModel:()=>WM,MimiDecoderModel:()=>r0,MimiDecoderOutput:()=>ZM,MimiEncoderModel:()=>t0,MimiEncoderOutput:()=>YM,MimiModel:()=>e0,MimiPreTrainedModel:()=>Xl,MistralForCausalLM:()=>pM,MistralModel:()=>uM,MistralPreTrainedModel:()=>cu,MobileBertForMaskedLM:()=>Ls,MobileBertForQuestionAnswering:()=>Ar,MobileBertForSequenceClassification:()=>zs,MobileBertModel:()=>br,MobileBertPreTrainedModel:()=>Cs,MobileLLMForCausalLM:()=>_o,MobileLLMModel:()=>_t,MobileLLMPreTrainedModel:()=>An,MobileNetV1ForImageClassification:()=>SM,MobileNetV1ForSemanticSegmentation:()=>$M,MobileNetV1Model:()=>CM,MobileNetV1PreTrainedModel:()=>Kl,MobileNetV2ForImageClassification:()=>IM,MobileNetV2ForSemanticSegmentation:()=>AM,MobileNetV2Model:()=>kM,MobileNetV2PreTrainedModel:()=>Hl,MobileNetV3ForImageClassification:()=>OM,MobileNetV3ForSemanticSegmentation:()=>DM,MobileNetV3Model:()=>FM,MobileNetV3PreTrainedModel:()=>ql,MobileNetV4ForImageClassification:()=>zM,MobileNetV4ForSemanticSegmentation:()=>BM,MobileNetV4Model:()=>LM,MobileNetV4PreTrainedModel:()=>Ql,MobileViTForImageClassification:()=>vl,MobileViTModel:()=>bl,MobileViTPreTrainedModel:()=>ea,MobileViTV2ForImageClassification:()=>Tl,MobileViTV2Model:()=>xl,MobileViTV2PreTrainedModel:()=>ta,ModelOutput:()=>pe,ModernBertForMaskedLM:()=>z,ModernBertForSequenceClassification:()=>ee,ModernBertForTokenClassification:()=>ce,ModernBertModel:()=>Z,ModernBertPreTrainedModel:()=>D,Moondream1ForConditionalGeneration:()=>qa,MoonshineForConditionalGeneration:()=>Ga,MoonshineModel:()=>Jc,MoonshinePreTrainedModel:()=>Hi,MptForCausalLM:()=>Uo,MptModel:()=>jo,MptPreTrainedModel:()=>yi,MultiModalityCausalLM:()=>UM,MultiModalityPreTrainedModel:()=>jM,MusicgenForCausalLM:()=>gx,MusicgenForConditionalGeneration:()=>gu,MusicgenModel:()=>fx,MusicgenPreTrainedModel:()=>fu,NomicBertModel:()=>ve,NomicBertPreTrainedModel:()=>be,OPTForCausalLM:()=>Wo,OPTModel:()=>Vo,OPTPreTrainedModel:()=>Mi,Olmo2ForCausalLM:()=>li,Olmo2Model:()=>wo,Olmo2PreTrainedModel:()=>ai,OlmoForCausalLM:()=>go,OlmoModel:()=>fo,OlmoPreTrainedModel:()=>oi,OpenELMForCausalLM:()=>ko,OpenELMModel:()=>$o,OpenELMPreTrainedModel:()=>mi,OwlViTForObjectDetection:()=>Pl,OwlViTModel:()=>El,OwlViTPreTrainedModel:()=>ra,Owlv2ForObjectDetection:()=>Sl,Owlv2Model:()=>Cl,Owlv2PreTrainedModel:()=>sa,PaliGemmaForConditionalGeneration:()=>Ji,PaliGemmaPreTrainedModel:()=>Xi,PatchTSMixerForPrediction:()=>QM,PatchTSMixerModel:()=>qM,PatchTSMixerPreTrainedModel:()=>yu,PatchTSTForPrediction:()=>HM,PatchTSTModel:()=>KM,PatchTSTPreTrainedModel:()=>wu,Phi3ForCausalLM:()=>Bo,Phi3Model:()=>zo,Phi3PreTrainedModel:()=>gi,Phi3VForCausalLM:()=>Ns,Phi3VPreTrainedModel:()=>Yi,PhiForCausalLM:()=>Lo,PhiModel:()=>Do,PhiPreTrainedModel:()=>fi,PreTrainedModel:()=>U,PretrainedMixin:()=>It,PvtForImageClassification:()=>cl,PvtModel:()=>dl,PvtPreTrainedModel:()=>Jo,PyAnnoteForAudioFrameClassification:()=>zy,PyAnnoteModel:()=>Ly,PyAnnotePreTrainedModel:()=>du,QuestionAnsweringModelOutput:()=>Cr,Qwen2ForCausalLM:()=>Ao,Qwen2Model:()=>Io,Qwen2PreTrainedModel:()=>_i,Qwen2VLForConditionalGeneration:()=>Oo,Qwen2VLPreTrainedModel:()=>Fo,RTDetrForObjectDetection:()=>Dl,RTDetrModel:()=>Ol,RTDetrObjectDetectionOutput:()=>Ll,RTDetrPreTrainedModel:()=>aa,ResNetForImageClassification:()=>se,ResNetModel:()=>W,ResNetPreTrainedModel:()=>I,RoFormerForMaskedLM:()=>je,RoFormerForQuestionAnswering:()=>ut,RoFormerForSequenceClassification:()=>Qe,RoFormerForTokenClassification:()=>Xe,RoFormerModel:()=>Fe,RoFormerPreTrainedModel:()=>Re,RobertaForMaskedLM:()=>Rt,RobertaForQuestionAnswering:()=>er,RobertaForSequenceClassification:()=>Jt,RobertaForTokenClassification:()=>qt,RobertaModel:()=>ur,RobertaPreTrainedModel:()=>Ht,SamImageSegmentationOutput:()=>Cy,SamModel:()=>Py,SamPreTrainedModel:()=>Ey,SapiensForDepthEstimation:()=>Yw,SapiensForNormalEstimation:()=>Zw,SapiensForSemanticSegmentation:()=>Jw,SapiensPreTrainedModel:()=>Nl,SegformerForImageClassification:()=>bM,SegformerForSemanticSegmentation:()=>vM,SegformerModel:()=>_x,SegformerPreTrainedModel:()=>Gl,Seq2SeqLMOutput:()=>Px,SequenceClassifierOutput:()=>bt,SiglipModel:()=>Ya,SiglipPreTrainedModel:()=>Xn,SiglipTextModel:()=>Za,SiglipVisionModel:()=>el,SmolVLMForConditionalGeneration:()=>qn,SnacDecoderModel:()=>c0,SnacEncoderModel:()=>d0,SnacModel:()=>l0,SnacPreTrainedModel:()=>Yl,SpeechT5ForSpeechToText:()=>oM,SpeechT5ForTextToSpeech:()=>aM,SpeechT5HifiGan:()=>lM,SpeechT5Model:()=>mx,SpeechT5PreTrainedModel:()=>Vl,SqueezeBertForMaskedLM:()=>_r,SqueezeBertForQuestionAnswering:()=>Pn,SqueezeBertForSequenceClassification:()=>Rs,SqueezeBertModel:()=>cr,SqueezeBertPreTrainedModel:()=>Jr,StableLmForCausalLM:()=>TM,StableLmModel:()=>xM,StableLmPreTrainedModel:()=>mu,Starcoder2ForCausalLM:()=>mM,Starcoder2Model:()=>hM,Starcoder2PreTrainedModel:()=>uu,StyleTextToSpeech2Model:()=>iM,StyleTextToSpeech2PreTrainedModel:()=>nM,Swin2SRForImageSuperResolution:()=>Bt,Swin2SRModel:()=>gt,Swin2SRPreTrainedModel:()=>ot,SwinForImageClassification:()=>ze,SwinForSemanticSegmentation:()=>Ye,SwinModel:()=>Ee,SwinPreTrainedModel:()=>ge,T5ForConditionalGeneration:()=>he,T5Model:()=>de,T5PreTrainedModel:()=>te,TableTransformerForObjectDetection:()=>Bl,TableTransformerModel:()=>zl,TableTransformerObjectDetectionOutput:()=>Rl,TableTransformerPreTrainedModel:()=>la,TokenClassifierOutput:()=>pr,TrOCRForCausalLM:()=>cM,TrOCRPreTrainedModel:()=>dM,UltravoxModel:()=>JM,UltravoxPreTrainedModel:()=>XM,UniSpeechForCTC:()=>jy,UniSpeechForSequenceClassification:()=>Uy,UniSpeechModel:()=>Ny,UniSpeechPreTrainedModel:()=>jl,UniSpeechSatForAudioFrameClassification:()=>Ky,UniSpeechSatForCTC:()=>Wy,UniSpeechSatForSequenceClassification:()=>Gy,UniSpeechSatModel:()=>Vy,UniSpeechSatPreTrainedModel:()=>ua,ViTForImageClassification:()=>Ko,ViTMAEModel:()=>pl,ViTMAEPreTrainedModel:()=>ul,ViTMSNForImageClassification:()=>ml,ViTMSNModel:()=>hl,ViTMSNPreTrainedModel:()=>Yo,ViTModel:()=>Go,ViTPreTrainedModel:()=>bi,VisionEncoderDecoderModel:()=>qi,VitMatteForImageMatting:()=>Ml,VitMattePreTrainedModel:()=>yl,VitPoseForPoseEstimation:()=>Xo,VitPosePreTrainedModel:()=>Qo,VitsModel:()=>hu,VitsModelOutput:()=>_b,VitsPreTrainedModel:()=>MM,Wav2Vec2BertForCTC:()=>qy,Wav2Vec2BertForSequenceClassification:()=>Qy,Wav2Vec2BertModel:()=>Hy,Wav2Vec2BertPreTrainedModel:()=>Ul,Wav2Vec2ForAudioFrameClassification:()=>Dy,Wav2Vec2ForCTC:()=>Fy,Wav2Vec2ForSequenceClassification:()=>Oy,Wav2Vec2Model:()=>Ay,Wav2Vec2PreTrainedModel:()=>ln,WavLMForAudioFrameClassification:()=>sM,WavLMForCTC:()=>eM,WavLMForSequenceClassification:()=>tM,WavLMForXVector:()=>rM,WavLMModel:()=>Zy,WavLMPreTrainedModel:()=>Ti,WeSpeakerResNetModel:()=>Ry,WeSpeakerResNetPreTrainedModel:()=>By,WhisperForConditionalGeneration:()=>Ki,WhisperModel:()=>Va,WhisperPreTrainedModel:()=>Gn,XLMForQuestionAnswering:()=>za,XLMForSequenceClassification:()=>La,XLMForTokenClassification:()=>Vi,XLMModel:()=>tn,XLMPreTrainedModel:()=>ir,XLMRobertaForMaskedLM:()=>Ra,XLMRobertaForQuestionAnswering:()=>Wi,XLMRobertaForSequenceClassification:()=>Sn,XLMRobertaForTokenClassification:()=>Na,XLMRobertaModel:()=>Ba,XLMRobertaPreTrainedModel:()=>ys,XLMWithLMHeadModel:()=>rn,XVectorOutput:()=>hb,YolosForObjectDetection:()=>xy,YolosModel:()=>vy,YolosObjectDetectionOutput:()=>Ty,YolosPreTrainedModel:()=>ou});var s=t("./src/configs.js"),i=t("./src/backends/onnx.js"),n=t("./src/utils/dtypes.js"),o=t("./src/utils/generic.js"),a=t("./src/utils/core.js"),l=t("./src/utils/hub.js"),d=t("./src/utils/constants.js"),p=t("./src/generation/logits_process.js"),u=t("./src/generation/configuration_utils.js"),h=t("./src/utils/tensor.js"),w=t("./src/utils/image.js"),f=t("./src/utils/maths.js"),P=t("./src/generation/stopping_criteria.js"),A=t("./src/generation/logits_sampler.js"),b=t("./src/env.js"),y=t("./src/models/whisper/generation_whisper.js"),$=t("./src/models/whisper/common_whisper.js");const T={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11},g=new Map,M=new Map,E=new Map;async function k(x,S,L){var yr;const oe=((yr=L.config)==null?void 0:yr["transformers.js_config"])??{};let fe=L.device??oe.device;fe&&typeof fe!="string"&&(fe.hasOwnProperty(S)?fe=fe[S]:(console.warn(`device not specified for "${S}". Using the default device.`),fe=null));const me=fe??(b.apis.IS_NODE_ENV?"cpu":"wasm"),Se=(0,i.deviceToExecutionProviders)(me);let De=L.dtype??oe.dtype;if(typeof De!="string"&&(De&&De.hasOwnProperty(S)?De=De[S]:(De=n.DEFAULT_DEVICE_DTYPE_MAPPING[me]??n.DATA_TYPES.fp32,console.warn(`dtype not specified for "${S}". Using the default dtype (${De}) for this device (${me}).`))),De===n.DATA_TYPES.auto){let Pt=oe.dtype;typeof Pt!="string"&&(Pt=Pt[S]),Pt&&Pt!==n.DATA_TYPES.auto&&n.DATA_TYPES.hasOwnProperty(Pt)?De=Pt:De=n.DEFAULT_DEVICE_DTYPE_MAPPING[me]??n.DATA_TYPES.fp32}const Ge=De;if(n.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(Ge)){if(Ge===n.DATA_TYPES.fp16&&me==="webgpu"&&!await(0,n.isWebGpuFp16Supported)())throw new Error(`The device (${me}) does not support fp16.`)}else throw new Error(`Invalid dtype: ${Ge}. Should be one of: ${Object.keys(n.DATA_TYPES).join(", ")}`);const Je=oe.kv_cache_dtype?typeof oe.kv_cache_dtype=="string"?oe.kv_cache_dtype:oe.kv_cache_dtype[Ge]??"float32":void 0;if(Je&&!["float32","float16"].includes(Je))throw new Error(`Invalid kv_cache_dtype: ${Je}. Should be one of: float32, float16`);const lt={dtype:Ge,kv_cache_dtype:Je},yt=n.DEFAULT_DTYPE_SUFFIX_MAPPING[Ge],st=`${S}${yt}.onnx`,Et=`${L.subfolder??""}/${st}`,at={...L.session_options};at.executionProviders??(at.executionProviders=Se);const vt=oe.free_dimension_overrides;vt?at.freeDimensionOverrides??(at.freeDimensionOverrides=vt):me.startsWith("webnn")&&!at.freeDimensionOverrides&&console.warn('WebNN does not currently support dynamic shapes and requires `free_dimension_overrides` to be set in config.json as a field within "transformers.js_config". When `free_dimension_overrides` is not set, you may experience significant performance degradation.');const ct=(0,l.getModelFile)(x,Et,!0,L,b.apis.IS_NODE_ENV),Tt=L.use_external_data_format??oe.use_external_data_format;let Lt=[];if(Tt){let Pt;typeof Tt=="object"?Tt.hasOwnProperty(st)?Pt=Tt[st]:Tt.hasOwnProperty(S)?Pt=Tt[S]:Pt=!1:Pt=Tt;const Nt=+Pt;if(Nt>l.MAX_EXTERNAL_DATA_CHUNKS)throw new Error(`The number of external data chunks (${Nt}) exceeds the maximum allowed value (${l.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let tr=0;tr{const Sr=await(0,l.getModelFile)(x,Wr,!0,L,b.apis.IS_NODE_ENV);dn(Sr instanceof Uint8Array?{path:sr,data:Sr}:sr)}))}}else at.externalData!==void 0&&(Lt=at.externalData.map(async Pt=>{if(typeof Pt.data=="string"){const Nt=await(0,l.getModelFile)(x,Pt.data,!0,L);return{...Pt,data:Nt}}return Pt}));if(Lt.length>0){const Pt=await Promise.all(Lt);b.apis.IS_NODE_ENV||(at.externalData=Pt)}if(me==="webgpu"){const Pt=(0,s.getKeyValueShapes)(L.config,{prefix:"present"});if(Object.keys(Pt).length>0&&!(0,i.isONNXProxy)()){const Nt={};for(const tr in Pt)Nt[tr]="gpu-buffer";at.preferredOutputLocation=Nt}}return{buffer_or_path:await ct,session_options:at,session_config:lt}}async function B(x,S,L){return Object.fromEntries(await Promise.all(Object.keys(S).map(async oe=>{const{buffer_or_path:fe,session_options:me,session_config:Se}=await k(x,S[oe],L),De=await(0,i.createInferenceSession)(fe,me,Se);return[oe,De]})))}async function N(x,S,L){return Object.fromEntries(await Promise.all(Object.keys(S).map(async oe=>{const fe=await(0,l.getModelJSON)(x,S[oe],!1,L);return[oe,fe]})))}function J(x,S){const L=Object.create(null),oe=[];for(const Se of x.inputNames){const De=S[Se];if(!(De instanceof h.Tensor)){oe.push(Se);continue}L[Se]=(0,i.isONNXProxy)()?De.clone():De}if(oe.length>0)throw new Error(`An error occurred during model execution: "Missing the following inputs: ${oe.join(", ")}.`);const fe=Object.keys(S).length,me=x.inputNames.length;if(fe>me){let Se=Object.keys(S).filter(De=>!x.inputNames.includes(De));console.warn(`WARNING: Too many inputs were provided (${fe} > ${me}). The following inputs will be ignored: "${Se.join(", ")}".`)}return L}async function q(x,S){const L=J(x,S);try{const oe=Object.fromEntries(Object.entries(L).map(([me,Se])=>[me,Se.ort_tensor]));let fe=await x.run(oe);return fe=V(fe),fe}catch(oe){const fe=Object.fromEntries(Object.entries(L).map(([me,{type:Se,dims:De,data:Ge}])=>[me,{type:Se,dims:De,data:Ge}]));throw console.error(`An error occurred during model execution: "${oe}".`),console.error("Inputs given to model:",fe),oe}}function V(x){for(let S in x)(0,i.isONNXTensor)(x[S])?x[S]=new h.Tensor(x[S]):typeof x[S]=="object"&&V(x[S]);return x}function Y(x){if(x instanceof h.Tensor)return x;if(x.length===0)throw Error("items must be non-empty");if(Array.isArray(x[0])){if(x.some(S=>S.length!==x[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 h.Tensor("int64",BigInt64Array.from(x.flat().map(S=>BigInt(S))),[x.length,x[0].length])}else return new h.Tensor("int64",BigInt64Array.from(x.map(S=>BigInt(S))),[1,x.length])}function H(x){return new h.Tensor("bool",[x],[1])}async function Q(x,S){let{encoder_outputs:L,input_ids:oe,decoder_input_ids:fe,...me}=S;if(!L){const De=(0,a.pick)(S,x.sessions.model.inputNames);L=(await ie(x,De)).last_hidden_state}return me.input_ids=fe,me.encoder_hidden_states=L,x.sessions.decoder_model_merged.inputNames.includes("encoder_attention_mask")&&(me.encoder_attention_mask=S.attention_mask),await ae(x,me,!0)}async function ie(x,S){const L=x.sessions.model,oe=(0,a.pick)(S,L.inputNames);if(L.inputNames.includes("inputs_embeds")&&!oe.inputs_embeds){if(!S.input_ids)throw new Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");oe.inputs_embeds=await x.encode_text({input_ids:S.input_ids})}if(L.inputNames.includes("token_type_ids")&&!oe.token_type_ids){if(!oe.input_ids)throw new Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");oe.token_type_ids=(0,h.zeros_like)(oe.input_ids)}if(L.inputNames.includes("pixel_mask")&&!oe.pixel_mask){if(!oe.pixel_values)throw new Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");const fe=oe.pixel_values.dims;oe.pixel_mask=(0,h.ones)([fe[0],fe[2],fe[3]])}return await q(L,oe)}async function le(x,S){const L=await x.encode(S);return await x.decode(L)}async function ae(x,S,L=!1){const oe=x.sessions[L?"decoder_model_merged":"model"],{past_key_values:fe,...me}=S;if(oe.inputNames.includes("use_cache_branch")&&(me.use_cache_branch=H(!!fe)),oe.inputNames.includes("position_ids")&&me.attention_mask&&!me.position_ids){const De=["paligemma","gemma3_text","gemma3"].includes(x.config.model_type)?1:0;me.position_ids=_e(me,fe,De)}x.addPastKeyValues(me,fe);const Se=(0,a.pick)(me,oe.inputNames);return await q(oe,Se)}function we({modality_token_id:x,inputs_embeds:S,modality_features:L,input_ids:oe,attention_mask:fe}){const me=oe.tolist().map(Je=>Je.reduce((lt,yt,st)=>(yt==x&<.push(st),lt),[])),Se=me.reduce((Je,lt)=>Je+lt.length,0),De=L.dims[0];if(Se!==De)throw new Error(`Number of tokens and features do not match: tokens: ${Se}, features ${De}`);let Ge=0;for(let Je=0;Jeme.dims[1])){if(feDe==x.config.image_token_index)){const De=x.config.num_image_tokens;if(!De)throw new Error("`num_image_tokens` is missing in the model configuration.");const Ge=me.dims[1]-(fe-De);L.input_ids=me.slice(null,[-Ge,null]),L.attention_mask=(0,h.ones)([1,fe+Ge])}}}return L}function He(x,S,L,oe){return L.past_key_values&&(S=S.map(fe=>[fe.at(-1)])),{...L,decoder_input_ids:Y(S)}}function Me(x,...S){return x.config.is_encoder_decoder?He(x,...S):ke(x,...S)}function K(x,S,L,oe){const fe=!!L.past_key_values;return oe.guidance_scale!==null&&oe.guidance_scale>1&&(fe?L.input_ids=(0,h.cat)([L.input_ids,L.input_ids],0):(L.input_ids=(0,h.cat)([L.input_ids,(0,h.full_like)(L.input_ids,BigInt(oe.pad_token_id))],0),L.attention_mask=(0,h.cat)([L.attention_mask,(0,h.full_like)(L.attention_mask,0n)],0))),(fe||!L.pixel_values)&&(L.pixel_values=(0,h.full)([0,0,3,384,384],1)),fe&&(L.images_seq_mask=new h.Tensor("bool",new Array(1).fill(!0).fill(!1,0,1),[1,1]),L.images_emb_mask=new h.Tensor("bool",new Array(0).fill(!1),[1,1,0])),L}class U extends o.Callable{constructor(L,oe,fe){super();re(this,"main_input_name","input_ids");re(this,"forward_params",["input_ids","attention_mask"]);this.config=L,this.sessions=oe,this.configs=fe;const me=E.get(this.constructor),Se=g.get(me);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,Se){case T.DecoderOnly:this.can_generate=!0,this._forward=ae,this._prepare_inputs_for_generation=ke;break;case T.Seq2Seq:case T.Vision2Seq:case T.Musicgen:this.can_generate=!0,this._forward=Q,this._prepare_inputs_for_generation=He;break;case T.EncoderDecoder:this._forward=Q;break;case T.ImageTextToText:this.can_generate=!0,this._forward=X,this._prepare_inputs_for_generation=Me;break;case T.AudioTextToText:this.can_generate=!0,this._forward=ne,this._prepare_inputs_for_generation=Me;break;case T.Phi3V:this.can_generate=!0,this._prepare_inputs_for_generation=Me;break;case T.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=K;break;case T.AutoEncoder:this._forward=le;break;default:this._forward=ie;break}this.can_generate&&this.forward_params.push("past_key_values"),this.custom_config=this.config["transformers.js_config"]??{}}async dispose(){var oe;const L=[];for(const fe of Object.values(this.sessions))(oe=fe==null?void 0:fe.handler)!=null&&oe.dispose&&L.push(fe.handler.dispose());return await Promise.all(L)}static async from_pretrained(L,{progress_callback:oe=null,config:fe=null,cache_dir:me=null,local_files_only:Se=!1,revision:De="main",model_file_name:Ge=null,subfolder:Je="onnx",device:lt=null,dtype:yt=null,use_external_data_format:st=null,session_options:Et={}}={}){let at={progress_callback:oe,config:fe,cache_dir:me,local_files_only:Se,revision:De,model_file_name:Ge,subfolder:Je,device:lt,dtype:yt,use_external_data_format:st,session_options:Et};const vt=E.get(this),ct=g.get(vt);fe=at.config=await s.AutoConfig.from_pretrained(L,at);let Tt;if(ct===T.DecoderOnly)Tt=await Promise.all([B(L,{model:at.model_file_name??"model"},at),N(L,{generation_config:"generation_config.json"},at)]);else if(ct===T.Seq2Seq||ct===T.Vision2Seq)Tt=await Promise.all([B(L,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},at),N(L,{generation_config:"generation_config.json"},at)]);else if(ct===T.MaskGeneration)Tt=await Promise.all([B(L,{model:"vision_encoder",prompt_encoder_mask_decoder:"prompt_encoder_mask_decoder"},at)]);else if(ct===T.EncoderDecoder)Tt=await Promise.all([B(L,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},at)]);else if(ct===T.ImageTextToText){const Lt={embed_tokens:"embed_tokens",vision_encoder:"vision_encoder",decoder_model_merged:"decoder_model_merged"};fe.is_encoder_decoder&&(Lt.model="encoder_model"),Tt=await Promise.all([B(L,Lt,at),N(L,{generation_config:"generation_config.json"},at)])}else if(ct===T.AudioTextToText){const Lt={embed_tokens:"embed_tokens",audio_encoder:"audio_encoder",decoder_model_merged:"decoder_model_merged"};Tt=await Promise.all([B(L,Lt,at),N(L,{generation_config:"generation_config.json"},at)])}else if(ct===T.Musicgen)Tt=await Promise.all([B(L,{model:"text_encoder",decoder_model_merged:"decoder_model_merged",encodec_decode:"encodec_decode"},at),N(L,{generation_config:"generation_config.json"},at)]);else if(ct===T.MultiModality)Tt=await Promise.all([B(L,{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"},at),N(L,{generation_config:"generation_config.json"},at)]);else if(ct===T.Phi3V)Tt=await Promise.all([B(L,{prepare_inputs_embeds:"prepare_inputs_embeds",model:"model",vision_encoder:"vision_encoder"},at),N(L,{generation_config:"generation_config.json"},at)]);else if(ct===T.AutoEncoder)Tt=await Promise.all([B(L,{encoder_model:"encoder_model",decoder_model:"decoder_model"},at)]);else{if(ct!==T.EncoderOnly){const Lt=vt??(fe==null?void 0:fe.model_type);Lt!=="custom"&&console.warn(`Model type for '${Lt}' not found, assuming encoder-only architecture. Please report this at ${d.GITHUB_ISSUE_URL}.`)}Tt=await Promise.all([B(L,{model:at.model_file_name??"model"},at)])}return new this(fe,...Tt)}async _call(L){return await this.forward(L)}async forward(L){return await this._forward(this,L)}get generation_config(){var L;return((L=this.configs)==null?void 0:L.generation_config)??null}_get_logits_warper(L){const oe=new p.LogitsProcessorList;return L.temperature!==null&&L.temperature!==1&&oe.push(new p.TemperatureLogitsWarper(L.temperature)),L.top_k!==null&&L.top_k!==0&&oe.push(new p.TopKLogitsWarper(L.top_k)),L.top_p!==null&&L.top_p<1&&oe.push(new p.TopPLogitsWarper(L.top_p)),oe}_get_logits_processor(L,oe,fe=null){const me=new p.LogitsProcessorList;if(L.repetition_penalty!==null&&L.repetition_penalty!==1&&me.push(new p.RepetitionPenaltyLogitsProcessor(L.repetition_penalty)),L.no_repeat_ngram_size!==null&&L.no_repeat_ngram_size>0&&me.push(new p.NoRepeatNGramLogitsProcessor(L.no_repeat_ngram_size)),L.bad_words_ids!==null&&me.push(new p.NoBadWordsLogitsProcessor(L.bad_words_ids,L.eos_token_id)),L.min_length!==null&&L.eos_token_id!==null&&L.min_length>0&&me.push(new p.MinLengthLogitsProcessor(L.min_length,L.eos_token_id)),L.min_new_tokens!==null&&L.eos_token_id!==null&&L.min_new_tokens>0&&me.push(new p.MinNewTokensLengthLogitsProcessor(oe,L.min_new_tokens,L.eos_token_id)),L.forced_bos_token_id!==null&&me.push(new p.ForcedBOSTokenLogitsProcessor(L.forced_bos_token_id)),L.forced_eos_token_id!==null&&me.push(new p.ForcedEOSTokenLogitsProcessor(L.max_length,L.forced_eos_token_id)),L.begin_suppress_tokens!==null){const Se=oe>1||L.forced_bos_token_id===null?oe:oe+1;me.push(new p.SuppressTokensAtBeginLogitsProcessor(L.begin_suppress_tokens,Se))}return L.guidance_scale!==null&&L.guidance_scale>1&&me.push(new p.ClassifierFreeGuidanceLogitsProcessor(L.guidance_scale)),fe!==null&&me.extend(fe),me}_prepare_generation_config(L,oe,fe=u.GenerationConfig){const me={...this.config};for(const De of["decoder","generator","text_config"])De in me&&Object.assign(me,me[De]);const Se=new fe(me);return Object.assign(Se,this.generation_config??{}),L&&Object.assign(Se,L),oe&&Object.assign(Se,(0,a.pick)(oe,Object.getOwnPropertyNames(Se))),Se}_get_stopping_criteria(L,oe=null){const fe=new P.StoppingCriteriaList;return L.max_length!==null&&fe.push(new P.MaxLengthCriteria(L.max_length,this.config.max_position_embeddings??null)),L.eos_token_id!==null&&fe.push(new P.EosTokenCriteria(L.eos_token_id)),oe&&fe.extend(oe),fe}_validate_model_class(){if(!this.can_generate){const L=[vu,xu,bu,Mu],oe=E.get(this.constructor),fe=new Set,me=this.config.model_type;for(const De of L){const Ge=De.get(me);Ge&&fe.add(Ge[0])}let Se=`The current model class (${oe}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw fe.size>0&&(Se+=` Please use the following class instead: ${[...fe].join(", ")}`),Error(Se)}}prepare_inputs_for_generation(...L){return this._prepare_inputs_for_generation(this,...L)}_update_model_kwargs_for_generation({generated_input_ids:L,outputs:oe,model_inputs:fe,is_encoder_decoder:me}){return fe.past_key_values=this.getPastKeyValues(oe,fe.past_key_values),fe.input_ids=new h.Tensor("int64",L.flat(),[L.length,1]),me||(fe.attention_mask=(0,h.cat)([fe.attention_mask,(0,h.ones)([fe.attention_mask.dims[0],1])],1)),fe.position_ids=null,fe}_prepare_model_inputs({inputs:L,bos_token_id:oe,model_kwargs:fe}){const me=(0,a.pick)(fe,this.forward_params),Se=this.main_input_name;if(Se in me){if(L)throw new Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else me[Se]=L;return{inputs_tensor:me[Se],model_inputs:me,model_input_name:Se}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:L,model_inputs:oe,model_input_name:fe,generation_config:me}){if(this.sessions.model.inputNames.includes("inputs_embeds")&&!oe.inputs_embeds&&"_prepare_inputs_embeds"in this){const{input_ids:De,pixel_values:Ge,attention_mask:Je,...lt}=oe,yt=await this._prepare_inputs_embeds(oe);oe={...lt,...(0,a.pick)(yt,["inputs_embeds","attention_mask"])}}let{last_hidden_state:Se}=await ie(this,oe);if(me.guidance_scale!==null&&me.guidance_scale>1)Se=(0,h.cat)([Se,(0,h.full_like)(Se,0)],0),"attention_mask"in oe&&(oe.attention_mask=(0,h.cat)([oe.attention_mask,(0,h.zeros_like)(oe.attention_mask)],0));else if(oe.decoder_input_ids){const De=Y(oe.decoder_input_ids).dims[0];if(De!==Se.dims[0]){if(Se.dims[0]!==1)throw new Error(`The encoder outputs have a different batch size (${Se.dims[0]}) than the decoder inputs (${De}).`);Se=(0,h.cat)(Array.from({length:De},()=>Se),0)}}return oe.encoder_outputs=Se,oe}_prepare_decoder_input_ids_for_generation({batch_size:L,model_input_name:oe,model_kwargs:fe,decoder_start_token_id:me,bos_token_id:Se,generation_config:De}){let{decoder_input_ids:Ge,...Je}=fe;if(!(Ge instanceof h.Tensor)){if(Ge)Array.isArray(Ge[0])||(Ge=Array.from({length:L},()=>Ge));else if(me??(me=Se),this.config.model_type==="musicgen")Ge=Array.from({length:L*this.config.decoder.num_codebooks},()=>[me]);else if(Array.isArray(me)){if(me.length!==L)throw new Error(`\`decoder_start_token_id\` expcted to have length ${L} but got ${me.length}`);Ge=me}else Ge=Array.from({length:L},()=>[me]);Ge=Y(Ge)}return fe.decoder_attention_mask=(0,h.ones_like)(Ge),{input_ids:Ge,model_inputs:Je}}async generate({inputs:L=null,generation_config:oe=null,logits_processor:fe=null,stopping_criteria:me=null,streamer:Se=null,...De}){this._validate_model_class(),oe=this._prepare_generation_config(oe,De);let{inputs_tensor:Ge,model_inputs:Je,model_input_name:lt}=this._prepare_model_inputs({inputs:L,model_kwargs:De});const yt=this.config.is_encoder_decoder;yt&&("encoder_outputs"in Je||(Je=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:Ge,model_inputs:Je,model_input_name:lt,generation_config:oe})));let st;yt?{input_ids:st,model_inputs:Je}=this._prepare_decoder_input_ids_for_generation({batch_size:Je[lt].dims.at(0),model_input_name:lt,model_kwargs:Je,decoder_start_token_id:oe.decoder_start_token_id,bos_token_id:oe.bos_token_id,generation_config:oe}):st=Je[lt];let Et=st.dims.at(-1);oe.max_new_tokens!==null&&(oe.max_length=Et+oe.max_new_tokens);const at=this._get_logits_processor(oe,Et,fe),vt=this._get_stopping_criteria(oe,me),ct=Je[lt].dims.at(0),Tt=A.LogitsSampler.getSampler(oe),Lt=new Array(ct).fill(0),Qt=st.tolist();Se&&Se.put(Qt);let yr,Pt={};for(;;){if(Je=this.prepare_inputs_for_generation(Qt,Je,oe),yr=await this.forward(Je),oe.output_attentions&&oe.return_dict_in_generate){const Sr=this.getAttentions(yr);for(const $s in Sr)$s in Pt||(Pt[$s]=[]),Pt[$s].push(Sr[$s])}const sr=yr.logits.slice(null,-1,null),Wr=at(Qt,sr),dn=[];for(let Sr=0;SrSr))break;Je=this._update_model_kwargs_for_generation({generated_input_ids:dn,outputs:yr,model_inputs:Je,is_encoder_decoder:yt})}Se&&Se.end();const Nt=this.getPastKeyValues(yr,Je.past_key_values,!0),tr=new h.Tensor("int64",Qt.flat(),[Qt.length,Qt[0].length]);if(oe.return_dict_in_generate)return{sequences:tr,past_key_values:Nt,...Pt};for(const sr of Object.values(yr))sr.location==="gpu-buffer"&&sr.dispose();return tr}getPastKeyValues(L,oe,fe=!1){const me=Object.create(null);for(const Se in L)if(Se.startsWith("present")){const De=Se.replace("present","past_key_values"),Ge=Se.includes("encoder");if(Ge&&oe?me[De]=oe[De]:me[De]=L[Se],oe&&(!Ge||fe)){const Je=oe[De];Je.location==="gpu-buffer"&&Je.dispose()}}return me}getAttentions(L){const oe={};for(const fe of["cross_attentions","encoder_attentions","decoder_attentions"])for(const me in L)me.startsWith(fe)&&(fe in oe||(oe[fe]=[]),oe[fe].push(L[me]));return oe}addPastKeyValues(L,oe){var fe,me,Se;if(oe)Object.assign(L,oe);else{const De=this.sessions.decoder_model_merged??this.sessions.model,Ge=((fe=De==null?void 0:De.config)==null?void 0:fe.kv_cache_dtype)??"float32",Je=Ge==="float16"?new h.DataTypeMap.float16:[],lt=((Se=(me=L[this.main_input_name]??L.attention_mask)==null?void 0:me.dims)==null?void 0:Se[0])??1,yt=(0,s.getKeyValueShapes)(this.config,{batch_size:lt});for(const st in yt)L[st]=new h.Tensor(Ge,Je,yt[st])}}async encode_image({pixel_values:L}){const oe=(await q(this.sessions.vision_encoder,{pixel_values:L})).image_features;return this.config.num_image_tokens||(console.warn(`The number of image tokens was not set in the model configuration. Setting it to the number of features detected by the vision encoder (${oe.dims[1]}).`),this.config.num_image_tokens=oe.dims[1]),oe}async encode_text({input_ids:L}){return(await q(this.sessions.embed_tokens,{input_ids:L})).inputs_embeds}async encode_audio({audio_values:L}){return(await q(this.sessions.audio_encoder,{audio_values:L})).audio_features}}class pe{}class Pe extends pe{constructor({last_hidden_state:S,hidden_states:L=null,attentions:oe=null}){super(),this.last_hidden_state=S,this.hidden_states=L,this.attentions=oe}}class Te extends U{}class Ae extends Te{}class Ie extends Te{async _call(S){return new wr(await super._call(S))}}class Le extends Te{async _call(S){return new bt(await super._call(S))}}class Ne extends Te{async _call(S){return new pr(await super._call(S))}}class Ve extends Te{async _call(S){return new Cr(await super._call(S))}}class D extends U{}class Z extends D{}class z extends D{async _call(S){return new wr(await super._call(S))}}class ee extends D{async _call(S){return new bt(await super._call(S))}}class ce extends D{async _call(S){return new pr(await super._call(S))}}class be extends U{}class ve extends be{}class Re extends U{}class Fe extends Re{}class je extends Re{async _call(S){return new wr(await super._call(S))}}class Qe extends Re{async _call(S){return new bt(await super._call(S))}}class Xe extends Re{async _call(S){return new pr(await super._call(S))}}class ut extends Re{async _call(S){return new Cr(await super._call(S))}}class wt extends U{}class nr extends wt{}class jt extends wt{async _call(S){return new wr(await super._call(S))}}class dr extends wt{async _call(S){return new bt(await super._call(S))}}class ds extends wt{async _call(S){return new pr(await super._call(S))}}class Fs extends wt{async _call(S){return new Cr(await super._call(S))}}class Dr extends U{}class cs extends Dr{}class Os extends Dr{async _call(S){return new wr(await super._call(S))}}class jr extends Dr{async _call(S){return new bt(await super._call(S))}}class dt extends Dr{async _call(S){return new pr(await super._call(S))}}class qr extends Dr{async _call(S){return new Cr(await super._call(S))}}class Ur extends U{}class us extends Ur{}class xs extends Ur{async _call(S){return new wr(await super._call(S))}}class Ts extends Ur{async _call(S){return new bt(await super._call(S))}}class Es extends Ur{async _call(S){return new pr(await super._call(S))}}class Ds extends Ur{async _call(S){return new Cr(await super._call(S))}}class mr extends U{}class Be extends mr{}class et extends mr{async _call(S){return new wr(await super._call(S))}}class it extends mr{async _call(S){return new bt(await super._call(S))}}class rr extends mr{async _call(S){return new pr(await super._call(S))}}class zt extends mr{async _call(S){return new Cr(await super._call(S))}}class Ir extends U{}class ps extends Ir{}class hs extends Ir{async _call(S){return new wr(await super._call(S))}}class Er extends Ir{async _call(S){return new bt(await super._call(S))}}class ms extends Ir{async _call(S){return new pr(await super._call(S))}}class _s extends Ir{async _call(S){return new Cr(await super._call(S))}}class Qr extends U{}class Ps extends Qr{}class qs extends Qr{async _call(S){return new bt(await super._call(S))}}class Qs extends Qr{async _call(S){return new pr(await super._call(S))}}class Xs extends Qr{async _call(S){return new Cr(await super._call(S))}}class Js extends Qr{async _call(S){return new wr(await super._call(S))}}class fs extends U{}class Ys extends fs{}class Zs extends fs{async _call(S){return new wr(await super._call(S))}}class en extends fs{async _call(S){return new bt(await super._call(S))}}class Lr extends fs{async _call(S){return new pr(await super._call(S))}}class Cs extends U{}class br extends Cs{}class Ls extends Cs{async _call(S){return new wr(await super._call(S))}}class zs extends Cs{async _call(S){return new bt(await super._call(S))}}class Ar extends Cs{async _call(S){return new Cr(await super._call(S))}}class Xr extends U{}class Tn extends Xr{}class zr extends Xr{async _call(S){return new wr(await super._call(S))}}class En extends Xr{async _call(S){return new bt(await super._call(S))}}class Bs extends Xr{async _call(S){return new pr(await super._call(S))}}class Fr extends Xr{async _call(S){return new Cr(await super._call(S))}}class Jr extends U{}class cr extends Jr{}class _r extends Jr{async _call(S){return new wr(await super._call(S))}}class Rs extends Jr{async _call(S){return new bt(await super._call(S))}}class Pn extends Jr{async _call(S){return new Cr(await super._call(S))}}class Ss extends U{}class Cn extends Ss{}class ue extends Ss{async _call(S){return new bt(await super._call(S))}}class F extends Ss{async _call(S){return new Cr(await super._call(S))}}class j extends Ss{async _call(S){return new wr(await super._call(S))}}class te extends U{constructor(){super(...arguments);re(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class de extends te{}class he extends te{}class Ce extends U{}class We extends Ce{}class qe extends Ce{}class Ke extends U{}class Ze extends Ke{}class ht extends Ke{}class Ct extends U{}class kt extends Ct{}class Wt extends Ct{}class Ot extends Ct{async _call(S){return new bt(await super._call(S))}}class Ut extends U{}class vr extends Ut{}class fr extends Ut{}class Yr extends Ut{async _call(S){return new bt(await super._call(S))}}class xr extends Ut{}class gs extends U{}class Gt extends gs{}class Zt extends gs{}class gr extends U{}class Zr extends gr{}class ws extends gr{}class Ht extends U{}class ur extends Ht{}class Rt extends Ht{async _call(S){return new wr(await super._call(S))}}class Jt extends Ht{async _call(S){return new bt(await super._call(S))}}class qt extends Ht{async _call(S){return new pr(await super._call(S))}}class er extends Ht{async _call(S){return new Cr(await super._call(S))}}class ir extends U{}class tn extends ir{}class rn extends ir{async _call(S){return new wr(await super._call(S))}}class La extends ir{async _call(S){return new bt(await super._call(S))}}class Vi extends ir{async _call(S){return new pr(await super._call(S))}}class za extends ir{async _call(S){return new Cr(await super._call(S))}}class ys extends U{}class Ba extends ys{}class Ra extends ys{async _call(S){return new wr(await super._call(S))}}class Sn extends ys{async _call(S){return new bt(await super._call(S))}}class Na extends ys{async _call(S){return new pr(await super._call(S))}}class Wi extends ys{async _call(S){return new Cr(await super._call(S))}}class Gi extends U{}class ja extends Gi{}class Ua extends Gi{}class Gn extends U{constructor(){super(...arguments);re(this,"requires_attention_mask",!1);re(this,"main_input_name","input_features");re(this,"forward_params",["input_features","attention_mask","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class Va extends Gn{}class Ki extends Gn{_prepare_generation_config(S,L){return super._prepare_generation_config(S,L,y.WhisperGenerationConfig)}_retrieve_init_tokens(S){const L=[S.decoder_start_token_id];let oe=S.language;const fe=S.task;if(S.is_multilingual){oe||(console.warn("No language specified - defaulting to English (en)."),oe="en");const Se=`<|${(0,$.whisper_language_to_code)(oe)}|>`;L.push(S.lang_to_id[Se]),L.push(S.task_to_id[fe??"transcribe"])}else if(oe||fe)throw new 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!S.return_timestamps&&S.no_timestamps_token_id&&L.at(-1)!==S.no_timestamps_token_id?L.push(S.no_timestamps_token_id):S.return_timestamps&&L.at(-1)===S.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),L.pop()),L.filter(me=>me!=null)}async generate({inputs:S=null,generation_config:L=null,logits_processor:oe=null,stopping_criteria:fe=null,...me}){L=this._prepare_generation_config(L,me);const Se=me.decoder_input_ids??this._retrieve_init_tokens(L);if(L.return_timestamps&&(oe??(oe=new p.LogitsProcessorList),oe.push(new p.WhisperTimeStampLogitsProcessor(L,Se))),L.begin_suppress_tokens&&(oe??(oe=new p.LogitsProcessorList),oe.push(new p.SuppressTokensAtBeginLogitsProcessor(L.begin_suppress_tokens,Se.length))),L.return_token_timestamps){if(!L.alignment_heads)throw new 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.");L.task==="translate"&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),L.output_attentions=!0,L.return_dict_in_generate=!0}const De=await super.generate({inputs:S,generation_config:L,logits_processor:oe,decoder_input_ids:Se,...me});return L.return_token_timestamps&&(De.token_timestamps=this._extract_token_timestamps(De,L.alignment_heads,L.num_frames)),De}_extract_token_timestamps(S,L,oe=null,fe=.02){if(!S.cross_attentions)throw new Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");oe==null&&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 me=this.config.median_filter_width;me===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),me=7);const Se=S.cross_attentions,De=Array.from({length:this.config.decoder_layers},(vt,ct)=>(0,h.cat)(Se.map(Tt=>Tt[ct]),2)),Ge=(0,h.stack)(L.map(([vt,ct])=>{if(vt>=De.length)throw new Error(`Layer index ${vt} is out of bounds for cross attentions (length ${De.length}).`);return oe?De[vt].slice(null,ct,null,[0,oe]):De[vt].slice(null,ct)})).transpose(1,0,2,3),[Je,lt]=(0,h.std_mean)(Ge,-2,0,!0),yt=Ge.clone();for(let vt=0;vtTt[tr+1]-Tt[tr]),yr=(0,a.mergeArrays)([1],Qt).map(Nt=>!!Nt),Pt=[];for(let Nt=0;Ntst.findIndex(Et=>Et==me)),Ge=De.every(st=>st===-1),Je=De.every(st=>st!==-1);if(!Ge&&!Je)throw new Error("Every input should contain either 0 or 1 image token.");if(Ge)return{inputs_embeds:S,attention_mask:fe};const lt=[],yt=[];for(let st=0;stArray.from({length:S.dims[0]},Qt=>Array.from({length:S.dims[1]},yr=>1))),at=L?L.tolist():[],vt=oe?oe.tolist():[];let ct=0,Tt=0;for(let Lt=0;Ltst[Lt][or]==1),Pt=Qt.reduce((Kt,or,cn)=>(or==Ge&&Kt.push(cn),Kt),[]).map(Kt=>Qt[Kt+1]),Nt=Pt.filter(Kt=>Kt==Se).length,tr=Pt.filter(Kt=>Kt==De).length;let sr=[],Wr=0,dn=Nt,Zl=tr;for(let Kt=0;KtMs>Wr&&Dn==Se),cn=Qt.findIndex((Dn,Ms)=>Ms>Wr&&Dn==De),On=dn>0&&or!==-1?or:Qt.length+1,Pi=Zl>0&&cn!==-1?cn:Qt.length+1;let sd,Pu,Cu,Su;On0?(0,f.max)(sr.at(-1))[0]+1:0;sr.push(Array.from({length:3*ku},(Dn,Ms)=>fb+Ms%ku));const Iu=ku+fb,id=Sx*$u*nd,$x=Array.from({length:id},(Dn,Ms)=>Iu+Math.floor(Ms/($u*nd))),kx=Array.from({length:id},(Dn,Ms)=>Iu+Math.floor(Ms/nd)%$u),Ix=Array.from({length:id},(Dn,Ms)=>Iu+Ms%nd);sr.push([$x,kx,Ix].flat()),Wr=sd+id}if(Wr0?(0,f.max)(sr.at(-1))[0]+1:0,or=Qt.length-Wr;sr.push(Array.from({length:3*or},(cn,On)=>Kt+On%or))}const Sr=sr.reduce((Kt,or)=>Kt+or.length,0),$s=new Array(Sr);let Eu=0;for(let Kt=0;Kt<3;++Kt)for(let or=0;oryt[ct%yt.length]),at=Array.from({length:st[0]},(vt,ct)=>(0,f.max)(yt.subarray(st[1]*ct,st[1]*(ct+1)))[0]+1n+BigInt(st[1]));return[new h.Tensor("int64",Et,[3,...st]),new h.Tensor("int64",at,[at.length,1])]}else{const[yt,st]=S.dims,Et=BigInt64Array.from({length:3*yt*st},(at,vt)=>BigInt(Math.floor(vt%st/yt)));return[new h.Tensor("int64",Et,[3,...S.dims]),(0,h.zeros)([yt,1])]}}async encode_image({pixel_values:S,image_grid_thw:L}){return(await q(this.sessions.vision_encoder,{pixel_values:S,grid_thw:L})).image_features}_merge_input_ids_with_image_features(S){return R({image_token_id:this.config.image_token_id,...S})}prepare_inputs_for_generation(S,L,oe){if(L.attention_mask&&!L.position_ids)if(!L.past_key_values)[L.position_ids,L.rope_deltas]=this.get_rope_index(L.input_ids,L.image_grid_thw,L.video_grid_thw,L.attention_mask);else{L.pixel_values=null;const fe=BigInt(Object.values(L.past_key_values)[0].dims.at(-2)),me=L.rope_deltas.map(Se=>fe+Se);L.position_ids=(0,h.stack)([me,me,me],0)}return L}}class fi extends U{}class Do extends fi{}class Lo extends fi{}class gi extends U{}class zo extends gi{}class Bo extends gi{}class wi extends U{}class Ro extends wi{}class No extends wi{}class yi extends U{}class jo extends yi{}class Uo extends yi{}class Mi extends U{}class Vo extends Mi{}class Wo extends Mi{}class bi extends U{}class Go extends bi{}class Ko extends bi{async _call(S){return new bt(await super._call(S))}}class vi extends U{}class Ho extends vi{}class qo extends vi{async _call(S){return new bt(await super._call(S))}}class Qo extends U{}class Xo extends Qo{}class Jo extends U{}class dl extends Jo{}class cl extends Jo{async _call(S){return new bt(await super._call(S))}}class ul extends U{}class pl extends ul{}class Yo extends U{}class hl extends Yo{}class ml extends Yo{async _call(S){return new bt(await super._call(S))}}class _l extends U{}class fl extends _l{}class Zo extends U{}class gl extends Zo{}class wl extends Zo{async _call(S){return new bt(await super._call(S))}}class yl extends U{}class Ml extends yl{async _call(S){return new mb(await super._call(S))}}class ea extends U{}class bl extends ea{}class vl extends ea{async _call(S){return new bt(await super._call(S))}}class ta extends U{}class xl extends ta{}class Tl extends ta{async _call(S){return new bt(await super._call(S))}}class ra extends U{}class El extends ra{}class Pl extends ra{}class sa extends U{}class Cl extends sa{}class Sl extends sa{}class na extends U{}class $l extends na{}class kl extends na{async _call(S){return new bt(await super._call(S))}}class xi extends U{}class Il extends xi{}class Al extends xi{async _call(S){return new oa(await super._call(S))}}class ia extends xi{async _call(S){return new Fl(await super._call(S))}}class oa extends pe{constructor({logits:S,pred_boxes:L}){super(),this.logits=S,this.pred_boxes=L}}class Fl extends pe{constructor({logits:S,pred_boxes:L,pred_masks:oe}){super(),this.logits=S,this.pred_boxes=L,this.pred_masks=oe}}class aa extends U{}class Ol extends aa{}class Dl extends aa{async _call(S){return new Ll(await super._call(S))}}class Ll extends pe{constructor({logits:S,pred_boxes:L}){super(),this.logits=S,this.pred_boxes=L}}class la extends U{}class zl extends la{}class Bl extends la{async _call(S){return new Rl(await super._call(S))}}class Rl extends oa{}class da extends U{}class ca extends da{}class c extends da{async _call(S){return new bt(await super._call(S))}}class m extends U{}class v extends m{}class C extends m{async _call(S){return new bt(await super._call(S))}}class I extends U{}class W extends I{}class se extends I{async _call(S){return new bt(await super._call(S))}}class ge extends U{}class Ee extends ge{}class ze extends ge{async _call(S){return new bt(await super._call(S))}}class Ye extends ge{}class ot extends U{}class gt extends ot{}class Bt extends ot{}class Pr extends U{}class an extends Pr{}class qw extends Pr{}class Qw extends U{}class Xw extends Qw{}class Nl extends U{}class Jw extends Nl{}class Yw extends Nl{}class Zw extends Nl{}class ey extends U{}class ty extends ey{}class ry extends U{}class sy extends ry{}class ny extends U{}class iy extends ny{}class eu extends U{}class oy extends eu{}class ay extends eu{}class tu extends U{}class ly extends tu{}class dy extends tu{}class cy extends U{}class uy extends cy{}class ru extends U{}class py extends ru{}class hy extends ru{async _call(S){return new bt(await super._call(S))}}class su extends U{}class my extends su{}class _y extends su{async _call(S){return new bt(await super._call(S))}}class nu extends U{}class fy extends nu{}class gy extends nu{async _call(S){return new bt(await super._call(S))}}class iu extends U{}class wy extends iu{}class yy extends iu{async _call(S){return new bt(await super._call(S))}}class My extends U{}class by extends My{}class ou extends U{}class vy extends ou{}class xy extends ou{async _call(S){return new Ty(await super._call(S))}}class Ty extends pe{constructor({logits:S,pred_boxes:L}){super(),this.logits=S,this.pred_boxes=L}}class Ey extends U{}class Py extends Ey{async get_image_embeddings({pixel_values:S}){return await ie(this,{pixel_values:S})}async forward(S){if((!S.image_embeddings||!S.image_positional_embeddings)&&(S={...S,...await this.get_image_embeddings(S)}),!S.input_labels&&S.input_points){const oe=S.input_points.dims.slice(0,-1),fe=oe.reduce((me,Se)=>me*Se,1);S.input_labels=new h.Tensor("int64",new BigInt64Array(fe).fill(1n),oe)}const L={image_embeddings:S.image_embeddings,image_positional_embeddings:S.image_positional_embeddings};return S.input_points&&(L.input_points=S.input_points),S.input_labels&&(L.input_labels=S.input_labels),S.input_boxes&&(L.input_boxes=S.input_boxes),await q(this.sessions.prompt_encoder_mask_decoder,L)}async _call(S){return new Cy(await super._call(S))}}class Cy extends pe{constructor({iou_scores:S,pred_masks:L}){super(),this.iou_scores=S,this.pred_masks=L}}class au extends U{}class Sy extends au{}class $y extends au{}class lu extends U{}class ky extends lu{}class Iy extends lu{}class ln extends U{}class Ay extends ln{}class Fy extends ln{async _call(S){return new Fn(await super._call(S))}}class Oy extends ln{async _call(S){return new bt(await super._call(S))}}class Dy extends ln{async _call(S){return new pr(await super._call(S))}}class du extends U{}class Ly extends du{}class zy extends du{async _call(S){return new pr(await super._call(S))}}class By extends U{}class Ry extends By{}class jl extends U{}class Ny extends jl{}class jy extends jl{async _call(S){return new Fn(await super._call(S))}}class Uy extends jl{async _call(S){return new bt(await super._call(S))}}class ua extends U{}class Vy extends ua{}class Wy extends ua{async _call(S){return new Fn(await super._call(S))}}class Gy extends ua{async _call(S){return new bt(await super._call(S))}}class Ky extends ua{async _call(S){return new pr(await super._call(S))}}class Ul extends U{}class Hy extends Ul{}class qy extends Ul{async _call(S){return new Fn(await super._call(S))}}class Qy extends Ul{async _call(S){return new bt(await super._call(S))}}class hx extends U{}class Xy extends ln{}class Jy extends ln{async _call(S){return new Fn(await super._call(S))}}class Yy extends ln{async _call(S){return new bt(await super._call(S))}}class Ti extends U{}class Zy extends Ti{}class eM extends Ti{async _call(S){return new Fn(await super._call(S))}}class tM extends Ti{async _call(S){return new bt(await super._call(S))}}class rM extends Ti{async _call(S){return new hb(await super._call(S))}}class sM extends Ti{async _call(S){return new pr(await super._call(S))}}class nM extends U{}class iM extends nM{}class Vl extends U{}class mx extends Vl{}class oM extends Vl{}class aM extends Vl{async generate_speech(S,L,{threshold:oe=.5,minlenratio:fe=0,maxlenratio:me=20,vocoder:Se=null}={}){const De={input_ids:S},{encoder_outputs:Ge,encoder_attention_mask:Je}=await ie(this,De),lt=Ge.dims[1]/this.config.reduction_factor,yt=Math.floor(lt*me),st=Math.floor(lt*fe),Et=this.config.num_mel_bins;let at=[],vt=null,ct=null,Tt=0;for(;;){++Tt;const yr=H(!!ct);let Pt;ct?Pt=ct.output_sequence_out:Pt=new h.Tensor("float32",new Float32Array(Et),[1,1,Et]);let Nt={use_cache_branch:yr,output_sequence:Pt,encoder_attention_mask:Je,speaker_embeddings:L,encoder_hidden_states:Ge};this.addPastKeyValues(Nt,vt),ct=await q(this.sessions.decoder_model_merged,Nt),vt=this.getPastKeyValues(ct,vt);const{prob:tr,spectrum:sr}=ct;if(at.push(sr),Tt>=st&&(Array.from(tr.data).filter(Wr=>Wr>=oe).length>0||Tt>=yt))break}const Lt=(0,h.cat)(at),{waveform:Qt}=await q(Se.sessions.model,{spectrogram:Lt});return{spectrogram:Lt,waveform:Qt}}}class lM extends U{constructor(){super(...arguments);re(this,"main_input_name","spectrogram")}}class dM extends U{}class cM extends dM{}class cu extends U{}class uM extends cu{}class pM extends cu{}class uu extends U{}class hM extends uu{}class mM extends uu{}class pu extends U{}class _M extends pu{}class fM extends pu{}class Wl extends U{}class gM extends Wl{}class wM extends Wl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"text_model"})}}class yM extends Wl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"audio_model"})}}class MM extends U{}class hu extends MM{async _call(S){return new _b(await super._call(S))}}class Gl extends U{}class _x extends Gl{}class bM extends Gl{}class vM extends Gl{}class mu extends U{}class xM extends mu{}class TM extends mu{}class _u extends U{}class EM extends _u{}class PM extends _u{async _call(S){return new bt(await super._call(S))}}class fu extends U{}class fx extends fu{}class gx extends fu{}class gu extends U{constructor(){super(...arguments);re(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}_apply_and_filter_by_delay_pattern_mask(L){const[oe,fe]=L.dims,me=this.config.decoder.num_codebooks,Se=fe-me;let De=0;for(let lt=0;lt0&&Et<=Se&&(L.data[De++]=L.data[lt])}const Ge=Math.floor(oe/me),Je=De/(Ge*me);return new h.Tensor(L.type,L.data.slice(0,De),[Ge,me,Je])}prepare_inputs_for_generation(L,oe,fe){let me=structuredClone(L);for(let De=0;De=Ge&&(me[De][Ge]=BigInt(this.config.decoder.pad_token_id));return fe.guidance_scale!==null&&fe.guidance_scale>1&&(me=me.concat(me)),super.prepare_inputs_for_generation(me,oe,fe)}async generate(L){const oe=await super.generate(L),fe=this._apply_and_filter_by_delay_pattern_mask(oe).unsqueeze_(0),{audio_values:me}=await q(this.sessions.encodec_decode,{audio_codes:fe});return me}}class Kl extends U{}class CM extends Kl{}class SM extends Kl{async _call(S){return new bt(await super._call(S))}}class $M extends Kl{}class Hl extends U{}class kM extends Hl{}class IM extends Hl{async _call(S){return new bt(await super._call(S))}}class AM extends Hl{}class ql extends U{}class FM extends ql{}class OM extends ql{async _call(S){return new bt(await super._call(S))}}class DM extends ql{}class Ql extends U{}class LM extends Ql{}class zM extends Ql{async _call(S){return new bt(await super._call(S))}}class BM extends Ql{}class RM extends U{}class NM extends RM{}class jM extends U{}class UM extends jM{constructor(...L){super(...L);re(this,"forward_params",["input_ids","pixel_values","images_seq_mask","images_emb_mask","attention_mask","position_ids","past_key_values"]);this._generation_mode="text"}async forward(L){const oe=this._generation_mode??"text";let fe;if(oe==="text"||!L.past_key_values){const Je=this.sessions.prepare_inputs_embeds,lt=(0,a.pick)(L,Je.inputNames);fe=await q(Je,lt)}else{const Je=this.sessions.gen_img_embeds,lt=(0,a.pick)({image_ids:L.input_ids},Je.inputNames);fe=await q(Je,lt)}const me={...L,...fe},Se=await ae(this,me),De=this.sessions[oe==="text"?"lm_head":"gen_head"];if(!De)throw new Error(`Unable to find "${De}" generation head`);const Ge=await q(De,(0,a.pick)(Se,De.inputNames));return{...fe,...Se,...Ge}}async generate(L){return this._generation_mode="text",super.generate(L)}async generate_images(L){this._generation_mode="image";const oe=(L.inputs??L[this.main_input_name]).dims[1],me=(await super.generate(L)).slice(null,[oe,null]),Se=this.sessions.image_decode,{decoded_image:De}=await q(Se,{generated_tokens:me}),Ge=De.add_(1).mul_(255/2).clamp_(0,255).to("uint8"),Je=[];for(const lt of Ge){const yt=w.RawImage.fromTensor(lt);Je.push(yt)}return Je}}class VM extends pe{constructor({char_logits:S,bpe_logits:L,wp_logits:oe}){super(),this.char_logits=S,this.bpe_logits=L,this.wp_logits=oe}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class WM extends U{}class GM extends WM{async _call(S){return new VM(await super._call(S))}}class wu extends U{}class KM extends wu{}class HM extends wu{}class yu extends U{}class qM extends yu{}class QM extends yu{}class XM extends U{constructor(){super(...arguments);re(this,"forward_params",["input_ids","attention_mask","position_ids","audio_values","past_key_values"])}}class JM extends XM{_merge_input_ids_with_audio_features(S){const L=S.audio_features.dims.at(-1),oe=S.audio_features.view(-1,L);return O({audio_token_id:this.config.ignore_index,...S,audio_features:oe})}}class Xl extends U{constructor(){super(...arguments);re(this,"main_input_name","input_values");re(this,"forward_params",["input_values"])}}class YM extends pe{constructor({audio_codes:S}){super(),this.audio_codes=S}}class ZM extends pe{constructor({audio_values:S}){super(),this.audio_values=S}}class e0 extends Xl{async encode(S){return new YM(await q(this.sessions.encoder_model,S))}async decode(S){return new ZM(await q(this.sessions.decoder_model,S))}}class t0 extends Xl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"encoder_model"})}}class r0 extends Xl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"decoder_model"})}}class Jl extends U{constructor(){super(...arguments);re(this,"main_input_name","input_values");re(this,"forward_params",["input_values"])}}class s0 extends pe{constructor({audio_codes:S}){super(),this.audio_codes=S}}class n0 extends pe{constructor({audio_values:S}){super(),this.audio_values=S}}class i0 extends Jl{async encode(S){return new s0(await q(this.sessions.encoder_model,S))}async decode(S){return new n0(await q(this.sessions.decoder_model,S))}}class o0 extends Jl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"encoder_model"})}}class a0 extends Jl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"decoder_model"})}}class Yl extends U{constructor(){super(...arguments);re(this,"main_input_name","input_values");re(this,"forward_params",["input_values"])}}class l0 extends Yl{async encode(S){return await q(this.sessions.encoder_model,S)}async decode(S){return await q(this.sessions.decoder_model,S)}}class d0 extends Yl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"encoder_model"})}}class c0 extends Yl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"decoder_model"})}}class It{static async from_pretrained(S,{progress_callback:L=null,config:oe=null,cache_dir:fe=null,local_files_only:me=!1,revision:Se="main",model_file_name:De=null,subfolder:Ge="onnx",device:Je=null,dtype:lt=null,use_external_data_format:yt=null,session_options:st={}}={}){const Et={progress_callback:L,config:oe,cache_dir:fe,local_files_only:me,revision:Se,model_file_name:De,subfolder:Ge,device:Je,dtype:lt,use_external_data_format:yt,session_options:st};if(Et.config=await s.AutoConfig.from_pretrained(S,Et),!this.MODEL_CLASS_MAPPINGS)throw new Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);const at=Et.config.model_type;for(const vt of this.MODEL_CLASS_MAPPINGS){let ct=vt.get(at);if(!ct){for(const Tt of vt.values())if(Tt[0]===at){ct=Tt;break}if(!ct)continue}return await ct[1].from_pretrained(S,Et)}if(this.BASE_IF_FAIL)return L0.has(at)||console.warn(`Unknown model class "${at}", attempting to construct from base class.`),await U.from_pretrained(S,Et);throw Error(`Unsupported model type: ${at}`)}}re(It,"MODEL_CLASS_MAPPINGS",null),re(It,"BASE_IF_FAIL",!1);const wx=new Map([["bert",["BertModel",Ae]],["modernbert",["ModernBertModel",Z]],["nomic_bert",["NomicBertModel",ve]],["roformer",["RoFormerModel",Fe]],["electra",["ElectraModel",cs]],["esm",["EsmModel",Ys]],["convbert",["ConvBertModel",nr]],["camembert",["CamembertModel",us]],["deberta",["DebertaModel",Be]],["deberta-v2",["DebertaV2Model",ps]],["mpnet",["MPNetModel",Tn]],["albert",["AlbertModel",Cn]],["distilbert",["DistilBertModel",Ps]],["roberta",["RobertaModel",ur]],["xlm",["XLMModel",tn]],["xlm-roberta",["XLMRobertaModel",Ba]],["clap",["ClapModel",gM]],["clip",["CLIPModel",Zi]],["clipseg",["CLIPSegModel",nn]],["chinese_clip",["ChineseCLIPModel",rl]],["siglip",["SiglipModel",Ya]],["jina_clip",["JinaCLIPModel",sl]],["mobilebert",["MobileBertModel",br]],["squeezebert",["SqueezeBertModel",cr]],["wav2vec2",["Wav2Vec2Model",Ay]],["wav2vec2-bert",["Wav2Vec2BertModel",Hy]],["unispeech",["UniSpeechModel",Ny]],["unispeech-sat",["UniSpeechSatModel",Vy]],["hubert",["HubertModel",Xy]],["wavlm",["WavLMModel",Zy]],["audio-spectrogram-transformer",["ASTModel",ja]],["vits",["VitsModel",hu]],["pyannote",["PyAnnoteModel",Ly]],["wespeaker-resnet",["WeSpeakerResNetModel",Ry]],["detr",["DetrModel",Il]],["rt_detr",["RTDetrModel",Ol]],["table-transformer",["TableTransformerModel",zl]],["vit",["ViTModel",Go]],["ijepa",["IJepaModel",Ho]],["pvt",["PvtModel",dl]],["vit_msn",["ViTMSNModel",hl]],["vit_mae",["ViTMAEModel",pl]],["groupvit",["GroupViTModel",fl]],["fastvit",["FastViTModel",gl]],["mobilevit",["MobileViTModel",bl]],["mobilevitv2",["MobileViTV2Model",xl]],["owlvit",["OwlViTModel",El]],["owlv2",["Owlv2Model",Cl]],["beit",["BeitModel",$l]],["deit",["DeiTModel",ca]],["hiera",["HieraModel",v]],["convnext",["ConvNextModel",py]],["convnextv2",["ConvNextV2Model",my]],["dinov2",["Dinov2Model",fy]],["dinov2_with_registers",["Dinov2WithRegistersModel",wy]],["resnet",["ResNetModel",W]],["swin",["SwinModel",Ee]],["swin2sr",["Swin2SRModel",gt]],["donut-swin",["DonutSwinModel",uy]],["yolos",["YolosModel",vy]],["dpt",["DPTModel",an]],["glpn",["GLPNModel",ly]],["hifigan",["SpeechT5HifiGan",lM]],["efficientnet",["EfficientNetModel",EM]],["decision_transformer",["DecisionTransformerModel",NM]],["patchtst",["PatchTSTForPrediction",KM]],["patchtsmixer",["PatchTSMixerForPrediction",qM]],["mobilenet_v1",["MobileNetV1Model",CM]],["mobilenet_v2",["MobileNetV2Model",kM]],["mobilenet_v3",["MobileNetV3Model",FM]],["mobilenet_v4",["MobileNetV4Model",LM]],["maskformer",["MaskFormerModel",oy]],["mgp-str",["MgpstrForSceneTextRecognition",GM]],["style_text_to_speech_2",["StyleTextToSpeech2Model",iM]]]),yx=new Map([["t5",["T5Model",de]],["longt5",["LongT5Model",We]],["mt5",["MT5Model",Ze]],["bart",["BartModel",kt]],["mbart",["MBartModel",vr]],["marian",["MarianModel",Sy]],["whisper",["WhisperModel",Va]],["m2m_100",["M2M100Model",ky]],["blenderbot",["BlenderbotModel",Gt]],["blenderbot-small",["BlenderbotSmallModel",Zr]]]),Mx=new Map([["mimi",["MimiModel",e0]],["dac",["DacModel",i0]],["snac",["SnacModel",l0]]]),bx=new Map([["bloom",["BloomModel",Ro]],["jais",["JAISModel",ro]],["gpt2",["GPT2Model",ol]],["gptj",["GPTJModel",lo]],["gpt_bigcode",["GPTBigCodeModel",ll]],["gpt_neo",["GPTNeoModel",no]],["gpt_neox",["GPTNeoXModel",al]],["codegen",["CodeGenModel",In]],["llama",["LlamaModel",ri]],["exaone",["ExaoneModel",mo]],["olmo",["OlmoModel",fo]],["olmo2",["Olmo2Model",wo]],["mobilellm",["MobileLLMModel",_t]],["granite",["GraniteModel",yo]],["cohere",["CohereModel",bo]],["gemma",["GemmaModel",xo]],["gemma2",["Gemma2Model",Eo]],["gemma3_text",["Gemma3Model",Co]],["helium",["HeliumModel",po]],["glm",["GlmModel",ho]],["openelm",["OpenELMModel",$o]],["qwen2",["Qwen2Model",Io]],["phi",["PhiModel",Do]],["phi3",["Phi3Model",zo]],["mpt",["MptModel",jo]],["opt",["OPTModel",Vo]],["mistral",["MistralModel",uM]],["starcoder2",["Starcoder2Model",hM]],["falcon",["FalconModel",_M]],["stablelm",["StableLmModel",xM]]]),Mu=new Map([["speecht5",["SpeechT5ForSpeechToText",oM]],["whisper",["WhisperForConditionalGeneration",Ki]],["lite-whisper",["LiteWhisperForConditionalGeneration",Wa]],["moonshine",["MoonshineForConditionalGeneration",Ga]]]),u0=new Map([["speecht5",["SpeechT5ForTextToSpeech",aM]]]),p0=new Map([["vits",["VitsModel",hu]],["musicgen",["MusicgenForConditionalGeneration",gu]]]),h0=new Map([["bert",["BertForSequenceClassification",Le]],["modernbert",["ModernBertForSequenceClassification",ee]],["roformer",["RoFormerForSequenceClassification",Qe]],["electra",["ElectraForSequenceClassification",jr]],["esm",["EsmForSequenceClassification",en]],["convbert",["ConvBertForSequenceClassification",dr]],["camembert",["CamembertForSequenceClassification",Ts]],["deberta",["DebertaForSequenceClassification",it]],["deberta-v2",["DebertaV2ForSequenceClassification",Er]],["mpnet",["MPNetForSequenceClassification",En]],["albert",["AlbertForSequenceClassification",ue]],["distilbert",["DistilBertForSequenceClassification",qs]],["roberta",["RobertaForSequenceClassification",Jt]],["xlm",["XLMForSequenceClassification",La]],["xlm-roberta",["XLMRobertaForSequenceClassification",Sn]],["bart",["BartForSequenceClassification",Ot]],["mbart",["MBartForSequenceClassification",Yr]],["mobilebert",["MobileBertForSequenceClassification",zs]],["squeezebert",["SqueezeBertForSequenceClassification",Rs]]]),m0=new Map([["bert",["BertForTokenClassification",Ne]],["modernbert",["ModernBertForTokenClassification",ce]],["roformer",["RoFormerForTokenClassification",Xe]],["electra",["ElectraForTokenClassification",dt]],["esm",["EsmForTokenClassification",Lr]],["convbert",["ConvBertForTokenClassification",ds]],["camembert",["CamembertForTokenClassification",Es]],["deberta",["DebertaForTokenClassification",rr]],["deberta-v2",["DebertaV2ForTokenClassification",ms]],["mpnet",["MPNetForTokenClassification",Bs]],["distilbert",["DistilBertForTokenClassification",Qs]],["roberta",["RobertaForTokenClassification",qt]],["xlm",["XLMForTokenClassification",Vi]],["xlm-roberta",["XLMRobertaForTokenClassification",Na]]]),bu=new Map([["t5",["T5ForConditionalGeneration",he]],["longt5",["LongT5ForConditionalGeneration",qe]],["mt5",["MT5ForConditionalGeneration",ht]],["bart",["BartForConditionalGeneration",Wt]],["mbart",["MBartForConditionalGeneration",fr]],["marian",["MarianMTModel",$y]],["m2m_100",["M2M100ForConditionalGeneration",Iy]],["blenderbot",["BlenderbotForConditionalGeneration",Zt]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",ws]]]),vu=new Map([["bloom",["BloomForCausalLM",No]],["gpt2",["GPT2LMHeadModel",Yn]],["jais",["JAISLMHeadModel",so]],["gptj",["GPTJForCausalLM",kn]],["gpt_bigcode",["GPTBigCodeForCausalLM",co]],["gpt_neo",["GPTNeoForCausalLM",io]],["gpt_neox",["GPTNeoXForCausalLM",oo]],["codegen",["CodeGenForCausalLM",Vr]],["llama",["LlamaForCausalLM",uo]],["exaone",["ExaoneForCausalLM",mt]],["olmo",["OlmoForCausalLM",go]],["olmo2",["Olmo2ForCausalLM",li]],["mobilellm",["MobileLLMForCausalLM",_o]],["granite",["GraniteForCausalLM",Mo]],["cohere",["CohereForCausalLM",vo]],["gemma",["GemmaForCausalLM",To]],["gemma2",["Gemma2ForCausalLM",Po]],["gemma3_text",["Gemma3ForCausalLM",So]],["helium",["HeliumForCausalLM",ni]],["glm",["GlmForCausalLM",ft]],["openelm",["OpenELMForCausalLM",ko]],["qwen2",["Qwen2ForCausalLM",Ao]],["phi",["PhiForCausalLM",Lo]],["phi3",["Phi3ForCausalLM",Bo]],["mpt",["MptForCausalLM",Uo]],["opt",["OPTForCausalLM",Wo]],["mbart",["MBartForCausalLM",xr]],["mistral",["MistralForCausalLM",pM]],["starcoder2",["Starcoder2ForCausalLM",mM]],["falcon",["FalconForCausalLM",fM]],["trocr",["TrOCRForCausalLM",cM]],["stablelm",["StableLmForCausalLM",TM]],["phi3_v",["Phi3VForCausalLM",Ns]]]),vx=new Map([["multi_modality",["MultiModalityCausalLM",UM]]]),_0=new Map([["bert",["BertForMaskedLM",Ie]],["modernbert",["ModernBertForMaskedLM",z]],["roformer",["RoFormerForMaskedLM",je]],["electra",["ElectraForMaskedLM",Os]],["esm",["EsmForMaskedLM",Zs]],["convbert",["ConvBertForMaskedLM",jt]],["camembert",["CamembertForMaskedLM",xs]],["deberta",["DebertaForMaskedLM",et]],["deberta-v2",["DebertaV2ForMaskedLM",hs]],["mpnet",["MPNetForMaskedLM",zr]],["albert",["AlbertForMaskedLM",j]],["distilbert",["DistilBertForMaskedLM",Js]],["roberta",["RobertaForMaskedLM",Rt]],["xlm",["XLMWithLMHeadModel",rn]],["xlm-roberta",["XLMRobertaForMaskedLM",Ra]],["mobilebert",["MobileBertForMaskedLM",Ls]],["squeezebert",["SqueezeBertForMaskedLM",_r]]]),f0=new Map([["bert",["BertForQuestionAnswering",Ve]],["roformer",["RoFormerForQuestionAnswering",ut]],["electra",["ElectraForQuestionAnswering",qr]],["convbert",["ConvBertForQuestionAnswering",Fs]],["camembert",["CamembertForQuestionAnswering",Ds]],["deberta",["DebertaForQuestionAnswering",zt]],["deberta-v2",["DebertaV2ForQuestionAnswering",_s]],["mpnet",["MPNetForQuestionAnswering",Fr]],["albert",["AlbertForQuestionAnswering",F]],["distilbert",["DistilBertForQuestionAnswering",Xs]],["roberta",["RobertaForQuestionAnswering",er]],["xlm",["XLMForQuestionAnswering",za]],["xlm-roberta",["XLMRobertaForQuestionAnswering",Wi]],["mobilebert",["MobileBertForQuestionAnswering",Ar]],["squeezebert",["SqueezeBertForQuestionAnswering",Pn]]]),xu=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",qi]],["idefics3",["Idefics3ForConditionalGeneration",Hn]],["smolvlm",["SmolVLMForConditionalGeneration",qn]]]),g0=new Map([["llava",["LlavaForConditionalGeneration",Kn]],["llava_onevision",["LlavaOnevisionForConditionalGeneration",Ha]],["moondream1",["Moondream1ForConditionalGeneration",qa]],["florence2",["Florence2ForConditionalGeneration",Qi]],["qwen2-vl",["Qwen2VLForConditionalGeneration",Oo]],["idefics3",["Idefics3ForConditionalGeneration",Hn]],["smolvlm",["SmolVLMForConditionalGeneration",qn]],["paligemma",["PaliGemmaForConditionalGeneration",Ji]]]),w0=new Map([["ultravox",["UltravoxModel",JM]]]),xx=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",qi]]]),y0=new Map([["vit",["ViTForImageClassification",Ko]],["ijepa",["IJepaForImageClassification",qo]],["pvt",["PvtForImageClassification",cl]],["vit_msn",["ViTMSNForImageClassification",ml]],["fastvit",["FastViTForImageClassification",wl]],["mobilevit",["MobileViTForImageClassification",vl]],["mobilevitv2",["MobileViTV2ForImageClassification",Tl]],["beit",["BeitForImageClassification",kl]],["deit",["DeiTForImageClassification",c]],["hiera",["HieraForImageClassification",C]],["convnext",["ConvNextForImageClassification",hy]],["convnextv2",["ConvNextV2ForImageClassification",_y]],["dinov2",["Dinov2ForImageClassification",gy]],["dinov2_with_registers",["Dinov2WithRegistersForImageClassification",yy]],["resnet",["ResNetForImageClassification",se]],["swin",["SwinForImageClassification",ze]],["segformer",["SegformerForImageClassification",bM]],["efficientnet",["EfficientNetForImageClassification",PM]],["mobilenet_v1",["MobileNetV1ForImageClassification",SM]],["mobilenet_v2",["MobileNetV2ForImageClassification",IM]],["mobilenet_v3",["MobileNetV3ForImageClassification",OM]],["mobilenet_v4",["MobileNetV4ForImageClassification",zM]]]),M0=new Map([["detr",["DetrForObjectDetection",Al]],["rt_detr",["RTDetrForObjectDetection",Dl]],["table-transformer",["TableTransformerForObjectDetection",Bl]],["yolos",["YolosForObjectDetection",xy]]]),b0=new Map([["owlvit",["OwlViTForObjectDetection",Pl]],["owlv2",["Owlv2ForObjectDetection",Sl]],["grounding-dino",["GroundingDinoForObjectDetection",by]]]),Ei=new Map([["detr",["DetrForSegmentation",ia]],["clipseg",["CLIPSegForImageSegmentation",eo]]]),v0=new Map([["segformer",["SegformerForSemanticSegmentation",vM]],["sapiens",["SapiensForSemanticSegmentation",Jw]],["swin",["SwinForSemanticSegmentation",Ye]],["mobilenet_v1",["MobileNetV1ForSemanticSegmentation",$M]],["mobilenet_v2",["MobileNetV2ForSemanticSegmentation",AM]],["mobilenet_v3",["MobileNetV3ForSemanticSegmentation",DM]],["mobilenet_v4",["MobileNetV4ForSemanticSegmentation",BM]]]),x0=new Map([["detr",["DetrForSegmentation",ia]],["maskformer",["MaskFormerForInstanceSegmentation",ay]]]),T0=new Map([["sam",["SamModel",Py]]]),E0=new Map([["wav2vec2",["Wav2Vec2ForCTC",Fy]],["wav2vec2-bert",["Wav2Vec2BertForCTC",qy]],["unispeech",["UniSpeechForCTC",jy]],["unispeech-sat",["UniSpeechSatForCTC",Wy]],["wavlm",["WavLMForCTC",eM]],["hubert",["HubertForCTC",Jy]]]),P0=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",Oy]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",Qy]],["unispeech",["UniSpeechForSequenceClassification",Uy]],["unispeech-sat",["UniSpeechSatForSequenceClassification",Gy]],["wavlm",["WavLMForSequenceClassification",tM]],["hubert",["HubertForSequenceClassification",Yy]],["audio-spectrogram-transformer",["ASTForAudioClassification",Ua]]]),C0=new Map([["wavlm",["WavLMForXVector",rM]]]),S0=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",Ky]],["wavlm",["WavLMForAudioFrameClassification",sM]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",Dy]],["pyannote",["PyAnnoteForAudioFrameClassification",zy]]]),$0=new Map([["vitmatte",["VitMatteForImageMatting",Ml]]]),Tx=new Map([["patchtst",["PatchTSTForPrediction",HM]],["patchtsmixer",["PatchTSMixerForPrediction",QM]]]),k0=new Map([["swin2sr",["Swin2SRForImageSuperResolution",Bt]]]),I0=new Map([["dpt",["DPTForDepthEstimation",qw]],["depth_anything",["DepthAnythingForDepthEstimation",Xw]],["glpn",["GLPNForDepthEstimation",dy]],["sapiens",["SapiensForDepthEstimation",Yw]],["depth_pro",["DepthProForDepthEstimation",ty]],["metric3d",["Metric3DForDepthEstimation",sy]],["metric3dv2",["Metric3Dv2ForDepthEstimation",iy]]]),A0=new Map([["sapiens",["SapiensForNormalEstimation",Zw]]]),F0=new Map([["vitpose",["VitPoseForPoseEstimation",Xo]]]),O0=new Map([["clip",["CLIPVisionModelWithProjection",Qn]],["siglip",["SiglipVisionModel",el]],["jina_clip",["JinaCLIPVisionModel",il]]]),D0=[[wx,T.EncoderOnly],[yx,T.EncoderDecoder],[bx,T.DecoderOnly],[Mx,T.AutoEncoder],[h0,T.EncoderOnly],[m0,T.EncoderOnly],[bu,T.Seq2Seq],[Mu,T.Seq2Seq],[vu,T.DecoderOnly],[vx,T.MultiModality],[_0,T.EncoderOnly],[f0,T.EncoderOnly],[xu,T.Vision2Seq],[g0,T.ImageTextToText],[w0,T.AudioTextToText],[y0,T.EncoderOnly],[Ei,T.EncoderOnly],[x0,T.EncoderOnly],[v0,T.EncoderOnly],[$0,T.EncoderOnly],[Tx,T.EncoderOnly],[k0,T.EncoderOnly],[I0,T.EncoderOnly],[A0,T.EncoderOnly],[F0,T.EncoderOnly],[M0,T.EncoderOnly],[b0,T.EncoderOnly],[T0,T.MaskGeneration],[E0,T.EncoderOnly],[P0,T.EncoderOnly],[u0,T.Seq2Seq],[p0,T.EncoderOnly],[C0,T.EncoderOnly],[S0,T.EncoderOnly],[O0,T.EncoderOnly]];for(const[x,S]of D0)for(const[L,oe]of x.values())g.set(L,S),E.set(oe,L),M.set(L,oe);const Ex=[["MusicgenForConditionalGeneration",gu,T.Musicgen],["Phi3VForCausalLM",Ns,T.Phi3V],["CLIPTextModelWithProjection",Ja,T.EncoderOnly],["SiglipTextModel",Za,T.EncoderOnly],["JinaCLIPTextModel",nl,T.EncoderOnly],["ClapTextModelWithProjection",wM,T.EncoderOnly],["ClapAudioModelWithProjection",yM,T.EncoderOnly],["DacEncoderModel",o0,T.EncoderOnly],["DacDecoderModel",a0,T.EncoderOnly],["MimiEncoderModel",t0,T.EncoderOnly],["MimiDecoderModel",r0,T.EncoderOnly],["SnacEncoderModel",d0,T.EncoderOnly],["SnacDecoderModel",c0,T.EncoderOnly]];for(const[x,S,L]of Ex)g.set(x,L),E.set(S,x),M.set(x,S);const L0=new Map([["modnet",Ei],["birefnet",Ei],["isnet",Ei],["ben",Ei]]);for(const[x,S]of L0.entries())S.set(x,["PreTrainedModel",U]),g.set(x,T.EncoderOnly),E.set(U,x),M.set(x,U);class Tu extends It{}re(Tu,"MODEL_CLASS_MAPPINGS",D0.map(S=>S[0])),re(Tu,"BASE_IF_FAIL",!0);class z0 extends It{}re(z0,"MODEL_CLASS_MAPPINGS",[h0]);class B0 extends It{}re(B0,"MODEL_CLASS_MAPPINGS",[m0]);class R0 extends It{}re(R0,"MODEL_CLASS_MAPPINGS",[bu]);class N0 extends It{}re(N0,"MODEL_CLASS_MAPPINGS",[Mu]);class j0 extends It{}re(j0,"MODEL_CLASS_MAPPINGS",[u0]);class U0 extends It{}re(U0,"MODEL_CLASS_MAPPINGS",[p0]);class V0 extends It{}re(V0,"MODEL_CLASS_MAPPINGS",[vu]);class W0 extends It{}re(W0,"MODEL_CLASS_MAPPINGS",[_0]);class G0 extends It{}re(G0,"MODEL_CLASS_MAPPINGS",[f0]);class K0 extends It{}re(K0,"MODEL_CLASS_MAPPINGS",[xu]);class H0 extends It{}re(H0,"MODEL_CLASS_MAPPINGS",[y0]);class q0 extends It{}re(q0,"MODEL_CLASS_MAPPINGS",[Ei]);class Q0 extends It{}re(Q0,"MODEL_CLASS_MAPPINGS",[v0]);class X0 extends It{}re(X0,"MODEL_CLASS_MAPPINGS",[x0]);class J0 extends It{}re(J0,"MODEL_CLASS_MAPPINGS",[M0]);class Y0 extends It{}re(Y0,"MODEL_CLASS_MAPPINGS",[b0]);class Z0 extends It{}re(Z0,"MODEL_CLASS_MAPPINGS",[T0]);class eb extends It{}re(eb,"MODEL_CLASS_MAPPINGS",[E0]);class tb extends It{}re(tb,"MODEL_CLASS_MAPPINGS",[P0]);class rb extends It{}re(rb,"MODEL_CLASS_MAPPINGS",[C0]);class sb extends It{}re(sb,"MODEL_CLASS_MAPPINGS",[S0]);class nb extends It{}re(nb,"MODEL_CLASS_MAPPINGS",[xx]);class ib extends It{}re(ib,"MODEL_CLASS_MAPPINGS",[$0]);class ob extends It{}re(ob,"MODEL_CLASS_MAPPINGS",[k0]);class ab extends It{}re(ab,"MODEL_CLASS_MAPPINGS",[I0]);class lb extends It{}re(lb,"MODEL_CLASS_MAPPINGS",[A0]);class db extends It{}re(db,"MODEL_CLASS_MAPPINGS",[F0]);class cb extends It{}re(cb,"MODEL_CLASS_MAPPINGS",[O0]);class ub extends It{}re(ub,"MODEL_CLASS_MAPPINGS",[g0]);class pb extends It{}re(pb,"MODEL_CLASS_MAPPINGS",[w0]);class Px extends pe{constructor({logits:S,past_key_values:L,encoder_outputs:oe,decoder_attentions:fe=null,cross_attentions:me=null}){super(),this.logits=S,this.past_key_values=L,this.encoder_outputs=oe,this.decoder_attentions=fe,this.cross_attentions=me}}class bt extends pe{constructor({logits:S,...L}){super(),this.logits=S;const oe=Object.values(L);oe.length>0&&(this.attentions=oe)}}class hb extends pe{constructor({logits:S,embeddings:L}){super(),this.logits=S,this.embeddings=L}}class pr extends pe{constructor({logits:S}){super(),this.logits=S}}class wr extends pe{constructor({logits:S}){super(),this.logits=S}}class Cr extends pe{constructor({start_logits:S,end_logits:L}){super(),this.start_logits=S,this.end_logits=L}}class Fn extends pe{constructor({logits:S}){super(),this.logits=S}}class Cx extends pe{constructor({logits:S,past_key_values:L}){super(),this.logits=S,this.past_key_values=L}}class mb extends pe{constructor({alphas:S}){super(),this.alphas=S}}class _b extends pe{constructor({waveform:S,spectrogram:L}){super(),this.waveform=S,this.spectrogram=L}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,r,t)=>{t.r(r),t.d(r,{ASTFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var i=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a);const l=this.config.sampling_rate,d=(0,i.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(l/2),l,null,"kaldi",!0);for(let p=0;p{t.r(r),t.d(r,{AutoFeatureExtractor:()=>o});var s=t("./src/utils/constants.js"),i=t("./src/utils/hub.js");t("./src/base/feature_extraction_utils.js");var n=t("./src/models/feature_extractors.js");class o{static async from_pretrained(l,d={}){const p=await(0,i.getModelJSON)(l,s.FEATURE_EXTRACTOR_NAME,!0,d),u=p.feature_extractor_type,h=n[u];if(!h)throw new Error(`Unknown feature_extractor_type: '${u}'. Please report this at ${s.GITHUB_ISSUE_URL}.`);return new h(p)}}},"./src/models/auto/image_processing_auto.js":(e,r,t)=>{t.r(r),t.d(r,{AutoImageProcessor:()=>a});var s=t("./src/utils/constants.js"),i=t("./src/utils/hub.js"),n=t("./src/base/image_processors_utils.js"),o=t("./src/models/image_processors.js");class a{static async from_pretrained(d,p={}){const u=await(0,i.getModelJSON)(d,s.IMAGE_PROCESSOR_NAME,!0,p),h=u.image_processor_type??u.feature_extractor_type;let w=o[h];return w||(h!==void 0&&console.warn(`Image processor type '${h}' not found, assuming base ImageProcessor. Please report this at ${s.GITHUB_ISSUE_URL}.`),w=n.ImageProcessor),new w(u)}}},"./src/models/auto/processing_auto.js":(e,r,t)=>{t.r(r),t.d(r,{AutoProcessor:()=>d});var s=t("./src/utils/constants.js"),i=t("./src/utils/hub.js"),n=t("./src/base/processing_utils.js"),o=t("./src/models/processors.js"),a=t("./src/models/image_processors.js"),l=t("./src/models/feature_extractors.js");class d{static async from_pretrained(u,h={}){const w=await(0,i.getModelJSON)(u,s.IMAGE_PROCESSOR_NAME,!0,h),{image_processor_type:f,feature_extractor_type:P,processor_class:A}=w;if(A&&o[A])return o[A].from_pretrained(u,h);if(!f&&!P)throw new Error("No `image_processor_type` or `feature_extractor_type` found in the config.");const b={};if(f){const $=a[f];if(!$)throw new Error(`Unknown image_processor_type: '${f}'.`);b.image_processor=new $(w)}if(P){const $=a[P];if($)b.image_processor=new $(w);else{const T=l[P];if(!T)throw new Error(`Unknown feature_extractor_type: '${P}'.`);b.feature_extractor=new T(w)}}const y={};return new n.Processor(y,b)}}},"./src/models/beit/image_processing_beit.js":(e,r,t)=>{t.r(r),t.d(r,{BeitFeatureExtractor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/bit/image_processing_bit.js":(e,r,t)=>{t.r(r),t.d(r,{BitImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/chinese_clip/image_processing_chinese_clip.js":(e,r,t)=>{t.r(r),t.d(r,{ChineseCLIPFeatureExtractor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/clap/feature_extraction_clap.js":(e,r,t)=>{t.r(r),t.d(r,{ClapFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var i=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a),this.mel_filters=(0,i.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,null,"htk"),this.mel_filters_slaney=(0,i.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,"slaney","slaney"),this.window=(0,i.window_function)(this.config.fft_window_size,"hann")}async _get_input_mel(a,l,d,p){let u;const h=a.length-l;if(h>0)if(d==="rand_trunc"){const w=Math.floor(Math.random()*(h+1));a=a.subarray(w,w+l),u=await this._extract_fbank_features(a,this.mel_filters_slaney,this.config.nb_max_samples)}else throw new Error(`Truncation strategy "${d}" not implemented`);else{if(h<0){let w=new Float64Array(l);if(w.set(a),p==="repeat")for(let f=a.length;f{t.r(r),t.d(r,{CLIPFeatureExtractor:()=>n,CLIPImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/convnext/image_processing_convnext.js":(e,r,t)=>{t.r(r),t.d(r,{ConvNextFeatureExtractor:()=>n,ConvNextImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{constructor(a){super(a),this.crop_pct=this.config.crop_pct??224/256}async resize(a){var d;const l=(d=this.size)==null?void 0:d.shortest_edge;if(l===void 0)throw new Error("Size dictionary must contain 'shortest_edge' key.");if(l<384){const p=Math.floor(l/this.crop_pct),[u,h]=this.get_resize_output_image_size(a,{shortest_edge:p});a=await a.resize(u,h,{resample:this.resample}),a=await a.center_crop(l,l)}else a=await a.resize(l,l,{resample:this.resample});return a}}class n extends i{}},"./src/models/dac/feature_extraction_dac.js":(e,r,t)=>{t.r(r),t.d(r,{DacFeatureExtractor:()=>i});var s=t("./src/models/encodec/feature_extraction_encodec.js");class i extends s.EncodecFeatureExtractor{}},"./src/models/deit/image_processing_deit.js":(e,r,t)=>{t.r(r),t.d(r,{DeiTFeatureExtractor:()=>n,DeiTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/detr/image_processing_detr.js":(e,r,t)=>{t.r(r),t.d(r,{DetrFeatureExtractor:()=>o,DetrImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(l){const d=await super._call(l),p=[d.pixel_values.dims[0],64,64],u=(0,i.full)(p,1n);return{...d,pixel_mask:u}}post_process_object_detection(...l){return(0,s.post_process_object_detection)(...l)}post_process_panoptic_segmentation(...l){return(0,s.post_process_panoptic_segmentation)(...l)}post_process_instance_segmentation(...l){return(0,s.post_process_instance_segmentation)(...l)}}class o extends n{}},"./src/models/donut/image_processing_donut.js":(e,r,t)=>{t.r(r),t.d(r,{DonutFeatureExtractor:()=>n,DonutImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{pad_image(a,l,d,p={}){const[u,h,w]=l;let f=this.image_mean;Array.isArray(this.image_mean)||(f=new Array(w).fill(f));let P=this.image_std;Array.isArray(P)||(P=new Array(w).fill(f));const A=f.map((b,y)=>-b/P[y]);return super.pad_image(a,l,d,{center:!0,constant_values:A,...p})}}class n extends i{}},"./src/models/dpt/image_processing_dpt.js":(e,r,t)=>{t.r(r),t.d(r,{DPTFeatureExtractor:()=>n,DPTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/efficientnet/image_processing_efficientnet.js":(e,r,t)=>{t.r(r),t.d(r,{EfficientNetImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{constructor(o){super(o),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(a=>a*a))}}},"./src/models/encodec/feature_extraction_encodec.js":(e,r,t)=>{t.r(r),t.d(r,{EncodecFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{async _call(a){(0,s.validate_audio_inputs)(a,"EncodecFeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));const l=this.config.feature_size;if(a.length%l!==0)throw new Error(`The length of the audio data must be a multiple of the number of channels (${l}).`);const d=[1,l,a.length/l];return{input_values:new i.Tensor("float32",a,d)}}}},"./src/models/feature_extractors.js":(e,r,t)=>{t.r(r),t.d(r,{ASTFeatureExtractor:()=>s.ASTFeatureExtractor,ClapFeatureExtractor:()=>n.ClapFeatureExtractor,DacFeatureExtractor:()=>o.DacFeatureExtractor,EncodecFeatureExtractor:()=>i.EncodecFeatureExtractor,ImageFeatureExtractor:()=>P.ImageProcessor,MoonshineFeatureExtractor:()=>a.MoonshineFeatureExtractor,PyAnnoteFeatureExtractor:()=>l.PyAnnoteFeatureExtractor,SeamlessM4TFeatureExtractor:()=>d.SeamlessM4TFeatureExtractor,SnacFeatureExtractor:()=>p.SnacFeatureExtractor,SpeechT5FeatureExtractor:()=>u.SpeechT5FeatureExtractor,Wav2Vec2FeatureExtractor:()=>h.Wav2Vec2FeatureExtractor,WeSpeakerFeatureExtractor:()=>w.WeSpeakerFeatureExtractor,WhisperFeatureExtractor:()=>f.WhisperFeatureExtractor});var s=t("./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js"),i=t("./src/models/encodec/feature_extraction_encodec.js"),n=t("./src/models/clap/feature_extraction_clap.js"),o=t("./src/models/dac/feature_extraction_dac.js"),a=t("./src/models/moonshine/feature_extraction_moonshine.js"),l=t("./src/models/pyannote/feature_extraction_pyannote.js"),d=t("./src/models/seamless_m4t/feature_extraction_seamless_m4t.js"),p=t("./src/models/snac/feature_extraction_snac.js"),u=t("./src/models/speecht5/feature_extraction_speecht5.js"),h=t("./src/models/wav2vec2/feature_extraction_wav2vec2.js"),w=t("./src/models/wespeaker/feature_extraction_wespeaker.js"),f=t("./src/models/whisper/feature_extraction_whisper.js"),P=t("./src/base/image_processors_utils.js")},"./src/models/florence2/processing_florence2.js":(e,r,t)=>{t.r(r),t.d(r,{Florence2Processor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class o extends s.Processor{constructor(l,d){super(l,d);const{tasks_answer_post_processing_type:p,task_prompts_without_inputs:u,task_prompts_with_input:h}=this.image_processor.config;this.tasks_answer_post_processing_type=new Map(Object.entries(p??{})),this.task_prompts_without_inputs=new Map(Object.entries(u??{})),this.task_prompts_with_input=new Map(Object.entries(h??{})),this.regexes={quad_boxes:/(.+?)/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(l){typeof l=="string"&&(l=[l]);const d=[];for(const p of l)if(this.task_prompts_without_inputs.has(p))d.push(this.task_prompts_without_inputs.get(p));else{for(const[u,h]of this.task_prompts_with_input)if(p.includes(u)){d.push(h.replaceAll("{input}",p).replaceAll(u,""));break}d.length!==l.length&&d.push(p)}return d}post_process_generation(l,d,p){const u=this.tasks_answer_post_processing_type.get(d)??"pure_text";l=l.replaceAll("","").replaceAll("","");let h;switch(u){case"pure_text":h=l;break;case"description_with_bboxes":case"bboxes":case"phrase_grounding":case"ocr":const w=u==="ocr"?"quad_boxes":"bboxes",f=l.matchAll(this.regexes[w]),P=[],A=[];for(const[b,y,...$]of f)P.push(y?y.trim():P.at(-1)??""),A.push($.map((T,g)=>(Number(T)+.5)/this.size_per_bin*p[g%2]));h={labels:P,[w]:A};break;default:throw new Error(`Task "${d}" (of type "${u}") not yet implemented.`)}return{[d]:h}}async _call(l,d=null,p={}){if(!l&&!d)throw new Error("Either text or images must be provided");const u=await this.image_processor(l,p),h=d?this.tokenizer(d,p):{};return{...u,...h}}}re(o,"tokenizer_class",n.AutoTokenizer),re(o,"image_processor_class",i.AutoImageProcessor)},"./src/models/glpn/image_processing_glpn.js":(e,r,t)=>{t.r(r),t.d(r,{GLPNFeatureExtractor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/grounding_dino/image_processing_grounding_dino.js":(e,r,t)=>{t.r(r),t.d(r,{GroundingDinoImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a){const l=await super._call(a),d=l.pixel_values.dims,p=(0,i.ones)([d[0],d[2],d[3]]);return{...l,pixel_mask:p}}}},"./src/models/grounding_dino/processing_grounding_dino.js":(e,r,t)=>{t.r(r),t.d(r,{GroundingDinoProcessor:()=>l});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),o=t("./src/base/image_processors_utils.js");function a(d,p){const h=d.dims.at(-1)-1,w=d.tolist();w.fill(!1,0,1),w.fill(!1,h);const f=p.tolist();return w.map((P,A)=>P?A:null).filter(P=>P!==null).map(P=>f[P])}class l extends s.Processor{async _call(p,u,h={}){const w=p?await this.image_processor(p,h):{};return{...u?this.tokenizer(u,h):{},...w}}post_process_grounded_object_detection(p,u,{box_threshold:h=.25,text_threshold:w=.25,target_sizes:f=null}={}){const{logits:P,pred_boxes:A}=p,b=P.dims[0];if(f!==null&&f.length!==b)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const y=P.dims.at(1),$=P.sigmoid(),T=$.max(-1).tolist(),g=A.tolist().map(E=>E.map(k=>(0,o.center_to_corners_format)(k))),M=[];for(let E=0;EV.map((Y,H)=>Y*k[(H+1)%2])));const B=T[E],N=[],J=[],q=[];for(let V=0;V{t.r(r),t.d(r,{Idefics3ImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{constructor(a){super(a),this.do_image_splitting=a.do_image_splitting??!0,this.max_image_size=a.max_image_size}get_resize_for_vision_encoder(a,l){let[d,p]=a.dims.slice(-2);const u=p/d;return p>=d?(p=Math.ceil(p/l)*l,d=Math.floor(p/u),d=Math.ceil(d/l)*l):(d=Math.ceil(d/l)*l,p=Math.floor(d*u),p=Math.ceil(p/l)*l),{height:d,width:p}}async _call(a,{do_image_splitting:l=null,return_row_col_info:d=!1}={}){let p;if(!Array.isArray(a))p=[[a]];else{if(a.length===0||!a[0])throw new Error("No images provided.");Array.isArray(a[0])?p=a:p=[a]}let u=[],h=[],w=[];const f=[],P=[];for(const E of p){let k=await Promise.all(E.map(J=>this.preprocess(J)));f.push(...k.map(J=>J.original_size)),P.push(...k.map(J=>J.reshaped_input_size)),k.forEach(J=>J.pixel_values.unsqueeze_(0));const{longest_edge:B}=this.max_image_size;let N;if(l??this.do_image_splitting){let J=new Array(k.length),q=new Array(k.length);N=await Promise.all(k.map(async(V,Y)=>{const H=this.get_resize_for_vision_encoder(V.pixel_values,B),Q=await(0,i.interpolate_4d)(V.pixel_values,{size:[H.height,H.width]}),{frames:ie,num_splits_h:le,num_splits_w:ae}=await this.split_image(Q,this.max_image_size);return J[Y]=le,q[Y]=ae,(0,i.cat)(ie,0)})),h.push(J),w.push(q)}else{const J=[B,B];N=await Promise.all(k.map(q=>(0,i.interpolate_4d)(q.pixel_values,{size:J}))),h.push(new Array(k.length).fill(0)),w.push(new Array(k.length).fill(0))}u.push((0,i.cat)(N,0))}const A=u.length,[b,y,$,T]=u[0].dims;let g,M;if(A===1)g=u[0].unsqueeze_(0),M=(0,i.full)([A,b,$,T],!0);else{const E=Math.max(...u.map(N=>N.dims.at(0)));M=(0,i.full)([A,E,$,T],!0);const k=M.data,B=E*$*T;for(let N=0;Nd||w>p){f=Math.ceil(h/d),P=Math.ceil(w/p);const A=Math.ceil(h/f),b=Math.ceil(w/P);for(let T=0;T{t.r(r),t.d(r,{Idefics3Processor:()=>p});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");var o=t("./src/utils/core.js");function a(u,h,w,f,P,A){let b="";for(let y=0;y`+P.repeat(u);b+=` -`}return b+=` -${f}${A}`+P.repeat(u)+`${f}`,b}function l(u,h,w,f){return`${h}${f}`+w.repeat(u)+`${h}`}function d(u,h,w,f,P,A){return u===0&&h===0?l(w,f,P,A):a(w,u,h,f,P,A)}class p extends s.Processor{constructor(){super(...arguments);re(this,"fake_image_token","");re(this,"image_token","");re(this,"global_img_token","")}async _call(w,f=null,P={}){P.return_row_col_info??(P.return_row_col_info=!0);let A;f&&(A=await this.image_processor(f,P)),Array.isArray(w)||(w=[w]);const b=A.rows??[new Array(w.length).fill(0)],y=A.cols??[new Array(w.length).fill(0)],$=this.config.image_seq_len,T=[],g=[];for(let E=0;Ed(Y,N[H],$,this.fake_image_token,this.image_token,this.global_img_token)),q=k.split(this.image_token);if(q.length===0)throw new Error("The image token should be present in the text.");let V=q[0];for(let Y=0;Y{t.r(r),t.d(r,{BeitFeatureExtractor:()=>s.BeitFeatureExtractor,BitImageProcessor:()=>i.BitImageProcessor,CLIPFeatureExtractor:()=>o.CLIPFeatureExtractor,CLIPImageProcessor:()=>o.CLIPImageProcessor,ChineseCLIPFeatureExtractor:()=>n.ChineseCLIPFeatureExtractor,ConvNextFeatureExtractor:()=>a.ConvNextFeatureExtractor,ConvNextImageProcessor:()=>a.ConvNextImageProcessor,DPTFeatureExtractor:()=>u.DPTFeatureExtractor,DPTImageProcessor:()=>u.DPTImageProcessor,DeiTFeatureExtractor:()=>l.DeiTFeatureExtractor,DeiTImageProcessor:()=>l.DeiTImageProcessor,DetrFeatureExtractor:()=>d.DetrFeatureExtractor,DetrImageProcessor:()=>d.DetrImageProcessor,DonutFeatureExtractor:()=>p.DonutFeatureExtractor,DonutImageProcessor:()=>p.DonutImageProcessor,EfficientNetImageProcessor:()=>h.EfficientNetImageProcessor,GLPNFeatureExtractor:()=>w.GLPNFeatureExtractor,GroundingDinoImageProcessor:()=>f.GroundingDinoImageProcessor,Idefics3ImageProcessor:()=>P.Idefics3ImageProcessor,JinaCLIPImageProcessor:()=>b.JinaCLIPImageProcessor,LlavaOnevisionImageProcessor:()=>y.LlavaOnevisionImageProcessor,Mask2FormerImageProcessor:()=>$.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>T.MaskFormerFeatureExtractor,MaskFormerImageProcessor:()=>T.MaskFormerImageProcessor,MobileNetV1FeatureExtractor:()=>g.MobileNetV1FeatureExtractor,MobileNetV1ImageProcessor:()=>g.MobileNetV1ImageProcessor,MobileNetV2FeatureExtractor:()=>M.MobileNetV2FeatureExtractor,MobileNetV2ImageProcessor:()=>M.MobileNetV2ImageProcessor,MobileNetV3FeatureExtractor:()=>E.MobileNetV3FeatureExtractor,MobileNetV3ImageProcessor:()=>E.MobileNetV3ImageProcessor,MobileNetV4FeatureExtractor:()=>k.MobileNetV4FeatureExtractor,MobileNetV4ImageProcessor:()=>k.MobileNetV4ImageProcessor,MobileViTFeatureExtractor:()=>B.MobileViTFeatureExtractor,MobileViTImageProcessor:()=>B.MobileViTImageProcessor,NougatImageProcessor:()=>N.NougatImageProcessor,OwlViTFeatureExtractor:()=>q.OwlViTFeatureExtractor,OwlViTImageProcessor:()=>q.OwlViTImageProcessor,Owlv2ImageProcessor:()=>J.Owlv2ImageProcessor,Phi3VImageProcessor:()=>V.Phi3VImageProcessor,PvtImageProcessor:()=>Y.PvtImageProcessor,Qwen2VLImageProcessor:()=>H.Qwen2VLImageProcessor,RTDetrImageProcessor:()=>Q.RTDetrImageProcessor,SamImageProcessor:()=>ie.SamImageProcessor,SegformerFeatureExtractor:()=>le.SegformerFeatureExtractor,SegformerImageProcessor:()=>le.SegformerImageProcessor,SiglipImageProcessor:()=>ae.SiglipImageProcessor,SmolVLMImageProcessor:()=>we.SmolVLMImageProcessor,Swin2SRImageProcessor:()=>R.Swin2SRImageProcessor,VLMImageProcessor:()=>A.VLMImageProcessor,ViTFeatureExtractor:()=>O.ViTFeatureExtractor,ViTImageProcessor:()=>O.ViTImageProcessor,VitMatteImageProcessor:()=>G.VitMatteImageProcessor,VitPoseImageProcessor:()=>ne.VitPoseImageProcessor,YolosFeatureExtractor:()=>X.YolosFeatureExtractor,YolosImageProcessor:()=>X.YolosImageProcessor});var s=t("./src/models/beit/image_processing_beit.js"),i=t("./src/models/bit/image_processing_bit.js"),n=t("./src/models/chinese_clip/image_processing_chinese_clip.js"),o=t("./src/models/clip/image_processing_clip.js"),a=t("./src/models/convnext/image_processing_convnext.js"),l=t("./src/models/deit/image_processing_deit.js"),d=t("./src/models/detr/image_processing_detr.js"),p=t("./src/models/donut/image_processing_donut.js"),u=t("./src/models/dpt/image_processing_dpt.js"),h=t("./src/models/efficientnet/image_processing_efficientnet.js"),w=t("./src/models/glpn/image_processing_glpn.js"),f=t("./src/models/grounding_dino/image_processing_grounding_dino.js"),P=t("./src/models/idefics3/image_processing_idefics3.js"),A=t("./src/models/janus/image_processing_janus.js"),b=t("./src/models/jina_clip/image_processing_jina_clip.js"),y=t("./src/models/llava_onevision/image_processing_llava_onevision.js"),$=t("./src/models/mask2former/image_processing_mask2former.js"),T=t("./src/models/maskformer/image_processing_maskformer.js"),g=t("./src/models/mobilenet_v1/image_processing_mobilenet_v1.js"),M=t("./src/models/mobilenet_v2/image_processing_mobilenet_v2.js"),E=t("./src/models/mobilenet_v3/image_processing_mobilenet_v3.js"),k=t("./src/models/mobilenet_v4/image_processing_mobilenet_v4.js"),B=t("./src/models/mobilevit/image_processing_mobilevit.js"),N=t("./src/models/nougat/image_processing_nougat.js"),J=t("./src/models/owlv2/image_processing_owlv2.js"),q=t("./src/models/owlvit/image_processing_owlvit.js"),V=t("./src/models/phi3_v/image_processing_phi3_v.js"),Y=t("./src/models/pvt/image_processing_pvt.js"),H=t("./src/models/qwen2_vl/image_processing_qwen2_vl.js"),Q=t("./src/models/rt_detr/image_processing_rt_detr.js"),ie=t("./src/models/sam/image_processing_sam.js"),le=t("./src/models/segformer/image_processing_segformer.js"),ae=t("./src/models/siglip/image_processing_siglip.js"),we=t("./src/models/smolvlm/image_processing_smolvlm.js"),R=t("./src/models/swin2sr/image_processing_swin2sr.js"),O=t("./src/models/vit/image_processing_vit.js"),G=t("./src/models/vitmatte/image_processing_vitmatte.js"),ne=t("./src/models/vitpose/image_processing_vitpose.js"),X=t("./src/models/yolos/image_processing_yolos.js")},"./src/models/janus/image_processing_janus.js":(e,r,t)=>{t.r(r),t.d(r,{VLMImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{constructor(o){super({do_pad:!0,pad_size:{width:o.image_size,height:o.image_size},...o}),this.constant_values=this.config.background_color.map(a=>a*this.rescale_factor)}pad_image(o,a,l,d){return super.pad_image(o,a,l,{constant_values:this.constant_values,center:!0,...d})}}},"./src/models/janus/processing_janus.js":(e,r,t)=>{t.r(r),t.d(r,{VLChatProcessor:()=>d});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),o=t("./src/utils/core.js"),a=t("./src/utils/tensor.js"),l=t("./src/utils/image.js");class d extends s.Processor{constructor(u,h){super(u,h),this.image_tag=this.config.image_tag,this.image_start_tag=this.config.image_start_tag,this.image_end_tag=this.config.image_end_tag,this.num_image_tokens=this.config.num_image_tokens}async _call(u,{images:h=null,chat_template:w="default"}={}){h?Array.isArray(h)||(h=[h]):h=await Promise.all(u.filter(N=>N.images).flatMap(N=>N.images).map(N=>l.RawImage.read(N)));const f=this.tokenizer,P=f.apply_chat_template(u,{tokenize:!1,add_generation_prompt:!0,chat_template:w}),A=N=>f.encode(N,{add_special_tokens:!1}),b=P.split(this.image_tag),y=b.length-1;if(h.length!==y)throw new Error(`Number of images provided (${h.length}) does not match number of "${this.image_tag}" image tags (${y})`);const[$,T,g]=f.model.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]);let M=A(b[0]),E=new Array(M.length).fill(!1);for(let N=1;N0){const N=await this.image_processor(h);return N.pixel_values.unsqueeze_(0),{...B,...N}}return B}}re(d,"image_processor_class",i.AutoImageProcessor),re(d,"tokenizer_class",n.AutoTokenizer),re(d,"uses_processor_config",!0)},"./src/models/jina_clip/image_processing_jina_clip.js":(e,r,t)=>{t.r(r),t.d(r,{JinaCLIPImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{constructor(o){const{resize_mode:a,fill_color:l,interpolation:d,size:p,...u}=o,h=a==="squash"?{width:p,height:p}:a==="shortest"?{shortest_edge:p}:{longest_edge:p},w=d==="bicubic"?3:2;super({...u,size:h,resample:w,do_center_crop:!0,crop_size:p,do_normalize:!0})}}},"./src/models/jina_clip/processing_jina_clip.js":(e,r,t)=>{t.r(r),t.d(r,{JinaCLIPProcessor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class o extends s.Processor{async _call(l=null,d=null,p={}){if(!l&&!d)throw new Error("Either text or images must be provided");const u=l?this.tokenizer(l,p):{},h=d?await this.image_processor(d,p):{};return{...u,...h}}}re(o,"tokenizer_class",n.AutoTokenizer),re(o,"image_processor_class",i.AutoImageProcessor)},"./src/models/llava_onevision/image_processing_llava_onevision.js":(e,r,t)=>{t.r(r),t.d(r,{LlavaOnevisionImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/mask2former/image_processing_mask2former.js":(e,r,t)=>{t.r(r),t.d(r,{Mask2FormerImageProcessor:()=>i});var s=t("./src/models/maskformer/image_processing_maskformer.js");class i extends s.MaskFormerImageProcessor{}},"./src/models/maskformer/image_processing_maskformer.js":(e,r,t)=>{t.r(r),t.d(r,{MaskFormerFeatureExtractor:()=>n,MaskFormerImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_panoptic_segmentation(...a){return(0,s.post_process_panoptic_segmentation)(...a)}post_process_instance_segmentation(...a){return(0,s.post_process_instance_segmentation)(...a)}}class n extends i{}},"./src/models/mgp_str/processing_mgp_str.js":(e,r,t)=>{t.r(r),t.d(r,{MgpstrProcessor:()=>l});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),o=t("./src/utils/maths.js");const a={char:["char_decode",1],bpe:["bpe_decode",2],wp:["wp_decode",102]};class l extends s.Processor{get char_tokenizer(){return this.components.char_tokenizer}get bpe_tokenizer(){return this.components.bpe_tokenizer}get wp_tokenizer(){return this.components.wp_tokenizer}_decode_helper(p,u){if(!a.hasOwnProperty(u))throw new Error(`Format ${u} is not supported.`);const[h,w]=a[u],f=this[h].bind(this),[P,A]=p.dims,b=[],y=[],$=p.tolist();for(let g=0;g0?k.reduce((N,J)=>N*J,1):0;y.push(E),b.push(B)}return[f(y),b]}char_decode(p){return this.char_tokenizer.batch_decode(p).map(u=>u.replaceAll(" ",""))}bpe_decode(p){return this.bpe_tokenizer.batch_decode(p)}wp_decode(p){return this.wp_tokenizer.batch_decode(p).map(u=>u.replaceAll(" ",""))}batch_decode([p,u,h]){const[w,f]=this._decode_helper(p,"char"),[P,A]=this._decode_helper(u,"bpe"),[b,y]=this._decode_helper(h,"wp"),$=[],T=[];for(let g=0;g{t.r(r),t.d(r,{MobileNetV1FeatureExtractor:()=>n,MobileNetV1ImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/mobilenet_v2/image_processing_mobilenet_v2.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV2FeatureExtractor:()=>n,MobileNetV2ImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/mobilenet_v3/image_processing_mobilenet_v3.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV3FeatureExtractor:()=>n,MobileNetV3ImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/mobilenet_v4/image_processing_mobilenet_v4.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV4FeatureExtractor:()=>n,MobileNetV4ImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/mobilevit/image_processing_mobilevit.js":(e,r,t)=>{t.r(r),t.d(r,{MobileViTFeatureExtractor:()=>n,MobileViTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/moonshine/feature_extraction_moonshine.js":(e,r,t)=>{t.r(r),t.d(r,{MoonshineFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{async _call(a){(0,s.validate_audio_inputs)(a,"MoonshineFeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));const l=[1,a.length];return{input_values:new i.Tensor("float32",a,l)}}}},"./src/models/moonshine/processing_moonshine.js":(e,r,t)=>{t.r(r),t.d(r,{MoonshineProcessor:()=>o});var s=t("./src/models/auto/feature_extraction_auto.js"),i=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",i.AutoTokenizer),re(o,"feature_extractor_class",s.AutoFeatureExtractor)},"./src/models/nougat/image_processing_nougat.js":(e,r,t)=>{t.r(r),t.d(r,{NougatImageProcessor:()=>i});var s=t("./src/models/donut/image_processing_donut.js");class i extends s.DonutImageProcessor{}},"./src/models/owlv2/image_processing_owlv2.js":(e,r,t)=>{t.r(r),t.d(r,{Owlv2ImageProcessor:()=>i});var s=t("./src/models/owlvit/image_processing_owlvit.js");class i extends s.OwlViTImageProcessor{}},"./src/models/owlvit/image_processing_owlvit.js":(e,r,t)=>{t.r(r),t.d(r,{OwlViTFeatureExtractor:()=>n,OwlViTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_object_detection(...a){return(0,s.post_process_object_detection)(...a)}}class n extends i{}},"./src/models/owlvit/processing_owlvit.js":(e,r,t)=>{t.r(r),t.d(r,{OwlViTProcessor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class o extends s.Processor{}re(o,"tokenizer_class",n.AutoTokenizer),re(o,"image_processor_class",i.AutoImageProcessor)},"./src/models/paligemma/processing_paligemma.js":(e,r,t)=>{t.r(r),t.d(r,{PaliGemmaProcessor:()=>l});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");const o="";function a(d,p,u,h,w){return`${h.repeat(u*w)}${p}${d} -`}class l extends s.Processor{async _call(p,u=null,h={}){u||(console.warn("You are using PaliGemma without a text prefix. It will perform as a picture-captioning model."),u=""),Array.isArray(p)||(p=[p]),Array.isArray(u)||(u=[u]);const w=this.tokenizer.bos_token,f=this.image_processor.config.image_seq_length;let P;u.some(y=>y.includes(o))?P=u.map(y=>{const $=y.replaceAll(o,o.repeat(f)),T=$.lastIndexOf(o),g=T===-1?0:T+o.length;return $.slice(0,g)+w+$.slice(g)+` -`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),P=u.map(y=>a(y,w,f,o,p.length)));const A=this.tokenizer(P,h);return{...await this.image_processor(p,h),...A}}}re(l,"tokenizer_class",n.AutoTokenizer),re(l,"image_processor_class",i.AutoImageProcessor),re(l,"uses_processor_config",!1)},"./src/models/phi3_v/image_processing_phi3_v.js":(e,r,t)=>{t.r(r),t.d(r,{Phi3VImageProcessor:()=>p});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");const n=336,o=[2,3],{ceil:a,floor:l,sqrt:d}=Math;class p extends s.ImageProcessor{constructor(h){super({...h,do_normalize:!0,do_pad:!0,pad_size:"custom",do_convert_rgb:!0,do_resize:!0}),this._num_crops=h.num_crops}calc_num_image_tokens_from_image_size(h,w){const{num_img_tokens:f}=this.config;return l((l(w/n)*l(h/n)+1)*f+1+(l(w/n)+1)*d(f))}get_resize_output_image_size(h,w){const f=this._num_crops,[P,A]=h.size;let b=P/A,y=1;for(;y*Math.ceil(y/b)<=f;)y+=1;y-=1;const $=Math.floor(y*336),T=Math.floor($/b);return[$,T]}pad_image(h,w,f,P={}){const[A,b]=w,y=n*a(A/n),$=n*a(b/n),T=[1,1,1].map((g,M)=>(g-this.image_mean[M])/this.image_std[M]);return super.pad_image(h,w,{width:$,height:y},{center:!0,constant_values:T,...P})}async _call(h,{num_crops:w=null}={}){if(this._num_crops=w??(w=this.config.num_crops),w<4||d(w)%1!==0)throw new Error("num_crops must be a square number >= 4");Array.isArray(h)||(h=[h]);const f=h.length,P=await Promise.all(h.map(E=>this.preprocess(E))),A=P.map(E=>E.original_size),b=P.map(E=>E.reshaped_input_size),y=[];for(const{pixel_values:E}of P){E.unsqueeze_(0);const[k,B]=E.dims.slice(-2),N=await(0,i.interpolate_4d)(E,{size:[n,n],mode:"bicubic"});if(w>0){const J=[],q=d(w),V=l(B/q),Y=l(k/q);for(let Q=0;QE.map(k=>n*a(k/n))),g=new i.Tensor("int64",T.flat(),[f,2]),M=T.map(([E,k])=>this.calc_num_image_tokens_from_image_size(k,E));return{pixel_values:$,original_sizes:A,reshaped_input_sizes:b,image_sizes:g,num_img_tokens:M}}}},"./src/models/phi3_v/processing_phi3_v.js":(e,r,t)=>{t.r(r),t.d(r,{Phi3VProcessor:()=>l});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");const o="<|image|>",a=/<\|image_\d+\|>/g;class l extends s.Processor{async _call(p,u=null,{padding:h=!0,truncation:w=!0,num_crops:f=null}={}){Array.isArray(p)||(p=[p]);let P,A;if(u){A=await this.image_processor(u,{num_crops:f});const{num_img_tokens:b}=A,y=p.map((T,g)=>T.split(a).join(o.repeat(b[g])));P=this.tokenizer(y,{padding:h,truncation:w});const $=this.tokenizer.model.convert_tokens_to_ids([o])[0];P.input_ids.map_(T=>T==$?-T:T)}else P=this.tokenizer(p);return{...P,...A}}}re(l,"image_processor_class",i.AutoImageProcessor),re(l,"tokenizer_class",n.AutoTokenizer)},"./src/models/processors.js":(e,r,t)=>{t.r(r),t.d(r,{Florence2Processor:()=>s.Florence2Processor,GroundingDinoProcessor:()=>i.GroundingDinoProcessor,Idefics3Processor:()=>n.Idefics3Processor,JinaCLIPProcessor:()=>a.JinaCLIPProcessor,MgpstrProcessor:()=>l.MgpstrProcessor,MoonshineProcessor:()=>d.MoonshineProcessor,OwlViTProcessor:()=>p.OwlViTProcessor,PaliGemmaProcessor:()=>h.PaliGemmaProcessor,Phi3VProcessor:()=>u.Phi3VProcessor,PyAnnoteProcessor:()=>w.PyAnnoteProcessor,Qwen2VLProcessor:()=>f.Qwen2VLProcessor,SamProcessor:()=>P.SamProcessor,SmolVLMProcessor:()=>A.SmolVLMProcessor,SpeechT5Processor:()=>b.SpeechT5Processor,UltravoxProcessor:()=>y.UltravoxProcessor,VLChatProcessor:()=>o.VLChatProcessor,Wav2Vec2Processor:()=>$.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>T.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>g.WhisperProcessor});var s=t("./src/models/florence2/processing_florence2.js"),i=t("./src/models/grounding_dino/processing_grounding_dino.js"),n=t("./src/models/idefics3/processing_idefics3.js"),o=t("./src/models/janus/processing_janus.js"),a=t("./src/models/jina_clip/processing_jina_clip.js"),l=t("./src/models/mgp_str/processing_mgp_str.js"),d=t("./src/models/moonshine/processing_moonshine.js"),p=t("./src/models/owlvit/processing_owlvit.js"),u=t("./src/models/phi3_v/processing_phi3_v.js"),h=t("./src/models/paligemma/processing_paligemma.js"),w=t("./src/models/pyannote/processing_pyannote.js"),f=t("./src/models/qwen2_vl/processing_qwen2_vl.js"),P=t("./src/models/sam/processing_sam.js"),A=t("./src/models/smolvlm/processing_smolvlm.js"),b=t("./src/models/speecht5/processing_speecht5.js"),y=t("./src/models/ultravox/processing_ultravox.js"),$=t("./src/models/wav2vec2/processing_wav2vec2.js"),T=t("./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js"),g=t("./src/models/whisper/processing_whisper.js")},"./src/models/pvt/image_processing_pvt.js":(e,r,t)=>{t.r(r),t.d(r,{PvtImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/pyannote/feature_extraction_pyannote.js":(e,r,t)=>{t.r(r),t.d(r,{PyAnnoteFeatureExtractor:()=>o});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");class o extends s.FeatureExtractor{async _call(l){(0,s.validate_audio_inputs)(l,"PyAnnoteFeatureExtractor"),l instanceof Float64Array&&(l=new Float32Array(l));const d=[1,1,l.length];return{input_values:new i.Tensor("float32",l,d)}}samples_to_frames(l){return(l-this.config.offset)/this.config.step}post_process_speaker_diarization(l,d){const p=d/this.samples_to_frames(d)/this.config.sampling_rate,u=[];for(const h of l.tolist()){const w=[];let f=-1;for(let P=0;P({id:P,start:A*p,end:b*p,confidence:y/(b-A)})))}return u}}},"./src/models/pyannote/processing_pyannote.js":(e,r,t)=>{t.r(r),t.d(r,{PyAnnoteProcessor:()=>n});var s=t("./src/base/processing_utils.js"),i=t("./src/models/pyannote/feature_extraction_pyannote.js");class n extends s.Processor{async _call(a){return await this.feature_extractor(a)}post_process_speaker_diarization(...a){return this.feature_extractor.post_process_speaker_diarization(...a)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}re(n,"feature_extractor_class",i.PyAnnoteFeatureExtractor)},"./src/models/qwen2_vl/image_processing_qwen2_vl.js":(e,r,t)=>{t.r(r),t.d(r,{Qwen2VLImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a,...l){const{pixel_values:d,original_sizes:p,reshaped_input_sizes:u}=await super._call(a,...l);let h=d;const{temporal_patch_size:w,merge_size:f,patch_size:P}=this.config;h.dims[0]===1&&(h=(0,i.cat)(Array.from({length:w},()=>h),0));const A=h.dims[0]/w,b=h.dims[1],y=Math.floor(h.dims[2]/P),$=Math.floor(h.dims[3]/P),T=h.view(A,w,b,Math.floor(y/f),f,P,Math.floor($/f),f,P).permute(0,3,6,4,7,2,1,5,8).view(A*y*$,b*w*P*P),g=new i.Tensor("int64",[A,y,$],[1,3]);return{pixel_values:T,image_grid_thw:g,original_sizes:p,reshaped_input_sizes:u}}}},"./src/models/qwen2_vl/processing_qwen2_vl.js":(e,r,t)=>{t.r(r),t.d(r,{Qwen2VLProcessor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");class o extends s.Processor{async _call(l,d=null,...p){Array.isArray(l)||(l=[l]);let u,h;if(d&&(u=await this.image_processor(d),h=u.image_grid_thw),h){let f=this.image_processor.config.merge_size**2,P=0;const A=h.tolist();l=l.map(b=>{for(;b.includes("<|image_pad|>");){const y=Number(A[P++].reduce(($,T)=>$*T,1n));b=b.replace("<|image_pad|>","<|placeholder|>".repeat(Math.floor(y/f)))}return b.replaceAll("<|placeholder|>","<|image_pad|>")})}return{...this.tokenizer(l),...u}}}re(o,"image_processor_class",i.AutoImageProcessor),re(o,"tokenizer_class",n.AutoTokenizer)},"./src/models/rt_detr/image_processing_rt_detr.js":(e,r,t)=>{t.r(r),t.d(r,{RTDetrImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_object_detection(...o){return(0,s.post_process_object_detection)(...o)}}},"./src/models/sam/image_processing_sam.js":(e,r,t)=>{t.r(r),t.d(r,{SamImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/core.js"),n=t("./src/utils/tensor.js");class o extends s.ImageProcessor{reshape_input_points(l,d,p,u=!1){l=structuredClone(l);let h=(0,i.calculateDimensions)(l);if(h.length===3)u||(h=[1,...h]),l=[l];else if(h.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let w=0;wu!==d.dims[h]))throw Error(`The first ${p.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new n.Tensor("int64",l.flat(1/0).map(BigInt),p)}async _call(l,{input_points:d=null,input_labels:p=null,input_boxes:u=null}={}){const h=await super._call(l);if(d&&(h.input_points=this.reshape_input_points(d,h.original_sizes,h.reshaped_input_sizes)),p){if(!h.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");h.input_labels=this.add_input_labels(p,h.input_points)}return u&&(h.input_boxes=this.reshape_input_points(u,h.original_sizes,h.reshaped_input_sizes,!0)),h}async post_process_masks(l,d,p,{mask_threshold:u=0,binarize:h=!0,pad_size:w=null}={}){const f=[];w=w??this.pad_size;const P=[w.height,w.width];for(let A=0;Au&&(g[M]=1);$=new n.Tensor("bool",g,$.dims)}f.push($)}return f}generate_crop_boxes(l,d,{crop_n_layers:p=0,overlap_ratio:u=512/1500,points_per_crop:h=32,crop_n_points_downscale_factor:w=1}={}){}}},"./src/models/sam/processing_sam.js":(e,r,t)=>{t.r(r),t.d(r,{SamProcessor:()=>n});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js");class n extends s.Processor{async _call(...a){return await this.image_processor(...a)}post_process_masks(...a){return this.image_processor.post_process_masks(...a)}reshape_input_points(...a){return this.image_processor.reshape_input_points(...a)}}re(n,"image_processor_class",i.AutoImageProcessor)},"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":(e,r,t)=>{t.r(r),t.d(r,{SeamlessM4TFeatureExtractor:()=>o});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js"),n=t("./src/utils/audio.js");class o extends s.FeatureExtractor{constructor(l){super(l);const d=this.config.sampling_rate,p=(0,n.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(d/2),d,null,"kaldi",!0);for(let u=0;up*32768),(0,n.spectrogram)(l,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:d,transpose:!0})}async _call(l,{padding:d=!0,pad_to_multiple_of:p=2,do_normalize_per_mel_bins:u=!0,return_attention_mask:h=!0}={}){(0,s.validate_audio_inputs)(l,"SeamlessM4TFeatureExtractor");let w=await this._extract_fbank_features(l,this.config.max_length);if(u){const[g,M]=w.dims,E=w.data;for(let k=0;k0){const B=new Float32Array(M*(g+k));B.set(E),B.fill(this.config.padding_value,E.length);const N=g+k;w=new i.Tensor(w.type,B,[N,M]),h&&(f=new i.Tensor("int64",new BigInt64Array(N),[1,N]),f.data.fill(1n,0,g))}}const[P,A]=w.dims,b=this.config.stride;if(P%b!==0)throw new Error(`The number of frames (${P}) must be a multiple of the stride (${b}).`);const $=w.view(1,Math.floor(P/b),A*b),T={input_features:$};if(h){const g=$.dims[1],M=new BigInt64Array(g);if(f){const E=f.data;for(let k=1,B=0;k{t.r(r),t.d(r,{SegformerFeatureExtractor:()=>n,SegformerImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_semantic_segmentation(...a){return(0,s.post_process_semantic_segmentation)(...a)}}class n extends i{}},"./src/models/siglip/image_processing_siglip.js":(e,r,t)=>{t.r(r),t.d(r,{SiglipImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/smolvlm/image_processing_smolvlm.js":(e,r,t)=>{t.r(r),t.d(r,{SmolVLMImageProcessor:()=>s.Idefics3ImageProcessor});var s=t("./src/models/idefics3/image_processing_idefics3.js")},"./src/models/smolvlm/processing_smolvlm.js":(e,r,t)=>{t.r(r),t.d(r,{SmolVLMProcessor:()=>s.Idefics3Processor});var s=t("./src/models/idefics3/processing_idefics3.js")},"./src/models/snac/feature_extraction_snac.js":(e,r,t)=>{t.r(r),t.d(r,{SnacFeatureExtractor:()=>i});var s=t("./src/models/dac/feature_extraction_dac.js");class i extends s.DacFeatureExtractor{}},"./src/models/speecht5/feature_extraction_speecht5.js":(e,r,t)=>{t.r(r),t.d(r,{SpeechT5FeatureExtractor:()=>i});var s=t("./src/base/feature_extraction_utils.js");class i extends s.FeatureExtractor{}},"./src/models/speecht5/processing_speecht5.js":(e,r,t)=>{t.r(r),t.d(r,{SpeechT5Processor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/tokenizers.js"),n=t("./src/models/auto/feature_extraction_auto.js");class o extends s.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",i.AutoTokenizer),re(o,"feature_extractor_class",n.AutoFeatureExtractor)},"./src/models/swin2sr/image_processing_swin2sr.js":(e,r,t)=>{t.r(r),t.d(r,{Swin2SRImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{pad_image(o,a,l,d={}){const[p,u,h]=a;return super.pad_image(o,a,{width:u+(l-u%l)%l,height:p+(l-p%l)%l},{mode:"symmetric",center:!1,constant_values:-1,...d})}}},"./src/models/ultravox/processing_ultravox.js":(e,r,t)=>{t.r(r),t.d(r,{UltravoxProcessor:()=>o});var s=t("./src/models/auto/feature_extraction_auto.js"),i=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l,d=null,p={}){if(Array.isArray(l))throw new Error("Batched inputs are not supported yet.");let u={};if(d){const w=d.length,{input_features:f}=await this.feature_extractor(d,{...p,max_length:w}),P=Math.round(w/this.config.encoder_ds_factor+1e-4),A=1+Math.ceil(P/this.config.stack_factor);u.audio_token_len=[A],u.audio_values=f;const b=this.config.audio_placeholder;if(!l.includes(b))throw new Error(`The input text does not contain the image token ${b}.`);l=l.replaceAll(b,b.repeat(A))}return{...this.tokenizer(l,{add_special_tokens:!1,...p}),...u}}}re(o,"tokenizer_class",i.AutoTokenizer),re(o,"feature_extractor_class",s.AutoFeatureExtractor),re(o,"uses_processor_config",!0)},"./src/models/vit/image_processing_vit.js":(e,r,t)=>{t.r(r),t.d(r,{ViTFeatureExtractor:()=>n,ViTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/vitmatte/image_processing_vitmatte.js":(e,r,t)=>{t.r(r),t.d(r,{VitMatteImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a,l){Array.isArray(a)||(a=[a]),Array.isArray(l)||(l=[l]);const d=await Promise.all(a.map(h=>this.preprocess(h))),p=await Promise.all(l.map(h=>this.preprocess(h,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:(0,i.stack)(d.map((h,w)=>(0,i.cat)([h.pixel_values,p[w].pixel_values],0)),0),original_sizes:d.map(h=>h.original_size),reshaped_input_sizes:d.map(h=>h.reshaped_input_size)}}}},"./src/models/vitpose/image_processing_vitpose.js":(e,r,t)=>{t.r(r),t.d(r,{VitPoseImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_pose_estimation(o,a,{threshold:l=null}={}){const d=o.tolist(),[p,u,h,w]=o.dims,f=[];for(let P=0;P{t.r(r),t.d(r,{Wav2Vec2FeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{_zero_mean_unit_var_norm(a){const d=a.reduce((u,h)=>u+h,0)/a.length,p=a.reduce((u,h)=>u+(h-d)**2,0)/a.length;return a.map(u=>(u-d)/Math.sqrt(p+1e-7))}async _call(a){(0,s.validate_audio_inputs)(a,"Wav2Vec2FeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));let l=a;this.config.do_normalize&&(l=this._zero_mean_unit_var_norm(l));const d=[1,l.length];return{input_values:new i.Tensor("float32",l,d),attention_mask:new i.Tensor("int64",new BigInt64Array(l.length).fill(1n),d)}}}},"./src/models/wav2vec2/processing_wav2vec2.js":(e,r,t)=>{t.r(r),t.d(r,{Wav2Vec2Processor:()=>o});var s=t("./src/tokenizers.js"),i=t("./src/models/auto/feature_extraction_auto.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",s.AutoTokenizer),re(o,"feature_extractor_class",i.AutoFeatureExtractor)},"./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js":(e,r,t)=>{t.r(r),t.d(r,{Wav2Vec2ProcessorWithLM:()=>o});var s=t("./src/tokenizers.js"),i=t("./src/models/auto/feature_extraction_auto.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",s.AutoTokenizer),re(o,"feature_extractor_class",i.AutoFeatureExtractor)},"./src/models/wespeaker/feature_extraction_wespeaker.js":(e,r,t)=>{t.r(r),t.d(r,{WeSpeakerFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var i=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a);const l=this.config.sampling_rate,d=(0,i.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(l/2),l,null,"kaldi",!0);for(let p=0;pl*32768),(0,i.spectrogram)(a,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(a){(0,s.validate_audio_inputs)(a,"WeSpeakerFeatureExtractor");const l=(await this._extract_fbank_features(a)).unsqueeze_(0);if(this.config.fbank_centering_span===null){const d=l.mean(1).data,p=l.data,[u,h,w]=l.dims;for(let f=0;f{t.r(r),t.d(r,{WHISPER_LANGUAGE_MAPPING:()=>i,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>n,whisper_language_to_code:()=>o});const s=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],i=new Map(s),n=new Map([...s.map(([a,l])=>[l,a]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);function o(a){a=a.toLowerCase();let l=n.get(a);if(l===void 0){const d=a.match(/^<\|([a-z]{2})\|>$/);if(d&&(a=d[1]),i.has(a))l=a;else{const u=a.length===2?i.keys():i.values();throw new Error(`Language "${a}" is not supported. Must be one of: ${JSON.stringify(Array.from(u))}`)}}return l}},"./src/models/whisper/feature_extraction_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperFeatureExtractor:()=>o});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var i=t("./src/utils/audio.js"),n=t("./src/utils/maths.js");class o extends s.FeatureExtractor{constructor(l){var d;super(l),(d=this.config).mel_filters??(d.mel_filters=(0,i.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney")),this.window=(0,i.window_function)(this.config.n_fft,"hann")}async _extract_fbank_features(l){const d=await(0,i.spectrogram)(l,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:Math.min(Math.floor(l.length/this.config.hop_length),this.config.nb_max_frames)}),p=d.data,u=(0,n.max)(p)[0];for(let h=0;hu?(l.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),p=l.slice(0,u)):(p=new Float32Array(u),p.set(l)),{input_features:(await this._extract_fbank_features(p)).unsqueeze_(0)}}}},"./src/models/whisper/generation_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperGenerationConfig:()=>i});var s=t("./src/generation/configuration_utils.js");class i extends s.GenerationConfig{constructor(){super(...arguments);re(this,"return_timestamps",null);re(this,"return_token_timestamps",null);re(this,"num_frames",null);re(this,"alignment_heads",null);re(this,"task",null);re(this,"language",null);re(this,"no_timestamps_token_id",null);re(this,"prompt_ids",null);re(this,"is_multilingual",null);re(this,"lang_to_id",null);re(this,"task_to_id",null);re(this,"max_initial_timestamp_index",1)}}},"./src/models/whisper/processing_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperProcessor:()=>o});var s=t("./src/models/auto/feature_extraction_auto.js"),i=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",i.AutoTokenizer),re(o,"feature_extractor_class",s.AutoFeatureExtractor)},"./src/models/yolos/image_processing_yolos.js":(e,r,t)=>{t.r(r),t.d(r,{YolosFeatureExtractor:()=>n,YolosImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_object_detection(...a){return(0,s.post_process_object_detection)(...a)}}class n extends i{}},"./src/ops/registry.js":(e,r,t)=>{t.r(r),t.d(r,{TensorOpRegistry:()=>l});var s=t("./src/backends/onnx.js"),i=t("./src/utils/tensor.js"),n=t("./src/env.js");const o=n.apis.IS_BROWSER_ENV||n.apis.IS_WEBWORKER_ENV,a=async(d,p,u)=>{const h=await(0,s.createInferenceSession)(new Uint8Array(d),p);let w=Promise.resolve();return async f=>{const P=(0,s.isONNXProxy)(),A=Object.fromEntries(Object.entries(f).map(([y,$])=>[y,(P?$.clone():$).ort_tensor])),b=await(w=o?w.then(()=>h.run(A)):h.run(A));return Array.isArray(u)?u.map(y=>new i.Tensor(b[y])):new i.Tensor(b[u])}};class l{static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||(this._nearest_interpolate_4d=a([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,"y")),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||(this._bilinear_interpolate_4d=a([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||(this._bicubic_interpolate_4d=a([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||(this._matmul=a([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,"c")),this._matmul}static get stft(){return this._stft||(this._stft=a([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,"o")),this._stft}static get rfft(){return this._rfft||(this._rfft=a([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,"y")),this._rfft}static get top_k(){return this._top_k||(this._top_k=a([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,["v","i"])),this._top_k}static get slice(){return this._slice||(this._slice=a([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,"y")),this._slice}}re(l,"session_options",{})},"./src/pipelines.js":(e,r,t)=>{t.r(r),t.d(r,{AudioClassificationPipeline:()=>q,AutomaticSpeechRecognitionPipeline:()=>Y,BackgroundRemovalPipeline:()=>le,DepthEstimationPipeline:()=>X,DocumentQuestionAnsweringPipeline:()=>O,FeatureExtractionPipeline:()=>N,FillMaskPipeline:()=>$,ImageClassificationPipeline:()=>Q,ImageFeatureExtractionPipeline:()=>J,ImageSegmentationPipeline:()=>ie,ImageToImagePipeline:()=>ne,ImageToTextPipeline:()=>H,ObjectDetectionPipeline:()=>we,Pipeline:()=>P,QuestionAnsweringPipeline:()=>y,SummarizationPipeline:()=>g,Text2TextGenerationPipeline:()=>T,TextClassificationPipeline:()=>A,TextGenerationPipeline:()=>k,TextToAudioPipeline:()=>G,TokenClassificationPipeline:()=>b,TranslationPipeline:()=>M,ZeroShotAudioClassificationPipeline:()=>V,ZeroShotClassificationPipeline:()=>B,ZeroShotImageClassificationPipeline:()=>ae,ZeroShotObjectDetectionPipeline:()=>R,pipeline:()=>ke});var s=t("./src/tokenizers.js"),i=t("./src/models.js"),n=t("./src/models/auto/processing_auto.js");t("./src/base/processing_utils.js");var o=t("./src/utils/generic.js"),a=t("./src/utils/core.js"),l=t("./src/utils/maths.js"),d=t("./src/utils/audio.js"),p=t("./src/utils/tensor.js"),u=t("./src/utils/image.js");async function h(Me){return Array.isArray(Me)||(Me=[Me]),await Promise.all(Me.map(K=>u.RawImage.read(K)))}async function w(Me,K){return Array.isArray(Me)||(Me=[Me]),await Promise.all(Me.map(U=>typeof U=="string"||U instanceof URL?(0,d.read_audio)(U,K):U instanceof Float64Array?new Float32Array(U):U))}function f(Me,K){K&&(Me=Me.map(Ae=>Ae|0));const[U,pe,Pe,Te]=Me;return{xmin:U,ymin:pe,xmax:Pe,ymax:Te}}class P extends o.Callable{constructor({task:K,model:U,tokenizer:pe=null,processor:Pe=null}){super(),this.task=K,this.model=U,this.tokenizer=pe,this.processor=Pe}async dispose(){await this.model.dispose()}}class A extends P{constructor(K){super(K)}async _call(K,{top_k:U=1}={}){const pe=this.tokenizer(K,{padding:!0,truncation:!0}),Pe=await this.model(pe),Te=this.model.config.problem_type==="multi_label_classification"?Le=>Le.sigmoid():Le=>new p.Tensor("float32",(0,l.softmax)(Le.data),Le.dims),Ae=this.model.config.id2label,Ie=[];for(const Le of Pe.logits){const Ne=Te(Le),Ve=await(0,p.topk)(Ne,U),D=Ve[0].tolist(),z=Ve[1].tolist().map((ee,ce)=>({label:Ae?Ae[ee]:`LABEL_${ee}`,score:D[ce]}));U===1?Ie.push(...z):Ie.push(z)}return Array.isArray(K)||U===1?Ie:Ie[0]}}class b extends P{constructor(K){super(K)}async _call(K,{ignore_labels:U=["O"]}={}){const pe=Array.isArray(K),Pe=this.tokenizer(pe?K:[K],{padding:!0,truncation:!0}),Ae=(await this.model(Pe)).logits,Ie=this.model.config.id2label,Le=[];for(let Ne=0;NeFe==this.tokenizer.sep_token_id);Le[D].map((Fe,je)=>Fe==1&&(je===0||je>z&&Ne.findIndex(Qe=>Qe==Z[je])===-1));const ee=Te[D].tolist(),ce=Ae[D].tolist();for(let Fe=1;Feje==Z[Fe])!==-1)&&(ee[Fe]=-1/0,ce[Fe]=-1/0);const be=(0,l.softmax)(ee).map((Fe,je)=>[Fe,je]),ve=(0,l.softmax)(ce).map((Fe,je)=>[Fe,je]);be[0][0]=0,ve[0][0]=0;const Re=(0,a.product)(be,ve).filter(Fe=>Fe[0][1]<=Fe[1][1]).map(Fe=>[Fe[0][1],Fe[1][1],Fe[0][0]*Fe[1][0]]).sort((Fe,je)=>je[2]-Fe[2]);for(let Fe=0;Feee==this.tokenizer.mask_token_id);if(Ne===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);const Ve=Pe[Ie][Ne],D=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(Ve.data),Ve.dims),U),Z=D[0].tolist(),z=D[1].tolist();Te.push(z.map((ee,ce)=>{const be=Le.slice();return be[Ne]=ee,{score:Z[ce],token:Number(ee),token_str:this.tokenizer.decode([ee]),sequence:this.tokenizer.decode(be,{skip_special_tokens:!0})}}))}return Array.isArray(K)?Te:Te[0]}}class T extends P{constructor(U){super(U);re(this,"_key","generated_text")}async _call(U,pe={}){Array.isArray(U)||(U=[U]),this.model.config.prefix&&(U=U.map(Ne=>this.model.config.prefix+Ne));const Pe=this.model.config.task_specific_params;Pe&&Pe[this.task]&&Pe[this.task].prefix&&(U=U.map(Ne=>Pe[this.task].prefix+Ne));const Te=this.tokenizer,Ae={padding:!0,truncation:!0};let Ie;this instanceof M&&"_build_translation_inputs"in Te?Ie=Te._build_translation_inputs(U,Ae,pe):Ie=Te(U,Ae);const Le=await this.model.generate({...Ie,...pe});return Te.batch_decode(Le,{skip_special_tokens:!0}).map(Ne=>({[this._key]:Ne}))}}class g extends T{constructor(U){super(U);re(this,"_key","summary_text")}}class M extends T{constructor(U){super(U);re(this,"_key","translation_text")}}function E(Me){return Array.isArray(Me)&&Me.every(K=>"role"in K&&"content"in K)}class k extends P{constructor(K){super(K)}async _call(K,U={}){let pe=!1,Pe=!1,Te;if(typeof K=="string")Te=K=[K];else if(Array.isArray(K)&&K.every(z=>typeof z=="string"))pe=!0,Te=K;else{if(E(K))K=[K];else if(Array.isArray(K)&&K.every(E))pe=!0;else throw new Error("Input must be a string, an array of strings, a Chat, or an array of Chats");Pe=!0,Te=K.map(z=>this.tokenizer.apply_chat_template(z,{tokenize:!1,add_generation_prompt:!0}))}const Ae=U.add_special_tokens??!1,Ie=Pe?!1:U.return_full_text??!0;this.tokenizer.padding_side="left";const Le=this.tokenizer(Te,{add_special_tokens:Ae,padding:!0,truncation:!0}),Ne=await this.model.generate({...Le,...U}),Ve=this.tokenizer.batch_decode(Ne,{skip_special_tokens:!0});let D;!Ie&&Le.input_ids.dims.at(-1)>0&&(D=this.tokenizer.batch_decode(Le.input_ids,{skip_special_tokens:!0}).map(z=>z.length));const Z=Array.from({length:K.length},z=>[]);for(let z=0;z[U.toLowerCase(),pe])),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(K,U,{hypothesis_template:pe="This example is {}.",multi_label:Pe=!1}={}){const Te=Array.isArray(K);Te||(K=[K]),Array.isArray(U)||(U=[U]);const Ae=U.map(Ne=>pe.replace("{}",Ne)),Ie=Pe||U.length===1,Le=[];for(const Ne of K){const Ve=[];for(const z of Ae){const ee=this.tokenizer(Ne,{text_pair:z,padding:!0,truncation:!0}),ce=await this.model(ee);Ie?Ve.push([ce.logits.data[this.contradiction_id],ce.logits.data[this.entailment_id]]):Ve.push(ce.logits.data[this.entailment_id])}const Z=(Ie?Ve.map(z=>(0,l.softmax)(z)[1]):(0,l.softmax)(Ve)).map((z,ee)=>[z,ee]).sort((z,ee)=>ee[0]-z[0]);Le.push({sequence:Ne,labels:Z.map(z=>U[z[1]]),scores:Z.map(z=>z[0])})}return Te?Le:Le[0]}}class N extends P{constructor(K){super(K)}async _call(K,{pooling:U="none",normalize:pe=!1,quantize:Pe=!1,precision:Te="binary"}={}){const Ae=this.tokenizer(K,{padding:!0,truncation:!0}),Ie=await this.model(Ae);let Le=Ie.last_hidden_state??Ie.logits??Ie.token_embeddings;if(U!=="none")if(U==="mean")Le=(0,p.mean_pooling)(Le,Ae.attention_mask);else if(U==="cls")Le=Le.slice(null,0);else throw Error(`Pooling method '${U}' not supported.`);return pe&&(Le=Le.normalize(2,-1)),Pe&&(Le=(0,p.quantize_embeddings)(Le,Te)),Le}}class J extends P{constructor(K){super(K)}async _call(K,{pool:U=null}={}){const pe=await h(K),{pixel_values:Pe}=await this.processor(pe),Te=await this.model({pixel_values:Pe});let Ae;if(U){if(!("pooler_output"in Te))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");Ae=Te.pooler_output}else Ae=Te.last_hidden_state??Te.logits??Te.image_embeds;return Ae}}class q extends P{constructor(K){super(K)}async _call(K,{top_k:U=5}={}){const pe=this.processor.feature_extractor.config.sampling_rate,Pe=await w(K,pe),Te=this.model.config.id2label,Ae=[];for(const Ie of Pe){const Le=await this.processor(Ie),Ve=(await this.model(Le)).logits[0],D=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(Ve.data),Ve.dims),U),Z=D[0].tolist(),ee=D[1].tolist().map((ce,be)=>({label:Te?Te[ce]:`LABEL_${ce}`,score:Z[be]}));Ae.push(ee)}return Array.isArray(K)?Ae:Ae[0]}}class V extends P{constructor(K){super(K)}async _call(K,U,{hypothesis_template:pe="This is a sound of {}."}={}){const Pe=!Array.isArray(K);Pe&&(K=[K]);const Te=U.map(Ve=>pe.replace("{}",Ve)),Ae=this.tokenizer(Te,{padding:!0,truncation:!0}),Ie=this.processor.feature_extractor.config.sampling_rate,Le=await w(K,Ie),Ne=[];for(const Ve of Le){const D=await this.processor(Ve),Z=await this.model({...Ae,...D}),z=(0,l.softmax)(Z.logits_per_audio.data);Ne.push([...z].map((ee,ce)=>({score:ee,label:U[ce]})))}return Pe?Ne[0]:Ne}}class Y extends P{constructor(K){super(K)}async _call(K,U={}){switch(this.model.config.model_type){case"whisper":case"lite-whisper":return this._call_whisper(K,U);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(K,U);case"moonshine":return this._call_moonshine(K,U);default:throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(K,U){U.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),U.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');const pe=!Array.isArray(K);pe&&(K=[K]);const Pe=this.processor.feature_extractor.config.sampling_rate,Te=await w(K,Pe),Ae=[];for(const Ie of Te){const Le=await this.processor(Ie),Ve=(await this.model(Le)).logits[0],D=[];for(const z of Ve)D.push((0,l.max)(z.data)[1]);const Z=this.tokenizer.decode(D);Ae.push({text:Z})}return pe?Ae[0]:Ae}async _call_whisper(K,U){const pe=U.return_timestamps??!1,Pe=U.chunk_length_s??0,Te=U.force_full_sequences??!1;let Ae=U.stride_length_s??null;const Ie={...U};pe==="word"&&(Ie.return_token_timestamps=!0,Ie.return_timestamps=!1);const Le=!Array.isArray(K);Le&&(K=[K]);const Ne=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,Ve=this.processor.feature_extractor.config.hop_length,D=this.processor.feature_extractor.config.sampling_rate,Z=await w(K,D),z=[];for(const ee of Z){let ce=[];if(Pe>0){if(Ae===null)Ae=Pe/6;else if(Pe<=Ae)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const Re=D*Pe,Fe=D*Ae,je=Re-2*Fe;let Qe=0;for(;;){const Xe=Qe+Re,ut=ee.subarray(Qe,Xe),wt=await this.processor(ut),nr=Qe===0,jt=Xe>=ee.length;if(ce.push({stride:[ut.length,nr?0:Fe,jt?0:Fe],input_features:wt.input_features,is_last:jt}),jt)break;Qe+=je}}else ce=[{stride:[ee.length,0,0],input_features:(await this.processor(ee)).input_features,is_last:!0}];for(const Re of ce){Ie.num_frames=Math.floor(Re.stride[0]/Ve);const Fe=await this.model.generate({inputs:Re.input_features,...Ie});pe==="word"?(Re.tokens=Fe.sequences.tolist()[0],Re.token_timestamps=Fe.token_timestamps.tolist()[0].map(je=>(0,l.round)(je,2))):Re.tokens=Fe[0].tolist(),Re.stride=Re.stride.map(je=>je/D)}const[be,ve]=this.tokenizer._decode_asr(ce,{time_precision:Ne,return_timestamps:pe,force_full_sequences:Te});z.push({text:be,...ve})}return Le?z[0]:z}async _call_moonshine(K,U){const pe=!Array.isArray(K);pe&&(K=[K]);const Pe=this.processor.feature_extractor.config.sampling_rate,Te=await w(K,Pe),Ae=[];for(const Ie of Te){const Le=await this.processor(Ie),Ne=Math.floor(Ie.length/Pe)*6,Ve=await this.model.generate({max_new_tokens:Ne,...U,...Le}),D=this.processor.batch_decode(Ve,{skip_special_tokens:!0})[0];Ae.push({text:D})}return pe?Ae[0]:Ae}}class H extends P{constructor(K){super(K)}async _call(K,U={}){const pe=Array.isArray(K),Pe=await h(K),{pixel_values:Te}=await this.processor(Pe),Ae=[];for(const Ie of Te){Ie.dims=[1,...Ie.dims];const Le=await this.model.generate({inputs:Ie,...U}),Ne=this.tokenizer.batch_decode(Le,{skip_special_tokens:!0}).map(Ve=>({generated_text:Ve.trim()}));Ae.push(Ne)}return pe?Ae:Ae[0]}}class Q extends P{constructor(K){super(K)}async _call(K,{top_k:U=5}={}){const pe=await h(K),{pixel_values:Pe}=await this.processor(pe),Te=await this.model({pixel_values:Pe}),Ae=this.model.config.id2label,Ie=[];for(const Le of Te.logits){const Ne=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(Le.data),Le.dims),U),Ve=Ne[0].tolist(),Z=Ne[1].tolist().map((z,ee)=>({label:Ae?Ae[z]:`LABEL_${z}`,score:Ve[ee]}));Ie.push(Z)}return Array.isArray(K)?Ie:Ie[0]}}class ie extends P{constructor(K){super(K),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(K,{threshold:U=.5,mask_threshold:pe=.5,overlap_mask_area_threshold:Pe=.8,label_ids_to_fuse:Te=null,target_sizes:Ae=null,subtask:Ie=null}={}){if(Array.isArray(K)&&K.length!==1)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");const Ne=await h(K),Ve=Ne.map(Re=>[Re.height,Re.width]),D=await this.processor(Ne),{inputNames:Z,outputNames:z}=this.model.sessions.model;if(!Z.includes("pixel_values")){if(Z.length!==1)throw Error(`Expected a single input name, but got ${Z.length} inputs: ${Z}.`);const Re=Z[0];if(Re in D)throw Error(`Input name ${Re} already exists in the inputs.`);D[Re]=D.pixel_values}const ee=await this.model(D);let ce=null;if(Ie!==null)ce=this.subtasks_mapping[Ie];else if(this.processor.image_processor){for(const[Re,Fe]of Object.entries(this.subtasks_mapping))if(Fe in this.processor.image_processor){ce=this.processor.image_processor[Fe].bind(this.processor.image_processor),Ie=Re;break}}const be=this.model.config.id2label,ve=[];if(Ie)if(Ie==="panoptic"||Ie==="instance"){const Re=ce(ee,U,pe,Pe,Te,Ae??Ve)[0],Fe=Re.segmentation;for(const je of Re.segments_info){const Qe=new Uint8ClampedArray(Fe.data.length);for(let ut=0;utwt<-1e-5||wt>1+1e-5)&&Xe.sigmoid_();const ut=await u.RawImage.fromTensor(Xe.mul_(255).to("uint8")).resize(Qe[1],Qe[0]);ve.push({label:null,score:null,mask:ut})}}return ve}}class le extends ie{constructor(K){super(K)}async _call(K,U={}){if(Array.isArray(K)&&K.length!==1)throw Error("Background removal pipeline currently only supports a batch size of 1.");const Pe=await h(K),Te=await super._call(K,U);return Pe.map((Ie,Le)=>{const Ne=Ie.clone();return Ne.putAlpha(Te[Le].mask),Ne})}}class ae extends P{constructor(K){super(K)}async _call(K,U,{hypothesis_template:pe="This is a photo of {}"}={}){const Pe=Array.isArray(K),Te=await h(K),Ae=U.map(Z=>pe.replace("{}",Z)),Ie=this.tokenizer(Ae,{padding:this.model.config.model_type==="siglip"?"max_length":!0,truncation:!0}),{pixel_values:Le}=await this.processor(Te),Ne=await this.model({...Ie,pixel_values:Le}),Ve=this.model.config.model_type==="siglip"?Z=>Z.sigmoid().data:Z=>(0,l.softmax)(Z.data),D=[];for(const Z of Ne.logits_per_image){const ee=[...Ve(Z)].map((ce,be)=>({score:ce,label:U[be]}));ee.sort((ce,be)=>be.score-ce.score),D.push(ee)}return Pe?D:D[0]}}class we extends P{constructor(K){super(K)}async _call(K,{threshold:U=.9,percentage:pe=!1}={}){const Pe=Array.isArray(K);if(Pe&&K.length!==1)throw Error("Object detection pipeline currently only supports a batch size of 1.");const Te=await h(K),Ae=pe?null:Te.map(z=>[z.height,z.width]),{pixel_values:Ie,pixel_mask:Le}=await this.processor(Te),Ne=await this.model({pixel_values:Ie,pixel_mask:Le}),Ve=this.processor.image_processor.post_process_object_detection(Ne,U,Ae),D=this.model.config.id2label,Z=Ve.map(z=>z.boxes.map((ee,ce)=>({score:z.scores[ce],label:D[z.classes[ce]],box:f(ee,!pe)})));return Pe?Z:Z[0]}}class R extends P{constructor(K){super(K)}async _call(K,U,{threshold:pe=.1,top_k:Pe=null,percentage:Te=!1}={}){const Ae=Array.isArray(K),Ie=await h(K),Le=this.tokenizer(U,{padding:!0,truncation:!0}),Ne=await this.processor(Ie),Ve=[];for(let D=0;D({score:ve.scores[Fe],label:ve.labels[Fe],box:f(Re,!Te)}))}else{const ve=this.processor.image_processor.post_process_object_detection(ce,pe,z,!0)[0];be=ve.boxes.map((Re,Fe)=>({score:ve.scores[Fe],label:U[ve.classes[Fe]],box:f(Re,!Te)}))}be.sort((ve,Re)=>Re.score-ve.score),Pe!==null&&(be=be.slice(0,Pe)),Ve.push(be)}return Ae?Ve:Ve[0]}}class O extends P{constructor(K){super(K)}async _call(K,U,pe={}){const Pe=(await h(K))[0],{pixel_values:Te}=await this.processor(Pe),Ae=`${U}`,Ie=this.tokenizer(Ae,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,Le=await this.model.generate({inputs:Te,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:Ie,...pe}),Ve=this.tokenizer.batch_decode(Le)[0].match(/(.*?)<\/s_answer>/);let D=null;return Ve&&Ve.length>=2&&(D=Ve[1].trim()),[{answer:D}]}}class G extends P{constructor(U){super(U);re(this,"DEFAULT_VOCODER_ID","Xenova/speecht5_hifigan");this.vocoder=U.vocoder??null}async _call(U,{speaker_embeddings:pe=null}={}){return this.processor?this._call_text_to_spectrogram(U,{speaker_embeddings:pe}):this._call_text_to_waveform(U)}async _call_text_to_waveform(U){const pe=this.tokenizer(U,{padding:!0,truncation:!0}),{waveform:Pe}=await this.model(pe),Te=this.model.config.sampling_rate;return new d.RawAudio(Pe.data,Te)}async _call_text_to_spectrogram(U,{speaker_embeddings:pe}){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 pe=="string"||pe instanceof URL)&&(pe=new Float32Array(await(await fetch(pe)).arrayBuffer())),pe instanceof Float32Array)pe=new p.Tensor("float32",pe,[1,pe.length]);else if(!(pe instanceof p.Tensor))throw new Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");const{input_ids:Pe}=this.tokenizer(U,{padding:!0,truncation:!0}),{waveform:Te}=await this.model.generate_speech(Pe,pe,{vocoder:this.vocoder}),Ae=this.processor.feature_extractor.config.sampling_rate;return new d.RawAudio(Te.data,Ae)}}class ne extends P{constructor(K){super(K)}async _call(K){const U=await h(K),pe=await this.processor(U),Pe=await this.model(pe),Te=[];for(const Ae of Pe.reconstruction){const Ie=Ae.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");Te.push(u.RawImage.fromTensor(Ie))}return Te.length>1?Te:Te[0]}}class X extends P{constructor(K){super(K)}async _call(K){const U=await h(K),pe=await this.processor(U),{predicted_depth:Pe}=await this.model(pe),Te=[];for(let Ae=0;Ae1?Te:Te[0]}}const ye=Object.freeze({"text-classification":{tokenizer:s.AutoTokenizer,pipeline:A,model:i.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:s.AutoTokenizer,pipeline:b,model:i.AutoModelForTokenClassification,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:s.AutoTokenizer,pipeline:y,model:i.AutoModelForQuestionAnswering,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:s.AutoTokenizer,pipeline:$,model:i.AutoModelForMaskedLM,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:s.AutoTokenizer,pipeline:g,model:i.AutoModelForSeq2SeqLM,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:s.AutoTokenizer,pipeline:M,model:i.AutoModelForSeq2SeqLM,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:s.AutoTokenizer,pipeline:T,model:i.AutoModelForSeq2SeqLM,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:s.AutoTokenizer,pipeline:k,model:i.AutoModelForCausalLM,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:s.AutoTokenizer,pipeline:B,model:i.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:q,model:i.AutoModelForAudioClassification,processor:n.AutoProcessor,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:s.AutoTokenizer,pipeline:V,model:i.AutoModel,processor:n.AutoProcessor,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:s.AutoTokenizer,pipeline:Y,model:[i.AutoModelForSpeechSeq2Seq,i.AutoModelForCTC],processor:n.AutoProcessor,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:s.AutoTokenizer,pipeline:G,model:[i.AutoModelForTextToWaveform,i.AutoModelForTextToSpectrogram],processor:[n.AutoProcessor,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:s.AutoTokenizer,pipeline:H,model:i.AutoModelForVision2Seq,processor:n.AutoProcessor,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:Q,model:i.AutoModelForImageClassification,processor:n.AutoProcessor,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:ie,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:n.AutoProcessor,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"background-removal":{pipeline:le,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:n.AutoProcessor,default:{model:"Xenova/modnet"},type:"image"},"zero-shot-image-classification":{tokenizer:s.AutoTokenizer,pipeline:ae,model:i.AutoModel,processor:n.AutoProcessor,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:we,model:i.AutoModelForObjectDetection,processor:n.AutoProcessor,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:s.AutoTokenizer,pipeline:R,model:i.AutoModelForZeroShotObjectDetection,processor:n.AutoProcessor,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:s.AutoTokenizer,pipeline:O,model:i.AutoModelForDocumentQuestionAnswering,processor:n.AutoProcessor,default:{model:"Xenova/donut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:ne,model:i.AutoModelForImageToImage,processor:n.AutoProcessor,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:X,model:i.AutoModelForDepthEstimation,processor:n.AutoProcessor,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:s.AutoTokenizer,pipeline:N,model:i.AutoModel,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:n.AutoProcessor,pipeline:J,model:[i.AutoModelForImageFeatureExtraction,i.AutoModel],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),_e=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function ke(Me,K=null,{progress_callback:U=null,config:pe=null,cache_dir:Pe=null,local_files_only:Te=!1,revision:Ae="main",device:Ie=null,dtype:Le=null,subfolder:Ne="onnx",use_external_data_format:Ve=null,model_file_name:D=null,session_options:Z={}}={}){Me=_e[Me]??Me;const z=ye[Me.split("_",1)[0]];if(!z)throw Error(`Unsupported pipeline: ${Me}. Must be one of [${Object.keys(ye)}]`);K||(K=z.default.model,console.log(`No model specified. Using default model: "${K}".`));const ee={progress_callback:U,config:pe,cache_dir:Pe,local_files_only:Te,revision:Ae,device:Ie,dtype:Le,subfolder:Ne,use_external_data_format:Ve,model_file_name:D,session_options:Z},ce=new Map([["tokenizer",z.tokenizer],["model",z.model],["processor",z.processor]]),be=await He(ce,K,ee);be.task=Me,(0,a.dispatchCallback)(U,{status:"ready",task:Me,model:K});const ve=z.pipeline;return new ve(be)}async function He(Me,K,U){const pe=Object.create(null),Pe=[];for(const[Te,Ae]of Me.entries()){if(!Ae)continue;let Ie;Array.isArray(Ae)?Ie=new Promise(async(Le,Ne)=>{var D,Z;let Ve;for(const z of Ae){if(z===null){Le(null);return}try{Le(await z.from_pretrained(K,U));return}catch(ee){if((D=ee.message)!=null&&D.includes("Unsupported model type"))Ve=ee;else if((Z=ee.message)!=null&&Z.includes("Could not locate file"))Ve=ee;else{Ne(ee);return}}}Ne(Ve)}):Ie=Ae.from_pretrained(K,U),pe[Te]=Ie,Pe.push(Ie)}await Promise.all(Pe);for(const[Te,Ae]of Object.entries(pe))pe[Te]=await Ae;return pe}},"./src/tokenizers.js":(e,r,t)=>{t.r(r),t.d(r,{AlbertTokenizer:()=>Ur,AutoTokenizer:()=>Cn,BartTokenizer:()=>hs,BertTokenizer:()=>qr,BlenderbotSmallTokenizer:()=>Jr,BlenderbotTokenizer:()=>Fr,BloomTokenizer:()=>Qr,CLIPTokenizer:()=>Tn,CamembertTokenizer:()=>it,CodeGenTokenizer:()=>Xr,CodeLlamaTokenizer:()=>Qs,CohereTokenizer:()=>Pn,ConvBertTokenizer:()=>mr,DebertaTokenizer:()=>Ts,DebertaV2Tokenizer:()=>Es,DistilBertTokenizer:()=>et,ElectraTokenizer:()=>zt,EsmTokenizer:()=>Zs,FalconTokenizer:()=>fs,GPT2Tokenizer:()=>ps,GPTNeoXTokenizer:()=>Ys,GemmaTokenizer:()=>Lr,Grok1Tokenizer:()=>Cs,HerbertTokenizer:()=>Ds,LlamaTokenizer:()=>qs,M2M100Tokenizer:()=>zs,MBart50Tokenizer:()=>ms,MBartTokenizer:()=>Er,MPNetTokenizer:()=>Js,MarianTokenizer:()=>En,MgpstrTokenizer:()=>Ss,MobileBertTokenizer:()=>us,NllbTokenizer:()=>Ls,NougatTokenizer:()=>_r,PreTrainedTokenizer:()=>dt,Qwen2Tokenizer:()=>en,RoFormerTokenizer:()=>Be,RobertaTokenizer:()=>_s,SiglipTokenizer:()=>zr,SpeechT5Tokenizer:()=>cr,SqueezeBertTokenizer:()=>xs,T5Tokenizer:()=>Ir,TokenizerModel:()=>J,VitsTokenizer:()=>Rs,Wav2Vec2CTCTokenizer:()=>Bs,WhisperTokenizer:()=>Ar,XLMRobertaTokenizer:()=>Xs,XLMTokenizer:()=>rr,is_chinese_char:()=>$});var s=t("./src/utils/generic.js"),i=t("./src/utils/core.js"),n=t("./src/utils/hub.js"),o=t("./src/utils/maths.js"),a=t("./src/utils/tensor.js"),l=t("./src/utils/data-structures.js"),d=t("./node_modules/@huggingface/jinja/dist/index.js"),p=t("./src/models/whisper/common_whisper.js");async function u(ue,F){const j=await Promise.all([(0,n.getModelJSON)(ue,"tokenizer.json",!0,F),(0,n.getModelJSON)(ue,"tokenizer_config.json",!0,F)]);return F.legacy!==null&&(j[1].legacy=F.legacy),j}function h(ue,F){const j=[];let te=0;for(const de of ue.matchAll(F)){const he=de[0];te0&&j.push(he),te=de.index+he.length}return te=19968&&ue<=40959||ue>=13312&&ue<=19903||ue>=131072&&ue<=173791||ue>=173824&&ue<=177983||ue>=177984&&ue<=178207||ue>=178208&&ue<=183983||ue>=63744&&ue<=64255||ue>=194560&&ue<=195103}function T(ue,F,j){const te=[];let de=0;for(;dethis.tokens_to_ids.get(j)??this.unk_token_id)}convert_ids_to_tokens(F){return F.map(j=>this.vocab[j]??this.unk_token)}}class q extends J{constructor(F){super(F),this.tokens_to_ids=f(F.vocab),this.unk_token_id=this.tokens_to_ids.get(F.unk_token),this.unk_token=F.unk_token,this.max_input_chars_per_word=F.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(const[j,te]of this.tokens_to_ids)this.vocab[te]=j}encode(F){const j=[];for(const te of F){const de=[...te];if(de.length>this.max_input_chars_per_word){j.push(this.unk_token);continue}let he=!1,Ce=0;const We=[];for(;Ce0&&(Ze=this.config.continuing_subword_prefix+Ze),this.tokens_to_ids.has(Ze)){Ke=Ze;break}--qe}if(Ke===null){he=!0;break}We.push(Ke),Ce=qe}he?j.push(this.unk_token):j.push(...We)}return j}}class V extends J{constructor(F,j){super(F);const te=F.vocab.length;this.vocab=new Array(te),this.scores=new Array(te);for(let de=0;de[de,he])),this.bos_token=" ",this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=j.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 l.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(F){const j=F.chars,te=1;let de=0;for(;de{const ue=[...Array.from({length:94},(de,he)=>he+33),...Array.from({length:12},(de,he)=>he+161),...Array.from({length:82},(de,he)=>he+174)],F=ue.slice();let j=0;for(let de=0;de<256;++de)ue.includes(de)||(ue.push(de),F.push(256+j),j+=1);const te=F.map(de=>String.fromCharCode(de));return Object.fromEntries(ue.map((de,he)=>[de,te[he]]))})(),H=(0,i.reverseDictionary)(Y);class Q extends J{constructor(F){super(F),this.tokens_to_ids=f(F.vocab),this.unk_token_id=this.tokens_to_ids.get(F.unk_token),this.unk_token=F.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(const[te,de]of this.tokens_to_ids)this.vocab[de]=te;const j=Array.isArray(F.merges[0]);this.merges=j?F.merges:F.merges.map(te=>te.split(" ",2)),this.bpe_ranks=new Map(this.merges.map((te,de)=>[JSON.stringify(te),de])),this.end_of_word_suffix=F.end_of_word_suffix,this.continuing_subword_suffix=F.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.cache=new Map}bpe(F){if(F.length===0)return[];const j=this.cache.get(F);if(j!==void 0)return j;const te=Array.from(F);this.end_of_word_suffix&&(te[te.length-1]+=this.end_of_word_suffix);let de=[];if(te.length>1){const he=new l.PriorityQueue((qe,Ke)=>qe.score`<0x${We.toString(16).toUpperCase().padStart(2,"0")}>`);Ce.every(We=>this.tokens_to_ids.has(We))?j.push(...Ce):j.push(this.unk_token)}else j.push(this.unk_token)}return j}}class ie extends J{constructor(F,j){super(F),this.tokens_to_ids=f(j.target_lang?F.vocab[j.target_lang]:F.vocab),this.bos_token=j.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=j.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=j.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=j.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(const[te,de]of this.tokens_to_ids)this.vocab[de]=te}encode(F){return F}}class le extends s.Callable{constructor(F){super(),this.config=F}static fromConfig(F){if(F===null)return null;switch(F.type){case"BertNormalizer":return new Me(F);case"Precompiled":return new jt(F);case"Sequence":return new He(F);case"Replace":return new ae(F);case"NFC":return new R(F);case"NFD":return new O(F);case"NFKC":return new G(F);case"NFKD":return new ne(F);case"Strip":return new X(F);case"StripAccents":return new ye(F);case"Lowercase":return new _e(F);case"Prepend":return new ke(F);default:throw new Error(`Unknown Normalizer type: ${F.type}`)}}normalize(F){throw Error("normalize should be implemented in subclass.")}_call(F){return this.normalize(F)}}class ae extends le{normalize(F){const j=w(this.config.pattern);return j===null?F:F.replaceAll(j,this.config.content)}}class we extends le{constructor(){super(...arguments);re(this,"form")}normalize(j){return j=j.normalize(this.form),j}}class R extends we{constructor(){super(...arguments);re(this,"form","NFC")}}class O extends we{constructor(){super(...arguments);re(this,"form","NFD")}}class G extends we{constructor(){super(...arguments);re(this,"form","NFKC")}}class ne extends we{constructor(){super(...arguments);re(this,"form","NFKD")}}class X extends le{normalize(F){return this.config.strip_left&&this.config.strip_right?F=F.trim():(this.config.strip_left&&(F=F.trimStart()),this.config.strip_right&&(F=F.trimEnd())),F}}class ye extends le{normalize(F){return F=b(F),F}}class _e extends le{normalize(F){return F=F.toLowerCase(),F}}class ke extends le{normalize(F){return F=this.config.prepend+F,F}}class He extends le{constructor(F){super(F),this.normalizers=F.normalizers.map(j=>le.fromConfig(j))}normalize(F){return this.normalizers.reduce((j,te)=>te.normalize(j),F)}}class Me extends le{_tokenize_chinese_chars(F){const j=[];for(let te=0;tethis.pre_tokenize_text(te,j)):this.pre_tokenize_text(F,j)).flat()}_call(F,j){return this.pre_tokenize(F,j)}}class U extends K{constructor(F){super(),this.pattern=new RegExp(`[^\\s${M}]+|[${M}]`,"gu")}pre_tokenize_text(F,j){return F.trim().match(this.pattern)||[]}}class pe extends K{constructor(F){super(),this.config=F,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=new RegExp("'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+","gu"),this.byte_encoder=Y,this.text_encoder=new TextEncoder}pre_tokenize_text(F,j){return this.add_prefix_space&&!F.startsWith(" ")&&(F=" "+F),(this.use_regex?F.match(this.pattern)||[]:[F]).map(de=>Array.from(this.text_encoder.encode(de),he=>this.byte_encoder[he]).join(""))}}class Pe extends K{constructor(F){super(),this.config=F,this.pattern=w(this.config.pattern,this.config.invert)}pre_tokenize_text(F,j){var te;return this.pattern===null?[]:this.config.invert?F.match(this.pattern)||[]:((te=this.config.behavior)==null?void 0:te.toLowerCase())==="removed"?F.split(this.pattern).filter(de=>de):h(F,this.pattern)}}class Te extends K{constructor(F){super(),this.config=F,this.pattern=new RegExp(`[^${M}]+|[${M}]+`,"gu")}pre_tokenize_text(F,j){return F.match(this.pattern)||[]}}class Ae extends K{constructor(F){super(),this.config=F;const j=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=new RegExp(j,"gu")}pre_tokenize_text(F,j){return F.match(this.pattern)||[]}}class Ie extends s.Callable{constructor(F){super(),this.config=F}static fromConfig(F){if(F===null)return null;switch(F.type){case"TemplateProcessing":return new Ve(F);case"ByteLevel":return new D(F);case"RobertaProcessing":return new Ne(F);case"BertProcessing":return new Le(F);case"Sequence":return new Z(F);default:throw new Error(`Unknown PostProcessor type: ${F.type}`)}}post_process(F,...j){throw Error("post_process should be implemented in subclass.")}_call(F,...j){return this.post_process(F,...j)}}class Le extends Ie{constructor(F){super(F),this.cls=F.cls[0],this.sep=F.sep[0]}post_process(F,j=null,{add_special_tokens:te=!0}={}){te&&(F=(0,i.mergeArrays)([this.cls],F,[this.sep]));let de=new Array(F.length).fill(0);if(j!==null){const he=te&&this instanceof Ne?[this.sep]:[],Ce=te?[this.sep]:[];F=(0,i.mergeArrays)(F,he,j,Ce),de=(0,i.mergeArrays)(de,new Array(j.length+he.length+Ce.length).fill(1))}return{tokens:F,token_type_ids:de}}}class Ne extends Le{}class Ve extends Ie{constructor(F){super(F),this.single=F.single,this.pair=F.pair}post_process(F,j=null,{add_special_tokens:te=!0}={}){const de=j===null?this.single:this.pair;let he=[],Ce=[];for(const We of de)"SpecialToken"in We?te&&(he.push(We.SpecialToken.id),Ce.push(We.SpecialToken.type_id)):"Sequence"in We&&(We.Sequence.id==="A"?(he=(0,i.mergeArrays)(he,F),Ce=(0,i.mergeArrays)(Ce,new Array(F.length).fill(We.Sequence.type_id))):We.Sequence.id==="B"&&(he=(0,i.mergeArrays)(he,j),Ce=(0,i.mergeArrays)(Ce,new Array(j.length).fill(We.Sequence.type_id))));return{tokens:he,token_type_ids:Ce}}}class D extends Ie{post_process(F,j=null){return j&&(F=(0,i.mergeArrays)(F,j)),{tokens:F}}}class Z extends Ie{constructor(F){super(F),this.processors=F.processors.map(j=>Ie.fromConfig(j))}post_process(F,j=null,te={}){let de;for(const he of this.processors)if(he instanceof D)F=he.post_process(F).tokens,j&&(j=he.post_process(j).tokens);else{const Ce=he.post_process(F,j,te);F=Ce.tokens,de=Ce.token_type_ids}return{tokens:F,token_type_ids:de}}}class z extends s.Callable{constructor(F){super(),this.config=F,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=F.trim_offsets}static fromConfig(F){if(F===null)return null;switch(F.type){case"WordPiece":return new Re(F);case"Metaspace":return new nr(F);case"ByteLevel":return new Fe(F);case"Replace":return new ee(F);case"ByteFallback":return new ce(F);case"Fuse":return new be(F);case"Strip":return new ve(F);case"Sequence":return new Qe(F);case"CTC":return new je(F);case"BPEDecoder":return new Xe(F);default:throw new Error(`Unknown Decoder type: ${F.type}`)}}_call(F){return this.decode(F)}decode(F){return this.decode_chain(F).join("")}decode_chain(F){throw Error("`decode_chain` should be implemented in subclass.")}}class ee extends z{decode_chain(F){const j=w(this.config.pattern);return j===null?F:F.map(te=>te.replaceAll(j,this.config.content))}}class ce extends z{constructor(F){super(F),this.text_decoder=new TextDecoder}decode_chain(F){const j=[];let te=[];for(const de of F){let he=null;if(de.length===6&&de.startsWith("<0x")&&de.endsWith(">")){const Ce=parseInt(de.slice(3,5),16);isNaN(Ce)||(he=Ce)}if(he!==null)te.push(he);else{if(te.length>0){const Ce=this.text_decoder.decode(Uint8Array.from(te));j.push(Ce),te=[]}j.push(de)}}if(te.length>0){const de=this.text_decoder.decode(Uint8Array.from(te));j.push(de),te=[]}return j}}class be extends z{decode_chain(F){return[F.join("")]}}class ve extends z{constructor(F){super(F),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(F){return F.map(j=>{let te=0;for(let he=0;he(te!==0&&(j.startsWith(this.config.prefix)?j=j.replace(this.config.prefix,""):j=" "+j),this.cleanup&&(j=A(j)),j))}}class Fe extends z{constructor(F){super(F),this.byte_decoder=H,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(F){const j=F.join(""),te=new Uint8Array([...j].map(he=>this.byte_decoder[he]));return this.text_decoder.decode(te)}decode_chain(F){const j=[];let te=[];for(const de of F)this.added_tokens.find(he=>he.content===de)!==void 0?(te.length>0&&(j.push(this.convert_tokens_to_string(te)),te=[]),j.push(de)):te.push(de);return te.length>0&&j.push(this.convert_tokens_to_string(te)),j}}class je extends z{constructor(F){super(F),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(F){if(F.length===0)return"";const j=[F[0]];for(let he=1;hehe!==this.pad_token).join("");return this.cleanup&&(de=A(de).replaceAll(this.word_delimiter_token," ").trim()),de}decode_chain(F){return[this.convert_tokens_to_string(F)]}}class Qe extends z{constructor(F){super(F),this.decoders=F.decoders.map(j=>z.fromConfig(j))}decode_chain(F){return this.decoders.reduce((j,te)=>te.decode_chain(j),F)}}class Xe extends z{constructor(F){super(F),this.suffix=this.config.suffix}decode_chain(F){return F.map((j,te)=>j.replaceAll(this.suffix,te===F.length-1?"":" "))}}class ut extends z{decode_chain(F){let j="";for(let te=1;tete.normalize("NFKC")).join("~"):F=F.normalize("NFKC"),F}}class dr extends K{constructor(F){super(),this.tokenizers=F.pretokenizers.map(j=>K.fromConfig(j))}pre_tokenize_text(F,j){return this.tokenizers.reduce((te,de)=>de.pre_tokenize(te,j),[F])}}class ds extends K{constructor(F){super()}pre_tokenize_text(F,j){return F.match(/\w+|[^\w\s]+/g)||[]}}class Fs extends K{constructor(F){super()}pre_tokenize_text(F,j){return g(F)}}class Dr extends K{constructor(F){super(),this.config=F,this.pattern=w(this.config.pattern),this.content=this.config.content}pre_tokenize_text(F,j){return this.pattern===null?[F]:[F.replaceAll(this.pattern,this.config.content)]}}const cs=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function Os(ue,F,j,te){for(const de of Object.keys(ue)){const he=F-ue[de].length,Ce=j(de),We=new Array(he).fill(Ce);ue[de]=te==="right"?(0,i.mergeArrays)(ue[de],We):(0,i.mergeArrays)(We,ue[de])}}function jr(ue,F){for(const j of Object.keys(ue))ue[j].length=F}class dt extends s.Callable{constructor(j,te){super();re(this,"return_token_type_ids",!1);re(this,"padding_side","right");this._tokenizer_config=te,this.normalizer=le.fromConfig(j.normalizer),this.pre_tokenizer=K.fromConfig(j.pre_tokenizer),this.model=J.fromConfig(j.model,te),this.post_processor=Ie.fromConfig(j.post_processor),this.decoder=z.fromConfig(j.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(const de of j.added_tokens){const he=new N(de);this.added_tokens.push(he),this.model.tokens_to_ids.set(he.content,he.id),this.model.vocab[he.id]=he.content,he.special&&(this.special_tokens.push(he.content),this.all_special_ids.push(he.id))}if(this.additional_special_tokens=te.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_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.slice().sort((de,he)=>he.content.length-de.content.length).map(de=>`${de.lstrip?"\\s*":""}(${(0,i.escapeRegExp)(de.content)})${de.rstrip?"\\s*":""}`).join("|")):null,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=te.model_max_length,this.remove_space=te.remove_space,this.clean_up_tokenization_spaces=te.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=te.do_lowercase_and_remove_accent??!1,te.padding_side&&(this.padding_side=te.padding_side),this.legacy=!1,this.chat_template=te.chat_template??null,Array.isArray(this.chat_template)){const de=Object.create(null);for(const{name:he,template:Ce}of this.chat_template){if(typeof he!="string"||typeof Ce!="string")throw new Error('Chat template must be a list of objects with "name" and "template" properties');de[he]=Ce}this.chat_template=de}this._compiled_template_cache=new Map}getToken(...j){for(const te of j){const de=this._tokenizer_config[te];if(de)if(typeof de=="object"){if(de.__type==="AddedToken")return de.content;throw Error(`Unknown token: ${de}`)}else return de}return null}static async from_pretrained(j,{progress_callback:te=null,config:de=null,cache_dir:he=null,local_files_only:Ce=!1,revision:We="main",legacy:qe=null}={}){const Ke=await u(j,{progress_callback:te,config:de,cache_dir:he,local_files_only:Ce,revision:We,legacy:qe});return new this(...Ke)}_call(j,{text_pair:te=null,add_special_tokens:de=!0,padding:he=!1,truncation:Ce=null,max_length:We=null,return_tensor:qe=!0,return_token_type_ids:Ke=null}={}){const Ze=Array.isArray(j);let ht;if(Ze){if(j.length===0)throw Error("text array must be non-empty");if(te!==null){if(Array.isArray(te)){if(j.length!==te.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");ht=j.map((kt,Wt)=>this._encode_plus(kt,{text_pair:te[Wt],add_special_tokens:de,return_token_type_ids:Ke}))}else ht=j.map(kt=>this._encode_plus(kt,{add_special_tokens:de,return_token_type_ids:Ke}))}else{if(j==null)throw Error("text may not be null or undefined");if(Array.isArray(te))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");ht=[this._encode_plus(j,{text_pair:te,add_special_tokens:de,return_token_type_ids:Ke})]}if(We===null?he==="max_length"?We=this.model_max_length:We=(0,o.max)(ht.map(kt=>kt.input_ids.length))[0]:Ce||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."),We=Math.min(We,this.model_max_length??1/0),he||Ce)for(let kt=0;ktWe?Ce&&jr(ht[kt],We):he&&Os(ht[kt],We,Wt=>Wt==="input_ids"?this.pad_token_id:0,this.padding_side));const Ct={};if(qe){if(!(he&&Ce)&&ht.some(Wt=>{var Ot;for(const Ut of Object.keys(Wt))if(Wt[Ut].length!==((Ot=ht[0][Ut])==null?void 0:Ot.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.");const kt=[ht.length,ht[0].input_ids.length];for(const Wt of Object.keys(ht[0]))Ct[Wt]=new a.Tensor("int64",BigInt64Array.from(ht.flatMap(Ot=>Ot[Wt]).map(BigInt)),kt)}else{for(const kt of Object.keys(ht[0]))Ct[kt]=ht.map(Wt=>Wt[kt]);if(!Ze)for(const kt of Object.keys(Ct))Ct[kt]=Ct[kt][0]}return Ct}_encode_text(j){return j===null?null:(this.added_tokens_regex?j.split(this.added_tokens_regex).filter(he=>he):[j]).map((he,Ce)=>{if(this.added_tokens.find(qe=>qe.content===he)!==void 0)return he;{if(this.remove_space===!0&&(he=he.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(he=y(he)),this.normalizer!==null&&(he=this.normalizer(he)),he.length===0)return[];const qe=this.pre_tokenizer!==null?this.pre_tokenizer(he,{section_index:Ce}):[he];return this.model(qe)}}).flat()}_encode_plus(j,{text_pair:te=null,add_special_tokens:de=!0,return_token_type_ids:he=null}={}){const{tokens:Ce,token_type_ids:We}=this._tokenize_helper(j,{pair:te,add_special_tokens:de}),qe=this.model.convert_tokens_to_ids(Ce),Ke={input_ids:qe,attention_mask:new Array(qe.length).fill(1)};return(he??this.return_token_type_ids)&&We&&(Ke.token_type_ids=We),Ke}_tokenize_helper(j,{pair:te=null,add_special_tokens:de=!1}={}){const he=this._encode_text(j),Ce=this._encode_text(te);return this.post_processor?this.post_processor(he,Ce,{add_special_tokens:de}):{tokens:(0,i.mergeArrays)(he??[],Ce??[])}}tokenize(j,{pair:te=null,add_special_tokens:de=!1}={}){return this._tokenize_helper(j,{pair:te,add_special_tokens:de}).tokens}encode(j,{text_pair:te=null,add_special_tokens:de=!0,return_token_type_ids:he=null}={}){return this._encode_plus(j,{text_pair:te,add_special_tokens:de,return_token_type_ids:he}).input_ids}batch_decode(j,te={}){return j instanceof a.Tensor&&(j=j.tolist()),j.map(de=>this.decode(de,te))}decode(j,te={}){if(j instanceof a.Tensor&&(j=P(j)),!Array.isArray(j)||j.length===0||!(0,i.isIntegralNumber)(j[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(j,te)}decode_single(j,{skip_special_tokens:te=!1,clean_up_tokenization_spaces:de=null}){let he=this.model.convert_ids_to_tokens(j);te&&(he=he.filter(We=>!this.special_tokens.includes(We)));let Ce=this.decoder?this.decoder(he):he.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(Ce=Ce.replaceAll(this.decoder.end_of_word_suffix," "),te&&(Ce=Ce.trim())),(de??this.clean_up_tokenization_spaces)&&(Ce=A(Ce)),Ce}get_chat_template({chat_template:j=null,tools:te=null}={}){if(this.chat_template&&typeof this.chat_template=="object"){const de=this.chat_template;if(j!==null&&Object.hasOwn(de,j))j=de[j];else if(j===null)if(te!==null&&"tool_use"in de)j=de.tool_use;else if("default"in de)j=de.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(de).sort()}.`)}else if(j===null)if(this.chat_template)j=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 j}apply_chat_template(j,{tools:te=null,documents:de=null,chat_template:he=null,add_generation_prompt:Ce=!1,tokenize:We=!0,padding:qe=!1,truncation:Ke=!1,max_length:Ze=null,return_tensor:ht=!0,return_dict:Ct=!1,tokenizer_kwargs:kt={},...Wt}={}){if(he=this.get_chat_template({chat_template:he,tools:te}),typeof he!="string")throw Error(`chat_template must be a string, but got ${typeof he}`);let Ot=this._compiled_template_cache.get(he);Ot===void 0&&(Ot=new d.Template(he),this._compiled_template_cache.set(he,Ot));const Ut=Object.create(null);for(const fr of cs){const Yr=this.getToken(fr);Yr&&(Ut[fr]=Yr)}const vr=Ot.render({messages:j,add_generation_prompt:Ce,tools:te,documents:de,...Ut,...Wt});if(We){const fr=this._call(vr,{add_special_tokens:!1,padding:qe,truncation:Ke,max_length:Ze,return_tensor:ht,...kt});return Ct?fr:fr.input_ids}return vr}}class qr extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Ur extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class us extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class xs extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Ts extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Es extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Ds extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class mr extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Be extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class et extends dt{}class it extends dt{}class rr extends dt{constructor(j,te){super(j,te);re(this,"return_token_type_ids",!0);console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class zt extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Ir extends dt{}class ps extends dt{}class hs extends dt{}class Er extends dt{constructor(F,j){super(F,j),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(te=>this.languageRegex.test(te)),this.lang_to_token=te=>te}_build_translation_inputs(F,j,te){return br(this,F,j,te)}}class ms extends Er{}class _s extends dt{}class Qr extends dt{}const Ps="▁";class qs extends dt{constructor(j,te){super(j,te);re(this,"padding_side","left");this.legacy=te.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new wt({replacement:Ps,add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(j){if(j===null)return null;if(this.legacy||j.length===0)return super._encode_text(j);let te=super._encode_text(Ps+j.replaceAll(Ps," "));return te.length>1&&te[0]===Ps&&this.special_tokens.includes(te[1])&&(te=te.slice(1)),te}}class Qs extends dt{}class Xs extends dt{}class Js extends dt{}class fs extends dt{}class Ys extends dt{}class Zs extends dt{}class en extends dt{}class Lr extends dt{}class Cs extends dt{}function br(ue,F,j,te){if(!("language_codes"in ue)||!Array.isArray(ue.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in ue)||!(ue.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in ue)||typeof ue.lang_to_token!="function")throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");const de=te.src_lang,he=te.tgt_lang;if(!ue.language_codes.includes(he))throw new Error(`Target language code "${he}" is not valid. Must be one of: {${ue.language_codes.join(", ")}}`);if(de!==void 0){if(!ue.language_codes.includes(de))throw new Error(`Source language code "${de}" is not valid. Must be one of: {${ue.language_codes.join(", ")}}`);for(const Ce of ue.post_processor.config.single)if("SpecialToken"in Ce&&ue.languageRegex.test(Ce.SpecialToken.id)){Ce.SpecialToken.id=ue.lang_to_token(de);break}}return te.forced_bos_token_id=ue.model.convert_tokens_to_ids([ue.lang_to_token(he)])[0],ue._call(F,j)}class Ls extends dt{constructor(F,j){super(F,j),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(te=>this.languageRegex.test(te)),this.lang_to_token=te=>te}_build_translation_inputs(F,j,te){return br(this,F,j,te)}}class zs extends dt{constructor(F,j){super(F,j),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(te=>this.languageRegex.test(te)).map(te=>te.slice(2,-2)),this.lang_to_token=te=>`__${te}__`}_build_translation_inputs(F,j,te){return br(this,F,j,te)}}class Ar extends dt{get timestamp_begin(){return this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1}_decode_asr(F,{return_timestamps:j=!1,return_language:te=!1,time_precision:de=null,force_full_sequences:he=!0}={}){if(de===null)throw Error("Must specify time_precision");let Ce=null;const We=j==="word";function qe(){return{language:Ce,timestamp:[null,null],text:""}}const Ke=[];let Ze=qe(),ht=0;const Ct=this.timestamp_begin,Wt=Ct+1500;let Ot=[],Ut=[],vr=!1,fr=null;const Yr=new Set(this.all_special_ids);for(const Gt of F){const Zt=Gt.tokens,gr=We?Gt.token_timestamps:null;let Zr=null,ws=Ct;if("stride"in Gt){const[Rt,Jt,qt]=Gt.stride;if(ht-=Jt,fr=Rt-qt,Jt&&(ws=Jt/de+Ct),qt)for(let er=Zt.length-1;er>=0;--er){const ir=Number(Zt[er]);if(ir>=Ct){if(Zr!==null&&(ir-Ct)*de=Ct&&Jt<=Wt){const qt=(Jt-Ct)*de+ht,er=(0,o.round)(qt,2);if(Zr!==null&&Jt>=Zr)vr=!0;else if(vr||Ot.length>0&&Jt0?(Ot.push(Ht),We&&Ut.push(ur)):Ot.every(Rt=>Rt.length===0)&&(Ze=qe(),Ot=[],Ht=[],Ut=[],ur=[])}if(Ot.length>0){if(he&&j)throw new 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.");const[Gt,Zt]=this.findLongestCommonSequence(Ot,Ut),gr=this.decode(Gt);Ze.text=gr,We&&(Ze.words=this.collateWordTimestamps(Gt,Zt,Ce)),Ke.push(Ze)}let xr=Object.create(null);const gs=Ke.map(Gt=>Gt.text).join("");if(j||te){for(let Gt=0;Gt0;let We=Ce?[]:null,qe=Ce?j[0]:null;for(let Ke=1;KeJt===ws[qt]&&qe[gs+qt]<=j[Ke][gr+qt]).length:Ht=Zt.filter((Jt,qt)=>Jt===ws[qt]).length;const ur=xr/1e4,Rt=Ht/xr+ur;Ht>1&&Rt>ht&&(ht=Rt,Ct=[gs,Gt,gr,Zr])}const[Wt,Ot,Ut,vr]=Ct,fr=Math.floor((Ot+Wt)/2),Yr=Math.floor((vr+Ut)/2);he.push(...te.slice(0,fr)),te=Ze.slice(Yr),de=te.length,Ce&&(We.push(...qe.slice(0,fr)),qe=j[Ke].slice(Yr))}return he.push(...te),Ce?(We.push(...qe),[he,We]):[he,[]]}collateWordTimestamps(F,j,te){const[de,he,Ce]=this.combineTokensIntoWords(F,te),We=[];for(let qe=0;qe=de){const We=((Ce-de)*te).toFixed(2);he.push(`<|${We}|>`),he.push([])}else he[he.length-1].push(Ce);return he=he.map(Ce=>typeof Ce=="string"?Ce:super.decode(Ce,j)),he.join("")}splitTokensOnUnicode(F){const j=this.decode(F,{decode_with_timestamps:!0}),te="�",de=[],he=[],Ce=[];let We=[],qe=[],Ke=0;for(let Ze=0;Ze=this.model.tokens_to_ids.get("<|endoftext|>"),Wt=Ze.startsWith(" "),Ot=Ze.trim(),Ut=qe.test(Ot);if(kt||Wt||Ut||he.length===0)he.push(Ze),Ce.push(ht),We.push(Ct);else{const vr=he.length-1;he[vr]+=Ze,Ce[vr].push(...ht),We[vr].push(...Ct)}}return[he,Ce,We]}mergePunctuations(F,j,te,de,he){const Ce=structuredClone(F),We=structuredClone(j),qe=structuredClone(te);let Ke=Ce.length-2,Ze=Ce.length-1;for(;Ke>=0;)Ce[Ke].startsWith(" ")&&de.includes(Ce[Ke].trim())?(Ce[Ze]=Ce[Ke]+Ce[Ze],We[Ze]=(0,i.mergeArrays)(We[Ke],We[Ze]),qe[Ze]=(0,i.mergeArrays)(qe[Ke],qe[Ze]),Ce[Ke]="",We[Ke]=[],qe[Ke]=[]):Ze=Ke,--Ke;for(Ke=0,Ze=1;Zeht),We.filter(ht=>ht.length>0),qe.filter(ht=>ht.length>0)]}}class Xr extends dt{}class Tn extends dt{}class zr extends dt{}class En extends dt{constructor(F,j){super(F,j),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(te=>this.languageRegex.test(te)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(F){if(F===null)return null;const[j,...te]=F.trim().split(this.languageRegex);if(te.length===0)return super._encode_text(j);if(te.length===2){const[de,he]=te;return this.supported_language_codes.includes(de)||console.warn(`Unsupported language code "${de}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,i.mergeArrays)([de],super._encode_text(he))}}}class Bs extends dt{}class Fr extends dt{}class Jr extends dt{}class cr extends dt{}class _r extends dt{}class Rs extends dt{constructor(F,j){super(F,j),this.decoder=new ut({})}}class Pn extends dt{}class Ss extends dt{}class Cn{static async from_pretrained(F,{progress_callback:j=null,config:te=null,cache_dir:de=null,local_files_only:he=!1,revision:Ce="main",legacy:We=null}={}){var Ct;const[qe,Ke]=await u(F,{progress_callback:j,config:te,cache_dir:de,local_files_only:he,revision:Ce,legacy:We}),Ze=((Ct=Ke.tokenizer_class)==null?void 0:Ct.replace(/Fast$/,""))??"PreTrainedTokenizer";let ht=this.TOKENIZER_CLASS_MAPPING[Ze];return ht||(console.warn(`Unknown tokenizer class "${Ze}", attempting to construct from base class.`),ht=dt),new ht(qe,Ke)}}re(Cn,"TOKENIZER_CLASS_MAPPING",{T5Tokenizer:Ir,DistilBertTokenizer:et,CamembertTokenizer:it,DebertaTokenizer:Ts,DebertaV2Tokenizer:Es,BertTokenizer:qr,HerbertTokenizer:Ds,ConvBertTokenizer:mr,RoFormerTokenizer:Be,XLMTokenizer:rr,ElectraTokenizer:zt,MobileBertTokenizer:us,SqueezeBertTokenizer:xs,AlbertTokenizer:Ur,GPT2Tokenizer:ps,BartTokenizer:hs,MBartTokenizer:Er,MBart50Tokenizer:ms,RobertaTokenizer:_s,WhisperTokenizer:Ar,CodeGenTokenizer:Xr,CLIPTokenizer:Tn,SiglipTokenizer:zr,MarianTokenizer:En,BloomTokenizer:Qr,NllbTokenizer:Ls,M2M100Tokenizer:zs,LlamaTokenizer:qs,CodeLlamaTokenizer:Qs,XLMRobertaTokenizer:Xs,MPNetTokenizer:Js,FalconTokenizer:fs,GPTNeoXTokenizer:Ys,EsmTokenizer:Zs,Wav2Vec2CTCTokenizer:Bs,BlenderbotTokenizer:Fr,BlenderbotSmallTokenizer:Jr,SpeechT5Tokenizer:cr,NougatTokenizer:_r,VitsTokenizer:Rs,Qwen2Tokenizer:en,GemmaTokenizer:Lr,Grok1Tokenizer:Cs,CohereTokenizer:Pn,MgpstrTokenizer:Ss,PreTrainedTokenizer:dt})},"./src/utils/audio.js":(e,r,t)=>{t.r(r),t.d(r,{RawAudio:()=>q,hamming:()=>h,hanning:()=>u,mel_filter_bank:()=>$,read_audio:()=>d,spectrogram:()=>k,window_function:()=>B});var s=t("./src/utils/hub.js"),i=t("./src/utils/maths.js"),n=t("./src/utils/core.js"),o=t("./src/env.js"),a=t("?7a2c"),l=t("./src/utils/tensor.js");async function d(V,Y){if(typeof AudioContext>"u")throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");const H=await(await(0,s.getFile)(V)).arrayBuffer(),Q=new AudioContext({sampleRate:Y});typeof Y>"u"&&console.warn(`No sampling rate provided, using default of ${Q.sampleRate}Hz.`);const ie=await Q.decodeAudioData(H);let le;if(ie.numberOfChannels===2){const ae=Math.sqrt(2),we=ie.getChannelData(0),R=ie.getChannelData(1);le=new Float32Array(we.length);for(let O=0;O2595*Math.log10(1+V/700),kaldi:V=>1127*Math.log(1+V/700),slaney:(V,Y=1e3,H=15,Q=27/Math.log(6.4))=>V>=Y?H+Math.log(V/Y)*Q:3*V/200};function f(V,Y="htk"){const H=w[Y];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof V=="number"?H(V):V.map(Q=>H(Q))}const P={htk:V=>700*(10**(V/2595)-1),kaldi:V=>700*(Math.exp(V/1127)-1),slaney:(V,Y=1e3,H=15,Q=Math.log(6.4)/27)=>V>=H?Y*Math.exp(Q*(V-H)):200*V/3};function A(V,Y="htk"){const H=P[Y];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof V=="number"?H(V):V.map(Q=>H(Q))}function b(V,Y){const H=Float64Array.from({length:Y.length-1},(ae,we)=>Y[we+1]-Y[we]),Q=Array.from({length:V.length},()=>new Array(Y.length));for(let ae=0;aenew Array(V.length));for(let ae=0;aeV+Q*le)}function $(V,Y,H,Q,ie,le=null,ae="htk",we=!1){if(le!==null&&le!=="slaney")throw new Error('norm must be one of null or "slaney"');const R=f(H,ae),O=f(Q,ae),G=y(R,O,Y+2);let ne=A(G,ae),X;if(we){const _e=ie/(V*2);X=f(Float64Array.from({length:V},(ke,He)=>He*_e),ae),ne=G}else X=y(0,Math.floor(ie/2),V);const ye=b(X,ne);if(le!==null&&le==="slaney")for(let _e=0;_eie)throw Error(`frame_length (${H}) may not be larger than fft_length (${ie})`);if(Pe!==H)throw new Error(`Length of the window (${Pe}) must equal frame_length (${H})`);if(Q<=0)throw new Error("hop_length must be greater than zero");if(le===null&&G!==null)throw new Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(ae){if(we!=="reflect")throw new Error(`pad_mode="${we}" not implemented yet.`);const be=Math.floor((ie-1)/2)+1;V=T(V,be,be)}let Te=Math.floor(1+Math.floor((V.length-H)/Q));Me!==null&&TeTe?U&&(Le=K):Le=Ie=K);const Ne=new i.FFT(ie),Ve=new Float64Array(ie),D=new Float64Array(Ne.outputBufferSize),Z=new Float32Array(Ae*Le);for(let be=0;be=1;--Fe)Ve[Fe]-=O*Ve[Fe-1];Ve[0]*=1-O}for(let Fe=0;FeMath.pow(we,.85));break;default:throw new Error(`Unknown window type ${Y}.`)}if(H&&(ae=ae.subarray(0,V)),Q===null)return ae;if(V>Q)throw new Error(`Length of the window (${V}) may not be larger than frame_length (${Q})`);return ae}function N(V,Y){let H=44;const Q=new ArrayBuffer(H+V.length*4),ie=new DataView(Q);J(ie,0,"RIFF"),ie.setUint32(4,36+V.length*4,!0),J(ie,8,"WAVE"),J(ie,12,"fmt "),ie.setUint32(16,16,!0),ie.setUint16(20,3,!0),ie.setUint16(22,1,!0),ie.setUint32(24,Y,!0),ie.setUint32(28,Y*4,!0),ie.setUint16(32,4,!0),ie.setUint16(34,32,!0),J(ie,36,"data"),ie.setUint32(40,V.length*4,!0);for(let le=0;le{let le=await ie.arrayBuffer();a.writeFileSync(Q,Buffer.from(le))};else throw new Error("Unable to save because filesystem is disabled in this environment.");await H(Y,this.toBlob())}}},"./src/utils/constants.js":(e,r,t)=>{t.r(r),t.d(r,{CHAT_TEMPLATE_NAME:()=>l,CONFIG_NAME:()=>i,FEATURE_EXTRACTOR_NAME:()=>n,GENERATION_CONFIG_NAME:()=>d,GITHUB_ISSUE_URL:()=>s,IMAGE_PROCESSOR_NAME:()=>o,PROCESSOR_NAME:()=>a});const s="https://github.com/huggingface/transformers.js/issues/new/choose",i="config.json",n="preprocessor_config.json",o=n,a="processor_config.json",l="chat_template.json",d="generation_config.json"},"./src/utils/core.js":(e,r,t)=>{t.r(r),t.d(r,{calculateDimensions:()=>d,calculateReflectOffset:()=>w,count:()=>b,dispatchCallback:()=>s,escapeRegExp:()=>n,isIntegralNumber:()=>a,isNullishDimension:()=>l,isTypedArray:()=>o,len:()=>A,mergeArrays:()=>u,pick:()=>P,pop:()=>p,product:()=>h,reverseDictionary:()=>i,saveBlob:()=>f});function s(y,$){y&&y($)}function i(y){return Object.fromEntries(Object.entries(y).map(([$,T])=>[T,$]))}function n(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(y){var $,T,g;return((g=(T=($=y==null?void 0:y.prototype)==null?void 0:$.__proto__)==null?void 0:T.constructor)==null?void 0:g.name)==="TypedArray"}function a(y){return Number.isInteger(y)||typeof y=="bigint"}function l(y){return y==null||y===-1}function d(y){const $=[];let T=y;for(;Array.isArray(T);)$.push(T.length),T=T[0];return $}function p(y,$,T=void 0){const g=y[$];if(g!==void 0)return delete y[$],g;if(T===void 0)throw Error(`Key ${$} does not exist in object.`);return T}function u(...y){return Array.prototype.concat.apply([],y)}function h(...y){return y.reduce(($,T)=>$.flatMap(g=>T.map(M=>[g,M])))}function w(y,$){return Math.abs((y+$)%(2*$)-$)}function f(y,$){const T=URL.createObjectURL($),g=document.createElement("a");g.href=T,g.download=y,g.click(),g.remove(),URL.revokeObjectURL(T)}function P(y,$){return Object.assign({},...$.map(T=>{if(y[T]!==void 0)return{[T]:y[T]}}))}function A(y){let $=0;for(const T of y)++$;return $}function b(y,$){let T=0;for(const g of y)g===$&&++T;return T}},"./src/utils/data-structures.js":(e,r,t)=>{t.r(r),t.d(r,{CharTrie:()=>i,PriorityQueue:()=>s,TokenLattice:()=>o});class s{constructor(d=(u,h)=>u>h,p=1/0){this._heap=[],this._comparator=d,this._maxSize=p}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...d){return this.extend(d)}extend(d){for(const p of d)if(this.size0&&this._swap(0,p),this._heap.pop(),this._siftDown(),d}replace(d){const p=this.peek();return this._heap[0]=d,this._siftDown(),p}_parent(d){return(d+1>>>1)-1}_left(d){return(d<<1)+1}_right(d){return d+1<<1}_greater(d,p){return this._comparator(this._heap[d],this._heap[p])}_swap(d,p){const u=this._heap[d];this._heap[d]=this._heap[p],this._heap[p]=u}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(d){for(;d>0&&this._greater(d,this._parent(d));)this._swap(d,this._parent(d)),d=this._parent(d)}_siftDown(){let d=0;for(;this._left(d)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);const h=new a(this.bosTokenId,0,0,0,0),w=new a(this.eosTokenId,1,this.len,0,0);this.nodes.push(h.clone()),this.nodes.push(w.clone()),this.beginNodes[this.len].push(w),this.endNodes[0].push(h)}insert(d,p,u,h){const w=this.nodes.length,f=new a(h,w,d,p,u);this.beginNodes[d].push(f),this.endNodes[d+p].push(f),this.nodes.push(f)}viterbi(){const d=this.len;let p=0;for(;p<=d;){if(this.beginNodes[p].length==0)return[];for(let P of this.beginNodes[p]){P.prev=null;let A=0,b=null;for(let y of this.endNodes[p]){const $=y.backtraceScore+P.score;(b===null||$>A)&&(b=y.clone(),A=$)}if(b!==null)P.prev=b,P.backtraceScore=A;else return[]}++p}const u=[],w=this.beginNodes[d][0].prev;if(w===null)return[];let f=w.clone();for(;f.prev!==null;)u.push(f.clone()),f=f.clone().prev.clone();return u.reverse(),u}piece(d){return this.chars.slice(d.pos,d.pos+d.length).join("")}tokens(){return this.viterbi().map(p=>this.piece(p))}tokenIds(){return this.viterbi().map(p=>p.tokenId)}}class a{constructor(d,p,u,h,w){this.tokenId=d,this.nodeId=p,this.pos=u,this.length=h,this.score=w,this.prev=null,this.backtraceScore=0}clone(){const d=new a(this.tokenId,this.nodeId,this.pos,this.length,this.score);return d.prev=this.prev,d.backtraceScore=this.backtraceScore,d}}},"./src/utils/devices.js":(e,r,t)=>{t.r(r),t.d(r,{DEVICE_TYPES:()=>s});const s=Object.freeze({auto:"auto",gpu:"gpu",cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:"webnn","webnn-npu":"webnn-npu","webnn-gpu":"webnn-gpu","webnn-cpu":"webnn-cpu"})},"./src/utils/dtypes.js":(e,r,t)=>{t.r(r),t.d(r,{DATA_TYPES:()=>o,DEFAULT_DEVICE_DTYPE_MAPPING:()=>a,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>l,isWebGpuFp16Supported:()=>n});var s=t("./src/env.js"),i=t("./src/utils/devices.js");const n=function(){let d;return async function(){if(d===void 0)if(!s.apis.IS_WEBGPU_AVAILABLE)d=!1;else try{d=(await navigator.gpu.requestAdapter()).features.has("shader-f16")}catch{d=!1}return d}}(),o=Object.freeze({auto:"auto",fp32:"fp32",fp16:"fp16",q8:"q8",int8:"int8",uint8:"uint8",q4:"q4",bnb4:"bnb4",q4f16:"q4f16"}),a=Object.freeze({[i.DEVICE_TYPES.wasm]:o.q8}),l=Object.freeze({[o.fp32]:"",[o.fp16]:"_fp16",[o.int8]:"_int8",[o.uint8]:"_uint8",[o.q8]:"_quantized",[o.q4]:"_q4",[o.q4f16]:"_q4f16",[o.bnb4]:"_bnb4"})},"./src/utils/generic.js":(e,r,t)=>{t.r(r),t.d(r,{Callable:()=>s});const s=class{constructor(){let i=function(...n){return i._call(...n)};return Object.setPrototypeOf(i,new.target.prototype)}_call(...i){throw Error("Must implement _call method in subclass")}}},"./src/utils/hub.js":(e,r,t)=>{t.r(r),t.d(r,{MAX_EXTERNAL_DATA_CHUNKS:()=>a,getFile:()=>u,getModelFile:()=>A,getModelJSON:()=>b});var s=t("?7a2c"),i=t("?a42a"),n=t("./src/env.js"),o=t("./src/utils/core.js");const a=100,l={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};class d{constructor(g){if(this.filePath=g,this.headers=new Headers,this.exists=s.existsSync(g),this.exists){this.status=200,this.statusText="OK";let M=s.statSync(g);this.headers.set("content-length",M.size.toString()),this.updateContentType();const E=s.createReadStream(g);this.body=new ReadableStream({start(k){E.on("data",B=>k.enqueue(B)),E.on("end",()=>k.close()),E.on("error",B=>k.error(B))},cancel(){E.destroy()}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const g=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",l[g]??"application/octet-stream")}clone(){let g=new d(this.filePath);return g.exists=this.exists,g.status=this.status,g.statusText=this.statusText,g.headers=new Headers(this.headers),g}async arrayBuffer(){return(await s.promises.readFile(this.filePath)).buffer}async blob(){const g=await s.promises.readFile(this.filePath);return new Blob([g],{type:this.headers.get("content-type")})}async text(){return await s.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function p(T,g=null,M=null){let E;try{E=new URL(T)}catch{return!1}return!(g&&!g.includes(E.protocol)||M&&!M.includes(E.hostname))}async function u(T){var g;if(n.env.useFS&&!p(T,["http:","https:","blob:"]))return new d(T.toString());if(typeof process<"u"&&((g=process==null?void 0:process.release)==null?void 0:g.name)==="node"){const M=!!(As!=null&&As.TESTING_REMOTELY),E=n.env.version,k=new Headers;if(k.set("User-Agent",`transformers.js/${E}; is_ci/${M};`),p(T,["http:","https:"],["huggingface.co","hf.co"])){const N=(As==null?void 0:As.HF_TOKEN)??(As==null?void 0:As.HF_ACCESS_TOKEN);N&&k.set("Authorization",`Bearer ${N}`)}return fetch(T,{headers:k})}else return fetch(T)}const h={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};function w(T,g,M){if(!M)return null;const E=h[T]??`Error (${T}) occurred while trying to load file`;throw Error(`${E}: "${g}".`)}class f{constructor(g){this.path=g}async match(g){let M=i.join(this.path,g),E=new d(M);if(E.exists)return E}async put(g,M,E=void 0){let k=i.join(this.path,g);try{const B=M.headers.get("Content-Length"),N=parseInt(B??"0");let J=0;await s.promises.mkdir(i.dirname(k),{recursive:!0});const q=s.createWriteStream(k),V=M.body.getReader();for(;;){const{done:Y,value:H}=await V.read();if(Y)break;await new Promise((ie,le)=>{q.write(H,ae=>{if(ae){le(ae);return}ie()})}),J+=H.length;const Q=N?J/N*100:0;E==null||E({progress:Q,loaded:J,total:N})}q.close()}catch(B){try{await s.promises.unlink(k)}catch{}throw B}}}async function P(T,...g){for(let M of g)try{let E=await T.match(M);if(E)return E}catch{continue}}async function A(T,g,M=!0,E={},k=!1){if(!n.env.allowLocalModels){if(E.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!n.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,o.dispatchCallback)(E.progress_callback,{status:"initiate",name:T,file:g});let B;if(!B&&n.env.useBrowserCache){if(typeof caches>"u")throw Error("Browser cache is not available in this environment.");try{B=await caches.open("transformers-cache")}catch(G){console.warn("An error occurred while opening the browser cache:",G)}}if(!B&&n.env.useFSCache&&(B=new f(E.cache_dir??n.env.cacheDir)),!B&&n.env.useCustomCache){if(!n.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!n.env.customCache.match||!n.env.customCache.put)throw new Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");B=n.env.customCache}const N=E.revision??"main";let J=$(T,g),q=$(n.env.localModelPath,J),V=J,Y=$(n.env.remoteHost,n.env.remotePathTemplate.replaceAll("{model}",T).replaceAll("{revision}",encodeURIComponent(N)),g),H=N==="main"?J:$(T,N,g),Q,ie=B instanceof f?H:Y,le=!1,ae;B&&(ae=await P(B,q,ie));const we=ae!==void 0;if(ae===void 0){if(n.env.allowLocalModels)if(p(J,["http:","https:"])){if(E.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${V}.`);if(!n.env.allowRemoteModels)throw new Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${V}.`)}else try{ae=await u(V),Q=V}catch(ne){console.warn(`Unable to load from local path "${V}": "${ne}"`)}if(ae===void 0||ae.status===404){if(E.local_files_only||!n.env.allowRemoteModels){if(M)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${V}".`);return null}if(ae=await u(Y),ae.status!==200)return w(ae.status,Y,M);Q=ie}le=B&&typeof Response<"u"&&ae instanceof Response&&ae.status===200}(0,o.dispatchCallback)(E.progress_callback,{status:"download",name:T,file:g});let R;if(!(n.apis.IS_NODE_ENV&&k)){let G;E.progress_callback?we&&typeof navigator<"u"&&/firefox/i.test(navigator.userAgent)?(G=new Uint8Array(await ae.arrayBuffer()),(0,o.dispatchCallback)(E.progress_callback,{status:"progress",name:T,file:g,progress:100,loaded:G.length,total:G.length})):G=await y(ae,ne=>{(0,o.dispatchCallback)(E.progress_callback,{status:"progress",name:T,file:g,...ne})}):G=new Uint8Array(await ae.arrayBuffer()),R=G}if(le&&Q&&await B.match(Q)===void 0&&(R?await B.put(Q,new Response(R,{headers:ae.headers})).catch(G=>{console.warn(`Unable to add response to browser cache: ${G}.`)}):await B.put(Q,ae,E.progress_callback)),(0,o.dispatchCallback)(E.progress_callback,{status:"done",name:T,file:g}),R){if(k)throw new Error("Cannot return path in a browser environment.");return R}if(ae instanceof d)return ae.filePath;const O=await B.match(Q);if(O instanceof d)return O.filePath;throw new Error("Unable to return path for response.")}async function b(T,g,M=!0,E={}){const k=await A(T,g,M,E,!1);if(k===null)return{};const N=new TextDecoder("utf-8").decode(k);return JSON.parse(N)}async function y(T,g){const M=T.headers.get("Content-Length");M===null&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let E=parseInt(M??"0"),k=new Uint8Array(E),B=0;const N=T.body.getReader();async function J(){const{done:q,value:V}=await N.read();if(q)return;const Y=B+V.length;if(Y>E){E=Y;const Q=new Uint8Array(E);Q.set(k),k=Q}k.set(V,B),B=Y;const H=B/E*100;return g({progress:H,loaded:B,total:E}),J()}return await J(),k}function $(...T){return T=T.map((g,M)=>(M&&(g=g.replace(new RegExp("^/"),"")),M!==T.length-1&&(g=g.replace(new RegExp("/$"),"")),g)),T.join("/")}},"./src/utils/image.js":(e,r,t)=>{t.r(r),t.d(r,{RawImage:()=>f,load_image:()=>P});var s=t("./src/utils/core.js"),i=t("./src/utils/hub.js"),n=t("./src/env.js"),o=t("./src/utils/tensor.js"),a=t("?2b25");let l,d,p;const u=n.apis.IS_BROWSER_ENV||n.apis.IS_WEBWORKER_ENV;if(u)l=(A,b)=>{if(!self.OffscreenCanvas)throw new Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas(A,b)},p=self.createImageBitmap,d=self.ImageData;else if(a)p=async A=>{const y=(await A.metadata()).channels,{data:$,info:T}=await A.rotate().raw().toBuffer({resolveWithObject:!0}),g=new f(new Uint8ClampedArray($),T.width,T.height,T.channels);return y!==void 0&&y!==T.channels&&g.convert(y),g};else throw new Error("Unable to load image processing library.");const h={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},w=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class f{constructor(b,y,$,T){this.data=b,this.width=y,this.height=$,this.channels=T}get size(){return[this.width,this.height]}static async read(b){if(b instanceof f)return b;if(typeof b=="string"||b instanceof URL)return await this.fromURL(b);if(b instanceof Blob)return await this.fromBlob(b);if(typeof HTMLCanvasElement<"u"&&b instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&b instanceof OffscreenCanvas)return this.fromCanvas(b);throw new Error(`Unsupported input type: ${typeof b}`)}static fromCanvas(b){if(!u)throw new Error("fromCanvas() is only supported in browser environments.");const $=b.getContext("2d").getImageData(0,0,b.width,b.height).data;return new f($,b.width,b.height,4)}static async fromURL(b){const y=await(0,i.getFile)(b);if(y.status!==200)throw new Error(`Unable to read image from "${b}" (${y.status} ${y.statusText})`);const $=await y.blob();return this.fromBlob($)}static async fromBlob(b){if(u){const y=await p(b),$=l(y.width,y.height).getContext("2d");return $.drawImage(y,0,0),new this($.getImageData(0,0,y.width,y.height).data,y.width,y.height,4)}else{const y=a(await b.arrayBuffer());return await p(y)}}static fromTensor(b,y="CHW"){if(b.dims.length!==3)throw new Error(`Tensor should have 3 dimensions, but has ${b.dims.length} dimensions.`);if(y==="CHW")b=b.transpose(1,2,0);else if(y!=="HWC")throw new Error(`Unsupported channel format: ${y}`);if(!(b.data instanceof Uint8ClampedArray||b.data instanceof Uint8Array))throw new Error(`Unsupported tensor type: ${b.type}`);switch(b.dims[2]){case 1:case 2:case 3:case 4:return new f(b.data,b.dims[1],b.dims[0],b.dims[2]);default:throw new Error(`Unsupported number of channels: ${b.dims[2]}`)}}grayscale(){if(this.channels===1)return this;const b=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let y=0,$=0;y=0?k=$:N=-$,T>=0?B=T:J=-T,E.drawImage(M,k,B,b,y,N,J,b,y),new f(E.getImageData(0,0,b,y).data,b,y,4).convert(g)}else{let g=this.toSharp();if($>=0&&T>=0)g=g.extract({left:Math.floor($),top:Math.floor(T),width:b,height:y});else if($<=0&&T<=0){const M=Math.floor(-T),E=Math.floor(-$);g=g.extend({top:M,left:E,right:b-this.width-E,bottom:y-this.height-M})}else{let M=[0,0],E=0;T<0?(M[0]=Math.floor(-T),M[1]=y-this.height-M[0]):E=Math.floor(T);let k=[0,0],B=0;$<0?(k[0]=Math.floor(-$),k[1]=b-this.width-k[0]):B=Math.floor($),g=g.extend({top:M[0],bottom:M[1],left:k[0],right:k[1]}).extract({left:B,top:E,width:b,height:y})}return await p(g)}}async toBlob(b="image/png",y=1){if(!u)throw new Error("toBlob() is only supported in browser environments.");return await this.toCanvas().convertToBlob({type:b,quality:y})}toTensor(b="CHW"){let y=new o.Tensor("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if(b!=="HWC")if(b==="CHW")y=y.permute(2,0,1);else throw new Error(`Unsupported channel format: ${b}`);return y}toCanvas(){if(!u)throw new Error("toCanvas() is only supported in browser environments.");const b=this.clone().rgba(),y=l(b.width,b.height),$=new d(b.data,b.width,b.height);return y.getContext("2d").putImageData($,0,0),y}split(){const{data:b,width:y,height:$,channels:T}=this,g=b.constructor,M=b.length/T,E=Array.from({length:T},()=>new g(M));for(let k=0;knew f(k,y,$,1))}_update(b,y,$,T=null){return this.data=b,this.width=y,this.height=$,T!==null&&(this.channels=T),this}clone(){return new f(this.data.slice(),this.width,this.height,this.channels)}convert(b){if(this.channels===b)return this;switch(b){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(b){if(u){if(n.apis.IS_WEBWORKER_ENV)throw new Error("Unable to save an image from a Web Worker.");const y=b.split(".").pop().toLowerCase(),$=w.get(y)??"image/png",T=await this.toBlob($);(0,s.saveBlob)(b,T)}else{if(n.apis.IS_FS_AVAILABLE)return await this.toSharp().toFile(b);throw new Error("Unable to save the image because filesystem is disabled in this environment.")}}toSharp(){if(u)throw new Error("toSharp() is only supported in server-side environments.");return a(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}const P=f.read.bind(f)},"./src/utils/maths.js":(e,r,t)=>{t.r(r),t.d(r,{FFT:()=>P,bankers_round:()=>y,cos_sim:()=>l,dot:()=>a,dynamic_time_warping:()=>$,interpolate_data:()=>s,log_softmax:()=>o,magnitude:()=>d,max:()=>u,medianFilter:()=>A,min:()=>p,permute_data:()=>i,round:()=>b,softmax:()=>n});function s(T,[g,M,E],[k,B],N="bilinear",J=!1){const q=B/E,V=k/M,Y=new T.constructor(k*B*g),H=M*E,Q=k*B;for(let ie=0;ie=0;--J)k[J]=q,E[J]=g[M[J]],q*=E[J];const B=M.map((J,q)=>k[M.indexOf(q)]),N=new T.constructor(T.length);for(let J=0;J=0;--V)q+=Y%g[V]*B[V],Y=Math.floor(Y/g[V]);N[q]=T[J]}return[N,E]}function n(T){const g=u(T)[0],M=T.map(B=>Math.exp(B-g)),E=M.reduce((B,N)=>B+N,0);return M.map(B=>B/E)}function o(T){const g=u(T)[0];let M=0;for(let B=0;BB-g-E)}function a(T,g){let M=0;for(let E=0;Eg+M*M,0))}function p(T){if(T.length===0)throw Error("Array must not be empty");let g=T[0],M=0;for(let E=1;Eg&&(g=T[E],M=E);return[g,M]}function h(T){return T>0&&(T&T-1)===0}class w{constructor(g){if(this.size=g|0,this.size<=1||!h(this.size))throw new Error("FFT size must be a power of two larger than 1");this._csize=g<<1,this.table=new Float64Array(this.size*2);for(let E=0;EE;E<<=1)++M;this._width=M%2===0?M-1:M,this._bitrev=new Int32Array(1<>>k&3)<>>1);for(let k=0;k>>1]=g[k];return E}toComplexArray(g,M){const E=M||this.createComplexArray();for(let k=0;k>>1],E[k+1]=0;return E}transform(g,M){if(g===M)throw new Error("Input and output buffers must be different");this._transform4(g,M,1)}realTransform(g,M){if(g===M)throw new Error("Input and output buffers must be different");this._realTransform4(g,M,1)}inverseTransform(g,M){if(g===M)throw new Error("Input and output buffers must be different");this._transform4(g,M,-1);for(let E=0;E>=2;N>=2;N>>=2){J=k/N<<1;const Q=J>>>2;for(q=0;q>>1,N>>>1)}else for(q=0,V=0;q>>1,N>>>1,E)}const H=this.table;for(N>>=2;N>=2;N>>=2){J=k/N<<1;const ie=J>>>1,le=ie>>>1,ae=le>>>1;for(q=0;q>>1;for(let ie=2;ie>1;++Y){const H=(Y+1-g)**2/2,Q=Math.sqrt(q**2+V**2)**H,ie=H*Math.atan2(V,q),le=2*Y;B[le]=Q*Math.cos(ie),B[le+1]=Q*Math.sin(ie),N[le]=B[le],N[le+1]=-B[le+1]}this._slicedChirpBuffer=B.subarray(M,E),this._f=new w(k>>1),this._f.transform(this._chirpBuffer,N)}_transform(g,M,E){const k=this._buffer1,B=this._buffer2,N=this._outBuffer1,J=this._outBuffer2,q=this._chirpBuffer,V=this._slicedChirpBuffer,Y=this._a;if(E)for(let H=0;H>1,le=M[ie];k[H]=le*V[H],k[Q]=le*V[Q]}else for(let H=0;H=T.length&&(q=2*(T.length-1)-q),E[N++]=T[q]}E.sort(),M[B]=E[k]}return M}function b(T,g){const M=Math.pow(10,g);return Math.round(T*M)/M}function y(T){const g=Math.round(T);return Math.abs(T)%1===.5?g%2===0?g:g-1:g}function $(T){const g=T.length,M=T[0].length,E=[g+1,M+1],k=Array.from({length:E[0]},()=>Array(E[1]).fill(1/0));k[0][0]=0;const B=Array.from({length:E[0]},()=>Array(E[1]).fill(-1));for(let Y=1;Y0||J>0;)switch(q.push(N-1),V.push(J-1),B[N][J]){case 0:--N,--J;break;case 1:--N;break;case 2:--J;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${N}, ${J}]. Please file a bug report.`)}return q.reverse(),V.reverse(),[q,V]}},"./src/utils/tensor.js":(e,r,t)=>{t.r(r),t.d(r,{DataTypeMap:()=>o,Tensor:()=>a,cat:()=>M,full:()=>V,full_like:()=>Y,interpolate:()=>p,interpolate_4d:()=>u,layer_norm:()=>y,matmul:()=>h,mean:()=>N,mean_pooling:()=>b,ones:()=>H,ones_like:()=>Q,permute:()=>d,quantize_embeddings:()=>we,rand:()=>ae,rfft:()=>w,slice:()=>A,stack:()=>E,std_mean:()=>B,topk:()=>f,zeros:()=>ie,zeros_like:()=>le});var s=t("./src/utils/maths.js"),i=t("./src/backends/onnx.js"),n=t("./src/ops/registry.js");const o=Object.freeze({float32:Float32Array,float16:typeof Float16Array<"u"?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});class a{constructor(...O){re(this,"ort_tensor");return(0,i.isONNXTensor)(O[0])?this.ort_tensor=O[0]:this.ort_tensor=new i.Tensor(O[0],O[1],O[2]),new Proxy(this,{get:(G,ne)=>{if(typeof ne=="string"){let X=Number(ne);if(Number.isInteger(X))return G._getitem(X)}return G[ne]},set:(G,ne,X)=>G[ne]=X})}get dims(){return this.ort_tensor.dims}set dims(O){this.ort_tensor.dims=O}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){const[O,...G]=this.dims;if(G.length>0){const ne=G.reduce((X,ye)=>X*ye);for(let X=0;X0){const X=ne.reduce((ye,_e)=>ye*_e);return this._subarray(O,X,ne)}else return new a(this.type,[this.data[O]],ne)}indexOf(O){const G=this.data;for(let ne=0;nepe)throw new Error(`Invalid slice: ${K}`);const Pe=[Math.max(U,0),Math.min(pe,this.dims[Me])];ne.push(Pe),G.push(Pe[1]-Pe[0])}else throw new Error(`Invalid slice: ${K}`)}const X=ne.map(([Me,K])=>K-Me),ye=X.reduce((Me,K)=>Me*K),_e=this.data,ke=new _e.constructor(ye),He=this.stride();for(let Me=0;Me=0;--U){const Pe=X[U];K+=(pe%Pe+ne[U][0])*He[U],pe=Math.floor(pe/Pe)}ke[Me]=_e[K]}return new a(this.type,ke,G)}permute(...O){return d(this,O)}transpose(...O){return this.permute(...O)}sum(O=null,G=!1){return this.norm(1,O,G)}norm(O="fro",G=null,ne=!1){if(O==="fro")O=2;else if(typeof O=="string")throw Error(`Unsupported norm: ${O}`);const X=this.data,ye=(Me,K)=>Me+K**O;if(G===null){const Me=X.reduce(ye,0)**(1/O);return new a(this.type,[Me],[])}const[_e,ke,He]=k(ye,this,G,ne);if(O!==1)for(let Me=0;Me=0;--He){const U=this.dims[He];if(He!==G){const pe=Me%U;ke+=pe*K,K*=this.dims[He]}Me=Math.floor(Me/U)}X[_e]/=ye[ke]}return this}normalize(O=2,G=1){return this.clone().normalize_(O,G)}stride(){return J(this.dims)}squeeze(O=null){return new a(this.type,this.data,$(this.dims,O))}squeeze_(O=null){return this.dims=$(this.dims,O),this}unsqueeze(O=null){return new a(this.type,this.data,T(this.dims,O))}unsqueeze_(O=null){return this.dims=T(this.dims,O),this}flatten_(O=0,G=-1){G=(G+this.dims.length)%this.dims.length;let ne=this.dims.slice(0,O),X=this.dims.slice(O,G+1),ye=this.dims.slice(G+1);return this.dims=[...ne,X.reduce((_e,ke)=>_e*ke,1),...ye],this}flatten(O=0,G=-1){return this.clone().flatten_(O,G)}view(...O){let G=-1;for(let X=0;Xke!==G?ye*_e:ye,1);O[G]=ne.length/X}return new a(this.type,ne,O)}neg_(){const O=this.data;for(let G=0;GO?1:0;return new a("bool",G,this.dims)}lt(O){const G=new Uint8Array(this.data.length),ne=this.data;for(let X=0;XMath.min(_e,ke),this,O,G,1/0);return new a(ne,X,ye)}max(O=null,G=!1){if(O===null){const _e=(0,s.max)(this.data)[0];return new a(this.type,[_e],[])}const[ne,X,ye]=k((_e,ke)=>Math.max(_e,ke),this,O,G,-1/0);return new a(ne,X,ye)}argmin(O=null,G=!1){if(O!==null)throw new Error("`dim !== null` not yet implemented.");const ne=(0,s.min)(this.data)[1];return new a("int64",[BigInt(ne)],[])}argmax(O=null,G=!1){if(O!==null)throw new Error("`dim !== null` not yet implemented.");const ne=(0,s.max)(this.data)[1];return new a("int64",[BigInt(ne)],[])}to(O){if(this.type===O)return this;if(!o.hasOwnProperty(O))throw new Error(`Unsupported type: ${O}`);let G;const ne=["int64","uint64"].includes(this.type),X=["int64","uint64"].includes(O);return ne&&!X?G=Number:!ne&&X&&(G=BigInt),new a(O,o[O].from(this.data,G),this.dims)}}function l(R,O){const G=R.length,ne=O.reduce((ye,_e)=>ye*_e);if(G!==ne)throw Error(`cannot reshape array of size ${G} into shape (${O})`);let X=R;for(let ye=O.length-1;ye>=0;ye--)X=X.reduce((_e,ke)=>{let He=_e[_e.length-1];return He.lengthnew a("int64",R,[R.length]);async function A(R,O,G,ne,X){return await(await n.TensorOpRegistry.slice)({x:R,s:P(O),e:P(G),a:P(ne),t:P(X??new Array(ne.length).fill(1))})}function b(R,O){const G=R.data,ne=O.data,X=[R.dims[0],R.dims[2]],ye=new G.constructor(X[0]*X[1]),[_e,ke,He]=R.dims;let Me=0;for(let K=0;K<_e;++K){const U=K*He*ke;for(let pe=0;peG!==1):typeof O=="number"?R[O]===1&&R.splice(O,1):Array.isArray(O)&&(R=R.filter((G,ne)=>G!==1||!O.includes(ne))),R}function T(R,O){return O=g(O,R.length+1),R=R.slice(),R.splice(O,0,1),R}function g(R,O,G=null,ne=!0){if(R<-O||R>=O){if(ne)throw new Error(`IndexError: index ${R} is out of bounds for dimension${G===null?"":" "+G} with size ${O}`);return R<-O?0:O}return R<0&&(R=(R%O+O)%O),R}function M(R,O=0){O=g(O,R[0].dims.length);const G=R[0].dims.slice();G[O]=R.reduce((_e,ke)=>_e+ke.dims[O],0);const ne=G.reduce((_e,ke)=>_e*ke,1),X=new R[0].data.constructor(ne),ye=R[0].type;if(O===0){let _e=0;for(const ke of R){const He=ke.data;X.set(He,_e),_e+=He.length}}else{let _e=0;for(let ke=0;ke=0;--pe){const Ae=Me[pe];let Ie=Pe%Ae;pe===O&&(Ie+=_e),U+=Ie*Te,Te*=G[pe],Pe=Math.floor(Pe/Ae)}X[U]=He[K]}_e+=Me[O]}}return new a(ye,X,G)}function E(R,O=0){return M(R.map(G=>G.unsqueeze(O)),O)}function k(R,O,G=null,ne=!1,X=null){const ye=O.data,_e=O.dims;G=g(G,_e.length);const ke=_e.slice();ke[G]=1;const He=new ye.constructor(ye.length/_e[G]);X!==null&&He.fill(X);for(let Me=0;Me=0;--U){const Te=_e[U];if(U!==G){const Ae=pe%Te;K+=Ae*Pe,Pe*=ke[U]}pe=Math.floor(pe/Te)}He[K]=R(He[K],ye[Me],Me,K)}return ne||ke.splice(G,1),[O.type,He,ke]}function B(R,O=null,G=1,ne=!1){const X=R.data,ye=R.dims;if(O===null){const Pe=X.reduce((Le,Ne)=>Le+Ne,0)/X.length,Te=Math.sqrt(X.reduce((Le,Ne)=>Le+(Ne-Pe)**2,0)/(X.length-G)),Ae=new a(R.type,[Pe],[]);return[new a(R.type,[Te],[]),Ae]}O=g(O,ye.length);const _e=N(R,O,ne),ke=_e.data,[He,Me,K]=k((pe,Pe,Te,Ae)=>pe+(Pe-ke[Ae])**2,R,O,ne);for(let pe=0;peMe+K,0);return new a(R.type,[He/X.length],[])}O=g(O,ne.length);const[ye,_e,ke]=k((He,Me)=>He+Me,R,O,G);if(ne[O]!==1)for(let He=0;He<_e.length;++He)_e[He]/=ne[O];return new a(ye,_e,ke)}function J(R){const O=new Array(R.length);for(let G=R.length-1,ne=1;G>=0;--G)O[G]=ne,ne*=R[G];return O}function q(R,O,G,ne){const X=R.reduce((ye,_e)=>ye*_e,1);return new a(G,new ne(X).fill(O),R)}function V(R,O){let G,ne;if(typeof O=="number")G="float32",ne=Float32Array;else if(typeof O=="bigint")G="int64",ne=BigInt64Array;else if(typeof O=="boolean")G="bool",ne=Uint8Array;else throw new Error(`Unsupported data type: ${typeof O}`);return q(R,O,G,ne)}function Y(R,O){return V(R.dims,O)}function H(R){return q(R,1n,"int64",BigInt64Array)}function Q(R){return H(R.dims)}function ie(R){return q(R,0n,"int64",BigInt64Array)}function le(R){return ie(R.dims)}function ae(R){const O=R.reduce((G,ne)=>G*ne,1);return new a("float32",Float32Array.from({length:O},()=>Math.random()),R)}function we(R,O){if(R.dims.length!==2)throw new Error("The tensor must have 2 dimensions");if(R.dims.at(-1)%8!==0)throw new Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes(O))throw new Error("The precision must be either 'binary' or 'ubinary'");const G=O==="binary",ne=G?"int8":"uint8",X=G?Int8Array:Uint8Array,ye=R.data,_e=new X(ye.length/8);for(let ke=0;ke0?1:0,Me=Math.floor(ke/8),K=ke%8;_e[Me]|=He<<7-K,G&&K===0&&(_e[Me]-=128)}return new a(ne,_e,[R.dims[0],R.dims[1]/8])}},"./src/utils/video.js":(e,r,t)=>{t.r(r),t.d(r,{RawVideo:()=>o,RawVideoFrame:()=>n,load_video:()=>a});var s=t("./src/utils/image.js"),i=t("./src/env.js");class n{constructor(d,p){this.image=d,this.timestamp=p}}class o{constructor(d,p){d.length>0&&d[0]instanceof s.RawImage&&(d=d.map((u,h)=>new n(u,(h+1)/(d.length+1)*p))),this.frames=d,this.duration=p}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 a(l,{num_frames:d=null,fps:p=null}={}){if(!i.apis.IS_BROWSER_ENV)throw new Error("`load_video` is currently only supported in browser environments.");if(d==null&&p==null)throw new Error("Either num_frames or fps must be provided.");const u=[],h=document.createElement("video");if(h.crossOrigin="anonymous",h.muted=!0,typeof l=="string")h.src=l;else if(l instanceof Blob)h.src=URL.createObjectURL(l);else if(l instanceof HTMLVideoElement)h.src=l.src;else throw new Error("Invalid URL or video element provided.");if(await new Promise($=>h.onloadedmetadata=$),h.seekable.start(0)===h.seekable.end(0)){const T=await(await fetch(h.src)).blob();h.src=URL.createObjectURL(T),await new Promise(g=>h.onloadedmetadata=g)}const w=h.duration;let f,P;d!=null?(f=d,P=d===1?0:w/(d-1)):(P=1/p,f=Math.floor(w/P));let A=[];for(let $=0;${h.onseeked=E}),y.drawImage(h,0,0,b.width,b.height);const T=y.getImageData(0,0,b.width,b.height),g=new s.RawImage(T.data,b.width,b.height,4),M=new n(g,$);u.push(M)}return h.remove(),new o(u,w)}}},Hw={};function Ft(e){var r=Hw[e];if(r!==void 0)return r.exports;var t=Hw[e]={exports:{}};return sx[e](t,t.exports,Ft),t.exports}(()=>{var e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,r;Ft.t=function(t,s){if(s&1&&(t=this(t)),s&8||typeof t=="object"&&t&&(s&4&&t.__esModule||s&16&&typeof t.then=="function"))return t;var i=Object.create(null);Ft.r(i);var n={};r=r||[null,e({}),e([]),e(e)];for(var o=s&2&&t;typeof o=="object"&&!~r.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(a=>n[a]=()=>t[a]);return n.default=()=>t,Ft.d(i,n),i}})(),Ft.d=(e,r)=>{for(var t in r)Ft.o(r,t)&&!Ft.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},Ft.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),Ft.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var _={};(()=>{/*!*****************************!*\ - !*** ./src/transformers.js ***! - \*****************************/Ft.r(_),Ft.d(_,{ASTFeatureExtractor:()=>u.ASTFeatureExtractor,ASTForAudioClassification:()=>t.ASTForAudioClassification,ASTModel:()=>t.ASTModel,ASTPreTrainedModel:()=>t.ASTPreTrainedModel,AlbertForMaskedLM:()=>t.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>t.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>t.AlbertForSequenceClassification,AlbertModel:()=>t.AlbertModel,AlbertPreTrainedModel:()=>t.AlbertPreTrainedModel,AlbertTokenizer:()=>s.AlbertTokenizer,AudioClassificationPipeline:()=>r.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>h.AutoFeatureExtractor,AutoImageProcessor:()=>P.AutoImageProcessor,AutoModel:()=>t.AutoModel,AutoModelForAudioClassification:()=>t.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>t.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>t.AutoModelForAudioTextToText,AutoModelForCTC:()=>t.AutoModelForCTC,AutoModelForCausalLM:()=>t.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>t.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>t.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>t.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>t.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>t.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>t.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>t.AutoModelForImageTextToText,AutoModelForImageToImage:()=>t.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>t.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>t.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>t.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>t.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>t.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>t.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>t.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>t.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>t.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>t.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>t.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>t.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>t.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>t.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>t.AutoModelForVision2Seq,AutoModelForXVector:()=>t.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>t.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>y.AutoProcessor,AutoTokenizer:()=>s.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>r.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>r.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>t.BartForConditionalGeneration,BartForSequenceClassification:()=>t.BartForSequenceClassification,BartModel:()=>t.BartModel,BartPretrainedModel:()=>t.BartPretrainedModel,BartTokenizer:()=>s.BartTokenizer,BaseModelOutput:()=>t.BaseModelOutput,BaseStreamer:()=>$.BaseStreamer,BeitFeatureExtractor:()=>f.BeitFeatureExtractor,BeitForImageClassification:()=>t.BeitForImageClassification,BeitModel:()=>t.BeitModel,BeitPreTrainedModel:()=>t.BeitPreTrainedModel,BertForMaskedLM:()=>t.BertForMaskedLM,BertForQuestionAnswering:()=>t.BertForQuestionAnswering,BertForSequenceClassification:()=>t.BertForSequenceClassification,BertForTokenClassification:()=>t.BertForTokenClassification,BertModel:()=>t.BertModel,BertPreTrainedModel:()=>t.BertPreTrainedModel,BertTokenizer:()=>s.BertTokenizer,BitImageProcessor:()=>f.BitImageProcessor,BlenderbotForConditionalGeneration:()=>t.BlenderbotForConditionalGeneration,BlenderbotModel:()=>t.BlenderbotModel,BlenderbotPreTrainedModel:()=>t.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>t.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>t.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>t.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>s.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>s.BlenderbotTokenizer,BloomForCausalLM:()=>t.BloomForCausalLM,BloomModel:()=>t.BloomModel,BloomPreTrainedModel:()=>t.BloomPreTrainedModel,BloomTokenizer:()=>s.BloomTokenizer,CLIPFeatureExtractor:()=>f.CLIPFeatureExtractor,CLIPImageProcessor:()=>f.CLIPImageProcessor,CLIPModel:()=>t.CLIPModel,CLIPPreTrainedModel:()=>t.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>t.CLIPSegForImageSegmentation,CLIPSegModel:()=>t.CLIPSegModel,CLIPSegPreTrainedModel:()=>t.CLIPSegPreTrainedModel,CLIPTextModel:()=>t.CLIPTextModel,CLIPTextModelWithProjection:()=>t.CLIPTextModelWithProjection,CLIPTokenizer:()=>s.CLIPTokenizer,CLIPVisionModel:()=>t.CLIPVisionModel,CLIPVisionModelWithProjection:()=>t.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>t.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>t.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>t.CamembertForSequenceClassification,CamembertForTokenClassification:()=>t.CamembertForTokenClassification,CamembertModel:()=>t.CamembertModel,CamembertPreTrainedModel:()=>t.CamembertPreTrainedModel,CamembertTokenizer:()=>s.CamembertTokenizer,CausalLMOutput:()=>t.CausalLMOutput,CausalLMOutputWithPast:()=>t.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>f.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>t.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>t.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>t.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>u.ClapFeatureExtractor,ClapModel:()=>t.ClapModel,ClapPreTrainedModel:()=>t.ClapPreTrainedModel,ClapTextModelWithProjection:()=>t.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>g.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>t.CodeGenForCausalLM,CodeGenModel:()=>t.CodeGenModel,CodeGenPreTrainedModel:()=>t.CodeGenPreTrainedModel,CodeGenTokenizer:()=>s.CodeGenTokenizer,CodeLlamaTokenizer:()=>s.CodeLlamaTokenizer,CohereForCausalLM:()=>t.CohereForCausalLM,CohereModel:()=>t.CohereModel,CoherePreTrainedModel:()=>t.CoherePreTrainedModel,CohereTokenizer:()=>s.CohereTokenizer,ConvBertForMaskedLM:()=>t.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>t.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>t.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>t.ConvBertForTokenClassification,ConvBertModel:()=>t.ConvBertModel,ConvBertPreTrainedModel:()=>t.ConvBertPreTrainedModel,ConvBertTokenizer:()=>s.ConvBertTokenizer,ConvNextFeatureExtractor:()=>f.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>t.ConvNextForImageClassification,ConvNextImageProcessor:()=>f.ConvNextImageProcessor,ConvNextModel:()=>t.ConvNextModel,ConvNextPreTrainedModel:()=>t.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>t.ConvNextV2ForImageClassification,ConvNextV2Model:()=>t.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>t.ConvNextV2PreTrainedModel,DPTFeatureExtractor:()=>f.DPTFeatureExtractor,DPTForDepthEstimation:()=>t.DPTForDepthEstimation,DPTImageProcessor:()=>f.DPTImageProcessor,DPTModel:()=>t.DPTModel,DPTPreTrainedModel:()=>t.DPTPreTrainedModel,DacDecoderModel:()=>t.DacDecoderModel,DacDecoderOutput:()=>t.DacDecoderOutput,DacEncoderModel:()=>t.DacEncoderModel,DacEncoderOutput:()=>t.DacEncoderOutput,DacFeatureExtractor:()=>u.DacFeatureExtractor,DacModel:()=>t.DacModel,DacPreTrainedModel:()=>t.DacPreTrainedModel,DataTypeMap:()=>l.DataTypeMap,DebertaForMaskedLM:()=>t.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>t.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>t.DebertaForSequenceClassification,DebertaForTokenClassification:()=>t.DebertaForTokenClassification,DebertaModel:()=>t.DebertaModel,DebertaPreTrainedModel:()=>t.DebertaPreTrainedModel,DebertaTokenizer:()=>s.DebertaTokenizer,DebertaV2ForMaskedLM:()=>t.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>t.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>t.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>t.DebertaV2ForTokenClassification,DebertaV2Model:()=>t.DebertaV2Model,DebertaV2PreTrainedModel:()=>t.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>s.DebertaV2Tokenizer,DecisionTransformerModel:()=>t.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>t.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>f.DeiTFeatureExtractor,DeiTForImageClassification:()=>t.DeiTForImageClassification,DeiTImageProcessor:()=>f.DeiTImageProcessor,DeiTModel:()=>t.DeiTModel,DeiTPreTrainedModel:()=>t.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>t.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>t.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>r.DepthEstimationPipeline,DepthProForDepthEstimation:()=>t.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>t.DepthProPreTrainedModel,DetrFeatureExtractor:()=>f.DetrFeatureExtractor,DetrForObjectDetection:()=>t.DetrForObjectDetection,DetrForSegmentation:()=>t.DetrForSegmentation,DetrImageProcessor:()=>f.DetrImageProcessor,DetrModel:()=>t.DetrModel,DetrObjectDetectionOutput:()=>t.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>t.DetrPreTrainedModel,DetrSegmentationOutput:()=>t.DetrSegmentationOutput,Dinov2ForImageClassification:()=>t.Dinov2ForImageClassification,Dinov2Model:()=>t.Dinov2Model,Dinov2PreTrainedModel:()=>t.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>t.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>t.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>t.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>t.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>t.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>t.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>t.DistilBertForTokenClassification,DistilBertModel:()=>t.DistilBertModel,DistilBertPreTrainedModel:()=>t.DistilBertPreTrainedModel,DistilBertTokenizer:()=>s.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>r.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>f.DonutFeatureExtractor,DonutImageProcessor:()=>f.DonutImageProcessor,DonutSwinModel:()=>t.DonutSwinModel,DonutSwinPreTrainedModel:()=>t.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>t.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>f.EfficientNetImageProcessor,EfficientNetModel:()=>t.EfficientNetModel,EfficientNetPreTrainedModel:()=>t.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>t.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>t.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>t.ElectraForSequenceClassification,ElectraForTokenClassification:()=>t.ElectraForTokenClassification,ElectraModel:()=>t.ElectraModel,ElectraPreTrainedModel:()=>t.ElectraPreTrainedModel,ElectraTokenizer:()=>s.ElectraTokenizer,EncodecFeatureExtractor:()=>u.EncodecFeatureExtractor,EosTokenCriteria:()=>T.EosTokenCriteria,EsmForMaskedLM:()=>t.EsmForMaskedLM,EsmForSequenceClassification:()=>t.EsmForSequenceClassification,EsmForTokenClassification:()=>t.EsmForTokenClassification,EsmModel:()=>t.EsmModel,EsmPreTrainedModel:()=>t.EsmPreTrainedModel,EsmTokenizer:()=>s.EsmTokenizer,ExaoneForCausalLM:()=>t.ExaoneForCausalLM,ExaoneModel:()=>t.ExaoneModel,ExaonePreTrainedModel:()=>t.ExaonePreTrainedModel,FFT:()=>d.FFT,FalconForCausalLM:()=>t.FalconForCausalLM,FalconModel:()=>t.FalconModel,FalconPreTrainedModel:()=>t.FalconPreTrainedModel,FalconTokenizer:()=>s.FalconTokenizer,FastViTForImageClassification:()=>t.FastViTForImageClassification,FastViTModel:()=>t.FastViTModel,FastViTPreTrainedModel:()=>t.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>r.FeatureExtractionPipeline,FeatureExtractor:()=>p.FeatureExtractor,FillMaskPipeline:()=>r.FillMaskPipeline,Florence2ForConditionalGeneration:()=>t.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>t.Florence2PreTrainedModel,Florence2Processor:()=>b.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>g.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>g.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>f.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>t.GLPNForDepthEstimation,GLPNModel:()=>t.GLPNModel,GLPNPreTrainedModel:()=>t.GLPNPreTrainedModel,GPT2LMHeadModel:()=>t.GPT2LMHeadModel,GPT2Model:()=>t.GPT2Model,GPT2PreTrainedModel:()=>t.GPT2PreTrainedModel,GPT2Tokenizer:()=>s.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>t.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>t.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>t.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>t.GPTJForCausalLM,GPTJModel:()=>t.GPTJModel,GPTJPreTrainedModel:()=>t.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>t.GPTNeoForCausalLM,GPTNeoModel:()=>t.GPTNeoModel,GPTNeoPreTrainedModel:()=>t.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>t.GPTNeoXForCausalLM,GPTNeoXModel:()=>t.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>t.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>s.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>t.Gemma2ForCausalLM,Gemma2Model:()=>t.Gemma2Model,Gemma2PreTrainedModel:()=>t.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>t.Gemma3ForCausalLM,Gemma3Model:()=>t.Gemma3Model,Gemma3PreTrainedModel:()=>t.Gemma3PreTrainedModel,GemmaForCausalLM:()=>t.GemmaForCausalLM,GemmaModel:()=>t.GemmaModel,GemmaPreTrainedModel:()=>t.GemmaPreTrainedModel,GemmaTokenizer:()=>s.GemmaTokenizer,GlmForCausalLM:()=>t.GlmForCausalLM,GlmModel:()=>t.GlmModel,GlmPreTrainedModel:()=>t.GlmPreTrainedModel,GraniteForCausalLM:()=>t.GraniteForCausalLM,GraniteModel:()=>t.GraniteModel,GranitePreTrainedModel:()=>t.GranitePreTrainedModel,Grok1Tokenizer:()=>s.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>t.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>f.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>t.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>b.GroundingDinoProcessor,GroupViTModel:()=>t.GroupViTModel,GroupViTPreTrainedModel:()=>t.GroupViTPreTrainedModel,HeliumForCausalLM:()=>t.HeliumForCausalLM,HeliumModel:()=>t.HeliumModel,HeliumPreTrainedModel:()=>t.HeliumPreTrainedModel,HerbertTokenizer:()=>s.HerbertTokenizer,HieraForImageClassification:()=>t.HieraForImageClassification,HieraModel:()=>t.HieraModel,HieraPreTrainedModel:()=>t.HieraPreTrainedModel,HubertForCTC:()=>t.HubertForCTC,HubertForSequenceClassification:()=>t.HubertForSequenceClassification,HubertModel:()=>t.HubertModel,HubertPreTrainedModel:()=>t.HubertPreTrainedModel,IJepaForImageClassification:()=>t.IJepaForImageClassification,IJepaModel:()=>t.IJepaModel,IJepaPreTrainedModel:()=>t.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>t.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>f.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>t.Idefics3PreTrainedModel,Idefics3Processor:()=>b.Idefics3Processor,ImageClassificationPipeline:()=>r.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>r.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>u.ImageFeatureExtractor,ImageMattingOutput:()=>t.ImageMattingOutput,ImageProcessor:()=>w.ImageProcessor,ImageSegmentationPipeline:()=>r.ImageSegmentationPipeline,ImageToImagePipeline:()=>r.ImageToImagePipeline,ImageToTextPipeline:()=>r.ImageToTextPipeline,InterruptableStoppingCriteria:()=>T.InterruptableStoppingCriteria,JAISLMHeadModel:()=>t.JAISLMHeadModel,JAISModel:()=>t.JAISModel,JAISPreTrainedModel:()=>t.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>f.JinaCLIPImageProcessor,JinaCLIPModel:()=>t.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>t.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>b.JinaCLIPProcessor,JinaCLIPTextModel:()=>t.JinaCLIPTextModel,JinaCLIPVisionModel:()=>t.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>t.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>t.LlamaForCausalLM,LlamaModel:()=>t.LlamaModel,LlamaPreTrainedModel:()=>t.LlamaPreTrainedModel,LlamaTokenizer:()=>s.LlamaTokenizer,LlavaForConditionalGeneration:()=>t.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>t.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>f.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>t.LlavaPreTrainedModel,LogitsProcessor:()=>g.LogitsProcessor,LogitsProcessorList:()=>g.LogitsProcessorList,LogitsWarper:()=>g.LogitsWarper,LongT5ForConditionalGeneration:()=>t.LongT5ForConditionalGeneration,LongT5Model:()=>t.LongT5Model,LongT5PreTrainedModel:()=>t.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>t.M2M100ForConditionalGeneration,M2M100Model:()=>t.M2M100Model,M2M100PreTrainedModel:()=>t.M2M100PreTrainedModel,M2M100Tokenizer:()=>s.M2M100Tokenizer,MBart50Tokenizer:()=>s.MBart50Tokenizer,MBartForCausalLM:()=>t.MBartForCausalLM,MBartForConditionalGeneration:()=>t.MBartForConditionalGeneration,MBartForSequenceClassification:()=>t.MBartForSequenceClassification,MBartModel:()=>t.MBartModel,MBartPreTrainedModel:()=>t.MBartPreTrainedModel,MBartTokenizer:()=>s.MBartTokenizer,MPNetForMaskedLM:()=>t.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>t.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>t.MPNetForSequenceClassification,MPNetForTokenClassification:()=>t.MPNetForTokenClassification,MPNetModel:()=>t.MPNetModel,MPNetPreTrainedModel:()=>t.MPNetPreTrainedModel,MPNetTokenizer:()=>s.MPNetTokenizer,MT5ForConditionalGeneration:()=>t.MT5ForConditionalGeneration,MT5Model:()=>t.MT5Model,MT5PreTrainedModel:()=>t.MT5PreTrainedModel,MarianMTModel:()=>t.MarianMTModel,MarianModel:()=>t.MarianModel,MarianPreTrainedModel:()=>t.MarianPreTrainedModel,MarianTokenizer:()=>s.MarianTokenizer,Mask2FormerImageProcessor:()=>f.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>f.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>t.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>f.MaskFormerImageProcessor,MaskFormerModel:()=>t.MaskFormerModel,MaskFormerPreTrainedModel:()=>t.MaskFormerPreTrainedModel,MaskedLMOutput:()=>t.MaskedLMOutput,MaxLengthCriteria:()=>T.MaxLengthCriteria,Metric3DForDepthEstimation:()=>t.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>t.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>t.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>t.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>t.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>t.MgpstrModelOutput,MgpstrPreTrainedModel:()=>t.MgpstrPreTrainedModel,MgpstrProcessor:()=>b.MgpstrProcessor,MgpstrTokenizer:()=>s.MgpstrTokenizer,MimiDecoderModel:()=>t.MimiDecoderModel,MimiDecoderOutput:()=>t.MimiDecoderOutput,MimiEncoderModel:()=>t.MimiEncoderModel,MimiEncoderOutput:()=>t.MimiEncoderOutput,MimiModel:()=>t.MimiModel,MimiPreTrainedModel:()=>t.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>g.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>g.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>t.MistralForCausalLM,MistralModel:()=>t.MistralModel,MistralPreTrainedModel:()=>t.MistralPreTrainedModel,MobileBertForMaskedLM:()=>t.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>t.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>t.MobileBertForSequenceClassification,MobileBertModel:()=>t.MobileBertModel,MobileBertPreTrainedModel:()=>t.MobileBertPreTrainedModel,MobileBertTokenizer:()=>s.MobileBertTokenizer,MobileLLMForCausalLM:()=>t.MobileLLMForCausalLM,MobileLLMModel:()=>t.MobileLLMModel,MobileLLMPreTrainedModel:()=>t.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>f.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>t.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>t.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>f.MobileNetV1ImageProcessor,MobileNetV1Model:()=>t.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>t.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>f.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>t.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>t.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>f.MobileNetV2ImageProcessor,MobileNetV2Model:()=>t.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>t.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>f.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>t.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>t.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>f.MobileNetV3ImageProcessor,MobileNetV3Model:()=>t.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>t.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>f.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>t.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>t.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>f.MobileNetV4ImageProcessor,MobileNetV4Model:()=>t.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>t.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>f.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>t.MobileViTForImageClassification,MobileViTImageProcessor:()=>f.MobileViTImageProcessor,MobileViTModel:()=>t.MobileViTModel,MobileViTPreTrainedModel:()=>t.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>t.MobileViTV2ForImageClassification,MobileViTV2Model:()=>t.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>t.MobileViTV2PreTrainedModel,ModelOutput:()=>t.ModelOutput,ModernBertForMaskedLM:()=>t.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>t.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>t.ModernBertForTokenClassification,ModernBertModel:()=>t.ModernBertModel,ModernBertPreTrainedModel:()=>t.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>t.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>u.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>t.MoonshineForConditionalGeneration,MoonshineModel:()=>t.MoonshineModel,MoonshinePreTrainedModel:()=>t.MoonshinePreTrainedModel,MoonshineProcessor:()=>b.MoonshineProcessor,MptForCausalLM:()=>t.MptForCausalLM,MptModel:()=>t.MptModel,MptPreTrainedModel:()=>t.MptPreTrainedModel,MultiModalityCausalLM:()=>t.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>t.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>t.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>t.MusicgenForConditionalGeneration,MusicgenModel:()=>t.MusicgenModel,MusicgenPreTrainedModel:()=>t.MusicgenPreTrainedModel,NllbTokenizer:()=>s.NllbTokenizer,NoBadWordsLogitsProcessor:()=>g.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>g.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>t.NomicBertModel,NomicBertPreTrainedModel:()=>t.NomicBertPreTrainedModel,NougatImageProcessor:()=>f.NougatImageProcessor,NougatTokenizer:()=>s.NougatTokenizer,OPTForCausalLM:()=>t.OPTForCausalLM,OPTModel:()=>t.OPTModel,OPTPreTrainedModel:()=>t.OPTPreTrainedModel,ObjectDetectionPipeline:()=>r.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>t.Olmo2ForCausalLM,Olmo2Model:()=>t.Olmo2Model,Olmo2PreTrainedModel:()=>t.Olmo2PreTrainedModel,OlmoForCausalLM:()=>t.OlmoForCausalLM,OlmoModel:()=>t.OlmoModel,OlmoPreTrainedModel:()=>t.OlmoPreTrainedModel,OpenELMForCausalLM:()=>t.OpenELMForCausalLM,OpenELMModel:()=>t.OpenELMModel,OpenELMPreTrainedModel:()=>t.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>f.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>t.OwlViTForObjectDetection,OwlViTImageProcessor:()=>f.OwlViTImageProcessor,OwlViTModel:()=>t.OwlViTModel,OwlViTPreTrainedModel:()=>t.OwlViTPreTrainedModel,OwlViTProcessor:()=>b.OwlViTProcessor,Owlv2ForObjectDetection:()=>t.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>f.Owlv2ImageProcessor,Owlv2Model:()=>t.Owlv2Model,Owlv2PreTrainedModel:()=>t.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>t.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>t.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>b.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>t.PatchTSMixerForPrediction,PatchTSMixerModel:()=>t.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>t.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>t.PatchTSTForPrediction,PatchTSTModel:()=>t.PatchTSTModel,PatchTSTPreTrainedModel:()=>t.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>t.Phi3ForCausalLM,Phi3Model:()=>t.Phi3Model,Phi3PreTrainedModel:()=>t.Phi3PreTrainedModel,Phi3VForCausalLM:()=>t.Phi3VForCausalLM,Phi3VImageProcessor:()=>f.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>t.Phi3VPreTrainedModel,Phi3VProcessor:()=>b.Phi3VProcessor,PhiForCausalLM:()=>t.PhiForCausalLM,PhiModel:()=>t.PhiModel,PhiPreTrainedModel:()=>t.PhiPreTrainedModel,Pipeline:()=>r.Pipeline,PreTrainedModel:()=>t.PreTrainedModel,PreTrainedTokenizer:()=>s.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>t.PretrainedMixin,Processor:()=>A.Processor,PvtForImageClassification:()=>t.PvtForImageClassification,PvtImageProcessor:()=>f.PvtImageProcessor,PvtModel:()=>t.PvtModel,PvtPreTrainedModel:()=>t.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>u.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>t.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>t.PyAnnoteModel,PyAnnotePreTrainedModel:()=>t.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>b.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>t.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>r.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>t.Qwen2ForCausalLM,Qwen2Model:()=>t.Qwen2Model,Qwen2PreTrainedModel:()=>t.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>s.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>t.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>f.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>t.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>b.Qwen2VLProcessor,RTDetrForObjectDetection:()=>t.RTDetrForObjectDetection,RTDetrImageProcessor:()=>f.RTDetrImageProcessor,RTDetrModel:()=>t.RTDetrModel,RTDetrObjectDetectionOutput:()=>t.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>t.RTDetrPreTrainedModel,RawAudio:()=>n.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>a.RawVideo,RawVideoFrame:()=>a.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>g.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>t.ResNetForImageClassification,ResNetModel:()=>t.ResNetModel,ResNetPreTrainedModel:()=>t.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>t.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>t.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>t.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>t.RoFormerForTokenClassification,RoFormerModel:()=>t.RoFormerModel,RoFormerPreTrainedModel:()=>t.RoFormerPreTrainedModel,RoFormerTokenizer:()=>s.RoFormerTokenizer,RobertaForMaskedLM:()=>t.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>t.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>t.RobertaForSequenceClassification,RobertaForTokenClassification:()=>t.RobertaForTokenClassification,RobertaModel:()=>t.RobertaModel,RobertaPreTrainedModel:()=>t.RobertaPreTrainedModel,RobertaTokenizer:()=>s.RobertaTokenizer,SamImageProcessor:()=>f.SamImageProcessor,SamImageSegmentationOutput:()=>t.SamImageSegmentationOutput,SamModel:()=>t.SamModel,SamPreTrainedModel:()=>t.SamPreTrainedModel,SamProcessor:()=>b.SamProcessor,SapiensForDepthEstimation:()=>t.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>t.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>t.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>t.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>u.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>f.SegformerFeatureExtractor,SegformerForImageClassification:()=>t.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>t.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>f.SegformerImageProcessor,SegformerModel:()=>t.SegformerModel,SegformerPreTrainedModel:()=>t.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>t.Seq2SeqLMOutput,SequenceClassifierOutput:()=>t.SequenceClassifierOutput,SiglipImageProcessor:()=>f.SiglipImageProcessor,SiglipModel:()=>t.SiglipModel,SiglipPreTrainedModel:()=>t.SiglipPreTrainedModel,SiglipTextModel:()=>t.SiglipTextModel,SiglipTokenizer:()=>s.SiglipTokenizer,SiglipVisionModel:()=>t.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>t.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>f.SmolVLMImageProcessor,SmolVLMProcessor:()=>b.SmolVLMProcessor,SnacDecoderModel:()=>t.SnacDecoderModel,SnacEncoderModel:()=>t.SnacEncoderModel,SnacFeatureExtractor:()=>u.SnacFeatureExtractor,SnacModel:()=>t.SnacModel,SnacPreTrainedModel:()=>t.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>u.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>t.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>t.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>t.SpeechT5HifiGan,SpeechT5Model:()=>t.SpeechT5Model,SpeechT5PreTrainedModel:()=>t.SpeechT5PreTrainedModel,SpeechT5Processor:()=>b.SpeechT5Processor,SpeechT5Tokenizer:()=>s.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>t.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>t.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>t.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>t.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>t.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>s.SqueezeBertTokenizer,StableLmForCausalLM:()=>t.StableLmForCausalLM,StableLmModel:()=>t.StableLmModel,StableLmPreTrainedModel:()=>t.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>t.Starcoder2ForCausalLM,Starcoder2Model:()=>t.Starcoder2Model,Starcoder2PreTrainedModel:()=>t.Starcoder2PreTrainedModel,StoppingCriteria:()=>T.StoppingCriteria,StoppingCriteriaList:()=>T.StoppingCriteriaList,StyleTextToSpeech2Model:()=>t.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>t.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>r.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>g.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>t.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>f.Swin2SRImageProcessor,Swin2SRModel:()=>t.Swin2SRModel,Swin2SRPreTrainedModel:()=>t.Swin2SRPreTrainedModel,SwinForImageClassification:()=>t.SwinForImageClassification,SwinForSemanticSegmentation:()=>t.SwinForSemanticSegmentation,SwinModel:()=>t.SwinModel,SwinPreTrainedModel:()=>t.SwinPreTrainedModel,T5ForConditionalGeneration:()=>t.T5ForConditionalGeneration,T5Model:()=>t.T5Model,T5PreTrainedModel:()=>t.T5PreTrainedModel,T5Tokenizer:()=>s.T5Tokenizer,TableTransformerForObjectDetection:()=>t.TableTransformerForObjectDetection,TableTransformerModel:()=>t.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>t.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>t.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>g.TemperatureLogitsWarper,Tensor:()=>l.Tensor,Text2TextGenerationPipeline:()=>r.Text2TextGenerationPipeline,TextClassificationPipeline:()=>r.TextClassificationPipeline,TextGenerationPipeline:()=>r.TextGenerationPipeline,TextStreamer:()=>$.TextStreamer,TextToAudioPipeline:()=>r.TextToAudioPipeline,TokenClassificationPipeline:()=>r.TokenClassificationPipeline,TokenClassifierOutput:()=>t.TokenClassifierOutput,TokenizerModel:()=>s.TokenizerModel,TopKLogitsWarper:()=>g.TopKLogitsWarper,TopPLogitsWarper:()=>g.TopPLogitsWarper,TrOCRForCausalLM:()=>t.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>t.TrOCRPreTrainedModel,TranslationPipeline:()=>r.TranslationPipeline,UltravoxModel:()=>t.UltravoxModel,UltravoxPreTrainedModel:()=>t.UltravoxPreTrainedModel,UltravoxProcessor:()=>b.UltravoxProcessor,UniSpeechForCTC:()=>t.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>t.UniSpeechForSequenceClassification,UniSpeechModel:()=>t.UniSpeechModel,UniSpeechPreTrainedModel:()=>t.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>t.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>t.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>t.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>t.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>t.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>b.VLChatProcessor,VLMImageProcessor:()=>f.VLMImageProcessor,ViTFeatureExtractor:()=>f.ViTFeatureExtractor,ViTForImageClassification:()=>t.ViTForImageClassification,ViTImageProcessor:()=>f.ViTImageProcessor,ViTMAEModel:()=>t.ViTMAEModel,ViTMAEPreTrainedModel:()=>t.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>t.ViTMSNForImageClassification,ViTMSNModel:()=>t.ViTMSNModel,ViTMSNPreTrainedModel:()=>t.ViTMSNPreTrainedModel,ViTModel:()=>t.ViTModel,ViTPreTrainedModel:()=>t.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>t.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>t.VitMatteForImageMatting,VitMatteImageProcessor:()=>f.VitMatteImageProcessor,VitMattePreTrainedModel:()=>t.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>t.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>f.VitPoseImageProcessor,VitPosePreTrainedModel:()=>t.VitPosePreTrainedModel,VitsModel:()=>t.VitsModel,VitsModelOutput:()=>t.VitsModelOutput,VitsPreTrainedModel:()=>t.VitsPreTrainedModel,VitsTokenizer:()=>s.VitsTokenizer,Wav2Vec2BertForCTC:()=>t.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>t.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>t.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>t.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>s.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>u.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>t.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>t.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>t.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>t.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>t.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>b.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>b.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>t.WavLMForAudioFrameClassification,WavLMForCTC:()=>t.WavLMForCTC,WavLMForSequenceClassification:()=>t.WavLMForSequenceClassification,WavLMForXVector:()=>t.WavLMForXVector,WavLMModel:()=>t.WavLMModel,WavLMPreTrainedModel:()=>t.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>u.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>t.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>t.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>u.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>t.WhisperForConditionalGeneration,WhisperModel:()=>t.WhisperModel,WhisperPreTrainedModel:()=>t.WhisperPreTrainedModel,WhisperProcessor:()=>b.WhisperProcessor,WhisperTextStreamer:()=>$.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>g.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>s.WhisperTokenizer,XLMForQuestionAnswering:()=>t.XLMForQuestionAnswering,XLMForSequenceClassification:()=>t.XLMForSequenceClassification,XLMForTokenClassification:()=>t.XLMForTokenClassification,XLMModel:()=>t.XLMModel,XLMPreTrainedModel:()=>t.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>t.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>t.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>t.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>t.XLMRobertaForTokenClassification,XLMRobertaModel:()=>t.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>t.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>s.XLMRobertaTokenizer,XLMTokenizer:()=>s.XLMTokenizer,XLMWithLMHeadModel:()=>t.XLMWithLMHeadModel,XVectorOutput:()=>t.XVectorOutput,YolosFeatureExtractor:()=>f.YolosFeatureExtractor,YolosForObjectDetection:()=>t.YolosForObjectDetection,YolosImageProcessor:()=>f.YolosImageProcessor,YolosModel:()=>t.YolosModel,YolosObjectDetectionOutput:()=>t.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>t.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>r.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>r.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>r.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>r.ZeroShotObjectDetectionPipeline,bankers_round:()=>d.bankers_round,cat:()=>l.cat,cos_sim:()=>d.cos_sim,dot:()=>d.dot,dynamic_time_warping:()=>d.dynamic_time_warping,env:()=>e.env,full:()=>l.full,full_like:()=>l.full_like,getKeyValueShapes:()=>i.getKeyValueShapes,hamming:()=>n.hamming,hanning:()=>n.hanning,interpolate:()=>l.interpolate,interpolate_4d:()=>l.interpolate_4d,interpolate_data:()=>d.interpolate_data,is_chinese_char:()=>s.is_chinese_char,layer_norm:()=>l.layer_norm,load_image:()=>o.load_image,load_video:()=>a.load_video,log_softmax:()=>d.log_softmax,magnitude:()=>d.magnitude,matmul:()=>l.matmul,max:()=>d.max,mean:()=>l.mean,mean_pooling:()=>l.mean_pooling,medianFilter:()=>d.medianFilter,mel_filter_bank:()=>n.mel_filter_bank,min:()=>d.min,ones:()=>l.ones,ones_like:()=>l.ones_like,permute:()=>l.permute,permute_data:()=>d.permute_data,pipeline:()=>r.pipeline,quantize_embeddings:()=>l.quantize_embeddings,rand:()=>l.rand,read_audio:()=>n.read_audio,rfft:()=>l.rfft,round:()=>d.round,slice:()=>l.slice,softmax:()=>d.softmax,spectrogram:()=>n.spectrogram,stack:()=>l.stack,std_mean:()=>l.std_mean,topk:()=>l.topk,window_function:()=>n.window_function,zeros:()=>l.zeros,zeros_like:()=>l.zeros_like});var e=Ft("./src/env.js"),r=Ft("./src/pipelines.js"),t=Ft("./src/models.js"),s=Ft("./src/tokenizers.js"),i=Ft("./src/configs.js"),n=Ft("./src/utils/audio.js"),o=Ft("./src/utils/image.js"),a=Ft("./src/utils/video.js"),l=Ft("./src/utils/tensor.js"),d=Ft("./src/utils/maths.js"),p=Ft("./src/base/feature_extraction_utils.js"),u=Ft("./src/models/feature_extractors.js"),h=Ft("./src/models/auto/feature_extraction_auto.js"),w=Ft("./src/base/image_processors_utils.js"),f=Ft("./src/models/image_processors.js"),P=Ft("./src/models/auto/image_processing_auto.js"),A=Ft("./src/base/processing_utils.js"),b=Ft("./src/models/processors.js"),y=Ft("./src/models/auto/processing_auto.js"),$=Ft("./src/generation/streamers.js"),T=Ft("./src/generation/stopping_criteria.js"),g=Ft("./src/generation/logits_process.js")})(),_.ASTFeatureExtractor,_.ASTForAudioClassification,_.ASTModel,_.ASTPreTrainedModel,_.AlbertForMaskedLM,_.AlbertForQuestionAnswering,_.AlbertForSequenceClassification,_.AlbertModel,_.AlbertPreTrainedModel,_.AlbertTokenizer,_.AudioClassificationPipeline,_.AutoConfig,_.AutoFeatureExtractor,_.AutoImageProcessor,_.AutoModel,_.AutoModelForAudioClassification,_.AutoModelForAudioFrameClassification,_.AutoModelForAudioTextToText,_.AutoModelForCTC,_.AutoModelForCausalLM,_.AutoModelForDepthEstimation,_.AutoModelForDocumentQuestionAnswering,_.AutoModelForImageClassification,_.AutoModelForImageFeatureExtraction,_.AutoModelForImageMatting,_.AutoModelForImageSegmentation,_.AutoModelForImageTextToText,_.AutoModelForImageToImage,_.AutoModelForMaskGeneration,_.AutoModelForMaskedLM,_.AutoModelForNormalEstimation,_.AutoModelForObjectDetection,_.AutoModelForPoseEstimation,_.AutoModelForQuestionAnswering,_.AutoModelForSemanticSegmentation,_.AutoModelForSeq2SeqLM,_.AutoModelForSequenceClassification,_.AutoModelForSpeechSeq2Seq,_.AutoModelForTextToSpectrogram,_.AutoModelForTextToWaveform,_.AutoModelForTokenClassification,_.AutoModelForUniversalSegmentation,_.AutoModelForVision2Seq,_.AutoModelForXVector,_.AutoModelForZeroShotObjectDetection;var nx=_.AutoProcessor,ix=_.AutoTokenizer;_.AutomaticSpeechRecognitionPipeline,_.BackgroundRemovalPipeline,_.BartForConditionalGeneration,_.BartForSequenceClassification,_.BartModel,_.BartPretrainedModel,_.BartTokenizer,_.BaseModelOutput,_.BaseStreamer,_.BeitFeatureExtractor,_.BeitForImageClassification,_.BeitModel,_.BeitPreTrainedModel,_.BertForMaskedLM,_.BertForQuestionAnswering,_.BertForSequenceClassification,_.BertForTokenClassification,_.BertModel,_.BertPreTrainedModel,_.BertTokenizer,_.BitImageProcessor,_.BlenderbotForConditionalGeneration,_.BlenderbotModel,_.BlenderbotPreTrainedModel,_.BlenderbotSmallForConditionalGeneration,_.BlenderbotSmallModel,_.BlenderbotSmallPreTrainedModel,_.BlenderbotSmallTokenizer,_.BlenderbotTokenizer,_.BloomForCausalLM,_.BloomModel,_.BloomPreTrainedModel,_.BloomTokenizer,_.CLIPFeatureExtractor,_.CLIPImageProcessor,_.CLIPModel,_.CLIPPreTrainedModel,_.CLIPSegForImageSegmentation,_.CLIPSegModel,_.CLIPSegPreTrainedModel,_.CLIPTextModel,_.CLIPTextModelWithProjection,_.CLIPTokenizer,_.CLIPVisionModel,_.CLIPVisionModelWithProjection,_.CamembertForMaskedLM,_.CamembertForQuestionAnswering,_.CamembertForSequenceClassification,_.CamembertForTokenClassification,_.CamembertModel,_.CamembertPreTrainedModel,_.CamembertTokenizer,_.CausalLMOutput,_.CausalLMOutputWithPast,_.ChineseCLIPFeatureExtractor,_.ChineseCLIPModel,_.ChineseCLIPPreTrainedModel,_.ClapAudioModelWithProjection,_.ClapFeatureExtractor,_.ClapModel,_.ClapPreTrainedModel,_.ClapTextModelWithProjection,_.ClassifierFreeGuidanceLogitsProcessor,_.CodeGenForCausalLM,_.CodeGenModel,_.CodeGenPreTrainedModel,_.CodeGenTokenizer,_.CodeLlamaTokenizer,_.CohereForCausalLM,_.CohereModel,_.CoherePreTrainedModel,_.CohereTokenizer,_.ConvBertForMaskedLM,_.ConvBertForQuestionAnswering,_.ConvBertForSequenceClassification,_.ConvBertForTokenClassification,_.ConvBertModel,_.ConvBertPreTrainedModel,_.ConvBertTokenizer,_.ConvNextFeatureExtractor,_.ConvNextForImageClassification,_.ConvNextImageProcessor,_.ConvNextModel,_.ConvNextPreTrainedModel,_.ConvNextV2ForImageClassification,_.ConvNextV2Model,_.ConvNextV2PreTrainedModel,_.DPTFeatureExtractor,_.DPTForDepthEstimation,_.DPTImageProcessor,_.DPTModel,_.DPTPreTrainedModel,_.DacDecoderModel,_.DacDecoderOutput,_.DacEncoderModel,_.DacEncoderOutput,_.DacFeatureExtractor,_.DacModel,_.DacPreTrainedModel,_.DataTypeMap,_.DebertaForMaskedLM,_.DebertaForQuestionAnswering,_.DebertaForSequenceClassification,_.DebertaForTokenClassification,_.DebertaModel,_.DebertaPreTrainedModel,_.DebertaTokenizer,_.DebertaV2ForMaskedLM,_.DebertaV2ForQuestionAnswering,_.DebertaV2ForSequenceClassification,_.DebertaV2ForTokenClassification,_.DebertaV2Model,_.DebertaV2PreTrainedModel,_.DebertaV2Tokenizer,_.DecisionTransformerModel,_.DecisionTransformerPreTrainedModel,_.DeiTFeatureExtractor,_.DeiTForImageClassification,_.DeiTImageProcessor,_.DeiTModel,_.DeiTPreTrainedModel,_.DepthAnythingForDepthEstimation,_.DepthAnythingPreTrainedModel,_.DepthEstimationPipeline,_.DepthProForDepthEstimation,_.DepthProPreTrainedModel,_.DetrFeatureExtractor,_.DetrForObjectDetection,_.DetrForSegmentation,_.DetrImageProcessor,_.DetrModel,_.DetrObjectDetectionOutput,_.DetrPreTrainedModel,_.DetrSegmentationOutput,_.Dinov2ForImageClassification,_.Dinov2Model,_.Dinov2PreTrainedModel,_.Dinov2WithRegistersForImageClassification,_.Dinov2WithRegistersModel,_.Dinov2WithRegistersPreTrainedModel,_.DistilBertForMaskedLM,_.DistilBertForQuestionAnswering,_.DistilBertForSequenceClassification,_.DistilBertForTokenClassification,_.DistilBertModel,_.DistilBertPreTrainedModel,_.DistilBertTokenizer,_.DocumentQuestionAnsweringPipeline,_.DonutFeatureExtractor,_.DonutImageProcessor,_.DonutSwinModel,_.DonutSwinPreTrainedModel,_.EfficientNetForImageClassification,_.EfficientNetImageProcessor,_.EfficientNetModel,_.EfficientNetPreTrainedModel,_.ElectraForMaskedLM,_.ElectraForQuestionAnswering,_.ElectraForSequenceClassification,_.ElectraForTokenClassification,_.ElectraModel,_.ElectraPreTrainedModel,_.ElectraTokenizer,_.EncodecFeatureExtractor,_.EosTokenCriteria,_.EsmForMaskedLM,_.EsmForSequenceClassification,_.EsmForTokenClassification,_.EsmModel,_.EsmPreTrainedModel,_.EsmTokenizer,_.ExaoneForCausalLM,_.ExaoneModel,_.ExaonePreTrainedModel,_.FFT,_.FalconForCausalLM,_.FalconModel,_.FalconPreTrainedModel,_.FalconTokenizer,_.FastViTForImageClassification,_.FastViTModel,_.FastViTPreTrainedModel,_.FeatureExtractionPipeline,_.FeatureExtractor,_.FillMaskPipeline,_.Florence2ForConditionalGeneration,_.Florence2PreTrainedModel,_.Florence2Processor,_.ForcedBOSTokenLogitsProcessor,_.ForcedEOSTokenLogitsProcessor,_.GLPNFeatureExtractor,_.GLPNForDepthEstimation,_.GLPNModel,_.GLPNPreTrainedModel,_.GPT2LMHeadModel,_.GPT2Model,_.GPT2PreTrainedModel,_.GPT2Tokenizer,_.GPTBigCodeForCausalLM,_.GPTBigCodeModel,_.GPTBigCodePreTrainedModel,_.GPTJForCausalLM,_.GPTJModel,_.GPTJPreTrainedModel,_.GPTNeoForCausalLM,_.GPTNeoModel,_.GPTNeoPreTrainedModel,_.GPTNeoXForCausalLM,_.GPTNeoXModel,_.GPTNeoXPreTrainedModel,_.GPTNeoXTokenizer,_.Gemma2ForCausalLM,_.Gemma2Model,_.Gemma2PreTrainedModel,_.Gemma3ForCausalLM,_.Gemma3Model,_.Gemma3PreTrainedModel,_.GemmaForCausalLM,_.GemmaModel,_.GemmaPreTrainedModel,_.GemmaTokenizer,_.GlmForCausalLM,_.GlmModel,_.GlmPreTrainedModel,_.GraniteForCausalLM,_.GraniteModel,_.GranitePreTrainedModel,_.Grok1Tokenizer,_.GroundingDinoForObjectDetection,_.GroundingDinoImageProcessor,_.GroundingDinoPreTrainedModel,_.GroundingDinoProcessor,_.GroupViTModel,_.GroupViTPreTrainedModel,_.HeliumForCausalLM,_.HeliumModel,_.HeliumPreTrainedModel,_.HerbertTokenizer,_.HieraForImageClassification,_.HieraModel,_.HieraPreTrainedModel,_.HubertForCTC,_.HubertForSequenceClassification,_.HubertModel,_.HubertPreTrainedModel,_.IJepaForImageClassification,_.IJepaModel,_.IJepaPreTrainedModel,_.Idefics3ForConditionalGeneration,_.Idefics3ImageProcessor,_.Idefics3PreTrainedModel,_.Idefics3Processor,_.ImageClassificationPipeline,_.ImageFeatureExtractionPipeline,_.ImageFeatureExtractor,_.ImageMattingOutput,_.ImageProcessor,_.ImageSegmentationPipeline,_.ImageToImagePipeline,_.ImageToTextPipeline,_.InterruptableStoppingCriteria,_.JAISLMHeadModel,_.JAISModel,_.JAISPreTrainedModel,_.JinaCLIPImageProcessor,_.JinaCLIPModel,_.JinaCLIPPreTrainedModel,_.JinaCLIPProcessor,_.JinaCLIPTextModel,_.JinaCLIPVisionModel,_.LiteWhisperForConditionalGeneration,_.LlamaForCausalLM,_.LlamaModel,_.LlamaPreTrainedModel,_.LlamaTokenizer,_.LlavaForConditionalGeneration,_.LlavaOnevisionForConditionalGeneration,_.LlavaOnevisionImageProcessor,_.LlavaPreTrainedModel,_.LogitsProcessor,_.LogitsProcessorList,_.LogitsWarper,_.LongT5ForConditionalGeneration,_.LongT5Model,_.LongT5PreTrainedModel,_.M2M100ForConditionalGeneration,_.M2M100Model,_.M2M100PreTrainedModel,_.M2M100Tokenizer,_.MBart50Tokenizer,_.MBartForCausalLM,_.MBartForConditionalGeneration,_.MBartForSequenceClassification,_.MBartModel,_.MBartPreTrainedModel,_.MBartTokenizer,_.MPNetForMaskedLM,_.MPNetForQuestionAnswering,_.MPNetForSequenceClassification,_.MPNetForTokenClassification,_.MPNetModel,_.MPNetPreTrainedModel,_.MPNetTokenizer,_.MT5ForConditionalGeneration,_.MT5Model,_.MT5PreTrainedModel,_.MarianMTModel,_.MarianModel,_.MarianPreTrainedModel,_.MarianTokenizer,_.Mask2FormerImageProcessor,_.MaskFormerFeatureExtractor,_.MaskFormerForInstanceSegmentation,_.MaskFormerImageProcessor,_.MaskFormerModel,_.MaskFormerPreTrainedModel,_.MaskedLMOutput,_.MaxLengthCriteria,_.Metric3DForDepthEstimation,_.Metric3DPreTrainedModel,_.Metric3Dv2ForDepthEstimation,_.Metric3Dv2PreTrainedModel,_.MgpstrForSceneTextRecognition,_.MgpstrModelOutput,_.MgpstrPreTrainedModel,_.MgpstrProcessor,_.MgpstrTokenizer,_.MimiDecoderModel,_.MimiDecoderOutput,_.MimiEncoderModel,_.MimiEncoderOutput,_.MimiModel,_.MimiPreTrainedModel,_.MinLengthLogitsProcessor,_.MinNewTokensLengthLogitsProcessor,_.MistralForCausalLM,_.MistralModel,_.MistralPreTrainedModel,_.MobileBertForMaskedLM,_.MobileBertForQuestionAnswering,_.MobileBertForSequenceClassification,_.MobileBertModel,_.MobileBertPreTrainedModel,_.MobileBertTokenizer,_.MobileLLMForCausalLM,_.MobileLLMModel,_.MobileLLMPreTrainedModel,_.MobileNetV1FeatureExtractor,_.MobileNetV1ForImageClassification,_.MobileNetV1ForSemanticSegmentation,_.MobileNetV1ImageProcessor,_.MobileNetV1Model,_.MobileNetV1PreTrainedModel,_.MobileNetV2FeatureExtractor,_.MobileNetV2ForImageClassification,_.MobileNetV2ForSemanticSegmentation,_.MobileNetV2ImageProcessor,_.MobileNetV2Model,_.MobileNetV2PreTrainedModel,_.MobileNetV3FeatureExtractor,_.MobileNetV3ForImageClassification,_.MobileNetV3ForSemanticSegmentation,_.MobileNetV3ImageProcessor,_.MobileNetV3Model,_.MobileNetV3PreTrainedModel,_.MobileNetV4FeatureExtractor,_.MobileNetV4ForImageClassification,_.MobileNetV4ForSemanticSegmentation,_.MobileNetV4ImageProcessor,_.MobileNetV4Model,_.MobileNetV4PreTrainedModel,_.MobileViTFeatureExtractor,_.MobileViTForImageClassification,_.MobileViTImageProcessor,_.MobileViTModel,_.MobileViTPreTrainedModel,_.MobileViTV2ForImageClassification,_.MobileViTV2Model,_.MobileViTV2PreTrainedModel,_.ModelOutput,_.ModernBertForMaskedLM,_.ModernBertForSequenceClassification,_.ModernBertForTokenClassification,_.ModernBertModel,_.ModernBertPreTrainedModel,_.Moondream1ForConditionalGeneration,_.MoonshineFeatureExtractor,_.MoonshineForConditionalGeneration,_.MoonshineModel,_.MoonshinePreTrainedModel,_.MoonshineProcessor,_.MptForCausalLM,_.MptModel,_.MptPreTrainedModel,_.MultiModalityCausalLM,_.MultiModalityPreTrainedModel,_.MusicgenForCausalLM,_.MusicgenForConditionalGeneration,_.MusicgenModel,_.MusicgenPreTrainedModel,_.NllbTokenizer,_.NoBadWordsLogitsProcessor,_.NoRepeatNGramLogitsProcessor,_.NomicBertModel,_.NomicBertPreTrainedModel,_.NougatImageProcessor,_.NougatTokenizer,_.OPTForCausalLM,_.OPTModel,_.OPTPreTrainedModel,_.ObjectDetectionPipeline,_.Olmo2ForCausalLM,_.Olmo2Model,_.Olmo2PreTrainedModel,_.OlmoForCausalLM,_.OlmoModel,_.OlmoPreTrainedModel,_.OpenELMForCausalLM,_.OpenELMModel,_.OpenELMPreTrainedModel,_.OwlViTFeatureExtractor,_.OwlViTForObjectDetection,_.OwlViTImageProcessor,_.OwlViTModel,_.OwlViTPreTrainedModel,_.OwlViTProcessor,_.Owlv2ForObjectDetection,_.Owlv2ImageProcessor,_.Owlv2Model,_.Owlv2PreTrainedModel,_.PaliGemmaForConditionalGeneration,_.PaliGemmaPreTrainedModel,_.PaliGemmaProcessor,_.PatchTSMixerForPrediction,_.PatchTSMixerModel,_.PatchTSMixerPreTrainedModel,_.PatchTSTForPrediction,_.PatchTSTModel,_.PatchTSTPreTrainedModel,_.Phi3ForCausalLM,_.Phi3Model,_.Phi3PreTrainedModel,_.Phi3VForCausalLM,_.Phi3VImageProcessor,_.Phi3VPreTrainedModel,_.Phi3VProcessor,_.PhiForCausalLM,_.PhiModel,_.PhiPreTrainedModel,_.Pipeline,_.PreTrainedModel,_.PreTrainedTokenizer,_.PretrainedConfig,_.PretrainedMixin,_.Processor,_.PvtForImageClassification,_.PvtImageProcessor,_.PvtModel,_.PvtPreTrainedModel,_.PyAnnoteFeatureExtractor,_.PyAnnoteForAudioFrameClassification,_.PyAnnoteModel,_.PyAnnotePreTrainedModel,_.PyAnnoteProcessor,_.QuestionAnsweringModelOutput,_.QuestionAnsweringPipeline,_.Qwen2ForCausalLM,_.Qwen2Model,_.Qwen2PreTrainedModel,_.Qwen2Tokenizer,_.Qwen2VLForConditionalGeneration,_.Qwen2VLImageProcessor,_.Qwen2VLPreTrainedModel,_.Qwen2VLProcessor,_.RTDetrForObjectDetection,_.RTDetrImageProcessor,_.RTDetrModel,_.RTDetrObjectDetectionOutput,_.RTDetrPreTrainedModel,_.RawAudio,_.RawImage,_.RawVideo,_.RawVideoFrame,_.RepetitionPenaltyLogitsProcessor,_.ResNetForImageClassification,_.ResNetModel,_.ResNetPreTrainedModel,_.RoFormerForMaskedLM,_.RoFormerForQuestionAnswering,_.RoFormerForSequenceClassification,_.RoFormerForTokenClassification,_.RoFormerModel,_.RoFormerPreTrainedModel,_.RoFormerTokenizer,_.RobertaForMaskedLM,_.RobertaForQuestionAnswering,_.RobertaForSequenceClassification,_.RobertaForTokenClassification,_.RobertaModel,_.RobertaPreTrainedModel,_.RobertaTokenizer,_.SamImageProcessor,_.SamImageSegmentationOutput,_.SamModel,_.SamPreTrainedModel,_.SamProcessor,_.SapiensForDepthEstimation,_.SapiensForNormalEstimation,_.SapiensForSemanticSegmentation,_.SapiensPreTrainedModel,_.SeamlessM4TFeatureExtractor,_.SegformerFeatureExtractor,_.SegformerForImageClassification,_.SegformerForSemanticSegmentation,_.SegformerImageProcessor,_.SegformerModel,_.SegformerPreTrainedModel,_.Seq2SeqLMOutput,_.SequenceClassifierOutput,_.SiglipImageProcessor,_.SiglipModel,_.SiglipPreTrainedModel,_.SiglipTextModel,_.SiglipTokenizer,_.SiglipVisionModel,_.SmolVLMForConditionalGeneration,_.SmolVLMImageProcessor,_.SmolVLMProcessor,_.SnacDecoderModel,_.SnacEncoderModel,_.SnacFeatureExtractor,_.SnacModel,_.SnacPreTrainedModel,_.SpeechT5FeatureExtractor,_.SpeechT5ForSpeechToText,_.SpeechT5ForTextToSpeech,_.SpeechT5HifiGan,_.SpeechT5Model,_.SpeechT5PreTrainedModel,_.SpeechT5Processor,_.SpeechT5Tokenizer,_.SqueezeBertForMaskedLM,_.SqueezeBertForQuestionAnswering,_.SqueezeBertForSequenceClassification,_.SqueezeBertModel,_.SqueezeBertPreTrainedModel,_.SqueezeBertTokenizer,_.StableLmForCausalLM,_.StableLmModel,_.StableLmPreTrainedModel,_.Starcoder2ForCausalLM,_.Starcoder2Model,_.Starcoder2PreTrainedModel,_.StoppingCriteria,_.StoppingCriteriaList,_.StyleTextToSpeech2Model,_.StyleTextToSpeech2PreTrainedModel,_.SummarizationPipeline,_.SuppressTokensAtBeginLogitsProcessor,_.Swin2SRForImageSuperResolution,_.Swin2SRImageProcessor,_.Swin2SRModel,_.Swin2SRPreTrainedModel,_.SwinForImageClassification,_.SwinForSemanticSegmentation,_.SwinModel,_.SwinPreTrainedModel,_.T5ForConditionalGeneration,_.T5Model,_.T5PreTrainedModel,_.T5Tokenizer,_.TableTransformerForObjectDetection,_.TableTransformerModel,_.TableTransformerObjectDetectionOutput,_.TableTransformerPreTrainedModel,_.TemperatureLogitsWarper,_.Tensor,_.Text2TextGenerationPipeline,_.TextClassificationPipeline,_.TextGenerationPipeline;var ox=_.TextStreamer;_.TextToAudioPipeline,_.TokenClassificationPipeline,_.TokenClassifierOutput,_.TokenizerModel,_.TopKLogitsWarper,_.TopPLogitsWarper,_.TrOCRForCausalLM,_.TrOCRPreTrainedModel,_.TranslationPipeline,_.UltravoxModel,_.UltravoxPreTrainedModel,_.UltravoxProcessor,_.UniSpeechForCTC,_.UniSpeechForSequenceClassification,_.UniSpeechModel,_.UniSpeechPreTrainedModel,_.UniSpeechSatForAudioFrameClassification,_.UniSpeechSatForCTC,_.UniSpeechSatForSequenceClassification,_.UniSpeechSatModel,_.UniSpeechSatPreTrainedModel,_.VLChatProcessor,_.VLMImageProcessor,_.ViTFeatureExtractor,_.ViTForImageClassification,_.ViTImageProcessor,_.ViTMAEModel,_.ViTMAEPreTrainedModel,_.ViTMSNForImageClassification,_.ViTMSNModel,_.ViTMSNPreTrainedModel,_.ViTModel,_.ViTPreTrainedModel,_.VisionEncoderDecoderModel,_.VitMatteForImageMatting,_.VitMatteImageProcessor,_.VitMattePreTrainedModel,_.VitPoseForPoseEstimation,_.VitPoseImageProcessor,_.VitPosePreTrainedModel,_.VitsModel,_.VitsModelOutput,_.VitsPreTrainedModel,_.VitsTokenizer,_.Wav2Vec2BertForCTC,_.Wav2Vec2BertForSequenceClassification,_.Wav2Vec2BertModel,_.Wav2Vec2BertPreTrainedModel,_.Wav2Vec2CTCTokenizer,_.Wav2Vec2FeatureExtractor,_.Wav2Vec2ForAudioFrameClassification,_.Wav2Vec2ForCTC,_.Wav2Vec2ForSequenceClassification,_.Wav2Vec2Model,_.Wav2Vec2PreTrainedModel,_.Wav2Vec2Processor,_.Wav2Vec2ProcessorWithLM,_.WavLMForAudioFrameClassification,_.WavLMForCTC,_.WavLMForSequenceClassification,_.WavLMForXVector,_.WavLMModel,_.WavLMPreTrainedModel,_.WeSpeakerFeatureExtractor,_.WeSpeakerResNetModel,_.WeSpeakerResNetPreTrainedModel,_.WhisperFeatureExtractor;var ax=_.WhisperForConditionalGeneration;_.WhisperModel,_.WhisperPreTrainedModel,_.WhisperProcessor,_.WhisperTextStreamer,_.WhisperTimeStampLogitsProcessor,_.WhisperTokenizer,_.XLMForQuestionAnswering,_.XLMForSequenceClassification,_.XLMForTokenClassification,_.XLMModel,_.XLMPreTrainedModel,_.XLMRobertaForMaskedLM,_.XLMRobertaForQuestionAnswering,_.XLMRobertaForSequenceClassification,_.XLMRobertaForTokenClassification,_.XLMRobertaModel,_.XLMRobertaPreTrainedModel,_.XLMRobertaTokenizer,_.XLMTokenizer,_.XLMWithLMHeadModel,_.XVectorOutput,_.YolosFeatureExtractor,_.YolosForObjectDetection,_.YolosImageProcessor,_.YolosModel,_.YolosObjectDetectionOutput,_.YolosPreTrainedModel,_.ZeroShotAudioClassificationPipeline,_.ZeroShotClassificationPipeline,_.ZeroShotImageClassificationPipeline,_.ZeroShotObjectDetectionPipeline,_.bankers_round,_.cat,_.cos_sim,_.dot,_.dynamic_time_warping,_.env;var lx=_.full;_.full_like,_.getKeyValueShapes,_.hamming,_.hanning,_.interpolate,_.interpolate_4d,_.interpolate_data,_.is_chinese_char,_.layer_norm,_.load_image,_.load_video,_.log_softmax,_.magnitude,_.matmul,_.max,_.mean,_.mean_pooling,_.medianFilter,_.mel_filter_bank,_.min,_.ones,_.ones_like,_.permute,_.permute_data,_.pipeline,_.quantize_embeddings,_.rand,_.read_audio,_.rfft,_.round,_.slice,_.softmax,_.spectrogram,_.stack,_.std_mean,_.topk,_.window_function,_.zeros,_.zeros_like;const dx=64;class Wn{static async getInstance(r){return this.model_id="onnx-community/whisper-large-v3-turbo",this.tokenizer??(this.tokenizer=ix.from_pretrained(this.model_id,{progress_callback:r})),this.processor??(this.processor=nx.from_pretrained(this.model_id,{progress_callback:r})),this.model??(this.model=ax.from_pretrained(this.model_id,{dtype:{encoder_model:"fp16",decoder_model_merged:"q4"},device:"webgpu",progress_callback:r})),Promise.all([this.tokenizer,this.processor,this.model])}}re(Wn,"model_id",null),re(Wn,"tokenizer"),re(Wn,"processor"),re(Wn,"model");async function cx(e){const r=atob(e),t=new Uint8Array(r.length);for(let n=0;n{o??(o=performance.now());let f;a++>0&&(f=a/(performance.now()-o)*1e3),globalThis.postMessage({status:"update",output:w,tps:f,numTokens:a})},d=new ox(s,{skip_prompt:!0,decode_kwargs:{skip_special_tokens:!0},callback_function:l}),p=await i(t),u=await n.generate({...p,max_new_tokens:dx,language:r,streamer:d}),h=s.batch_decode(u,{skip_special_tokens:!0});globalThis.postMessage({status:"complete",output:h}),Xc=!1}async function px(){globalThis.postMessage({status:"loading",data:"Loading model..."});const[e,r,t]=await Wn.getInstance(s=>{globalThis.postMessage(s)});globalThis.postMessage({status:"loading",data:"Compiling shaders and warming up model..."}),await t.generate({input_features:lx([1,128,3e3],0),max_new_tokens:1}),globalThis.postMessage({status:"ready"})}globalThis.addEventListener("message",async e=>{const{type:r,data:t}=e.data;switch(r){case"load":px();break;case"generate":ux(t);break}})})(); diff --git a/assets/worker-Pjvo6JHG.js b/assets/worker-Pjvo6JHG.js new file mode 100644 index 0000000000000000000000000000000000000000..98808d9efe8e025812caab5575a47bc39df92e97 --- /dev/null +++ b/assets/worker-Pjvo6JHG.js @@ -0,0 +1,2846 @@ +var NT=Object.defineProperty;var jT=(bs,Sr,Ln)=>Sr in bs?NT(bs,Sr,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):bs[Sr]=Ln;var re=(bs,Sr,Ln)=>jT(bs,typeof Sr!="symbol"?Sr+"":Sr,Ln);(function(){"use strict";const bs=new Map,Sr=[],Ln=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=bs.get(e);if(s===void 0)bs.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){const i=Sr.indexOf(e);i!==-1&&Sr.splice(i,1);for(let n=0;n{const r=bs.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{const t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},$b=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?Sr:t;let i;const n=[],o=new Set;for(const l of s){const c=await Sb(l);typeof c=="string"?n.push({name:l,err:c}):(i||(i=c),i===c&&o.add(l))}if(!i)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:c}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${c}`);const a=r.filter(l=>o.has(typeof l=="string"?l:l.name));return[i,new Proxy(e,{get:(l,c)=>c==="executionProviders"?a:Reflect.get(l,c)})]},kb="1.21.0";let Ou="warning";const es={wasm:{},webgl:{},webgpu:{},versions:{common:kb},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);Ou=e}},get logLevel(){return Ou}};Object.defineProperty(es,"logLevel",{enumerable:!0});const Ib=es,Ab=(e,r)=>{const t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];const s=t.getContext("2d");if(s!=null){let i,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(i=e.dims[2],n=e.dims[3]):(i=e.dims[3],n=e.dims[2]);const o=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,c;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?c=[0,0,0,0]:typeof a.bias=="number"?c=[a.bias,a.bias,a.bias,a.bias]:(c=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(c[3]=a.bias[3]));const p=n*i;let u=0,h=p,g=p*2,_=-1;o==="RGBA"?(u=0,h=p,g=p*2,_=p*3):o==="RGB"?(u=0,h=p,g=p*2):o==="RBG"&&(u=0,g=p,h=p*2);for(let P=0;P{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let i,n,o;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(i=e.dims[2],n=e.dims[1],o=e.dims[3]):(i=e.dims[3],n=e.dims[2],o=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let c,p;l===void 0||l.mean===void 0?c=[255,255,255,255]:typeof l.mean=="number"?c=[l.mean,l.mean,l.mean,l.mean]:(c=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(c[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));const u=n*i;if(r!==void 0&&(r.format!==void 0&&o===4&&r.format!=="RGBA"||o===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const h=4;let g=0,_=1,P=2,A=3,v=0,y=u,k=u*2,E=-1;a==="RGBA"?(v=0,y=u,k=u*2,E=u*3):a==="RGB"?(v=0,y=u,k=u*2):a==="RBG"&&(v=0,k=u,y=u*2),s=t.createImageData(i,n);for(let M=0;M{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:t,width:s}=r,i=r.norm??{mean:255,bias:0};let n,o;typeof i.mean=="number"?n=[i.mean,i.mean,i.mean,i.mean]:n=[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],typeof i.bias=="number"?o=[i.bias,i.bias,i.bias,i.bias]:o=[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",c=t*s,p=l==="RGBA"?new Float32Array(c*4):new Float32Array(c*3);let u=4,h=0,g=1,_=2,P=3,A=0,v=c,y=c*2,k=-1;a==="RGB"&&(u=3,h=0,g=1,_=2,P=-1),l==="RGBA"?k=c*3:l==="RBG"?(A=0,y=c,v=c*2):l==="BGR"&&(y=0,v=c,A=c*2);for(let M=0;M{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,i=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let o,a=r??{};const l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},c=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){const p=l();p.width=e.width,p.height=e.height;const u=c(p);if(u!=null){let h=e.height,g=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(h=r.resizedHeight,g=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=h,a.width=g}else a.tensorFormat="RGBA",a.height=h,a.width=g;u.drawImage(e,0,0),o=u.getImageData(0,0,g,h).data}else throw new Error("Can not access image data")}else if(s){let p,u;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,u=r.resizedWidth):(p=e.height,u=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=u,r!==void 0){const h=l();h.width=u,h.height=p;const g=c(h);if(g!=null)g.putImageData(e,0,0),o=g.getImageData(0,0,u,p).data;else throw new Error("Can not access image data")}else o=e.data}else if(i){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=l();p.width=e.width,p.height=e.height;const u=c(p);if(u!=null){const h=e.height,g=e.width;return u.drawImage(e,0,0,g,h),o=u.getImageData(0,0,g,h).data,a.height=h,a.width=g,ad(o,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,u)=>{const h=l(),g=c(h);if(!e||!g)return u();const _=new Image;_.crossOrigin="Anonymous",_.src=e,_.onload=()=>{h.width=_.width,h.height=_.height,g.drawImage(_,0,0,h.width,h.height);const P=g.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,p(ad(P.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(o!==void 0)return ad(o,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Db=(e,r)=>{const{width:t,height:s,download:i,dispose:n}=r,o=[1,s,t,4];return new Gr({location:"texture",type:"float32",texture:e,dims:o,download:i,dispose:n})},Lb=(e,r)=>{const{dataType:t,dims:s,download:i,dispose:n}=r;return new Gr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:i,dispose:n})},zb=(e,r)=>{const{dataType:t,dims:s,download:i,dispose:n}=r;return new Gr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:i,dispose:n})},Bb=(e,r,t)=>new Gr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),zn=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ma=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let Du=!1;const Rb=()=>{if(!Du){Du=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(zn.set("int64",BigInt64Array),ma.set(BigInt64Array,"int64")),r&&(zn.set("uint64",BigUint64Array),ma.set(BigUint64Array,"uint64")),s?(zn.set("float16",t),ma.set(t,"float16")):zn.set("float16",Uint16Array)}},Nb=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Gr(e.type,e.data,r);case"cpu-pinned":return new Gr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Gr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Gr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Gr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let Gr=class{constructor(r,t,s){Rb();let i,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,i=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=zn.get(i);if(!a)throw new TypeError(`unsupported type "${i}" to create tensor from pinned buffer`);if(!(r.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=r.data;break}case"texture":{if(i!=="float32")throw new TypeError(`unsupported type "${i}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(i!=="float32"&&i!=="float16"&&i!=="int32"&&i!=="int64"&&i!=="uint32"&&i!=="uint8"&&i!=="bool"&&i!=="uint4"&&i!=="int4")throw new TypeError(`unsupported type "${i}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(i!=="float32"&&i!=="float16"&&i!=="int32"&&i!=="int64"&&i!=="uint32"&&i!=="uint64"&&i!=="int8"&&i!=="uint8"&&i!=="bool"&&i!=="uint4"&&i!=="int4")throw new TypeError(`unsupported type "${i}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,l;if(typeof r=="string")if(i=r,l=s,r==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");a=t}else{const c=zn.get(r);if(c===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&c===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${c.name} as data.`);r==="uint64"||r==="int64"?a=c.from(t,BigInt):a=c.from(t)}else if(t instanceof c)a=t;else if(t instanceof Uint8ClampedArray)if(r==="uint8")a=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&t instanceof Uint16Array&&c!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${i} tensor's data must be type of ${c}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const c=typeof r[0];if(c==="string")i="string",a=r;else if(c==="boolean")i="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${c}.`)}else if(r instanceof Uint8ClampedArray)i="uint8",a=Uint8Array.from(r);else{const c=ma.get(r.constructor);if(c===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);i=c,a=r}if(l===void 0)l=[a.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");n=l,this.cpuData=a,this.dataLocation="cpu"}const o=Nb(n);if(this.cpuData&&o!==this.cpuData.length&&!((i==="uint4"||i==="int4")&&Math.ceil(o/2)===this.cpuData.length))throw new Error(`Tensor's size(${o}) does not match data length(${this.cpuData.length}).`);this.type=i,this.dims=n,this.size=o}static async fromImage(r,t){return Ob(r,t)}static fromTexture(r,t){return Db(r,t)}static fromGpuBuffer(r,t){return Lb(r,t)}static fromMLTensor(r,t){return zb(r,t)}static fromPinnedBuffer(r,t,s){return Bb(r,t,s)}toDataURL(r){return Ab(this,r)}toImageData(r){return Fb(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new 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 new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){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 new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,r&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new 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 new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return jb(this,r)}};const Bn=Gr,Lu=(e,r)=>{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||console.timeStamp(`${e}::ORT::${r}`)},zu=(e,r)=>{var i;const t=((i=new Error().stack)==null?void 0:i.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||zu("BEGIN",e)},dd=e=>{(typeof es.trace>"u"?!es.wasm.trace:!es.trace)||zu("END",e)};var Vb=Object.freeze({__proto__:null,InferenceSession:class Eb{constructor(r){this.handler=r}async run(r,t,s){ld();const i={};let n={};if(typeof r!="object"||r===null||r instanceof Bn||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let o=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof Bn)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");o=!1;for(const c of t){if(typeof c!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(c)===-1)throw new RangeError(`'fetches' contains invalid output name: ${c}.`);i[c]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let c=!1;const p=Object.getOwnPropertyNames(t);for(const u of this.outputNames)if(p.indexOf(u)!==-1){const h=t[u];(h===null||h instanceof Bn)&&(c=!0,o=!1,i[u]=h)}if(c){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const c of this.inputNames)if(typeof r[c]>"u")throw new Error(`input '${c}' is missing in 'feeds'.`);if(o)for(const c of this.outputNames)i[c]=null;const a=await this.handler.run(r,i,n),l={};for(const c in a)if(Object.hasOwnProperty.call(a,c)){const p=a[c];p instanceof Bn?l[c]=p:l[c]=new Bn(p.type,p.data,p.dims)}return dd(),l}async release(){return this.handler.dispose()}static async create(r,t,s,i){ld();let n,o={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)o=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)o=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const p=r;let u=0,h=r.byteLength;if(typeof t=="object"&&t!==null)o=t;else if(typeof t=="number"){if(u=t,!Number.isSafeInteger(u))throw new RangeError("'byteOffset' must be an integer.");if(u<0||u>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(h=r.byteLength-u,typeof s=="number"){if(h=s,!Number.isSafeInteger(h))throw new RangeError("'byteLength' must be an integer.");if(h<=0||u+h>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-u}].`);if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,u,h)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await $b(o),c=await a.createInferenceSessionHandler(n,l);return dd(),new Eb(c)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}},TRACE:Lu,TRACE_FUNC_BEGIN:ld,TRACE_FUNC_END:dd,Tensor:Bn,env:Ib,registerBackend:Ln});/*! + * ONNX Runtime Web v1.22.0-dev.20250306-ccf8fdd9ea + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + */var cd=Object.defineProperty,Ub=Object.getOwnPropertyDescriptor,Wb=Object.getOwnPropertyNames,Gb=Object.prototype.hasOwnProperty,Kb=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Ve=(e,r)=>()=>(e&&(r=e(e=0)),r),Si=(e,r)=>{for(var t in r)cd(e,t,{get:r[t],enumerable:!0})},Hb=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Wb(r))!Gb.call(e,i)&&i!==t&&cd(e,i,{get:()=>r[i],enumerable:!(s=Ub(r,i))||s.enumerable});return e},fa=e=>Hb(cd({},"__esModule",{value:!0}),e),$i,Ws,un,Bu,Ru,Nu=Ve(()=>{$i=new Map,Ws=[],un=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){let s=$i.get(e);if(s===void 0)$i.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){let i=Ws.indexOf(e);i!==-1&&Ws.splice(i,1);for(let n=0;n{let r=$i.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{let t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},Ru=async e=>{let r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?Ws:t,i,n=[],o=new Set;for(let l of s){let c=await Bu(l);typeof c=="string"?n.push({name:l,err:c}):(i||(i=c),i===c&&o.add(l))}if(!i)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(let{name:l,err:c}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${c}`);let a=r.filter(l=>o.has(typeof l=="string"?l:l.name));return[i,new Proxy(e,{get:(l,c)=>c==="executionProviders"?a:Reflect.get(l,c)})]}}),qb=Ve(()=>{Nu()}),ju,Qb=Ve(()=>{ju="1.22.0-dev.20250306-aafa8d170a"}),ud,Kr,Vu=Ve(()=>{Qb(),ud="warning",Kr={wasm:{},webgl:{},webgpu:{},versions:{common:ju},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);ud=e}},get logLevel(){return ud}},Object.defineProperty(Kr,"logLevel",{enumerable:!0})}),Ut,Xb=Ve(()=>{Vu(),Ut=Kr}),Uu,Wu,Jb=Ve(()=>{Uu=(e,r)=>{let t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];let s=t.getContext("2d");if(s!=null){let i,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(i=e.dims[2],n=e.dims[3]):(i=e.dims[3],n=e.dims[2]);let o=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm,l,c;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?c=[0,0,0,0]:typeof a.bias=="number"?c=[a.bias,a.bias,a.bias,a.bias]:(c=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(c[3]=a.bias[3]));let p=n*i,u=0,h=p,g=p*2,_=-1;o==="RGBA"?(u=0,h=p,g=p*2,_=p*3):o==="RGB"?(u=0,h=p,g=p*2):o==="RBG"&&(u=0,g=p,h=p*2);for(let P=0;P{let t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),s;if(t!=null){let i,n,o;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(i=e.dims[2],n=e.dims[1],o=e.dims[3]):(i=e.dims[3],n=e.dims[2],o=e.dims[1]);let a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm,c,p;l===void 0||l.mean===void 0?c=[255,255,255,255]:typeof l.mean=="number"?c=[l.mean,l.mean,l.mean,l.mean]:(c=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(c[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));let u=n*i;if(r!==void 0&&(r.format!==void 0&&o===4&&r.format!=="RGBA"||o===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let h=4,g=0,_=1,P=2,A=3,v=0,y=u,k=u*2,E=-1;a==="RGBA"?(v=0,y=u,k=u*2,E=u*3):a==="RGB"?(v=0,y=u,k=u*2):a==="RBG"&&(v=0,k=u,y=u*2),s=t.createImageData(i,n);for(let M=0;M{hd(),_a=(e,r)=>{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:t,width:s}=r,i=r.norm??{mean:255,bias:0},n,o;typeof i.mean=="number"?n=[i.mean,i.mean,i.mean,i.mean]:n=[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],typeof i.bias=="number"?o=[i.bias,i.bias,i.bias,i.bias]:o=[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",c=t*s,p=l==="RGBA"?new Float32Array(c*4):new Float32Array(c*3),u=4,h=0,g=1,_=2,P=3,A=0,v=c,y=c*2,k=-1;a==="RGB"&&(u=3,h=0,g=1,_=2,P=-1),l==="RGBA"?k=c*3:l==="RBG"?(A=0,y=c,v=c*2):l==="BGR"&&(y=0,v=c,A=c*2);for(let E=0;E{let t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,i=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string",o,a=r??{},l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},c=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){let p=l();p.width=e.width,p.height=e.height;let u=c(p);if(u!=null){let h=e.height,g=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(h=r.resizedHeight,g=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=h,a.width=g}else a.tensorFormat="RGBA",a.height=h,a.width=g;u.drawImage(e,0,0),o=u.getImageData(0,0,g,h).data}else throw new Error("Can not access image data")}else if(s){let p,u;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,u=r.resizedWidth):(p=e.height,u=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=u,r!==void 0){let h=l();h.width=u,h.height=p;let g=c(h);if(g!=null)g.putImageData(e,0,0),o=g.getImageData(0,0,u,p).data;else throw new Error("Can not access image data")}else o=e.data}else if(i){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");let p=l();p.width=e.width,p.height=e.height;let u=c(p);if(u!=null){let h=e.height,g=e.width;return u.drawImage(e,0,0,g,h),o=u.getImageData(0,0,g,h).data,a.height=h,a.width=g,_a(o,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,u)=>{let h=l(),g=c(h);if(!e||!g)return u();let _=new Image;_.crossOrigin="Anonymous",_.src=e,_.onload=()=>{h.width=_.width,h.height=_.height,g.drawImage(_,0,0,h.width,h.height);let P=g.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,p(_a(P.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(o!==void 0)return _a(o,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Ku=(e,r)=>{let{width:t,height:s,download:i,dispose:n}=r,o=[1,s,t,4];return new Br({location:"texture",type:"float32",texture:e,dims:o,download:i,dispose:n})},Hu=(e,r)=>{let{dataType:t,dims:s,download:i,dispose:n}=r;return new Br({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:i,dispose:n})},qu=(e,r)=>{let{dataType:t,dims:s,download:i,dispose:n}=r;return new Br({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:i,dispose:n})},Qu=(e,r,t)=>new Br({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]})}),pn,ki,pd,Xu,Zb=Ve(()=>{pn=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ki=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),pd=!1,Xu=()=>{if(!pd){pd=!0;let e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(pn.set("int64",BigInt64Array),ki.set(BigInt64Array,"int64")),r&&(pn.set("uint64",BigUint64Array),ki.set(BigUint64Array,"uint64")),s?(pn.set("float16",t),ki.set(t,"float16")):pn.set("float16",Uint16Array)}}}),Ju,Yu,ev=Ve(()=>{hd(),Ju=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Br(e.type,e.data,r);case"cpu-pinned":return new Br({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Br({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Br({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Br({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}}}),Br,hd=Ve(()=>{Jb(),Yb(),Zb(),ev(),Br=class{constructor(e,r,t){Xu();let s,i;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,s=e.type,i=e.dims,e.location){case"cpu-pinned":{let o=pn.get(s);if(!o)throw new TypeError(`unsupported type "${s}" to create tensor from pinned buffer`);if(!(e.data instanceof o))throw new TypeError(`buffer should be of type ${o.name}`);this.cpuData=e.data;break}case"texture":{if(s!=="float32")throw new TypeError(`unsupported type "${s}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint64"&&s!=="int8"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let o,a;if(typeof e=="string")if(s=e,a=t,e==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");o=r}else{let l=pn.get(e);if(l===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(r)){if(e==="float16"&&l===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${l.name} as data.`);e==="uint64"||e==="int64"?o=l.from(r,BigInt):o=l.from(r)}else if(r instanceof l)o=r;else if(r instanceof Uint8ClampedArray)if(e==="uint8")o=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&r instanceof Uint16Array&&l!==Uint16Array)o=new globalThis.Float16Array(r.buffer,r.byteOffset,r.length);else throw new TypeError(`A ${s} tensor's data must be type of ${l}`)}else if(a=r,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let l=typeof e[0];if(l==="string")s="string",o=e;else if(l==="boolean")s="bool",o=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${l}.`)}else if(e instanceof Uint8ClampedArray)s="uint8",o=Uint8Array.from(e);else{let l=ki.get(e.constructor);if(l===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);s=l,o=e}if(a===void 0)a=[o.length];else if(!Array.isArray(a))throw new TypeError("A tensor's dims must be a number array");i=a,this.cpuData=o,this.dataLocation="cpu"}let n=Ju(i);if(this.cpuData&&n!==this.cpuData.length&&!((s==="uint4"||s==="int4")&&Math.ceil(n/2)===this.cpuData.length))throw new Error(`Tensor's size(${n}) does not match data length(${this.cpuData.length}).`);this.type=s,this.dims=i,this.size=n}static async fromImage(e,r){return Gu(e,r)}static fromTexture(e,r){return Ku(e,r)}static fromGpuBuffer(e,r){return Hu(e,r)}static fromMLTensor(e,r){return qu(e,r)}static fromPinnedBuffer(e,r,t){return Qu(e,r,t)}toDataURL(e){return Uu(this,e)}toImageData(e){return Wu(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new 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 new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new 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 new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,e&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new 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 new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Yu(this,e)}}}),ts,Zu=Ve(()=>{hd(),ts=Br}),Ii,md,rs,Hr,ep=Ve(()=>{Vu(),Ii=(e,r)=>{(typeof Kr.trace>"u"?!Kr.wasm.trace:!Kr.trace)||console.timeStamp(`${e}::ORT::${r}`)},md=(e,r)=>{var i;let t=((i=new Error().stack)==null?void 0:i.split(/\r\n|\r|\n/g))||[],s=!1;for(let n=0;n{(typeof Kr.trace>"u"?!Kr.wasm.trace:!Kr.trace)||md("BEGIN",e)},Hr=e=>{(typeof Kr.trace>"u"?!Kr.wasm.trace:!Kr.trace)||md("END",e)}}),tp,tv=Ve(()=>{Nu(),Zu(),ep(),tp=class Pb{constructor(r){this.handler=r}async run(r,t,s){rs();let i={},n={};if(typeof r!="object"||r===null||r instanceof ts||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let o=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof ts)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");o=!1;for(let c of t){if(typeof c!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(c)===-1)throw new RangeError(`'fetches' contains invalid output name: ${c}.`);i[c]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let c=!1,p=Object.getOwnPropertyNames(t);for(let u of this.outputNames)if(p.indexOf(u)!==-1){let h=t[u];(h===null||h instanceof ts)&&(c=!0,o=!1,i[u]=h)}if(c){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let c of this.inputNames)if(typeof r[c]>"u")throw new Error(`input '${c}' is missing in 'feeds'.`);if(o)for(let c of this.outputNames)i[c]=null;let a=await this.handler.run(r,i,n),l={};for(let c in a)if(Object.hasOwnProperty.call(a,c)){let p=a[c];p instanceof ts?l[c]=p:l[c]=new ts(p.type,p.data,p.dims)}return Hr(),l}async release(){return this.handler.dispose()}static async create(r,t,s,i){rs();let n,o={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)o=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)o=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){let p=r,u=0,h=r.byteLength;if(typeof t=="object"&&t!==null)o=t;else if(typeof t=="number"){if(u=t,!Number.isSafeInteger(u))throw new RangeError("'byteOffset' must be an integer.");if(u<0||u>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(h=r.byteLength-u,typeof s=="number"){if(h=s,!Number.isSafeInteger(h))throw new RangeError("'byteLength' must be an integer.");if(h<=0||u+h>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-u}].`);if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,u,h)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[a,l]=await Ru(o),c=await a.createInferenceSessionHandler(n,l);return Hr(),new Pb(c)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}}),fd,rv=Ve(()=>{tv(),fd=tp}),sv=Ve(()=>{}),nv=Ve(()=>{}),iv=Ve(()=>{}),ov=Ve(()=>{}),rp={};Si(rp,{InferenceSession:()=>fd,TRACE:()=>Ii,TRACE_FUNC_BEGIN:()=>rs,TRACE_FUNC_END:()=>Hr,Tensor:()=>ts,env:()=>Ut,registerBackend:()=>un});var ss=Ve(()=>{qb(),Xb(),rv(),Zu(),sv(),nv(),ep(),iv(),ov()}),_d=Ve(()=>{}),sp={};Si(sp,{default:()=>np});var gd,wd,np,av=Ve(()=>{var e;Dw(),hn(),Pd(),gd="ort-wasm-proxy-worker",wd=((e=globalThis.self)==null?void 0:e.name)===gd,wd&&(self.onmessage=r=>{let{type:t,in:s}=r.data;try{switch(t){case"init-wasm":$d(s.wasm).then(()=>{Bc(s).then(()=>{postMessage({type:t})},i=>{postMessage({type:t,err:i})})},i=>{postMessage({type:t,err:i})});break;case"init-ep":{let{epName:i,env:n}=s;Rc(n,i).then(()=>{postMessage({type:t})},o=>{postMessage({type:t,err:o})});break}case"copy-from":{let{buffer:i}=s,n=Oa(i);postMessage({type:t,out:n});break}case"create":{let{model:i,options:n}=s;Nc(i,n).then(o=>{postMessage({type:t,out:o})},o=>{postMessage({type:t,err:o})});break}case"release":jc(s),postMessage({type:t});break;case"run":{let{sessionId:i,inputIndices:n,inputs:o,outputIndices:a,options:l}=s;Uc(i,n,o,a,new Array(a.length).fill(null),l).then(c=>{c.some(p=>p[3]!=="cpu")?postMessage({type:t,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:t,out:c},Gc([...o,...c]))},c=>{postMessage({type:t,err:c})});break}case"end-profiling":Wc(s),postMessage({type:t});break;default:}}catch(i){postMessage({type:t,err:i})}}),np=wd?null:r=>new Worker(r??Rr,{type:"module",name:gd})}),ip={};Si(ip,{default:()=>op});var yd,Md,op,ap,lv=Ve(()=>{var e,r;Md=(yd=self.location.href,async function(t={}){var ua;var s,i,n=t,o=new Promise((d,m)=>{s=d,i=m}),a=typeof window=="object",l=typeof WorkerGlobalScope<"u",c=l&&((ua=self.name)==null?void 0:ua.startsWith("em-pthread"));n.mountExternalData=(d,m)=>{d.startsWith("./")&&(d=d.substring(2)),(n.Bd||(n.Bd=new Map)).set(d,m)},n.unmountExternalData=()=>{delete n.Bd};var p=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor;let u=()=>{let d=(T,C,I)=>(...W)=>{let ne=Rt,ye=C==null?void 0:C();W=T(...W);let Ee=C==null?void 0:C();return ye!==Ee&&(T=Ee,I(ye),C=I=null),Rt!=ne?new Promise((ze,Ye)=>{sn={resolve:ze,reject:Ye}}):W},m=T=>async(...C)=>{var I;try{if(n.Cd)throw Error("Session already started");let W=n.Cd={be:C[0],errors:[]},ne=await T(...C);if(n.Cd!==W)throw Error("Session mismatch");(I=n.Dd)==null||I.flush();let ye=W.errors;if(0ze),0n._OrtCreateSession,T=>n._OrtCreateSession=T),n._OrtRun=m(d(n._OrtRun,()=>n._OrtRun,T=>n._OrtRun=T)),n._OrtRunWithBinding=m(d(n._OrtRunWithBinding,()=>n._OrtRunWithBinding,T=>n._OrtRunWithBinding=T)),n._OrtBindInput=d(n._OrtBindInput,()=>n._OrtBindInput,T=>n._OrtBindInput=T),u=void 0};n.jsepInit=(d,m)=>{if(u==null||u(),d==="webgpu"){[n.Dd,n.Rd,n.Vd,n.Hd,n.Ud,n.hc,n.Wd,n.Zd,n.Sd,n.Td,n.Xd]=m;let T=n.Dd;n.jsepRegisterBuffer=(C,I,W,ne)=>T.registerBuffer(C,I,W,ne),n.jsepGetBuffer=C=>T.getBuffer(C),n.jsepCreateDownloader=(C,I,W)=>T.createDownloader(C,I,W),n.jsepOnCreateSession=C=>{T.onCreateSession(C)},n.jsepOnReleaseSession=C=>{T.onReleaseSession(C)},n.jsepOnRunStart=C=>T.onRunStart(C),n.$d=(C,I)=>{T.upload(C,I)}}else if(d==="webnn"){[n.Dd,n.Yd,n.Id,n.jsepEnsureTensor,n.Jd,n.jsepDownloadTensor]=m,n.jsepReleaseTensorId=n.Id,n.jsepUploadTensor=n.Jd;let T=n.Dd;n.jsepOnRunStart=C=>T.onRunStart(C),n.jsepOnRunEnd=T.onRunEnd.bind(T),n.jsepRegisterMLContext=(C,I)=>{T.registerMLContext(C,I)},n.jsepOnReleaseSession=C=>{T.onReleaseSession(C)},n.jsepCreateMLTensorDownloader=(C,I)=>T.createMLTensorDownloader(C,I),n.jsepRegisterMLTensor=(C,I,W,ne)=>T.registerMLTensor(C,I,W,ne),n.jsepCreateMLContext=C=>T.createMLContext(C),n.jsepRegisterMLConstant=(C,I,W,ne,ye)=>T.registerMLConstant(C,I,W,ne,ye,n.Bd),n.jsepRegisterGraphInput=T.registerGraphInput.bind(T),n.jsepIsGraphInput=T.isGraphInput.bind(T),n.jsepCreateTemporaryTensor=T.createTemporaryTensor.bind(T)}};var h,g,_=Object.assign({},n),P=(d,m)=>{throw m},A="";(a||l)&&(l?A=self.location.href:typeof document<"u"&&document.currentScript&&(A=document.currentScript.src),yd&&(A=yd),A=A.startsWith("blob:")?"":A.slice(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1),l&&(g=d=>{var m=new XMLHttpRequest;return m.open("GET",d,!1),m.responseType="arraybuffer",m.send(null),new Uint8Array(m.response)}),h=async d=>{if(he(d))return new Promise((T,C)=>{var I=new XMLHttpRequest;I.open("GET",d,!0),I.responseType="arraybuffer",I.onload=()=>{I.status==200||I.status==0&&I.response?T(I.response):C(I.status)},I.onerror=C,I.send(null)});var m=await fetch(d,{credentials:"same-origin"});if(m.ok)return m.arrayBuffer();throw Error(m.status+" : "+m.url)});var v=console.log.bind(console),y=console.error.bind(console),k=v,E=y;Object.assign(n,_),_=null;var M,w,x,$,z,R,Q,q,U,Z,H,J,ie,ae=n.wasmBinary,ce=!1,he=d=>d.startsWith("file://");function N(){return M.buffer!=$.buffer&&K(),$}function O(){return M.buffer!=$.buffer&&K(),z}function G(){return M.buffer!=$.buffer&&K(),R}function se(){return M.buffer!=$.buffer&&K(),Q}function X(){return M.buffer!=$.buffer&&K(),q}function we(){return M.buffer!=$.buffer&&K(),U}function _e(){return M.buffer!=$.buffer&&K(),Z}function ke(){return M.buffer!=$.buffer&&K(),ie}if(c){let d=function(m){try{var T=m.data,C=T.yd;if(C==="load"){let I=[];self.onmessage=W=>I.push(W),self.startWorker=()=>{postMessage({yd:"loaded"});for(let W of I)d(W);self.onmessage=d};for(let W of T.Od)n[W]&&!n[W].proxy||(n[W]=(...ne)=>{postMessage({yd:"callHandler",Nd:W,args:ne})},W=="print"&&(k=n[W]),W=="printErr"&&(E=n[W]));M=T.he,K(),He(T.ie)}else if(C==="run"){Os(T.xd),ri(T.xd,0,0,1,0,0),jt(),Ot(T.xd),Me||(ti(),Me=!0);try{Dr(T.de,T.Fd)}catch(I){if(I!="unwind")throw I}}else T.target!=="setimmediate"&&(C==="checkMailbox"?Me&&Vt():C&&(E(`worker: received unknown command ${C}`),E(T)))}catch(I){throw po(),I}};var He,Me=!1;E=function(...m){m=m.join(" "),console.error(m)},self.alert=function(...m){postMessage({yd:"alert",text:m.join(" "),fe:In()})},self.onunhandledrejection=m=>{throw m.reason||m},self.onmessage=d}function K(){var d=M.buffer;n.HEAP8=$=new Int8Array(d),n.HEAP16=R=new Int16Array(d),n.HEAPU8=z=new Uint8Array(d),n.HEAPU16=Q=new Uint16Array(d),n.HEAP32=q=new Int32Array(d),n.HEAPU32=U=new Uint32Array(d),n.HEAPF32=Z=new Float32Array(d),n.HEAPF64=ie=new Float64Array(d),n.HEAP64=H=new BigInt64Array(d),n.HEAPU64=J=new BigUint64Array(d)}function j(){c?startWorker(n):Oe.Bb()}c||(M=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),K());var me,Pe=0,xe=null;function Ae(){if(--Pe==0&&xe){var d=xe;xe=null,d()}}function Ie(d){throw E(d="Aborted("+d+")"),ce=!0,d=new WebAssembly.RuntimeError(d+". Build with -sASSERTIONS for more info."),i(d),d}function Le(){return{a:{Ta:D,Va:We,W:Ds,la:dt,b:Ts,u:xs,R:Es,Za:Ls,d:mr,pb:et,g:Vr,T:kr,Ga:ps,lb:ms,nb:fs,Ha:Qr,Ea:Ps,wb:Qs,Da:Xs,pa:Js,mb:Ys,jb:_s,Fa:Zs,kb:en,Ma:Cs,za:xn,eb:En,cb:Ss,ya:pe,V:F,N:V,db:Y,ma:ht,fb:Ct,zb:kt,hb:vr,qb:Yr,ab:Tr,Aa:gs,yb:Ot,Ja:Gt,S:Zr,Wa:ws,$:Ba,H:Ra,E:ja,l:Jr,F:Ki,B:Wa,X:Hi,J:Ga,v:qi,O:Jc,D:Ka,t:Qi,A:Ha,z:Kn,w:qa,r:Qa,tb:Xa,ub:Ja,vb:Hn,rb:qn,sb:Zi,bb:eo,Oa:Yc,La:Zc,y:Za,ja:el,Ba:tl,Ka:Ya,qa:rl,Ia:sl,ib:Jn,U:Vs,fa:nl,Sa:il,gb:ol,Qa:ro,Pa:al,Ab:no,Ca:Zn,ob:je,aa:io,oa:oo,xb:ei,na:ao,$a:Cl,ia:la,sa:zl,ga:sa,da:Il,ua:xi,p:xl,e:pl,c:cl,ea:ia,f:hl,n:ml,k:ta,Y:_l,ka:vl,j:El,wa:$l,Ra:ca,ca:aa,Ua:Rl,P:kl,K:ea,_:oa,Q:Pl,Z:Dl,x:gl,m:ul,va:Fl,i:Yo,h:fl,ra:Bl,ta:da,o:Zo,q:wl,s:Ml,I:bl,C:ra,L:Tl,xa:Sl,_a:na,G:Ol,Ya:Ti,ba:Ll,M:yl,Xa:Al,ha:lo,a:M,Na:Re}}}var Ne={1320978:()=>typeof wasmOffsetConverter<"u",1321035:(d,m,T,C,I)=>{if(n===void 0||!n.Bd)return 1;if((d=zt(Number(d>>>0))).startsWith("./")&&(d=d.substring(2)),!(d=n.Bd.get(d)))return 2;if(m=Number(m>>>0),T=Number(T>>>0),C=Number(C>>>0),m+T>d.byteLength)return 3;try{let W=d.subarray(m,m+T);switch(I){case 0:O().set(W,C>>>0);break;case 1:n.$d(C,W);break;default:return 4}return 0}catch{return 4}},1321750:(d,m,T)=>{n.Jd(d,O().subarray(m>>>0,m+T>>>0))},1321813:()=>n.Yd(),1321854:d=>{n.Id(d)},1321890:()=>{n.Sd()},1321921:()=>{n.Td()},1321950:()=>{n.Xd()},1321975:d=>n.Rd(d),1322008:d=>n.Vd(d),1322040:(d,m,T)=>{n.Hd(Number(d),Number(m),Number(T),!0)},1322103:(d,m,T)=>{n.Hd(Number(d),Number(m),Number(T))},1322160:d=>{n.hc("Abs",d,void 0)},1322211:d=>{n.hc("Neg",d,void 0)},1322262:d=>{n.hc("Floor",d,void 0)},1322315:d=>{n.hc("Ceil",d,void 0)},1322367:d=>{n.hc("Reciprocal",d,void 0)},1322425:d=>{n.hc("Sqrt",d,void 0)},1322477:d=>{n.hc("Exp",d,void 0)},1322528:d=>{n.hc("Erf",d,void 0)},1322579:d=>{n.hc("Sigmoid",d,void 0)},1322634:(d,m,T)=>{n.hc("HardSigmoid",d,{alpha:m,beta:T})},1322713:d=>{n.hc("Log",d,void 0)},1322764:d=>{n.hc("Sin",d,void 0)},1322815:d=>{n.hc("Cos",d,void 0)},1322866:d=>{n.hc("Tan",d,void 0)},1322917:d=>{n.hc("Asin",d,void 0)},1322969:d=>{n.hc("Acos",d,void 0)},1323021:d=>{n.hc("Atan",d,void 0)},1323073:d=>{n.hc("Sinh",d,void 0)},1323125:d=>{n.hc("Cosh",d,void 0)},1323177:d=>{n.hc("Asinh",d,void 0)},1323230:d=>{n.hc("Acosh",d,void 0)},1323283:d=>{n.hc("Atanh",d,void 0)},1323336:d=>{n.hc("Tanh",d,void 0)},1323388:d=>{n.hc("Not",d,void 0)},1323439:(d,m,T)=>{n.hc("Clip",d,{min:m,max:T})},1323508:d=>{n.hc("Clip",d,void 0)},1323560:(d,m)=>{n.hc("Elu",d,{alpha:m})},1323618:d=>{n.hc("Gelu",d,void 0)},1323670:d=>{n.hc("Relu",d,void 0)},1323722:(d,m)=>{n.hc("LeakyRelu",d,{alpha:m})},1323786:(d,m)=>{n.hc("ThresholdedRelu",d,{alpha:m})},1323856:(d,m)=>{n.hc("Cast",d,{to:m})},1323914:d=>{n.hc("Add",d,void 0)},1323965:d=>{n.hc("Sub",d,void 0)},1324016:d=>{n.hc("Mul",d,void 0)},1324067:d=>{n.hc("Div",d,void 0)},1324118:d=>{n.hc("Pow",d,void 0)},1324169:d=>{n.hc("Equal",d,void 0)},1324222:d=>{n.hc("Greater",d,void 0)},1324277:d=>{n.hc("GreaterOrEqual",d,void 0)},1324339:d=>{n.hc("Less",d,void 0)},1324391:d=>{n.hc("LessOrEqual",d,void 0)},1324450:(d,m,T,C,I)=>{n.hc("ReduceMean",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1324625:(d,m,T,C,I)=>{n.hc("ReduceMax",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1324799:(d,m,T,C,I)=>{n.hc("ReduceMin",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1324973:(d,m,T,C,I)=>{n.hc("ReduceProd",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325148:(d,m,T,C,I)=>{n.hc("ReduceSum",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325322:(d,m,T,C,I)=>{n.hc("ReduceL1",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325495:(d,m,T,C,I)=>{n.hc("ReduceL2",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325668:(d,m,T,C,I)=>{n.hc("ReduceLogSum",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1325845:(d,m,T,C,I)=>{n.hc("ReduceSumSquare",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1326025:(d,m,T,C,I)=>{n.hc("ReduceLogSumExp",d,{keepDims:!!m,noopWithEmptyAxes:!!T,axes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1326205:d=>{n.hc("Where",d,void 0)},1326258:(d,m,T)=>{n.hc("Transpose",d,{perm:m?Array.from(X().subarray(Number(m)>>>0,Number(T)>>>0)):[]})},1326382:(d,m,T,C)=>{n.hc("DepthToSpace",d,{blocksize:m,mode:zt(T),format:C?"NHWC":"NCHW"})},1326515:(d,m,T,C)=>{n.hc("DepthToSpace",d,{blocksize:m,mode:zt(T),format:C?"NHWC":"NCHW"})},1326648:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt,Fr)=>{n.hc("ConvTranspose",d,{format:Ee?"NHWC":"NCHW",autoPad:m,dilations:[T],group:C,kernelShape:[I],pads:[W,ne],strides:[ye],wIsConst:()=>!!N()[ze>>>0],outputPadding:Ye?Array.from(X().subarray(Number(Ye)>>>0,Number(ot)>>>0)):[],outputShape:_t?Array.from(X().subarray(Number(_t)>>>0,Number(Bt)>>>0)):[],activation:zt(Fr)})},1327081:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt)=>{n.hc("ConvTranspose",d,{format:ye?"NHWC":"NCHW",autoPad:m,dilations:Array.from(X().subarray(Number(T)>>>0,2+(Number(T)>>>0)>>>0)),group:C,kernelShape:Array.from(X().subarray(Number(I)>>>0,2+(Number(I)>>>0)>>>0)),pads:Array.from(X().subarray(Number(W)>>>0,4+(Number(W)>>>0)>>>0)),strides:Array.from(X().subarray(Number(ne)>>>0,2+(Number(ne)>>>0)>>>0)),wIsConst:()=>!!N()[Ee>>>0],outputPadding:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],outputShape:ot?Array.from(X().subarray(Number(ot)>>>0,Number(_t)>>>0)):[],activation:zt(Bt)})},1327742:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt,Fr)=>{n.hc("ConvTranspose",d,{format:Ee?"NHWC":"NCHW",autoPad:m,dilations:[T],group:C,kernelShape:[I],pads:[W,ne],strides:[ye],wIsConst:()=>!!N()[ze>>>0],outputPadding:Ye?Array.from(X().subarray(Number(Ye)>>>0,Number(ot)>>>0)):[],outputShape:_t?Array.from(X().subarray(Number(_t)>>>0,Number(Bt)>>>0)):[],activation:zt(Fr)})},1328175:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt)=>{n.hc("ConvTranspose",d,{format:ye?"NHWC":"NCHW",autoPad:m,dilations:Array.from(X().subarray(Number(T)>>>0,2+(Number(T)>>>0)>>>0)),group:C,kernelShape:Array.from(X().subarray(Number(I)>>>0,2+(Number(I)>>>0)>>>0)),pads:Array.from(X().subarray(Number(W)>>>0,4+(Number(W)>>>0)>>>0)),strides:Array.from(X().subarray(Number(ne)>>>0,2+(Number(ne)>>>0)>>>0)),wIsConst:()=>!!N()[Ee>>>0],outputPadding:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],outputShape:ot?Array.from(X().subarray(Number(ot)>>>0,Number(_t)>>>0)):[],activation:zt(Bt)})},1328836:(d,m)=>{n.hc("GlobalAveragePool",d,{format:m?"NHWC":"NCHW"})},1328927:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt)=>{n.hc("AveragePool",d,{format:Bt?"NHWC":"NCHW",auto_pad:m,ceil_mode:T,count_include_pad:C,storage_order:I,dilations:W?Array.from(X().subarray(Number(W)>>>0,Number(ne)>>>0)):[],kernel_shape:ye?Array.from(X().subarray(Number(ye)>>>0,Number(Ee)>>>0)):[],pads:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],strides:ot?Array.from(X().subarray(Number(ot)>>>0,Number(_t)>>>0)):[]})},1329406:(d,m)=>{n.hc("GlobalAveragePool",d,{format:m?"NHWC":"NCHW"})},1329497:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt)=>{n.hc("AveragePool",d,{format:Bt?"NHWC":"NCHW",auto_pad:m,ceil_mode:T,count_include_pad:C,storage_order:I,dilations:W?Array.from(X().subarray(Number(W)>>>0,Number(ne)>>>0)):[],kernel_shape:ye?Array.from(X().subarray(Number(ye)>>>0,Number(Ee)>>>0)):[],pads:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],strides:ot?Array.from(X().subarray(Number(ot)>>>0,Number(_t)>>>0)):[]})},1329976:(d,m)=>{n.hc("GlobalMaxPool",d,{format:m?"NHWC":"NCHW"})},1330063:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt)=>{n.hc("MaxPool",d,{format:Bt?"NHWC":"NCHW",auto_pad:m,ceil_mode:T,count_include_pad:C,storage_order:I,dilations:W?Array.from(X().subarray(Number(W)>>>0,Number(ne)>>>0)):[],kernel_shape:ye?Array.from(X().subarray(Number(ye)>>>0,Number(Ee)>>>0)):[],pads:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],strides:ot?Array.from(X().subarray(Number(ot)>>>0,Number(_t)>>>0)):[]})},1330538:(d,m)=>{n.hc("GlobalMaxPool",d,{format:m?"NHWC":"NCHW"})},1330625:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt)=>{n.hc("MaxPool",d,{format:Bt?"NHWC":"NCHW",auto_pad:m,ceil_mode:T,count_include_pad:C,storage_order:I,dilations:W?Array.from(X().subarray(Number(W)>>>0,Number(ne)>>>0)):[],kernel_shape:ye?Array.from(X().subarray(Number(ye)>>>0,Number(Ee)>>>0)):[],pads:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],strides:ot?Array.from(X().subarray(Number(ot)>>>0,Number(_t)>>>0)):[]})},1331100:(d,m,T,C,I)=>{n.hc("Gemm",d,{alpha:m,beta:T,transA:C,transB:I})},1331204:d=>{n.hc("MatMul",d,void 0)},1331258:(d,m,T,C)=>{n.hc("ArgMax",d,{keepDims:!!m,selectLastIndex:!!T,axis:C})},1331366:(d,m,T,C)=>{n.hc("ArgMin",d,{keepDims:!!m,selectLastIndex:!!T,axis:C})},1331474:(d,m)=>{n.hc("Softmax",d,{axis:m})},1331537:(d,m)=>{n.hc("Concat",d,{axis:m})},1331597:(d,m,T,C,I)=>{n.hc("Split",d,{axis:m,numOutputs:T,splitSizes:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1331753:d=>{n.hc("Expand",d,void 0)},1331807:(d,m)=>{n.hc("Gather",d,{axis:Number(m)})},1331878:(d,m)=>{n.hc("GatherElements",d,{axis:Number(m)})},1331957:(d,m)=>{n.hc("GatherND",d,{batch_dims:Number(m)})},1332036:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye)=>{n.hc("Resize",d,{antialias:m,axes:T?Array.from(X().subarray(Number(T)>>>0,Number(C)>>>0)):[],coordinateTransformMode:zt(I),cubicCoeffA:W,excludeOutside:ne,extrapolationValue:ye,keepAspectRatioPolicy:zt(Ee),mode:zt(ze),nearestMode:zt(Ye)})},1332398:(d,m,T,C,I,W,ne)=>{n.hc("Slice",d,{starts:m?Array.from(X().subarray(Number(m)>>>0,Number(T)>>>0)):[],ends:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[],axes:W?Array.from(X().subarray(Number(W)>>>0,Number(ne)>>>0)):[]})},1332662:d=>{n.hc("Tile",d,void 0)},1332714:(d,m,T)=>{n.hc("InstanceNormalization",d,{epsilon:m,format:T?"NHWC":"NCHW"})},1332828:(d,m,T)=>{n.hc("InstanceNormalization",d,{epsilon:m,format:T?"NHWC":"NCHW"})},1332942:d=>{n.hc("Range",d,void 0)},1332995:(d,m)=>{n.hc("Einsum",d,{equation:zt(m)})},1333076:(d,m,T,C,I)=>{n.hc("Pad",d,{mode:m,value:T,pads:C?Array.from(X().subarray(Number(C)>>>0,Number(I)>>>0)):[]})},1333219:(d,m,T,C,I,W)=>{n.hc("BatchNormalization",d,{epsilon:m,momentum:T,spatial:!!I,trainingMode:!!C,format:W?"NHWC":"NCHW"})},1333388:(d,m,T,C,I,W)=>{n.hc("BatchNormalization",d,{epsilon:m,momentum:T,spatial:!!I,trainingMode:!!C,format:W?"NHWC":"NCHW"})},1333557:(d,m,T)=>{n.hc("CumSum",d,{exclusive:Number(m),reverse:Number(T)})},1333654:(d,m,T)=>{n.hc("DequantizeLinear",d,{axis:m,blockSize:T})},1333744:(d,m,T,C,I)=>{n.hc("GridSample",d,{align_corners:m,mode:zt(T),padding_mode:zt(C),format:I?"NHWC":"NCHW"})},1333914:(d,m,T,C,I)=>{n.hc("GridSample",d,{align_corners:m,mode:zt(T),padding_mode:zt(C),format:I?"NHWC":"NCHW"})},1334084:(d,m)=>{n.hc("ScatterND",d,{reduction:zt(m)})},1334169:(d,m,T,C,I,W,ne,ye,Ee)=>{n.hc("Attention",d,{numHeads:m,isUnidirectional:T,maskFilterValue:C,scale:I,doRotary:W,qkvHiddenSizes:ne?Array.from(X().subarray(Number(ye)>>>0,Number(ye)+ne>>>0)):[],pastPresentShareBuffer:!!Ee})},1334441:d=>{n.hc("BiasAdd",d,void 0)},1334496:d=>{n.hc("BiasSplitGelu",d,void 0)},1334557:d=>{n.hc("FastGelu",d,void 0)},1334613:(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt,Fr,$s)=>{n.hc("Conv",d,{format:ot?"NHWC":"NCHW",auto_pad:m,dilations:T?Array.from(X().subarray(Number(T)>>>0,Number(C)>>>0)):[],group:I,kernel_shape:W?Array.from(X().subarray(Number(W)>>>0,Number(ne)>>>0)):[],pads:ye?Array.from(X().subarray(Number(ye)>>>0,Number(Ee)>>>0)):[],strides:ze?Array.from(X().subarray(Number(ze)>>>0,Number(Ye)>>>0)):[],w_is_const:()=>!!N()[Number(_t)>>>0],activation:zt(Bt),activation_params:Fr?Array.from(_e().subarray(Number(Fr)>>>0,Number($s)>>>0)):[]})},1335197:d=>{n.hc("Gelu",d,void 0)},1335249:(d,m,T,C,I,W,ne,ye,Ee)=>{n.hc("GroupQueryAttention",d,{numHeads:m,kvNumHeads:T,scale:C,softcap:I,doRotary:W,rotaryInterleaved:ne,smoothSoftmax:ye,localWindowSize:Ee})},1335466:(d,m,T,C)=>{n.hc("LayerNormalization",d,{axis:m,epsilon:T,simplified:!!C})},1335577:(d,m,T,C)=>{n.hc("LayerNormalization",d,{axis:m,epsilon:T,simplified:!!C})},1335688:(d,m,T,C,I,W)=>{n.hc("MatMulNBits",d,{k:m,n:T,accuracyLevel:C,bits:I,blockSize:W})},1335815:(d,m,T,C,I,W)=>{n.hc("MultiHeadAttention",d,{numHeads:m,isUnidirectional:T,maskFilterValue:C,scale:I,doRotary:W})},1335974:(d,m)=>{n.hc("QuickGelu",d,{alpha:m})},1336038:(d,m,T,C,I)=>{n.hc("RotaryEmbedding",d,{interleaved:!!m,numHeads:T,rotaryEmbeddingDim:C,scale:I})},1336177:(d,m,T)=>{n.hc("SkipLayerNormalization",d,{epsilon:m,simplified:!!T})},1336279:(d,m,T)=>{n.hc("SkipLayerNormalization",d,{epsilon:m,simplified:!!T})},1336381:(d,m,T,C)=>{n.hc("GatherBlockQuantized",d,{gatherAxis:m,quantizeAxis:T,blockSize:C})},1336502:d=>{n.Wd(d)},1336536:(d,m)=>n.Zd(Number(d),Number(m),n.Cd.be,n.Cd.errors)};function We(d,m,T){return Wi(async()=>{await n.Ud(Number(d),Number(m),Number(T))})}function D(){return typeof wasmOffsetConverter<"u"}class ee{constructor(m){re(this,"name","ExitStatus");this.message=`Program terminated with exit(${m})`,this.status=m}}var B=d=>{d.terminate(),d.onmessage=()=>{}},te=[],de=d=>{qe.length==0&&(ds(),dr(qe[0]));var m=qe.pop();if(!m)return 6;Xe.push(m),wt[d.xd]=m,m.xd=d.xd;var T={yd:"run",de:d.ce,Fd:d.Fd,xd:d.xd};return m.postMessage(T,d.Ld),0},be=0,ve=(d,m,...T)=>{for(var C=2*T.length,I=ft(),W=An(8*C),ne=W>>>3,ye=0;ye>>0]=Ee)}return d=si(d,0,C,W,m),mt(I),d};function Re(d){if(c)return ve(0,1,d);if(x=d,!(0{if(x=d,c)throw Fe(d),"unwind";Re(d)},qe=[],Xe=[],ut=[],wt={},nr=d=>{var m=d.xd;delete wt[m],qe.push(d),Xe.splice(Xe.indexOf(d),1),d.xd=0,ho(m)};function jt(){ut.forEach(d=>d())}var dr=d=>new Promise(m=>{d.onmessage=I=>{var W=(I=I.data).yd;if(I.Ed&&I.Ed!=In()){var ne=wt[I.Ed];ne?ne.postMessage(I,I.Ld):E(`Internal error! Worker sent a message "${W}" to target pthread ${I.Ed}, but that thread no longer exists!`)}else W==="checkMailbox"?Vt():W==="spawnThread"?de(I):W==="cleanupThread"?nr(wt[I.ee]):W==="loaded"?(d.loaded=!0,m(d)):W==="alert"?alert(`Thread ${I.fe}: ${I.text}`):I.target==="setimmediate"?d.postMessage(I):W==="callHandler"?n[I.Nd](...I.args):W&&E(`worker sent an unknown command ${W}`)},d.onerror=I=>{throw E(`worker sent an error! ${I.filename}:${I.lineno}: ${I.message}`),I};var T,C=[];for(T of[])n.propertyIsEnumerable(T)&&C.push(T);d.postMessage({yd:"load",Od:C,he:M,ie:w})});function ds(){var d=new Worker((()=>{let m=URL;return self.location.href>"file:"&&self.location.href<"file;"?new m("ort.bundle.min.mjs",self.location.href):new URL(self.location.href)})(),{type:"module",workerData:"em-pthread",name:"em-pthread"});qe.push(d)}var Os=d=>{K();var m=we()[d+52>>>2>>>0];d=we()[d+56>>>2>>>0],fo(m,m-d),mt(m)},Dr=(d,m)=>{be=0,d=li(d,m),0>>=0);if(N()[m.wd+12>>>0]==0){var T=1;N()[m.wd+12>>>0]=T}return T=0,N()[m.wd+13>>>0]=T,cs.push(m),oi(d),wo(d)}var jr=0,dt=()=>{gt(0,0);var d=cs.pop();_o(d.Gd),jr=0};class qr{constructor(m){this.Gd=m,this.wd=m-24}}function Vr(d){throw jr||(jr=d>>>0),jr}var us=d=>{var m=jr;if(!m)return Us(0),0;var T=new qr(m);we()[T.wd+16>>>2>>>0]=m;var C=we()[T.wd+4>>>2>>>0];if(!C)return Us(0),m;for(var I of d){if(I===0||I===C)break;if(go(I,C,T.wd+16))return Us(I),m}return Us(C),m};function Ts(){return us([])}function xs(d){return us([d>>>0])}function Es(d,m){return us([d>>>0,m>>>0])}var Ls=()=>{var d=cs.pop();d||Ie("no exception to throw");var m=d.Gd;if(N()[d.wd+13>>>0]==0){cs.push(d);var T=1;N()[d.wd+13>>>0]=T,T=0,N()[d.wd+12>>>0]=T}throw jr=m};function mr(d,m,T){var C=new qr(d>>>=0);throw m>>>=0,T>>>=0,we()[C.wd+16>>>2>>>0]=0,we()[C.wd+4>>>2>>>0]=m,we()[C.wd+8>>>2>>>0]=T,jr=d}function Be(d,m,T,C){return c?ve(2,1,d,m,T,C):et(d,m,T,C)}function et(d,m,T,C){if(d>>>=0,T>>>=0,C>>>=0,p===void 0)return 6;var I=[];return c&&I.length===0?Be(d,m>>>=0,T,C):(d={ce:T,xd:d,Fd:C,Ld:I},c?(d.yd="spawnThread",postMessage(d,I),0):de(d))}var it=typeof TextDecoder<"u"?new TextDecoder:void 0,rr=(d,m=0,T=NaN)=>{var C=(m>>>=0)+T;for(T=m;d[T]&&!(T>=C);)++T;if(16(I=(240&I)==224?(15&I)<<12|W<<6|ne:(7&I)<<18|W<<12|ne<<6|63&d[m++])?C+=String.fromCharCode(I):(I-=65536,C+=String.fromCharCode(55296|I>>10,56320|1023&I))}}else C+=String.fromCharCode(I)}return C},zt=(d,m)=>(d>>>=0)?rr(O(),d,m):"";function kr(d,m,T){return c?ve(3,1,d,m,T):0}function ps(d,m){if(c)return ve(4,1,d,m)}var hs=d=>{for(var m=0,T=0;T=C?m++:2047>=C?m+=2:55296<=C&&57343>=C?(m+=4,++T):m+=3}return m},Er=(d,m,T)=>{var C=O();if(m>>>=0,0=ne&&(ne=65536+((1023&ne)<<10)|1023&d.charCodeAt(++W)),127>=ne){if(m>=T)break;C[m++>>>0]=ne}else{if(2047>=ne){if(m+1>=T)break;C[m++>>>0]=192|ne>>6}else{if(65535>=ne){if(m+2>=T)break;C[m++>>>0]=224|ne>>12}else{if(m+3>=T)break;C[m++>>>0]=240|ne>>18,C[m++>>>0]=128|ne>>12&63}C[m++>>>0]=128|ne>>6&63}C[m++>>>0]=128|63&ne}}C[m>>>0]=0,d=m-I}else d=0;return d};function ms(d,m){if(c)return ve(5,1,d,m)}function fs(d,m,T){if(c)return ve(6,1,d,m,T)}function Qr(d,m,T){return c?ve(7,1,d,m,T):0}function Ps(d,m){if(c)return ve(8,1,d,m)}function Qs(d,m,T){if(c)return ve(9,1,d,m,T)}function Xs(d,m,T,C){if(c)return ve(10,1,d,m,T,C)}function Js(d,m,T,C){if(c)return ve(11,1,d,m,T,C)}function Ys(d,m,T,C){if(c)return ve(12,1,d,m,T,C)}function _s(d){if(c)return ve(13,1,d)}function Zs(d,m){if(c)return ve(14,1,d,m)}function en(d,m,T){if(c)return ve(15,1,d,m,T)}var tn,Lr,Cs=()=>Ie(""),br=d=>{for(var m="";O()[d>>>0];)m+=tn[O()[d++>>>0]];return m},zs={},Bs={};function Ir(d,m,T={}){return function(C,I,W={}){var ne=I.name;if(!C)throw new Lr(`type "${ne}" must have a positive integer typeid pointer`);if(Bs.hasOwnProperty(C)){if(W.Pd)return;throw new Lr(`Cannot register type '${ne}' twice`)}Bs[C]=I,zs.hasOwnProperty(C)&&(I=zs[C],delete zs[C],I.forEach(ye=>ye()))}(d,m,T)}var Xr=(d,m,T)=>{switch(m){case 1:return T?C=>N()[C>>>0]:C=>O()[C>>>0];case 2:return T?C=>G()[C>>>1>>>0]:C=>se()[C>>>1>>>0];case 4:return T?C=>X()[C>>>2>>>0]:C=>we()[C>>>2>>>0];case 8:return T?C=>H[C>>>3]:C=>J[C>>>3];default:throw new TypeError(`invalid integer width (${m}): ${d}`)}};function xn(d,m,T){T>>>=0,Ir(d>>>=0,{name:m=br(m>>>0),fromWireType:C=>C,toWireType:function(C,I){if(typeof I!="bigint"&&typeof I!="number")throw I=I===null?"null":(C=typeof I)=="object"||C==="array"||C==="function"?I.toString():""+I,new TypeError(`Cannot convert "${I}" to ${this.name}`);return typeof I=="number"&&(I=BigInt(I)),I},zd:zr,readValueFromPointer:Xr(m,T,m.indexOf("u")==-1),Ad:null})}var zr=8;function En(d,m,T,C){Ir(d>>>=0,{name:m=br(m>>>0),fromWireType:function(I){return!!I},toWireType:function(I,W){return W?T:C},zd:zr,readValueFromPointer:function(I){return this.fromWireType(O()[I>>>0])},Ad:null})}var Rs=[],Ar=[];function Jr(d){9<(d>>>=0)&&--Ar[d+1]==0&&(Ar[d]=void 0,Rs.push(d))}var cr=d=>{if(!d)throw new Lr("Cannot use deleted val. handle = "+d);return Ar[d]},fr=d=>{switch(d){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let m=Rs.pop()||Ar.length;return Ar[m]=d,Ar[m+1]=1,m}};function Ns(d){return this.fromWireType(we()[d>>>2>>>0])}var Pn={name:"emscripten::val",fromWireType:d=>{var m=cr(d);return Jr(d),m},toWireType:(d,m)=>fr(m),zd:zr,readValueFromPointer:Ns,Ad:null};function Ss(d){return Ir(d>>>0,Pn)}var Cn=(d,m)=>{switch(m){case 4:return function(T){return this.fromWireType(_e()[T>>>2>>>0])};case 8:return function(T){return this.fromWireType(ke()[T>>>3>>>0])};default:throw new TypeError(`invalid float width (${m}): ${d}`)}};function pe(d,m,T){T>>>=0,Ir(d>>>=0,{name:m=br(m>>>0),fromWireType:C=>C,toWireType:(C,I)=>I,zd:zr,readValueFromPointer:Cn(m,T),Ad:null})}function F(d,m,T,C,I){if(d>>>=0,T>>>=0,m=br(m>>>0),I===-1&&(I=4294967295),I=ye=>ye,C===0){var W=32-8*T;I=ye=>ye<>>W}var ne=m.includes("unsigned")?function(ye,Ee){return Ee>>>0}:function(ye,Ee){return Ee};Ir(d,{name:m,fromWireType:I,toWireType:ne,zd:zr,readValueFromPointer:Xr(m,T,C!==0),Ad:null})}function V(d,m,T){function C(W){var ne=we()[W>>>2>>>0];return W=we()[W+4>>>2>>>0],new I(N().buffer,W,ne)}var I=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][m];Ir(d>>>=0,{name:T=br(T>>>0),fromWireType:C,zd:zr,readValueFromPointer:C},{Pd:!0})}function Y(d,m){Ir(d>>>=0,{name:m=br(m>>>0),fromWireType:function(T){for(var C,I=we()[T>>>2>>>0],W=T+4,ne=W,ye=0;ye<=I;++ye){var Ee=W+ye;ye!=I&&O()[Ee>>>0]!=0||(ne=zt(ne,Ee-ne),C===void 0?C=ne:(C+="\0",C+=ne),ne=Ee+1)}return Ur(T),C},toWireType:function(T,C){C instanceof ArrayBuffer&&(C=new Uint8Array(C));var I=typeof C=="string";if(!(I||C instanceof Uint8Array||C instanceof Uint8ClampedArray||C instanceof Int8Array))throw new Lr("Cannot pass non-string to std::string");var W=I?hs(C):C.length,ne=an(4+W+1),ye=ne+4;if(we()[ne>>>2>>>0]=W,I)Er(C,ye,W+1);else if(I)for(I=0;I>>0]=Ee}else for(I=0;I>>0]=C[I];return T!==null&&T.push(Ur,ne),ne},zd:zr,readValueFromPointer:Ns,Ad(T){Ur(T)}})}var le=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ue=(d,m)=>{for(var T=d>>1,C=T+m/2;!(T>=C)&&se()[T>>>0];)++T;if(32<(T<<=1)-d&&le)return le.decode(O().slice(d,T));for(T="",C=0;!(C>=m/2);++C){var I=G()[d+2*C>>>1>>>0];if(I==0)break;T+=String.fromCharCode(I)}return T},Ce=(d,m,T)=>{if(T??(T=2147483647),2>T)return 0;var C=m;T=(T-=2)<2*d.length?T/2:d.length;for(var I=0;I>>1>>>0]=W,m+=2}return G()[m>>>1>>>0]=0,m-C},Ue=d=>2*d.length,Qe=(d,m)=>{for(var T=0,C="";!(T>=m/4);){var I=X()[d+4*T>>>2>>>0];if(I==0)break;++T,65536<=I?(I-=65536,C+=String.fromCharCode(55296|I>>10,56320|1023&I)):C+=String.fromCharCode(I)}return C},Ke=(d,m,T)=>{if(m>>>=0,T??(T=2147483647),4>T)return 0;var C=m;T=C+T-4;for(var I=0;I=W&&(W=65536+((1023&W)<<10)|1023&d.charCodeAt(++I)),X()[m>>>2>>>0]=W,(m+=4)+4>T)break}return X()[m>>>2>>>0]=0,m-C},Ze=d=>{for(var m=0,T=0;T=C&&++T,m+=4}return m};function ht(d,m,T){if(d>>>=0,m>>>=0,T=br(T>>>=0),m===2)var C=ue,I=Ce,W=Ue,ne=ye=>se()[ye>>>1>>>0];else m===4&&(C=Qe,I=Ke,W=Ze,ne=ye=>we()[ye>>>2>>>0]);Ir(d,{name:T,fromWireType:ye=>{for(var Ee,ze=we()[ye>>>2>>>0],Ye=ye+4,ot=0;ot<=ze;++ot){var _t=ye+4+ot*m;ot!=ze&&ne(_t)!=0||(Ye=C(Ye,_t-Ye),Ee===void 0?Ee=Ye:(Ee+="\0",Ee+=Ye),Ye=_t+m)}return Ur(ye),Ee},toWireType:(ye,Ee)=>{if(typeof Ee!="string")throw new Lr(`Cannot pass non-string to C++ string type ${T}`);var ze=W(Ee),Ye=an(4+ze+m);return we()[Ye>>>2>>>0]=ze/m,I(Ee,Ye+4,ze+m),ye!==null&&ye.push(Ur,Ye),Ye},zd:zr,readValueFromPointer:Ns,Ad(ye){Ur(ye)}})}function Ct(d,m){Ir(d>>>=0,{Qd:!0,name:m=br(m>>>0),zd:0,fromWireType:()=>{},toWireType:()=>{}})}function kt(d){ri(d>>>0,!l,1,!a,131072,!1),jt()}var Wt=d=>{if(!ce)try{if(d(),!(0>>=0,typeof Atomics.ge=="function"&&(Atomics.ge(X(),d>>>2,d).value.then(Vt),d+=128,Atomics.store(X(),d>>>2,1))}var Vt=()=>{var d=In();d&&(Ot(d),Wt(mo))};function vr(d,m){(d>>>=0)==m>>>0?setTimeout(Vt):c?postMessage({Ed:d,yd:"checkMailbox"}):(d=wt[d])&&d.postMessage({yd:"checkMailbox"})}var _r=[];function Yr(d,m,T,C,I){for(m>>>=0,C/=2,_r.length=C,T=I>>>0>>>3,I=0;I>>0];return(m?Ne[m]:dl[d])(..._r)}var Tr=()=>{be=0};function gs(d){d>>>=0,c?postMessage({yd:"cleanupThread",ee:d}):nr(wt[d])}function Gt(d){}var Zt=(d,m)=>{var T=Bs[d];if(T===void 0)throw d=uo(d),T=br(d),Ur(d),new Lr(`${m} has unknown type ${T}`);return T},gr=(d,m,T)=>{var C=[];return d=d.toWireType(C,T),C.length&&(we()[m>>>2>>>0]=fr(C)),d};function Zr(d,m,T){return m>>>=0,T>>>=0,d=cr(d>>>0),m=Zt(m,"emval::as"),gr(m,T,d)}function ws(d,m){return m>>>=0,d=cr(d>>>0),(m=Zt(m,"emval::as")).toWireType(null,d)}var Ht=d=>{try{d()}catch(m){Ie(m)}},ur=0,Rt=null,Jt=0,qt=[],er={},ir={},rn=0,sn=null,za=[];function Wi(d){return function(m){if(!ce){if(ur===0){var T=!1,C=!1;m((I=0)=>{if(!ce&&(Jt=I,T=!0,C)){ur=2,Ht(()=>Xo(Rt)),typeof MainLoop<"u"&&MainLoop.Md&&MainLoop.resume(),I=!1;try{var W=function(){var Ee=X()[Rt+8>>>2>>>0];return Ee=Oe[ir[Ee]],--be,Ee()}()}catch(Ee){W=Ee,I=!0}var ne=!1;if(!Rt){var ye=sn;ye&&(sn=null,(I?ye.reject:ye.resolve)(W),ne=!0)}if(I&&!ne)throw W}}),C=!0,T||(ur=1,Rt=function(){var I=an(65548),W=I+12;we()[I>>>2>>>0]=W,we()[I+4>>>2>>>0]=W+65536,W=qt[0];var ne=er[W];return ne===void 0&&(ne=rn++,er[W]=ne,ir[ne]=W),W=ne,X()[I+8>>>2>>>0]=W,I}(),typeof MainLoop<"u"&&MainLoop.Md&&MainLoop.pause(),Ht(()=>qo(Rt)))}else ur===2?(ur=0,Ht(Jo),Ur(Rt),Rt=null,za.forEach(Wt)):Ie(`invalid state: ${ur}`);return Jt}}(m=>{d().then(m)})}function Ba(d){return d>>>=0,Wi(async()=>{var m=await cr(d);return fr(m)})}var ys=[];function Ra(d,m,T,C){return T>>>=0,C>>>=0,(d=ys[d>>>0])(null,m=cr(m>>>0),T,C)}var Na={},Sn=d=>{var m=Na[d];return m===void 0?br(d):m};function ja(d,m,T,C,I){return T>>>=0,C>>>=0,I>>>=0,(d=ys[d>>>0])(m=cr(m>>>0),m[T=Sn(T)],C,I)}var Gi=()=>typeof globalThis=="object"?globalThis:Function("return this")();function Ki(d){return(d>>>=0)==0?fr(Gi()):(d=Sn(d),fr(Gi()[d]))}var Va=d=>{var m=ys.length;return ys.push(d),m},Ua=(d,m)=>{for(var T=Array(d),C=0;C>>2>>>0],"parameter "+C);return T},Gn=(d,m)=>Object.defineProperty(m,"name",{value:d});function Wa(d,m,T){var C=(m=Ua(d,m>>>0)).shift();d--;var I=`return function (obj, func, destructorsRef, args) { +`,W=0,ne=[];T===0&&ne.push("obj");for(var ye=["retType"],Ee=[C],ze=0;zeYe.name).join(", ")}) => ${C.name}>`,Va(Gn(T,d))}function Hi(d){return d=Sn(d>>>0),fr(n[d])}function Ga(d,m){return m>>>=0,d=cr(d>>>0),m=cr(m),fr(d[m])}function qi(d){9<(d>>>=0)&&(Ar[d+1]+=1)}function Jc(){return fr([])}function Ka(d){d=cr(d>>>0);for(var m=Array(d.length),T=0;T>>0))}function Ha(){return fr({})}function Kn(d){for(var m=cr(d>>>=0);m.length;){var T=m.pop();m.pop()(T)}Jr(d)}function qa(d,m,T){m>>>=0,T>>>=0,d=cr(d>>>0),m=cr(m),T=cr(T),d[m]=T}function Qa(d,m){return m>>>=0,d=(d=Zt(d>>>0,"_emval_take_value")).readValueFromPointer(m),fr(d)}function Xa(d,m){d=-9007199254740992>d||9007199254740992>>=0,d=new Date(1e3*d),X()[m>>>2>>>0]=d.getUTCSeconds(),X()[m+4>>>2>>>0]=d.getUTCMinutes(),X()[m+8>>>2>>>0]=d.getUTCHours(),X()[m+12>>>2>>>0]=d.getUTCDate(),X()[m+16>>>2>>>0]=d.getUTCMonth(),X()[m+20>>>2>>>0]=d.getUTCFullYear()-1900,X()[m+24>>>2>>>0]=d.getUTCDay(),d=(d.getTime()-Date.UTC(d.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,X()[m+28>>>2>>>0]=d}var Xi=d=>d%4==0&&(d%100!=0||d%400==0),Ji=[0,31,60,91,121,152,182,213,244,274,305,335],Yi=[0,31,59,90,120,151,181,212,243,273,304,334];function Ja(d,m){d=-9007199254740992>d||9007199254740992>>=0,d=new Date(1e3*d),X()[m>>>2>>>0]=d.getSeconds(),X()[m+4>>>2>>>0]=d.getMinutes(),X()[m+8>>>2>>>0]=d.getHours(),X()[m+12>>>2>>>0]=d.getDate(),X()[m+16>>>2>>>0]=d.getMonth(),X()[m+20>>>2>>>0]=d.getFullYear()-1900,X()[m+24>>>2>>>0]=d.getDay();var T=(Xi(d.getFullYear())?Ji:Yi)[d.getMonth()]+d.getDate()-1|0;X()[m+28>>>2>>>0]=T,X()[m+36>>>2>>>0]=-60*d.getTimezoneOffset(),T=new Date(d.getFullYear(),6,1).getTimezoneOffset();var C=new Date(d.getFullYear(),0,1).getTimezoneOffset();d=0|(T!=C&&d.getTimezoneOffset()==Math.min(C,T)),X()[m+32>>>2>>>0]=d}function Hn(d){d>>>=0;var m=new Date(X()[d+20>>>2>>>0]+1900,X()[d+16>>>2>>>0],X()[d+12>>>2>>>0],X()[d+8>>>2>>>0],X()[d+4>>>2>>>0],X()[d>>>2>>>0],0),T=X()[d+32>>>2>>>0],C=m.getTimezoneOffset(),I=new Date(m.getFullYear(),6,1).getTimezoneOffset(),W=new Date(m.getFullYear(),0,1).getTimezoneOffset(),ne=Math.min(W,I);return 0>T?X()[d+32>>>2>>>0]=+(I!=W&&ne==C):0>>2>>>0]=m.getDay(),T=(Xi(m.getFullYear())?Ji:Yi)[m.getMonth()]+m.getDate()-1|0,X()[d+28>>>2>>>0]=T,X()[d>>>2>>>0]=m.getSeconds(),X()[d+4>>>2>>>0]=m.getMinutes(),X()[d+8>>>2>>>0]=m.getHours(),X()[d+12>>>2>>>0]=m.getDate(),X()[d+16>>>2>>>0]=m.getMonth(),X()[d+20>>>2>>>0]=m.getYear(),d=m.getTime(),BigInt(isNaN(d)?-1:d/1e3)}function qn(d,m,T,C,I,W,ne){return c?ve(16,1,d,m,T,C,I,W,ne):-52}function Zi(d,m,T,C,I,W){if(c)return ve(17,1,d,m,T,C,I,W)}var js={},Vs=()=>performance.timeOrigin+performance.now();function eo(d,m){if(c)return ve(18,1,d,m);if(js[d]&&(clearTimeout(js[d].id),delete js[d]),!m)return 0;var T=setTimeout(()=>{delete js[d],Wt(()=>ii(d,performance.timeOrigin+performance.now()))},m);return js[d]={id:T,ke:m},0}function Yc(d,m,T,C){d>>>=0,m>>>=0,T>>>=0,C>>>=0;var I=new Date().getFullYear(),W=new Date(I,0,1).getTimezoneOffset();I=new Date(I,6,1).getTimezoneOffset();var ne=Math.max(W,I);we()[d>>>2>>>0]=60*ne,X()[m>>>2>>>0]=+(W!=I),d=(m=ye=>{var Ee=Math.abs(ye);return`UTC${0<=ye?"-":"+"}${String(Math.floor(Ee/60)).padStart(2,"0")}${String(Ee%60).padStart(2,"0")}`})(W),m=m(I),IDate.now();function Zc(d,m,T){return 0<=d&&3>=d?(d===0?d=Date.now():d=performance.timeOrigin+performance.now(),H[T>>>0>>>3]=BigInt(Math.round(1e6*d)),0):28}var Qn=[],Xn=(d,m)=>{Qn.length=0;for(var T;T=O()[d++>>>0];){var C=T!=105;m+=(C&=T!=112)&&m%8?4:0,Qn.push(T==112?we()[m>>>2>>>0]:T==106?H[m>>>3]:T==105?X()[m>>>2>>>0]:ke()[m>>>3>>>0]),m+=C?8:4}return Qn};function Za(d,m,T){return d>>>=0,m=Xn(m>>>0,T>>>0),Ne[d](...m)}function el(d,m,T){return d>>>=0,m=Xn(m>>>0,T>>>0),Ne[d](...m)}var tl=()=>{};function rl(d,m){return E(zt(d>>>0,m>>>0))}var sl=()=>{throw be+=1,"unwind"};function Jn(){return 4294901760}var nl=()=>navigator.hardwareConcurrency;function il(){return Ie("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}function ol(d){d>>>=0;var m=O().length;if(d<=m||4294901760=T;T*=2){var C=m*(1+.2/T);C=Math.min(C,d+100663296);e:{C=(Math.min(4294901760,65536*Math.ceil(Math.max(d,C)/65536))-M.buffer.byteLength+65535)/65536|0;try{M.grow(C),K();var I=1;break e}catch{}I=void 0}if(I)return!0}return!1}var nn=()=>(Ie("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),on={},to=d=>{d.forEach(m=>{nn()})};function ro(){var d=Error().stack.toString().split(` +`);return d[0]=="Error"&&d.shift(),to(d),on.Kd=nn(),on.ae=d,on.Kd}function al(d,m,T){if(d>>>=0,m>>>=0,on.Kd==d)var C=on.ae;else(C=Error().stack.toString().split(` +`))[0]=="Error"&&C.shift(),to(C);for(var I=3;C[I]&&nn()!=d;)++I;for(d=0;d>>2>>>0]=nn();return d}var Yn,$n={},so=()=>{if(!Yn){var d,m={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(d in $n)$n[d]===void 0?delete m[d]:m[d]=$n[d];var T=[];for(d in m)T.push(`${d}=${m[d]}`);Yn=T}return Yn};function no(d,m){if(c)return ve(19,1,d,m);d>>>=0,m>>>=0;var T=0;return so().forEach((C,I)=>{var W=m+T;for(I=we()[d+4*I>>>2>>>0]=W,W=0;W>>0]=C.charCodeAt(W);N()[I>>>0]=0,T+=C.length+1}),0}function Zn(d,m){if(c)return ve(20,1,d,m);d>>>=0,m>>>=0;var T=so();we()[d>>>2>>>0]=T.length;var C=0;return T.forEach(I=>C+=I.length+1),we()[m>>>2>>>0]=C,0}function io(d){return c?ve(21,1,d):52}function oo(d,m,T,C){return c?ve(22,1,d,m,T,C):52}function ei(d,m,T,C){return c?ve(23,1,d,m,T,C):70}var ll=[null,[],[]];function ao(d,m,T,C){if(c)return ve(24,1,d,m,T,C);m>>>=0,T>>>=0,C>>>=0;for(var I=0,W=0;W>>2>>>0],ye=we()[m+4>>>2>>>0];m+=8;for(var Ee=0;Ee>>0],Ye=ll[d];ze===0||ze===10?((d===1?k:E)(rr(Ye)),Ye.length=0):Ye.push(ze)}I+=ye}return we()[C>>>2>>>0]=I,0}function lo(d){return d>>>0}c||function(){for(var d=n.numThreads-1;d--;)ds();te.unshift(()=>{Pe++,function(m){c?m():Promise.all(qe.map(dr)).then(m)}(()=>Ae())})}();for(var co=Array(256),kn=0;256>kn;++kn)co[kn]=String.fromCharCode(kn);tn=co,Lr=n.BindingError=class extends Error{constructor(d){super(d),this.name="BindingError"}},n.InternalError=class extends Error{constructor(d){super(d),this.name="InternalError"}},Ar.push(0,1,void 0,1,null,1,!0,1,!1,1),n.count_emval_handles=()=>Ar.length/2-5-Rs.length;var Oe,dl=[Re,Fe,Be,kr,ps,ms,fs,Qr,Ps,Qs,Xs,Js,Ys,_s,Zs,en,qn,Zi,eo,no,Zn,io,oo,ei,ao];(async function(){function d(C,I){return Oe=C.exports,Oe=function(){var W=Oe,ne={};for(let[ye,Ee]of Object.entries(W))ne[ye]=typeof Ee=="function"?(...ze)=>{qt.push(ye);try{return Ee(...ze)}finally{ce||(qt.pop(),Rt&&ur===1&&qt.length===0&&(ur=0,be+=1,Ht(Qo),typeof Fibers<"u"&&Fibers.le()))}}:Ee;return ne}(),Oe=function(){var W=Oe,ne=Ee=>ze=>Ee(ze)>>>0,ye=Ee=>()=>Ee()>>>0;return(W=Object.assign({},W)).Cb=ne(W.Cb),W.fc=ye(W.fc),W.ic=ne(W.ic),W.vc=ne(W.vc),W.wc=ye(W.wc),W.Ac=ne(W.Ac),W}(),ut.push(Oe.jc),w=I,Ae(),Oe}Pe++;var m=Le();if(n.instantiateWasm)return new Promise(C=>{n.instantiateWasm(m,(I,W)=>{d(I,W),C(I.exports)})});if(c)return new Promise(C=>{He=I=>{var W=new WebAssembly.Instance(I,Le());C(d(W,I))}});me??(me=n.locateFile?n.locateFile?n.locateFile("ort-wasm-simd-threaded.jsep.wasm",A):A+"ort-wasm-simd-threaded.jsep.wasm":new URL("/assets/ort-wasm-simd-threaded.jsep-BAR87mbD.wasm",self.location.href).href);try{var T=await async function(C){var I=me;if(!ae&&typeof WebAssembly.instantiateStreaming=="function"&&!he(I))try{var W=fetch(I,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(W,C)}catch(ne){E(`wasm streaming compile failed: ${ne}`),E("falling back to ArrayBuffer instantiation")}return async function(ne,ye){try{var Ee=await async function(ze){if(!ae)try{var Ye=await h(ze);return new Uint8Array(Ye)}catch{}if(ze==me&&ae)ze=new Uint8Array(ae);else{if(!g)throw"both async and sync fetching of the wasm failed";ze=g(ze)}return ze}(ne);return await WebAssembly.instantiate(Ee,ye)}catch(ze){E(`failed to asynchronously prepare wasm: ${ze}`),Ie(ze)}}(I,C)}(m);return d(T.instance,T.module)}catch(C){return i(C),Promise.reject(C)}})();var uo=d=>(uo=Oe.Cb)(d),ti=()=>(ti=Oe.Db)();n._OrtInit=(d,m)=>(n._OrtInit=Oe.Eb)(d,m),n._OrtGetLastError=(d,m)=>(n._OrtGetLastError=Oe.Fb)(d,m),n._OrtCreateSessionOptions=(d,m,T,C,I,W,ne,ye,Ee,ze)=>(n._OrtCreateSessionOptions=Oe.Gb)(d,m,T,C,I,W,ne,ye,Ee,ze),n._OrtAppendExecutionProvider=(d,m)=>(n._OrtAppendExecutionProvider=Oe.Hb)(d,m),n._OrtAddFreeDimensionOverride=(d,m,T)=>(n._OrtAddFreeDimensionOverride=Oe.Ib)(d,m,T),n._OrtAddSessionConfigEntry=(d,m,T)=>(n._OrtAddSessionConfigEntry=Oe.Jb)(d,m,T),n._OrtReleaseSessionOptions=d=>(n._OrtReleaseSessionOptions=Oe.Kb)(d),n._OrtCreateSession=(d,m,T)=>(n._OrtCreateSession=Oe.Lb)(d,m,T),n._OrtReleaseSession=d=>(n._OrtReleaseSession=Oe.Mb)(d),n._OrtGetInputOutputCount=(d,m,T)=>(n._OrtGetInputOutputCount=Oe.Nb)(d,m,T),n._OrtGetInputName=(d,m)=>(n._OrtGetInputName=Oe.Ob)(d,m),n._OrtGetOutputName=(d,m)=>(n._OrtGetOutputName=Oe.Pb)(d,m),n._OrtFree=d=>(n._OrtFree=Oe.Qb)(d),n._OrtCreateTensor=(d,m,T,C,I,W)=>(n._OrtCreateTensor=Oe.Rb)(d,m,T,C,I,W),n._OrtGetTensorData=(d,m,T,C,I)=>(n._OrtGetTensorData=Oe.Sb)(d,m,T,C,I),n._OrtReleaseTensor=d=>(n._OrtReleaseTensor=Oe.Tb)(d),n._OrtCreateRunOptions=(d,m,T,C)=>(n._OrtCreateRunOptions=Oe.Ub)(d,m,T,C),n._OrtAddRunConfigEntry=(d,m,T)=>(n._OrtAddRunConfigEntry=Oe.Vb)(d,m,T),n._OrtReleaseRunOptions=d=>(n._OrtReleaseRunOptions=Oe.Wb)(d),n._OrtCreateBinding=d=>(n._OrtCreateBinding=Oe.Xb)(d),n._OrtBindInput=(d,m,T)=>(n._OrtBindInput=Oe.Yb)(d,m,T),n._OrtBindOutput=(d,m,T,C)=>(n._OrtBindOutput=Oe.Zb)(d,m,T,C),n._OrtClearBoundOutputs=d=>(n._OrtClearBoundOutputs=Oe._b)(d),n._OrtReleaseBinding=d=>(n._OrtReleaseBinding=Oe.$b)(d),n._OrtRunWithBinding=(d,m,T,C,I)=>(n._OrtRunWithBinding=Oe.ac)(d,m,T,C,I),n._OrtRun=(d,m,T,C,I,W,ne,ye)=>(n._OrtRun=Oe.bc)(d,m,T,C,I,W,ne,ye),n._OrtEndProfiling=d=>(n._OrtEndProfiling=Oe.cc)(d),n._JsepOutput=(d,m,T)=>(n._JsepOutput=Oe.dc)(d,m,T),n._JsepGetNodeName=d=>(n._JsepGetNodeName=Oe.ec)(d);var In=()=>(In=Oe.fc)(),Ur=n._free=d=>(Ur=n._free=Oe.gc)(d),an=n._malloc=d=>(an=n._malloc=Oe.ic)(d),ri=(d,m,T,C,I,W)=>(ri=Oe.kc)(d,m,T,C,I,W),po=()=>(po=Oe.lc)(),si=(d,m,T,C,I)=>(si=Oe.mc)(d,m,T,C,I),ho=d=>(ho=Oe.nc)(d),ni=d=>(ni=Oe.oc)(d),ii=(d,m)=>(ii=Oe.pc)(d,m),mo=()=>(mo=Oe.qc)(),gt=(d,m)=>(gt=Oe.rc)(d,m),Us=d=>(Us=Oe.sc)(d),fo=(d,m)=>(fo=Oe.tc)(d,m),mt=d=>(mt=Oe.uc)(d),An=d=>(An=Oe.vc)(d),ft=()=>(ft=Oe.wc)(),_o=d=>(_o=Oe.xc)(d),oi=d=>(oi=Oe.yc)(d),go=(d,m,T)=>(go=Oe.zc)(d,m,T),wo=d=>(wo=Oe.Ac)(d),ai=n.dynCall_iii=(d,m,T)=>(ai=n.dynCall_iii=Oe.Bc)(d,m,T),yo=n.dynCall_vi=(d,m)=>(yo=n.dynCall_vi=Oe.Cc)(d,m),li=n.dynCall_ii=(d,m)=>(li=n.dynCall_ii=Oe.Dc)(d,m),di=n.dynCall_vii=(d,m,T)=>(di=n.dynCall_vii=Oe.Ec)(d,m,T),Mo=n.dynCall_iiii=(d,m,T,C)=>(Mo=n.dynCall_iiii=Oe.Fc)(d,m,T,C),bo=n.dynCall_viii=(d,m,T,C)=>(bo=n.dynCall_viii=Oe.Gc)(d,m,T,C),ci=n.dynCall_iiiii=(d,m,T,C,I)=>(ci=n.dynCall_iiiii=Oe.Hc)(d,m,T,C,I),vo=n.dynCall_viiii=(d,m,T,C,I)=>(vo=n.dynCall_viiii=Oe.Ic)(d,m,T,C,I),To=n.dynCall_viiiiii=(d,m,T,C,I,W,ne)=>(To=n.dynCall_viiiiii=Oe.Jc)(d,m,T,C,I,W,ne),ui=n.dynCall_viiiiiii=(d,m,T,C,I,W,ne,ye)=>(ui=n.dynCall_viiiiiii=Oe.Kc)(d,m,T,C,I,W,ne,ye),xo=n.dynCall_ji=(d,m)=>(xo=n.dynCall_ji=Oe.Lc)(d,m),Eo=n.dynCall_v=d=>(Eo=n.dynCall_v=Oe.Mc)(d),pi=n.dynCall_viiiii=(d,m,T,C,I,W)=>(pi=n.dynCall_viiiii=Oe.Nc)(d,m,T,C,I,W),Po=n.dynCall_i=d=>(Po=n.dynCall_i=Oe.Oc)(d),Co=n.dynCall_fii=(d,m,T)=>(Co=n.dynCall_fii=Oe.Pc)(d,m,T),hi=n.dynCall_viiiiiiii=(d,m,T,C,I,W,ne,ye,Ee)=>(hi=n.dynCall_viiiiiiii=Oe.Qc)(d,m,T,C,I,W,ne,ye,Ee),So=n.dynCall_viiiiiiiiii=(d,m,T,C,I,W,ne,ye,Ee,ze,Ye)=>(So=n.dynCall_viiiiiiiiii=Oe.Rc)(d,m,T,C,I,W,ne,ye,Ee,ze,Ye),$o=n.dynCall_jiii=(d,m,T,C)=>($o=n.dynCall_jiii=Oe.Sc)(d,m,T,C),mi=n.dynCall_dii=(d,m,T)=>(mi=n.dynCall_dii=Oe.Tc)(d,m,T),ko=n.dynCall_viiiiiiiii=(d,m,T,C,I,W,ne,ye,Ee,ze)=>(ko=n.dynCall_viiiiiiiii=Oe.Uc)(d,m,T,C,I,W,ne,ye,Ee,ze),Io=n.dynCall_viiiiiiiiiii=(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot)=>(Io=n.dynCall_viiiiiiiiiii=Oe.Vc)(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot),fi=n.dynCall_iiiiii=(d,m,T,C,I,W)=>(fi=n.dynCall_iiiiii=Oe.Wc)(d,m,T,C,I,W),Ao=n.dynCall_iij=(d,m,T)=>(Ao=n.dynCall_iij=Oe.Xc)(d,m,T),Fo=n.dynCall_iiiiiiiiii=(d,m,T,C,I,W,ne,ye,Ee,ze)=>(Fo=n.dynCall_iiiiiiiiii=Oe.Yc)(d,m,T,C,I,W,ne,ye,Ee,ze),Oo=n.dynCall_iiiiiiiiiii=(d,m,T,C,I,W,ne,ye,Ee,ze,Ye)=>(Oo=n.dynCall_iiiiiiiiiii=Oe.Zc)(d,m,T,C,I,W,ne,ye,Ee,ze,Ye),Do=n.dynCall_vij=(d,m,T)=>(Do=n.dynCall_vij=Oe._c)(d,m,T),_i=n.dynCall_iiif=(d,m,T,C)=>(_i=n.dynCall_iiif=Oe.$c)(d,m,T,C),Lo=n.dynCall_iiij=(d,m,T,C)=>(Lo=n.dynCall_iiij=Oe.ad)(d,m,T,C),zo=n.dynCall_fiii=(d,m,T,C)=>(zo=n.dynCall_fiii=Oe.bd)(d,m,T,C),gi=n.dynCall_viiiiiiiiiiiii=(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt)=>(gi=n.dynCall_viiiiiiiiiiiii=Oe.cd)(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt),Bo=n.dynCall_vjiii=(d,m,T,C,I)=>(Bo=n.dynCall_vjiii=Oe.dd)(d,m,T,C,I),Ro=n.dynCall_vif=(d,m,T)=>(Ro=n.dynCall_vif=Oe.ed)(d,m,T),wi=n.dynCall_iiiiiii=(d,m,T,C,I,W,ne)=>(wi=n.dynCall_iiiiiii=Oe.fd)(d,m,T,C,I,W,ne),No=n.dynCall_iiiij=(d,m,T,C,I)=>(No=n.dynCall_iiiij=Oe.gd)(d,m,T,C,I),jo=n.dynCall_iiiiiiii=(d,m,T,C,I,W,ne,ye)=>(jo=n.dynCall_iiiiiiii=Oe.hd)(d,m,T,C,I,W,ne,ye),yi=n.dynCall_viiiiiiiiiiii=(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t)=>(yi=n.dynCall_viiiiiiiiiiii=Oe.id)(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t),Vo=n.dynCall_diii=(d,m,T,C)=>(Vo=n.dynCall_diii=Oe.jd)(d,m,T,C),Uo=n.dynCall_jiiii=(d,m,T,C,I)=>(Uo=n.dynCall_jiiii=Oe.kd)(d,m,T,C,I),Mi=n.dynCall_viiij=(d,m,T,C,I)=>(Mi=n.dynCall_viiij=Oe.ld)(d,m,T,C,I),Wo=n.dynCall_fiiii=(d,m,T,C,I)=>(Wo=n.dynCall_fiiii=Oe.md)(d,m,T,C,I),Go=n.dynCall_viiif=(d,m,T,C,I)=>(Go=n.dynCall_viiif=Oe.nd)(d,m,T,C,I),bi=n.dynCall_diiii=(d,m,T,C,I)=>(bi=n.dynCall_diiii=Oe.od)(d,m,T,C,I),Ko=n.dynCall_viiid=(d,m,T,C,I)=>(Ko=n.dynCall_viiid=Oe.pd)(d,m,T,C,I),Ho=n.dynCall_iiiijii=(d,m,T,C,I,W,ne)=>(Ho=n.dynCall_iiiijii=Oe.qd)(d,m,T,C,I,W,ne),vi=n.dynCall_iiiiiij=(d,m,T,C,I,W,ne)=>(vi=n.dynCall_iiiiiij=Oe.rd)(d,m,T,C,I,W,ne),qo=d=>(qo=Oe.sd)(d),Qo=()=>(Qo=Oe.td)(),Xo=d=>(Xo=Oe.ud)(d),Jo=()=>(Jo=Oe.vd)();function Yo(d,m,T){var C=ft();try{di(d,m,T)}catch(I){if(mt(C),I!==I+0)throw I;gt(1,0)}}function cl(d,m,T){var C=ft();try{return ai(d,m,T)}catch(I){if(mt(C),I!==I+0)throw I;gt(1,0)}}function ul(d,m){var T=ft();try{yo(d,m)}catch(C){if(mt(T),C!==C+0)throw C;gt(1,0)}}function pl(d,m){var T=ft();try{return li(d,m)}catch(C){if(mt(T),C!==C+0)throw C;gt(1,0)}}function hl(d,m,T,C){var I=ft();try{return Mo(d,m,T,C)}catch(W){if(mt(I),W!==W+0)throw W;gt(1,0)}}function Zo(d,m,T,C,I){var W=ft();try{vo(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function ml(d,m,T,C,I){var W=ft();try{return ci(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function fl(d,m,T,C){var I=ft();try{bo(d,m,T,C)}catch(W){if(mt(I),W!==W+0)throw W;gt(1,0)}}function _l(d,m,T,C,I,W,ne){var ye=ft();try{return wi(d,m,T,C,I,W,ne)}catch(Ee){if(mt(ye),Ee!==Ee+0)throw Ee;gt(1,0)}}function gl(d){var m=ft();try{Eo(d)}catch(T){if(mt(m),T!==T+0)throw T;gt(1,0)}}function ea(d,m,T){var C=ft();try{return Ao(d,m,T)}catch(I){if(mt(C),I!==I+0)throw I;gt(1,0)}}function wl(d,m,T,C,I,W){var ne=ft();try{pi(d,m,T,C,I,W)}catch(ye){if(mt(ne),ye!==ye+0)throw ye;gt(1,0)}}function yl(d,m,T){var C=ft();try{Do(d,m,T)}catch(I){if(mt(C),I!==I+0)throw I;gt(1,0)}}function Ml(d,m,T,C,I,W,ne){var ye=ft();try{To(d,m,T,C,I,W,ne)}catch(Ee){if(mt(ye),Ee!==Ee+0)throw Ee;gt(1,0)}}function bl(d,m,T,C,I,W,ne,ye){var Ee=ft();try{ui(d,m,T,C,I,W,ne,ye)}catch(ze){if(mt(Ee),ze!==ze+0)throw ze;gt(1,0)}}function ta(d,m,T,C,I,W){var ne=ft();try{return fi(d,m,T,C,I,W)}catch(ye){if(mt(ne),ye!==ye+0)throw ye;gt(1,0)}}function vl(d,m,T,C,I,W,ne,ye){var Ee=ft();try{return jo(d,m,T,C,I,W,ne,ye)}catch(ze){if(mt(Ee),ze!==ze+0)throw ze;gt(1,0)}}function Tl(d,m,T,C,I,W,ne,ye,Ee,ze){var Ye=ft();try{ko(d,m,T,C,I,W,ne,ye,Ee,ze)}catch(ot){if(mt(Ye),ot!==ot+0)throw ot;gt(1,0)}}function ra(d,m,T,C,I,W,ne,ye,Ee){var ze=ft();try{hi(d,m,T,C,I,W,ne,ye,Ee)}catch(Ye){if(mt(ze),Ye!==Ye+0)throw Ye;gt(1,0)}}function xl(d){var m=ft();try{return Po(d)}catch(T){if(mt(m),T!==T+0)throw T;gt(1,0)}}function El(d,m,T,C,I,W,ne,ye,Ee,ze){var Ye=ft();try{return Fo(d,m,T,C,I,W,ne,ye,Ee,ze)}catch(ot){if(mt(Ye),ot!==ot+0)throw ot;gt(1,0)}}function sa(d,m,T){var C=ft();try{return Co(d,m,T)}catch(I){if(mt(C),I!==I+0)throw I;gt(1,0)}}function Pl(d,m,T,C){var I=ft();try{return $o(d,m,T,C)}catch(W){if(mt(I),W!==W+0)throw W;return gt(1,0),0n}}function Cl(d,m,T){var C=ft();try{return mi(d,m,T)}catch(I){if(mt(C),I!==I+0)throw I;gt(1,0)}}function na(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot){var _t=ft();try{Io(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot)}catch(Bt){if(mt(_t),Bt!==Bt+0)throw Bt;gt(1,0)}}function Sl(d,m,T,C,I,W,ne,ye,Ee,ze,Ye){var ot=ft();try{So(d,m,T,C,I,W,ne,ye,Ee,ze,Ye)}catch(_t){if(mt(ot),_t!==_t+0)throw _t;gt(1,0)}}function $l(d,m,T,C,I,W,ne,ye,Ee,ze,Ye){var ot=ft();try{return Oo(d,m,T,C,I,W,ne,ye,Ee,ze,Ye)}catch(_t){if(mt(ot),_t!==_t+0)throw _t;gt(1,0)}}function ia(d,m,T,C){var I=ft();try{return _i(d,m,T,C)}catch(W){if(mt(I),W!==W+0)throw W;gt(1,0)}}function kl(d,m,T,C){var I=ft();try{return Lo(d,m,T,C)}catch(W){if(mt(I),W!==W+0)throw W;gt(1,0)}}function Il(d,m,T,C){var I=ft();try{return zo(d,m,T,C)}catch(W){if(mt(I),W!==W+0)throw W;gt(1,0)}}function Ti(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt){var Fr=ft();try{gi(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t,Bt)}catch($s){if(mt(Fr),$s!==$s+0)throw $s;gt(1,0)}}function Al(d,m,T,C,I){var W=ft();try{Bo(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function Fl(d,m,T){var C=ft();try{Ro(d,m,T)}catch(I){if(mt(C),I!==I+0)throw I;gt(1,0)}}function oa(d,m){var T=ft();try{return xo(d,m)}catch(C){if(mt(T),C!==C+0)throw C;return gt(1,0),0n}}function aa(d,m,T,C,I){var W=ft();try{return No(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function Ol(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t){var Bt=ft();try{yi(d,m,T,C,I,W,ne,ye,Ee,ze,Ye,ot,_t)}catch(Fr){if(mt(Bt),Fr!==Fr+0)throw Fr;gt(1,0)}}function la(d,m,T,C){var I=ft();try{return Vo(d,m,T,C)}catch(W){if(mt(I),W!==W+0)throw W;gt(1,0)}}function Dl(d,m,T,C,I){var W=ft();try{return Uo(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;return gt(1,0),0n}}function Ll(d,m,T,C,I){var W=ft();try{Mi(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function xi(d,m,T,C,I){var W=ft();try{return Wo(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function da(d,m,T,C,I){var W=ft();try{Go(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function zl(d,m,T,C,I){var W=ft();try{return bi(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function Bl(d,m,T,C,I){var W=ft();try{Ko(d,m,T,C,I)}catch(ne){if(mt(W),ne!==ne+0)throw ne;gt(1,0)}}function Rl(d,m,T,C,I,W,ne){var ye=ft();try{return Ho(d,m,T,C,I,W,ne)}catch(Ee){if(mt(ye),Ee!==Ee+0)throw Ee;gt(1,0)}}function ca(d,m,T,C,I,W,ne){var ye=ft();try{return vi(d,m,T,C,I,W,ne)}catch(Ee){if(mt(ye),Ee!==Ee+0)throw Ee;gt(1,0)}}return n.stackSave=()=>ft(),n.stackRestore=d=>mt(d),n.stackAlloc=d=>An(d),n.setValue=function(d,m,T="i8"){switch(T.endsWith("*")&&(T="*"),T){case"i1":case"i8":N()[d>>>0]=m;break;case"i16":G()[d>>>1>>>0]=m;break;case"i32":X()[d>>>2>>>0]=m;break;case"i64":H[d>>>3]=BigInt(m);break;case"float":_e()[d>>>2>>>0]=m;break;case"double":ke()[d>>>3>>>0]=m;break;case"*":we()[d>>>2>>>0]=m;break;default:Ie(`invalid type for setValue: ${T}`)}},n.getValue=function(d,m="i8"){switch(m.endsWith("*")&&(m="*"),m){case"i1":case"i8":return N()[d>>>0];case"i16":return G()[d>>>1>>>0];case"i32":return X()[d>>>2>>>0];case"i64":return H[d>>>3];case"float":return _e()[d>>>2>>>0];case"double":return ke()[d>>>3>>>0];case"*":return we()[d>>>2>>>0];default:Ie(`invalid type for getValue: ${m}`)}},n.UTF8ToString=zt,n.stringToUTF8=Er,n.lengthBytesUTF8=hs,function d(){if(0{_d(),bd=typeof location>"u"?void 0:location.origin,vd=self.location.href>"file:"&&self.location.href<"file;",lp=()=>{{if(vd){let e=URL;return new URL(new e("ort.bundle.min.mjs",self.location.href).href,bd).href}return self.location.href}},Rr=lp(),dp=()=>{if(Rr&&!Rr.startsWith("blob:"))return Rr.substring(0,Rr.lastIndexOf("/")+1)},ga=(e,r)=>{try{let t=r??Rr;return(t?new URL(e,t):new URL(e)).origin===bd}catch{return!1}},cp=(e,r)=>{let t=r??Rr;try{return(t?new URL(e,t):new URL(e)).href}catch{return}},up=(e,r)=>`${r??"./"}${e}`,Td=async e=>{let r=await(await fetch(e,{credentials:"same-origin"})).blob();return URL.createObjectURL(r)},pp=async e=>(await import(e)).default,xd=(av(),fa(sp)).default,hp=async()=>{if(!Rr)throw new Error("Failed to load proxy worker: cannot determine the script source URL.");if(ga(Rr))return[void 0,xd()];let e=await Td(Rr);return[e,xd(e)]},Ed=(lv(),fa(ip)).default,mp=async(e,r,t)=>{if(!e&&!r&&Ed&&Rr&&ga(Rr))return[void 0,Ed];{let s="ort-wasm-simd-threaded.jsep.mjs",i=e??cp(s,r),n=t&&i&&!ga(i,r),o=n?await Td(i):i??up(s,r);return[n?o:void 0,await pp(o)]}}}),Cd,wa,Ai,Sd,fp,_p,$d,ar,hn=Ve(()=>{Pd(),wa=!1,Ai=!1,Sd=!1,fp=()=>{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}},_p=()=>{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}},$d=async e=>{if(wa)return Promise.resolve();if(Ai)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(Sd)throw new Error("previous call to 'initializeWebAssembly()' failed.");Ai=!0;let r=e.initTimeout,t=e.numThreads;if(!_p())throw new Error("WebAssembly SIMD is not supported in the current environment.");let s=fp();t>1&&!s&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+t+", 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=t=1);let i=e.wasmPaths,n=typeof i=="string"?i:void 0,o=i==null?void 0:i.mjs,a=(o==null?void 0:o.href)??o,l=i==null?void 0:i.wasm,c=(l==null?void 0:l.href)??l,p=e.wasmBinary,[u,h]=await mp(a,n,t>1),g=!1,_=[];if(r>0&&_.push(new Promise(P=>{setTimeout(()=>{g=!0,P()},r)})),_.push(new Promise((P,A)=>{let v={numThreads:t};if(p)v.wasmBinary=p;else if(c||n)v.locateFile=y=>c??n+y;else if(a&&a.indexOf("blob:")!==0)v.locateFile=y=>new URL(y,a).href;else if(u){let y=dp();y&&(v.locateFile=k=>y+k)}h(v).then(y=>{Ai=!1,wa=!0,Cd=y,P(),u&&URL.revokeObjectURL(u)},y=>{Ai=!1,Sd=!0,A(y)})})),await Promise.race(_),g)throw new Error(`WebAssembly backend initializing failed due to timeout: ${r}ms`)},ar=()=>{if(wa&&Cd)return Cd;throw new Error("WebAssembly is not initialized yet.")}}),Mr,ya,At,kd=Ve(()=>{hn(),Mr=(e,r)=>{let t=ar(),s=t.lengthBytesUTF8(e)+1,i=t._malloc(s);return t.stringToUTF8(e,i,s),r.push(i),i},ya=(e,r,t,s)=>{if(typeof e=="object"&&e!==null){if(t.has(e))throw new Error("Circular reference in options");t.add(e)}Object.entries(e).forEach(([i,n])=>{let o=r?r+i:i;if(typeof n=="object")ya(n,o+".",t,s);else if(typeof n=="string"||typeof n=="number")s(o,n.toString());else if(typeof n=="boolean")s(o,n?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof n}`)})},At=e=>{let r=ar(),t=r.stackSave();try{let s=r.PTR_SIZE,i=r.stackAlloc(2*s);r._OrtGetLastError(i,i+s);let n=Number(r.getValue(i,s===4?"i32":"i64")),o=r.getValue(i+s,"*"),a=o?r.UTF8ToString(o):"";throw new Error(`${e} ERROR_CODE: ${n}, ERROR_MESSAGE: ${a}`)}finally{r.stackRestore(t)}}}),gp,dv=Ve(()=>{hn(),kd(),gp=e=>{let r=ar(),t=0,s=[],i=e||{};try{if((e==null?void 0:e.logSeverityLevel)===void 0)i.logSeverityLevel=2;else if(typeof e.logSeverityLevel!="number"||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if((e==null?void 0:e.logVerbosityLevel)===void 0)i.logVerbosityLevel=0;else if(typeof e.logVerbosityLevel!="number"||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);(e==null?void 0:e.terminate)===void 0&&(i.terminate=!1);let n=0;return(e==null?void 0:e.tag)!==void 0&&(n=Mr(e.tag,s)),t=r._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,n),t===0&&At("Can't create run options."),(e==null?void 0:e.extra)!==void 0&&ya(e.extra,"",new WeakSet,(o,a)=>{let l=Mr(o,s),c=Mr(a,s);r._OrtAddRunConfigEntry(t,l,c)!==0&&At(`Can't set a run config entry: ${o} - ${a}.`)}),[t,s]}catch(n){throw t!==0&&r._OrtReleaseRunOptions(t),s.forEach(o=>r._free(o)),n}}}),wp,yp,Mp,bp,vp,cv=Ve(()=>{hn(),kd(),wp=e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}},yp=e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}},Mp=e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});let r=e.extra.session;r.use_ort_model_bytes_directly||(r.use_ort_model_bytes_directly="1"),e.executionProviders&&e.executionProviders.some(t=>(typeof t=="string"?t:t.name)==="webgpu")&&(e.enableMemPattern=!1)},bp=(e,r,t)=>{for(let s of r){let i=typeof s=="string"?s:s.name;switch(i){case"webnn":if(i="WEBNN",typeof s!="string"){let o=s==null?void 0:s.deviceType;if(o){let a=Mr("deviceType",t),l=Mr(o,t);ar()._OrtAddSessionConfigEntry(e,a,l)!==0&&At(`Can't set a session config entry: 'deviceType' - ${o}.`)}}break;case"webgpu":if(i="JS",typeof s!="string"){let o=s;if(o!=null&&o.preferredLayout){if(o.preferredLayout!=="NCHW"&&o.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${o.preferredLayout}`);let a=Mr("preferredLayout",t),l=Mr(o.preferredLayout,t);ar()._OrtAddSessionConfigEntry(e,a,l)!==0&&At(`Can't set a session config entry: 'preferredLayout' - ${o.preferredLayout}.`)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${i}`)}let n=Mr(i,t);ar()._OrtAppendExecutionProvider(e,n)!==0&&At(`Can't append execution provider: ${i}.`)}},vp=e=>{let r=ar(),t=0,s=[],i=e||{};Mp(i);try{let n=wp(i.graphOptimizationLevel??"all"),o=yp(i.executionMode??"sequential"),a=typeof i.logId=="string"?Mr(i.logId,s):0,l=i.logSeverityLevel??2;if(!Number.isInteger(l)||l<0||l>4)throw new Error(`log serverity level is not valid: ${l}`);let c=i.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw new Error(`log verbosity level is not valid: ${c}`);let p=typeof i.optimizedModelFilePath=="string"?Mr(i.optimizedModelFilePath,s):0;if(t=r._OrtCreateSessionOptions(n,!!i.enableCpuMemArena,!!i.enableMemPattern,o,!!i.enableProfiling,0,a,l,c,p),t===0&&At("Can't create session options."),i.executionProviders&&bp(t,i.executionProviders,s),i.enableGraphCapture!==void 0){if(typeof i.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${i.enableGraphCapture}`);let u=Mr("enableGraphCapture",s),h=Mr(i.enableGraphCapture.toString(),s);r._OrtAddSessionConfigEntry(t,u,h)!==0&&At(`Can't set a session config entry: 'enableGraphCapture' - ${i.enableGraphCapture}.`)}if(i.freeDimensionOverrides)for(let[u,h]of Object.entries(i.freeDimensionOverrides)){if(typeof u!="string")throw new Error(`free dimension override name must be a string: ${u}`);if(typeof h!="number"||!Number.isInteger(h)||h<0)throw new Error(`free dimension override value must be a non-negative integer: ${h}`);let g=Mr(u,s);r._OrtAddFreeDimensionOverride(t,g,h)!==0&&At(`Can't set a free dimension override: ${u} - ${h}.`)}return i.extra!==void 0&&ya(i.extra,"",new WeakSet,(u,h)=>{let g=Mr(u,s),_=Mr(h,s);r._OrtAddSessionConfigEntry(t,g,_)!==0&&At(`Can't set a session config entry: ${u} - ${h}.`)}),[t,s]}catch(n){throw t!==0&&r._OrtReleaseSessionOptions(t)!==0&&At("Can't release session options."),s.forEach(o=>r._free(o)),n}}}),Rn,mn,fn,Id,Ma,Ad,Fd,Od,pt=Ve(()=>{Rn=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 new Error(`unsupported data type: ${e}`)}},mn=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 new Error(`unsupported data type: ${e}`)}},fn=(e,r)=>{let t=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][e],s=typeof r=="number"?r:r.reduce((i,n)=>i*n,1);return t>0?Math.ceil(s*t):void 0},Id=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 new Error(`unsupported type: ${e}`)}},Ma=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 new Error(`unsupported logging level: ${e}`)}},Ad=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",Fd=e=>e==="float32"||e==="float16"||e==="int32"||e==="int64"||e==="uint32"||e==="uint64"||e==="int8"||e==="uint8"||e==="bool"||e==="uint4"||e==="int4",Od=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 new Error(`unsupported data location: ${e}`)}}}),Dd,Tp=Ve(()=>{_d(),Dd=async e=>{if(typeof e=="string"){let r=await fetch(e);if(!r.ok)throw new Error(`failed to load external data file: ${e}`);let t=r.headers.get("Content-Length"),s=t?parseInt(t,10):0;if(s<1073741824)return new Uint8Array(await r.arrayBuffer());{if(!r.body)throw new Error(`failed to load external data file: ${e}, no response body.`);let i=r.body.getReader(),n;try{n=new ArrayBuffer(s)}catch(a){if(a instanceof RangeError){let l=Math.ceil(s/65536);n=new WebAssembly.Memory({initial:l,maximum:l}).buffer}else throw a}let o=0;for(;;){let{done:a,value:l}=await i.read();if(a)break;let c=l.byteLength;new Uint8Array(n,o,c).set(l),o+=c}return new Uint8Array(n,0,s)}}else return e instanceof Blob?new Uint8Array(await e.arrayBuffer()):e instanceof Uint8Array?e:new Uint8Array(e)}}),xp,Ep,Pp,Cp,Ld,Sp,St,Is=Ve(()=>{pt(),xp=["V","I","W","E","F"],Ep=(e,r)=>{console.log(`[${xp[e]},${new Date().toISOString()}]${r}`)},Ld=(e,r)=>{Pp=e,Cp=r},Sp=(e,r)=>{let t=Ma(e),s=Ma(Pp);t>=s&&Ep(t,typeof r=="function"?r():r)},St=(...e)=>{Cp&&Sp(...e)}}),zd,$p=Ve(()=>{pt(),zd=(e,r)=>new(Id(r))(e)}),Bd=Ve(()=>{}),Rd,ba,va,kp,Ip,Nd,jd,Ap,Fp,uv=Ve(()=>{Is(),Bd(),Rd=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]]),ba=[],va=e=>Math.ceil(Number(e)/16)*16,kp=e=>{for(let r=0;rIp++,jd=async(e,r,t,s)=>{let i=va(t),n=e.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});try{let o=e.getCommandEncoder();e.endComputePass(),o.copyBufferToBuffer(r,0,n,0,i),e.flush(),await n.mapAsync(GPUMapMode.READ);let a=n.getMappedRange();if(s){let l=s();return l.set(new Uint8Array(a,0,t)),l}else return new Uint8Array(a.slice(0,t))}finally{n.destroy()}},Ap=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[r]of Rd)ba.push(r),this.freeBuffers.set(r,[]),this.freeUniformBuffers.set(r,[]);this.sessionCount=0}upload(e,r){let t=r.buffer,s=r.byteOffset,i=r.byteLength,n=va(i),o=this.storageCache.get(e);if(!o)throw new Error("gpu data for uploading does not exist");if(Number(o.originalSize)!==i)throw new Error(`inconsistent data size. gpu data size=${o.originalSize}, data size=${i}`);let a=this.backend.device.createBuffer({mappedAtCreation:!0,size:n,usage:GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC}),l=a.getMappedRange();new Uint8Array(l).set(new Uint8Array(t,s,i)),a.unmap();let c=this.backend.device.createCommandEncoder();c.copyBufferToBuffer(a,0,o.gpuData.buffer,0,n),this.backend.device.queue.submit([c.finish()]),a.destroy(),St("verbose",()=>`[WebGPU] GpuDataManager.upload(id=${e})`)}memcpy(e,r){let t=this.storageCache.get(e);if(!t)throw new Error("source gpu data for memcpy does not exist");let s=this.storageCache.get(r);if(!s)throw new Error("destination gpu data for memcpy does not exist");if(t.originalSize!==s.originalSize)throw new Error("inconsistent source and destination gpu data size");let i=va(t.originalSize),n=this.backend.getCommandEncoder();this.backend.endComputePass(),n.copyBufferToBuffer(t.gpuData.buffer,0,s.gpuData.buffer,0,i)}registerExternalBuffer(e,r,t){let s;if(t){if(s=t[0],e===t[1])return St("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${s}, buffer is the same, skip.`),s;if(this.backend.capturedCommandList.has(this.backend.currentSessionId))throw new Error(`Registering a different external buffer under graph capture mode is not supported yet. + Please use the previous external buffer!`)}else s=Nd();return this.storageCache.set(s,{gpuData:{id:s,type:0,buffer:e},originalSize:r}),St("verbose",()=>`[WebGPU] GpuDataManager.registerExternalBuffer(size=${r}) => id=${s}, registered.`),s}unregisterExternalBuffer(e){e!==void 0&&(this.storageCache.delete(e),St("verbose",()=>`[WebGPU] GpuDataManager.unregisterExternalBuffer() => id=${e}`))}create(e,r=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST){let t=kp(e),s,i=(r&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE,n=(r&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM;if(i||n){let a=(i?this.freeBuffers:this.freeUniformBuffers).get(t);a?a.length>0?s=a.pop():s=this.backend.device.createBuffer({size:t,usage:r}):s=this.backend.device.createBuffer({size:t,usage:r})}else s=this.backend.device.createBuffer({size:t,usage:r});let o={id:Nd(),type:0,buffer:s};return this.storageCache.set(o.id,{gpuData:o,originalSize:Number(e)}),St("verbose",()=>`[WebGPU] GpuDataManager.create(size=${e}) => id=${o.id}`),o}get(e){var r;return(r=this.storageCache.get(e))==null?void 0:r.gpuData}release(e){let r=typeof e=="bigint"?Number(e):e,t=this.storageCache.get(r);if(!t){if(this.storageCache.size===0)return 0;throw new Error("releasing data does not exist")}return St("verbose",()=>`[WebGPU] GpuDataManager.release(id=${r}), gpuDataId=${t.gpuData.id}`),this.storageCache.delete(r),this.buffersPending.push(t.gpuData.buffer),t.originalSize}async download(e,r){let t=this.storageCache.get(Number(e));if(!t)throw new Error("data does not exist");await jd(this.backend,t.gpuData.buffer,t.originalSize,r)}refreshPendingBuffers(){if(this.buffersPending.length!==0)if(this.backend.sessionStatus==="default"){for(let e of this.buffersPending){let r=Rd.get(e.size);if((e.usage&GPUBufferUsage.STORAGE)===GPUBufferUsage.STORAGE){let t=this.freeBuffers.get(e.size)||[];r===void 0||t.length>=r?e.destroy():t.push(e)}else if((e.usage&GPUBufferUsage.UNIFORM)===GPUBufferUsage.UNIFORM){let t=this.freeUniformBuffers.get(e.size)||[];r===void 0||t.length>=r?e.destroy():t.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 r of this.buffersPending)e.push(r);this.buffersPending=[]}}dispose(){this.freeBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.freeUniformBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.storageCache.forEach(e=>{e.gpuData.buffer.destroy()}),this.capturedPendingBuffers.forEach(e=>{e.forEach(r=>{r.destroy()})}),this.storageCache=new Map,this.freeBuffers=new Map,this.freeUniformBuffers=new Map,this.capturedPendingBuffers=new Map}onCreateSession(){this.sessionCount+=1}onReleaseSession(e){let r=this.capturedPendingBuffers.get(e);r&&(r.forEach(t=>{t.destroy()}),this.capturedPendingBuffers.delete(e)),this.sessionCount-=1,this.sessionCount===0&&(St("warning",()=>"[WebGPU] Clearing webgpu buffer cache"),this.storageCache.forEach(t=>{t.gpuData.buffer.destroy()}),this.storageCache=new Map)}},Fp=(...e)=>new Ap(...e)}),Op,Dt,Yt=Ve(()=>{Op=class{constructor(e){Object.assign(this,e)}get cacheKey(){return this.key||(this.key=Object.getOwnPropertyNames(this).sort().map(e=>`${this[e]}`).join(";")),this.key}},Dt=e=>new Op(e)}),Dp,Nn,Te,Ta,Lp,zp,Bp,Mt=Ve(()=>{Dp=class{static calcMatMulShape(e,r){return e[1]!==r[0]?void 0:[e[0],r[1]]}},Nn=class{static calcShape(e,r,t=!1){let s=e.length,i=r.length;if(s===0)return r;if(i===0)return e;let n=Math.max(e.length,r.length),o=new Array(n);if(t){if(s<2||i<2)return;let a=Dp.calcMatMulShape([e[s-2],e[s-1]],[r[i-2],r[i-1]]);if(a===void 0)return;[o[n-2],o[n-1]]=a}for(let a=t?3:1;a<=n;a++){let l=s-a<0?1:e[s-a],c=i-a<0?1:r[i-a];if(l!==c&&l>1&&c>1)return;let p=Math.max(l,c);if(l&&c)o[n-a]=Math.max(l,c);else{if(p>1)return;o[n-a]=0}}return o}static isValidBroadcast(e,r){let t=e.length,s=r.length;if(t>s)return!1;for(let i=1;i<=t;i++)if(e[t-i]!==1&&e[t-i]!==r[s-i])return!1;return!0}},Te=class od{static size(r){return od.getSizeFromDimensionRange(r,0,r.length)}static convertShape(r,t=4){let s=r.length;if(s===0)return[];let i=new Array(s),n=s-1;for(;n>=0;){if(r[n]%t===0){i[n]=r[n]/t;break}if(t%r[n]!==0)throw new Error("cannot convert shape");i[n]=1,t/=r[n],n--}for(n--;n>=0;n--)i[n]=r[n];return i}static sizeFromDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${r.length} dimensions.`);return od.getSizeFromDimensionRange(r,t,r.length)}static sizeToDimension(r,t){if(t<0||t>r.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${r.length} dimensions.`);return od.getSizeFromDimensionRange(r,0,t)}static getSizeFromDimensionRange(r,t,s){let i=1;for(let n=t;n=0;--i)s[i]=s[i+1]*r[i+1];return s}static normalizeAxis(r,t){if(r<-t&&r>=t)throw new Error("unsupported axis for this operation.");return r<0?r+t:r}static normalizeAxes(r,t){return r.map(s=>this.normalizeAxis(s,t??r.length))}static sortBasedOnPerm(r,t){return t?t.map(s=>r[s]):r.slice().reverse()}static padShape(r,t){let s=r.length;return r.map((i,n)=>i+t[n]+t[n+s])}static areEqual(r,t){return r.length!==t.length?!1:r.every((s,i)=>s===t[i])}},Ta=class ha{static adjustPoolAttributes(r,t,s,i,n,o){if(!r&&s.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(r)for(let a=0;a=s.length?s.push(t[a+2]):s[a]=t[a+2];for(let a=0;a=s[a]||o[a+s.length]>=s[a])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(r,t,s,i,n,o,a){if(a){if(n.length!==2*(r.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==r.length-2)throw new Error("length of strides should be the length of data dimensions");if(i.length!==r.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let l=0;l{pt(),Mt(),jn=64,xa=(e,r)=>{if(r===3)throw new Error("vec3 has same alignment as vec4, use vec4 instead");switch(Number(e)){case 10:return r>1?`vec${r}`:"f16";case 1:return r>1?`vec${r}`:"f32";case 6:return r>1?`vec${r}`:"i32";case 12:return r>1?`vec${r}`:"u32";case 7:if(r>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2","i32"];case 13:if(r>1)throw new Error("currently not supported vecX of uint64 yet");return["vec2","u32"];case 9:if(r!==4)throw new Error("bool must be vec4");return["u32","vec4"];case 22:return"i32";case 21:return"u32";default:throw new Error(`Unknown data type: ${e}`)}},lr=(e,r=1)=>{let t=xa(e,r);return typeof t=="string"?t:t[0]},xr=(e,r=1)=>{let t=xa(e,r);return typeof t=="string"?t:t[1]},nt=(...e)=>{let r=[];return e.forEach(t=>{t.length!==0&&r.push({type:12,data:t},{type:12,data:Te.computeStrides(t)})}),r},Xt=e=>e%4===0?4:e%2===0?2:1,Vd=(e="f32",r,t="0")=>!r||r===1?`${e}(${t})`:`vec${r}<${e}>(${t})`,Vn=(e,r,t)=>e==="f32"?t:r===1?`f32(${t})`:`vec${r}(${t})`,Gs=(e,r)=>r===4?`(${e}.x + ${e}.y + ${e}.z + ${e}.w)`:r===2?`(${e}.x + ${e}.y)`:r===3?`(${e}.x + ${e}.y + ${e}.z)`:e,rt=(e,r,t,s)=>e.startsWith("uniforms.")&&t>4?typeof r=="string"?s==="f16"?`${e}[(${r}) / 8][(${r}) % 8 / 4][(${r}) % 8 % 4]`:`${e}[(${r}) / 4][(${r}) % 4]`:s==="f16"?`${e}[${Math.floor(r/8)}][${Math.floor(r%8/4)}][${r%8%4}]`:`${e}[${Math.floor(r/4)}][${r%4}]`:t>1?`${e}[${r}]`:e,Fi=(e,r,t,s,i)=>{let n=typeof t=="number",o=n?t:t.length,a=[...new Array(o).keys()],l=o<2?"u32":o<=4?`vec${o}`:`array`,c=xa(r,i),p=typeof c=="string"?c:c[1],u=typeof c=="string"?c:c[0],h={indices:l,value:p,storage:u,tensor:r},g=N=>typeof N=="string"?N:`${N}u`,_={offsetToIndices:!1,indicesToOffset:!1,broadcastedIndicesToOffset:!1,set:!1,setByIndices:!1,get:!1,getByIndices:!1},P=n?"uniforms.":"",A=`${P}${e}_shape`,v=`${P}${e}_strides`,y="";for(let N=0;N ${h.indices} { + var indices: ${h.indices}; + var current = offset; + ${y} + return indices; + }`,E=N=>(_.offsetToIndices=!0,o<2?N:`o2i_${e}(${N})`),M=[];if(o>=2)for(let N=o-1;N>=0;N--)M.push(`${rt(v,N,o)} * (indices[${N}])`);let w=o<2?"":` + fn i2o_${e}(indices: ${h.indices}) -> u32 { + return ${M.join("+")}; + }`,x=N=>(_.indicesToOffset=!0,o<2?N:`i2o_${e}(${N})`),$=(...N)=>o===0?"0u":`${h.indices}(${N.map(g).join(",")})`,z=(N,O)=>o<2?`${N}`:`${rt(N,O,o)}`,R=(N,O,G)=>o<2?`${N}=${G};`:`${rt(N,O,o)}=${G};`,Q={},q=(N,O)=>{_.broadcastedIndicesToOffset=!0;let G=`${O.name}broadcastedIndicesTo${e}Offset`;if(G in Q)return`${G}(${N})`;let se=[];for(let X=o-1;X>=0;X--){let we=O.indicesGet("outputIndices",X+O.rank-o);se.push(`${z(v,X)} * (${we} % ${z(A,X)})`)}return Q[G]=`fn ${G}(outputIndices: ${O.type.indices}) -> u32 { + return ${se.length>0?se.join("+"):"0u"}; + }`,`${G}(${N})`},U=(N,O)=>(()=>{if(h.storage===h.value)return`${e}[${N}]=${O};`;if(h.storage==="vec2"&&h.value==="i32")return`${e}[${N}]=vec2(u32(${O}), select(0u, 0xFFFFFFFFu, ${O} < 0));`;if(h.storage==="vec2"&&h.value==="u32")return`${e}[${N}]=vec2(u32(${O}), 0u);`;if(h.storage==="u32"&&h.value==="vec4")return`${e}[${N}]=dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(${O}));`;throw new Error(`not supported combination of storage type ${h.storage} and value type ${h.value} yet`)})(),Z=N=>(()=>{if(h.storage===h.value)return`${e}[${N}]`;if(h.storage==="vec2"&&h.value==="i32")return`i32(${e}[${N}].x)`;if(h.storage==="vec2"&&h.value==="u32")return`u32(${e}[${N}].x)`;if(h.storage==="u32"&&h.value==="vec4")return`vec4(bool(${e}[${N}] & 0xFFu), bool(${e}[${N}] & 0xFF00u), bool(${e}[${N}] & 0xFF0000u), bool(${e}[${N}] & 0xFF000000u))`;throw new Error(`not supported combination of storage type ${h.storage} and value type ${h.value} yet`)})(),H=o<2?"":` + fn get_${e}ByIndices(indices: ${h.indices}) -> ${p} { + return ${Z(`i2o_${e}(indices)`)}; + }`,J=o<2?"":(()=>{let N=a.map(G=>`d${G}: u32`).join(", "),O=a.map(G=>`d${G}`).join(", ");return` + fn get_${e}(${N}) -> ${p} { + return get_${e}ByIndices(${$(O)}); + }`})(),ie=(...N)=>{if(N.length!==o)throw new Error(`indices length must be ${o}`);let O=N.map(g).join(",");return o===0?Z("0u"):o===1?Z(O[0]):(_.get=!0,_.getByIndices=!0,_.indicesToOffset=!0,`get_${e}(${O})`)},ae=N=>o<2?Z(N):(_.getByIndices=!0,_.indicesToOffset=!0,`get_${e}ByIndices(${N})`),ce=o<2?"":` + fn set_${e}ByIndices(indices: ${h.indices}, value: ${p}) { + ${U(`i2o_${e}(indices)`,"value")} + }`,he=o<2?"":(()=>{let N=a.map(G=>`d${G}: u32`).join(", "),O=a.map(G=>`d${G}`).join(", ");return` + fn set_${e}(${N}, value: ${p}) { + set_${e}ByIndices(${$(O)}, value); + }`})();return{impl:()=>{let N=[],O=!1;return _.offsetToIndices&&(N.push(k),O=!0),_.indicesToOffset&&(N.push(w),O=!0),_.broadcastedIndicesToOffset&&(Object.values(Q).forEach(G=>N.push(G)),O=!0),_.set&&(N.push(he),O=!0),_.setByIndices&&(N.push(ce),O=!0),_.get&&(N.push(J),O=!0),_.getByIndices&&(N.push(H),O=!0),!n&&O&&N.unshift(`const ${A} = ${h.indices}(${t.join(",")});`,`const ${v} = ${h.indices}(${Te.computeStrides(t).join(",")});`),N.join(` +`)},type:h,offsetToIndices:E,indicesToOffset:x,broadcastedIndicesToOffset:q,indices:$,indicesGet:z,indicesSet:R,set:(...N)=>{if(N.length!==o+1)throw new Error(`indices length must be ${o}`);let O=N[o];if(typeof O!="string")throw new Error("value must be string");let G=N.slice(0,o).map(g).join(",");return o===0?U("0u",O):o===1?U(G[0],O):(_.set=!0,_.setByIndices=!0,_.indicesToOffset=!0,`set_${e}(${G}, ${O})`)},setByOffset:U,setByIndices:(N,O)=>o<2?U(N,O):(_.setByIndices=!0,_.indicesToOffset=!0,`set_${e}ByIndices(${N}, ${O});`),get:ie,getByOffset:Z,getByIndices:ae,usage:s,name:e,strides:v,shape:A,rank:o}},$e=(e,r,t,s=1)=>Fi(e,r,t,"input",s),tt=(e,r,t,s=1)=>Fi(e,r,t,"output",s),Rp=(e,r,t)=>Fi(e,r,t,"atomicOutput",1),Ud=(e,r,t,s=1)=>Fi(e,r,t,"internal",s),Np=class{constructor(e,r){this.normalizedDispatchGroup=e,this.limits=r,this.internalVariables=[],this.variables=[],this.uniforms=[],this.variableIndex=0}guardAgainstOutOfBoundsWorkgroupSizes(e){return`if (global_idx >= ${typeof e=="number"?`${e}u`:e}) { return; }`}mainStart(e=jn){let r=typeof e=="number"?e:e[0],t=typeof e=="number"?1:e[1],s=typeof e=="number"?1:e[2];if(r>this.limits.maxComputeWorkgroupSizeX||t>this.limits.maxComputeWorkgroupSizeY||s>this.limits.maxComputeWorkgroupSizeZ)throw new Error(`workgroup size [${r}, ${t}, ${s}] exceeds the maximum workgroup size [${this.limits.maxComputeWorkgroupSizeX}, ${this.limits.maxComputeWorkgroupSizeY}, ${this.limits.maxComputeWorkgroupSizeZ}].`);if(r*t*s>this.limits.maxComputeInvocationsPerWorkgroup)throw new Error(`workgroup size [${r}, ${t}, ${s}] exceeds the maximum workgroup invocations ${this.limits.maxComputeInvocationsPerWorkgroup}.`);let i=this.normalizedDispatchGroup[1]===1&&this.normalizedDispatchGroup[2]===1,n=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, + @builtin(local_invocation_id) local_id : vec3, + @builtin(local_invocation_index) local_idx : u32, + @builtin(workgroup_id) workgroup_id : vec3, + @builtin(num_workgroups) num_workgroups : vec3`,o=i?`let global_idx = global_id.x; + let workgroup_index = workgroup_id.x;`:`let workgroup_index = workgroup_id.z * num_workgroups[0] * num_workgroups[1] + + workgroup_id.y * num_workgroups[0] + workgroup_id.x; + let global_idx = workgroup_index * ${r*t*s}u + local_idx;`;return`@compute @workgroup_size(${r}, ${t}, ${s}) + fn main(${n}) { + ${o} + `}appendVariableUniforms(e){e.rank!==0&&(e.shape.startsWith("uniforms.")&&this.uniforms.push({name:e.shape.replace("uniforms.",""),type:"u32",length:e.rank}),e.strides.startsWith("uniforms.")&&this.uniforms.push({name:e.strides.replace("uniforms.",""),type:"u32",length:e.rank}))}declareVariable(e,r){if(e.usage==="internal")throw new Error("cannot use internal variable with declareVariable(). use registerInternalVariables() instead.");this.variables.push(e),this.appendVariableUniforms(e);let t=e.usage==="input"?"read":"read_write",s=e.usage==="atomicOutput"?"atomic":e.type.storage;return`@group(0) @binding(${r}) var ${e.name}: array<${s}>;`}declareVariables(...e){return e.map(r=>this.declareVariable(r,this.variableIndex++)).join(` +`)}registerInternalVariable(e){if(e.usage!=="internal")throw new Error("cannot use input or output variable with registerInternalVariable(). use declareVariables() instead.");this.internalVariables.push(e),this.appendVariableUniforms(e)}registerInternalVariables(...e){return e.forEach(r=>this.registerInternalVariable(r)),this}registerUniform(e,r,t=1){return this.uniforms.push({name:e,type:r,length:t}),this}registerUniforms(e){return this.uniforms=this.uniforms.concat(e),this}uniformDeclaration(){if(this.uniforms.length===0)return"";let e=[];for(let{name:r,type:t,length:s}of this.uniforms)if(s&&s>4)t==="f16"?e.push(`@align(16) ${r}:array, ${Math.ceil(s/8)}>`):e.push(`${r}:array, ${Math.ceil(s/4)}>`);else{let i=s==null||s===1?t:`vec${s}<${t}>`;e.push(`${r}:${i}`)}return` + 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=r=>[12,10,1,6][["u32","f16","f32","i32"].indexOf(r)];return this.uniforms.map(r=>[e(r.type),r.length??1])}},jp=(e,r)=>new Np(e,r)}),Vp,Wd,Up,Wp,Gp,Kp,Nr,Hp,qp,Ks=Ve(()=>{pt(),Mt(),Yt(),Tt(),Vp=(e,r)=>{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(r.length!==0&&r.length!==e[0].dims.length)throw new Error(`perm size ${r.length} does not match input rank ${e[0].dims.length}`)},Wd=(e,r)=>r.length!==0?r:[...new Array(e).keys()].reverse(),Up=(e,r)=>Te.sortBasedOnPerm(e,Wd(e.length,r)),Wp=(e,r,t,s)=>{let i=`fn perm(i: ${s.type.indices}) -> ${t.type.indices} { + var a: ${t.type.indices};`;for(let n=0;n{let t=[],s=[];for(let i=0;i{let t=0;for(let s=0;s{let t=e.dataType,s=e.dims.length,i=Wd(s,r),n=Up(e.dims,i),o=e.dims,a=n,l=s<2||Kp(i,e.dims),c;if(l)return c=_=>{let P=$e("input",t,o,4),A=tt("output",t,a,4);return` + ${_.registerUniform("output_size","u32").declareVariables(P,A)} + ${_.mainStart()} + ${_.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + output[global_idx] = input[global_idx]; + }`},{name:"TransposeCopy",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let _=Te.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(_/64/4)},programUniforms:[{type:12,data:Math.ceil(_/4)}]}},getShaderSource:c};let{newShape:p,newPerm:u}=Gp(e.dims,i),h=Te.areEqual(u,[2,3,1]),g=Te.areEqual(u,[3,1,2]);if(p.length===2||h||g){o=h?[p[0],p[1]*p[2]]:g?[p[0]*p[1],p[2]]:p,a=[o[1],o[0]];let _=16;return c=P=>{let A=$e("a",t,o.length),v=tt("output",t,a.length);return` + ${P.registerUniform("output_size","u32").declareVariables(A,v)} + var tile : array, ${_}>; + ${P.mainStart([_,_,1])} + let stride = (uniforms.output_shape[1] - 1) / ${_} + 1; + let workgroup_id_x = workgroup_index % stride; + let workgroup_id_y = workgroup_index / stride; + let input_col = workgroup_id_y * ${_}u + local_id.x; + let input_row = workgroup_id_x * ${_}u + local_id.y; + if (input_row < uniforms.a_shape[0] && input_col < uniforms.a_shape[1]) { + tile[local_id.y][local_id.x] = ${A.getByIndices(`${A.type.indices}(input_row, input_col)`)}; + } + workgroupBarrier(); + + let output_col = workgroup_id_x * ${_}u + local_id.x; + let output_row = workgroup_id_y * ${_}u + local_id.y; + if (output_row < uniforms.output_shape[0] && output_col < uniforms.output_shape[1]) { + ${v.setByIndices(`${v.type.indices}(output_row, output_col)`,"tile[local_id.x][local_id.y]")} + } + }`},{name:"TransposeShared",shaderCache:{inputDependencies:["type"]},getRunData:()=>{let P=Te.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(a[1]/_),y:Math.ceil(a[0]/_)},programUniforms:[{type:12,data:P},...nt(o,a)]}},getShaderSource:c}}return c=_=>{let P=$e("a",t,o.length),A=tt("output",t,a.length);return` + ${_.registerUniform("output_size","u32").declareVariables(P,A)} + + ${Wp(i,s,P,A)} + + ${_.mainStart()} + ${_.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + + let indices = ${A.offsetToIndices("global_idx")}; + let aIndices = perm(indices); + + ${A.setByOffset("global_idx",P.getByIndices("aIndices"))} + }`},{name:"Transpose",shaderCache:{hint:`${r}`,inputDependencies:["rank"]},getRunData:()=>{let _=Te.size(n);return{outputs:[{dims:n,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:[{type:12,data:_},...nt(o,a)]}},getShaderSource:c}},Hp=(e,r)=>{Vp(e.inputs,r.perm),e.compute(Nr(e.inputs[0],r.perm))},qp=e=>Dt({perm:e.perm})}),Qp,Xp,Jp,Yp,Zp,eh,th,rh,sh,nh,ns,ih,oh,ah,lh,dh,ch,uh,ph,hh,mh,pv=Ve(()=>{pt(),Mt(),Tt(),Kd(),Ks(),Qp={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"},Xp={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"},Jp={max:"_A[offset]",min:"_A[offset]",mean:"0",sum:"0",prod:"1",sumSquare:"0",logSumExp:"0",l1:"0",l2:"0",logSum:"0"},Yp={max:"bestValue",min:"bestValue",sum:"bestValue",prod:"bestValue",sumSquare:"bestValue",logSumExp:"log(bestValue)",l1:"bestValue",l2:"sqrt(bestValue)",logSum:"log(bestValue)"},Zp=(e,r)=>{let t=[];for(let s=r-e;s{let t=[],s=e.length;for(let n=0;ne[n]);return[t,i]},th=(e,r)=>{let t=e.length+r.length,s=[],i=0;for(let n=0;n{for(let t=0;t{let t=[];if(!rh(e,r)){for(let s=0;st.push(s))}return t},nh=(e,r,t,s,i,n,o)=>{let a=t[0].dims,l=Te.size(n),c=Te.size(o),p=$e("_A",t[0].dataType,a),u=tt("output",i,n),h=64;l===1&&(h=256);let g=` + var aBestValues : array; + `,_=P=>` + ${P.registerUniform("reduceSize","u32").declareVariables(p,u)} + ${g} + fn DIV_CEIL(a : u32, b : u32) -> u32 { + return ((a - 1u) / b + 1u); + } + ${P.mainStart(h)} + + let outputIndex = global_idx / ${h}; + let offset = outputIndex * uniforms.reduceSize; + + var bestValue = f32(${Jp[s]}); + let Length = uniforms.reduceSize; + for (var k = local_idx; k < Length; k = k + ${h}) { + let candidate = f32(${p.getByOffset("offset + k")}); + bestValue = ${Qp[s]}; + } + aBestValues[local_idx] = bestValue; + workgroupBarrier(); + + var reduceSize = min(Length, ${h}u); + for (var currentSize = reduceSize / 2u; reduceSize > 1u; + currentSize = reduceSize / 2u) { + let interval = DIV_CEIL(reduceSize, 2u); + if (local_idx < currentSize) { + let candidate = aBestValues[local_idx + interval]; + bestValue = ${Xp[s]}; + aBestValues[local_idx] = bestValue; + } + reduceSize = interval; + workgroupBarrier(); + } + + if (local_idx == 0u) { + ${u.setByOffset("outputIndex",`${s==="mean"?`${u.type.storage}(bestValue / f32(uniforms.reduceSize))`:`${u.type.storage}(${Yp[s]})`}`)}; + } + }`;return{name:e,shaderCache:{hint:`${r};${h}`,inputDependencies:["type"]},getShaderSource:_,getRunData:()=>({outputs:[{dims:n,dataType:i}],dispatchGroup:{x:l},programUniforms:[{type:12,data:c}]})}},ns=(e,r,t,s)=>{let i=e.inputs.length===1?t:Gd(e.inputs,t),n=i.axes;n.length===0&&!i.noopWithEmptyAxes&&(n=e.inputs[0].dims.map((g,_)=>_));let o=Te.normalizeAxes(n,e.inputs[0].dims.length),a=o,l=e.inputs[0],c=sh(a,e.inputs[0].dims.length);c.length>0&&(l=e.compute(Nr(e.inputs[0],c),{inputs:[0],outputs:[-1]})[0],a=Zp(a.length,l.dims.length));let[p,u]=eh(l.dims,a),h=p;i.keepDims&&(h=th(p,o)),e.compute(nh(r,i.cacheKey,[l],s,e.inputs[0].dataType,h,u),{inputs:[l]})},ih=(e,r)=>{ns(e,"ReduceMeanShared",r,"mean")},oh=(e,r)=>{ns(e,"ReduceL1Shared",r,"l1")},ah=(e,r)=>{ns(e,"ReduceL2Shared",r,"l2")},lh=(e,r)=>{ns(e,"ReduceLogSumExpShared",r,"logSumExp")},dh=(e,r)=>{ns(e,"ReduceMaxShared",r,"max")},ch=(e,r)=>{ns(e,"ReduceMinShared",r,"min")},uh=(e,r)=>{ns(e,"ReduceProdShared",r,"prod")},ph=(e,r)=>{ns(e,"ReduceSumShared",r,"sum")},hh=(e,r)=>{ns(e,"ReduceSumSquareShared",r,"sumSquare")},mh=(e,r)=>{ns(e,"ReduceLogSumShared",r,"logSum")}}),is,fh,Ea,Gd,os,_h,gh,wh,yh,Mh,bh,vh,Th,xh,Eh,as,Ph,Ch,Sh,$h,kh,Ih,Ah,Fh,Oh,Dh,Kd=Ve(()=>{pt(),Mt(),Yt(),Tt(),pv(),is=e=>{if(!e||e.length===0||e.length>2)throw new Error("Reduce op requires 1 or 2 inputs.");if(e.length===2&&e[1].dims.length!==1)throw new Error("Invalid axes input dims.")},fh=e=>["","",`var value = ${e.getByIndices("input_indices")};`,""],Ea=(e,r,t,s,i,n,o=!1,a=!1)=>{let l=[],c=t[0].dims,p=c.length,u=Te.normalizeAxes(i,p),h=!a&&u.length===0;c.forEach((P,A)=>{h||u.indexOf(A)>=0?o&&l.push(1):l.push(P)});let g=l.length,_=Te.size(l);return{name:e,shaderCache:r,getShaderSource:P=>{let A=[],v=$e("_A",t[0].dataType,p),y=tt("output",n,g),k=s(v,y,u),E=k[2];for(let M=0,w=0;M=0?(o&&w++,E=`for(var j${M}: u32 = 0; j${M} < ${c[M]}; j${M}++) { + ${k[2].includes("last_index")?`let last_index = j${M};`:""} + ${v.indicesSet("input_indices",M,`j${M}`)} + ${E} + }`):(A.push(`${v.indicesSet("input_indices",M,y.indicesGet("output_indices",w))};`),w++);return` + + ${P.registerUniform("output_size","u32").declareVariables(v,y)} + + ${P.mainStart()} + ${P.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + var input_indices: ${v.type.indices}; + let output_indices = ${y.offsetToIndices("global_idx")}; + + ${A.join(` +`)} + ${k[0]} // init ops for reduce max/min + ${k[1]} + ${E} + ${k[3]} + ${k.length===4?y.setByOffset("global_idx","value"):k.slice(4).join(` +`)} + }`},getRunData:()=>({outputs:[{dims:l,dataType:n}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:[{type:12,data:_},...nt(c,l)]})}},Gd=(e,r)=>{let t=[];return e[1].dims[0]>0&&e[1].getBigInt64Array().forEach(s=>t.push(Number(s))),Dt({axes:t,keepDims:r.keepDims,noopWithEmptyAxes:r.noopWithEmptyAxes})},os=(e,r,t,s)=>{let i=e.inputs,n=i.length===1?t:Gd(i,t);e.compute(Ea(r,{hint:n.cacheKey,inputDependencies:["rank"]},[i[0]],n.noopWithEmptyAxes&&n.axes.length===0?fh:s,n.axes,i[0].dataType,n.keepDims,n.noopWithEmptyAxes),{inputs:[0]})},_h=(e,r)=>{is(e.inputs),os(e,"ReduceLogSum",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += ${t.getByIndices("input_indices")};`,"value = log(value);"])},gh=(e,r)=>{is(e.inputs),os(e,"ReduceL1",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += abs(${t.getByIndices("input_indices")});`,""])},wh=(e,r)=>{is(e.inputs),os(e,"ReduceL2",r,(t,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,"",`t = ${t.getByIndices("input_indices")}; value += (t * t);`,"value = sqrt(value);"])},yh=(e,r)=>{is(e.inputs),os(e,"ReduceLogSumExp",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += exp(${t.getByIndices("input_indices")});`,"value = log(value);"])},Mh=(e,r)=>{is(e.inputs),os(e,"ReduceMax",r,(t,s,i)=>{let n=[];for(let o=0;o=0||i.length===0)&&n.push(t.indicesSet("input_indices",o,0));return[`${n.join(` +`)}`,`var value = ${t.getByIndices("input_indices")};`,`value = max(value, ${t.getByIndices("input_indices")});`,""]})},bh=(e,r)=>{is(e.inputs),os(e,"ReduceMean",r,(t,s,i)=>{let n=1;for(let o=0;o=0||i.length===0)&&(n*=e.inputs[0].dims[o]);return["var sum = f32(0);","",`sum += f32(${t.getByIndices("input_indices")});`,`let value = ${s.type.value}(sum / ${n});`]})},vh=(e,r)=>{is(e.inputs),os(e,"ReduceMin",r,(t,s,i)=>{let n=[];for(let o=0;o=0||i.length===0)&&n.push(`input_indices[${o}] = 0;`);return[`${n.join(` +`)}`,`var value = ${t.getByIndices("input_indices")};`,`value = min(value, ${t.getByIndices("input_indices")});`,""]})},Th=(e,r)=>{is(e.inputs),os(e,"ReduceProd",r,(t,s)=>[`var value = ${s.type.storage}(1);`,"",`value *= ${t.getByIndices("input_indices")};`,""])},xh=(e,r)=>{is(e.inputs),os(e,"ReduceSum",r,(t,s)=>[`var value = ${s.type.storage}(0);`,"",`value += ${t.getByIndices("input_indices")};`,""])},Eh=(e,r)=>{is(e.inputs),os(e,"ReduceSumSquare",r,(t,s)=>[`var t = ${s.type.value}(0); var value = ${s.type.value}(0);`,"",`t = ${t.getByIndices("input_indices")}; value += t * t;`,""])},as=(e,r,t)=>{if(r.length===0)return t;let s=1,i=1;for(let n=0;n1024},Ph=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?bh(e,r):ih(e,r)},Ch=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?gh(e,r):oh(e,r)},Sh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?wh(e,r):ah(e,r)},$h=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?yh(e,r):lh(e,r)},kh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?Mh(e,r):dh(e,r)},Ih=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?vh(e,r):ch(e,r)},Ah=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?Th(e,r):uh(e,r)},Fh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?xh(e,r):ph(e,r)},Oh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?Eh(e,r):hh(e,r)},Dh=(e,r)=>{as(e.inputs[0].dims,r.axes,r.noopWithEmptyAxes)?_h(e,r):mh(e,r)}}),Hd,Lh,zh,qd,hv=Ve(()=>{pt(),Yt(),Kd(),Hd=e=>{if(!e||e.length===0||e.length>2)throw new Error("ArgMinMaxOp op requires 1 or 2 inputs.");if(e[0].dataType!==1)throw new Error("Invalid input type.")},Lh=(e,r)=>{Hd(e.inputs);let t=(s,i,n)=>{let o=[];for(let a=0;a=0||n.length===0)&&o.push(`input_indices[${a}] = 0;`);return[`${o.join(` +`)}`,`var value = ${s.getByIndices("input_indices")}; +var best_index : i32 = 0;`,`if (${s.getByIndices("input_indices")} ${r.selectLastIndex>0?"<=":"<"} value) { + value = ${s.getByIndices("input_indices")}; + best_index = i32(last_index); + }`,"",i.setByOffset("global_idx","best_index")]};e.compute(Ea("ArgMin",{hint:r.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},zh=(e,r)=>{Hd(e.inputs);let t=(s,i,n)=>{let o=[];for(let a=0;a=0||n.length===0)&&o.push(`input_indices[${a}] = 0;`);return[`${o.join(` +`)}`,`var value = ${s.getByIndices("input_indices")}; +var best_index : i32 = 0;`,`if (${s.getByIndices("input_indices")} ${r.selectLastIndex>0?">=":">"} value) { + value = ${s.getByIndices("input_indices")}; + best_index = i32(last_index); + }`,"",i.setByOffset("global_idx","best_index")]};e.compute(Ea("argMax",{hint:r.cacheKey,inputDependencies:["rank"]},[e.inputs[0]],t,[r.axis],7,r.keepDims),{inputs:[0]})},qd=e=>Dt(e)}),Bh,Pa,Rh,Nh,jh,Oi,Vh,Uh,Qd=Ve(()=>{pt(),Mt(),Bd(),Tt(),Bh=(e,r)=>{let t=e[0],s=e[1],i=e[2],n=e[3],o=e[4],a=e[5];if(o&&a)throw new Error("Attention cannot have both past and attention_bias");if(t.dims.length!==3)throw new Error('Input "input" must have 3 dimensions');let l=t.dims[0],c=t.dims[1],p=t.dims[2];if(i.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimensions');if(s.dims.length!==2)throw new Error('Input "weights" is expected to have 2 dimensions');if(s.dims[0]!==p)throw new Error("Input 1 dimension 0 should have same length as dimension 2 of input 0");if(i.dims[0]!==s.dims[1])throw new Error('Input "bias" dimension 0 should have same length as dimension 1 of input "weights"');let u=i.dims[0]/3,h=u,g=h;if(r.qkvHiddenSizes.length>0){if(r.qkvHiddenSizes.length!==3)throw new Error("qkv_hidden_sizes attribute should have 3 elements");for(let k of r.qkvHiddenSizes)if(k%r.numHeads!==0)throw new Error("qkv_hidden_sizes should be divisible by num_heads");u=r.qkvHiddenSizes[0],h=r.qkvHiddenSizes[1],g=r.qkvHiddenSizes[2]}let _=c;if(u!==h)throw new Error("qkv_hidden_sizes first element should be same as the second");if(i.dims[0]!==u+h+g)throw new Error('Input "bias" dimension 0 should have same length as sum of Q/K/V hidden sizes');let P=0;if(o){if(h!==g)throw new Error('Input "past" expect k_hidden_size == v_hidden_size');if(o.dims.length!==5)throw new Error('Input "past" must have 5 dimensions');if(o.dims[0]!==2)throw new Error('Input "past" first dimension must be 2');if(o.dims[1]!==l)throw new Error('Input "past" second dimension must be batch_size');if(o.dims[2]!==r.numHeads)throw new Error('Input "past" third dimension must be num_heads');if(o.dims[4]!==h/r.numHeads)throw new Error('Input "past" fifth dimension must be k_hidden_size / num_heads');r.pastPresentShareBuffer||(P=o.dims[3])}let A=_+P,v=-1,y=0;if(n)throw new Error("Mask not supported");if(o)throw new Error("past is not supported");if(a){if(a.dims.length!==4)throw new Error('Input "attention_bias" must have 4 dimensions');if(a.dims[0]!==l||a.dims[1]!==r.numHeads||a.dims[2]!==c||a.dims[3]!==A)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:l,sequenceLength:c,pastSequenceLength:P,kvSequenceLength:_,totalSequenceLength:A,maxSequenceLength:v,inputHiddenSize:p,hiddenSize:u,vHiddenSize:g,headSize:Math.floor(u/r.numHeads),vHeadSize:Math.floor(g/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:y,scale:r.scale,broadcastResPosBias:!1,passPastInKv:!1,qkvFormat:1}},Pa=(e,r,t)=>r&&e?` + let total_sequence_length_input = u32(${r.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; + let is_first_prompt: bool = is_subsequent_prompt == false && sequence_length == total_sequence_length_input; + total_sequence_length = u32(${e==null?void 0:e.getByOffset("batchIdx")}) + 1; + var past_sequence_length: u32 = 0; + if (is_first_prompt == false) { + past_sequence_length = total_sequence_length - sequence_length; + } + `:` + ${t?"let past_sequence_length = uniforms.past_sequence_length":""}; + let present_sequence_length = total_sequence_length; + `,Rh=(e,r,t,s,i,n,o,a)=>{let l=Xt(o?1:n),c=64,p=n/l;p{let y=tt("x",e.dataType,e.dims,l),k=[y],E=o?$e("seq_lens",o.dataType,o.dims):void 0;E&&k.push(E);let M=a?$e("total_sequence_length_input",a.dataType,a.dims):void 0;M&&k.push(M);let w=xr(e.dataType),x=[{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; + ${v.registerUniforms(x).declareVariables(...k)} + ${v.mainStart([c,1,1])} + let batchIdx = workgroup_id.z / uniforms.num_heads; + let headIdx = workgroup_id.z % uniforms.num_heads; + let sequence_length = uniforms.sequence_length; + var total_sequence_length = uniforms.total_sequence_length; + ${Pa(E,M,!1)} + let local_offset = local_idx * uniforms.elements_per_thread; + let offset = (global_idx / ${c}) * uniforms.total_sequence_length + local_offset; + let seq_causal_length = ${o?"u32(past_sequence_length + workgroup_id.y + 1)":"total_sequence_length"}; + var thread_max_vector = ${_}(-3.402823e+38f); + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + thread_max_vector = max(${_}(x[offset + i]), thread_max_vector); + } + thread_max[local_idx] = ${(()=>{switch(l){case 1:return"thread_max_vector";case 2:return"max(thread_max_vector.x, thread_max_vector.y)";case 4:return"max(max(thread_max_vector.x, thread_max_vector.y), max(thread_max_vector.z, thread_max_vector.w))";default:throw new Error(`Unsupported components: ${l}`)}})()}; + workgroupBarrier(); + + var max_value = f32(-3.402823e+38f); + for (var i = 0u; i < ${c}; i++) { + max_value = max(thread_max[i], max_value); + } + + var sum_vector = ${_}(0); + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + sum_vector += exp(${_}(x[offset + i]) - max_value); + } + thread_sum[local_idx] = ${(()=>{switch(l){case 1:return"sum_vector";case 2:return"sum_vector.x + sum_vector.y";case 4:return"sum_vector.x + sum_vector.y + sum_vector.z + sum_vector.w";default:throw new Error(`Unsupported components: ${l}`)}})()}; + workgroupBarrier(); + + var sum: f32 = 0; + for (var i = 0u; i < ${c}; i++) { + sum += thread_sum[i]; + } + + if (sum == 0) { + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + x[offset + i] = ${y.type.value}(${w}(1.0) / ${w}(seq_causal_length)); + } + } else { + for (var i: u32 = 0; i < uniforms.elements_per_thread && i + local_offset < seq_causal_length; i++) { + var f32input = ${_}(x[offset + i]); + x[offset + i] = ${y.type.value}(exp(f32input - max_value) / sum); + } + } + ${o?` + 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] = ${y.type.value}(${w}(0)); + }`:""}; + }`};return{name:"AttentionProbsSoftmax",shaderCache:{hint:`${c};${g};${l}`,inputDependencies:P},getShaderSource:A,getRunData:()=>({outputs:[],dispatchGroup:{x:1,y:i,z:r*t},programUniforms:h})}},Nh=(e,r,t,s,i,n,o,a,l)=>{let c=o+n.kvSequenceLength,p=[n.batchSize,n.numHeads,n.sequenceLength,c],u=e>1&&s,h=n.kvNumHeads?n.kvNumHeads:n.numHeads,g=u?[n.batchSize,h,c,n.headSize]:void 0,_=n.nReps?n.nReps:1,P=n.scale===0?1/Math.sqrt(n.headSize):n.scale,A=Xt(n.headSize),v=n.headSize/A,y=12,k={x:Math.ceil(c/y),y:Math.ceil(n.sequenceLength/y),z:n.batchSize*n.numHeads},E=[{type:12,data:n.sequenceLength},{type:12,data:v},{type:12,data:c},{type:12,data:n.numHeads},{type:12,data:n.headSize},{type:1,data:P},{type:12,data:o},{type:12,data:n.kvSequenceLength},{type:12,data:_}],M=u&&s&&Te.size(s.dims)>0,w=["type","type"];M&&w.push("type"),i&&w.push("type"),a&&w.push("type"),l&&w.push("type");let x=[{dims:p,dataType:r.dataType,gpuDataType:0}];u&&x.push({dims:g,dataType:r.dataType,gpuDataType:0});let $=z=>{let R=$e("q",r.dataType,r.dims,A),Q=$e("key",t.dataType,t.dims,A),q=[R,Q];if(M){let ce=$e("past_key",s.dataType,s.dims,A);q.push(ce)}i&&q.push($e("attention_bias",i.dataType,i.dims));let U=a?$e("seq_lens",a.dataType,a.dims):void 0;U&&q.push(U);let Z=l?$e("total_sequence_length_input",l.dataType,l.dims):void 0;Z&&q.push(Z);let H=tt("output",r.dataType,p),J=[H];u&&J.push(tt("present_key",r.dataType,g,A));let ie=xr(1,A),ae=[{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 = ${y}u; + + var tileQ: array<${R.type.storage}, ${y*y}>; + var tileK: array<${R.type.storage}, ${y*y}>; + ${z.registerUniforms(ae).declareVariables(...q,...J)} + ${z.mainStart([y,y,1])} + // x holds the N and y holds the M + let headIdx = workgroup_id.z % uniforms.num_heads; + let kvHeadIdx = ${_===1?"headIdx":"headIdx / uniforms.n_reps"}; + let kv_num_heads = ${_===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"}; + let batchIdx = workgroup_id.z / uniforms.num_heads; + let m = workgroup_id.y * TILE_SIZE; + let n = workgroup_id.x * TILE_SIZE; + let sequence_length = uniforms.M; + var total_sequence_length = uniforms.N; + ${Pa(U,Z,!0)} + let absKvHeadIdx = batchIdx * kv_num_heads + kvHeadIdx; + let qOffset = workgroup_id.z * uniforms.M * uniforms.K + m * uniforms.K; + ${M&&u?"let pastKeyOffset = absKvHeadIdx * uniforms.past_sequence_length * uniforms.K;":""}; + let kOffset = absKvHeadIdx * uniforms.kv_sequence_length * uniforms.K; + ${u?"let presentKeyOffset = absKvHeadIdx * uniforms.N * uniforms.K;":""} + var value = ${ie}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (global_id.y < uniforms.M && w + local_id.x < uniforms.K) { + tileQ[TILE_SIZE * local_id.y + local_id.x] = q[qOffset + local_id.y * uniforms.K + w + local_id.x]; + } + if (n + local_id.y < uniforms.N && w + local_id.x < uniforms.K) { + var idx = TILE_SIZE * local_id.y + local_id.x; + ${M&&u?` + if (n + local_id.y < past_sequence_length) { + tileK[idx] = past_key[pastKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; + } else if (n + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { + tileK[idx] = key[kOffset + (n + local_id.y - past_sequence_length) * uniforms.K + w + local_id.x]; + }`:` + if (n + local_id.y < uniforms.kv_sequence_length) { + tileK[idx] = key[kOffset + (n + local_id.y) * uniforms.K + w + local_id.x]; + }`} + ${u?`if (n + local_id.y < present_sequence_length) { + present_key[presentKeyOffset + (n + local_id.y) * uniforms.K + w + local_id.x] = tileK[idx]; + }`:""} + } + workgroupBarrier(); + + for (var k: u32 = 0u; k < TILE_SIZE && w+k < uniforms.K; k++) { + value += ${ie}(tileQ[TILE_SIZE * local_id.y + k] * tileK[TILE_SIZE * local_id.x + k]); + } + + workgroupBarrier(); + } + + if (global_id.y < uniforms.M && global_id.x < total_sequence_length) { + let headOffset = workgroup_id.z * uniforms.M * uniforms.N; + let outputIdx = headOffset + global_id.y * uniforms.N + global_id.x; + var sum: f32 = ${(()=>{switch(A){case 1:return"value";case 2:return"value.x + value.y";case 4:return"value.x + value.y + value.z + value.w";default:throw new Error(`Unsupported components: ${A}`)}})()}; + output[outputIdx] = ${H.type.value} (sum * uniforms.alpha) + ${i?"attention_bias[outputIdx]":"0.0"}; + } + }`};return{name:"AttentionProbs",shaderCache:{hint:`${A};${i!==void 0};${s!==void 0};${e}`,inputDependencies:w},getRunData:()=>({outputs:x,dispatchGroup:k,programUniforms:E}),getShaderSource:$}},jh=(e,r,t,s,i,n,o=void 0,a=void 0)=>{let l=n+i.kvSequenceLength,c=i.nReps?i.nReps:1,p=i.vHiddenSize*c,u=e>1&&s,h=i.kvNumHeads?i.kvNumHeads:i.numHeads,g=u?[i.batchSize,h,l,i.headSize]:void 0,_=[i.batchSize,i.sequenceLength,p],P=12,A={x:Math.ceil(i.vHeadSize/P),y:Math.ceil(i.sequenceLength/P),z:i.batchSize*i.numHeads},v=[{type:12,data:i.sequenceLength},{type:12,data:l},{type:12,data:i.vHeadSize},{type:12,data:i.numHeads},{type:12,data:i.headSize},{type:12,data:p},{type:12,data:n},{type:12,data:i.kvSequenceLength},{type:12,data:c}],y=u&&s&&Te.size(s.dims)>0,k=["type","type"];y&&k.push("type"),o&&k.push("type"),a&&k.push("type");let E=[{dims:_,dataType:r.dataType,gpuDataType:0}];u&&E.push({dims:g,dataType:r.dataType,gpuDataType:0});let M=w=>{let x=$e("probs",r.dataType,r.dims),$=$e("v",t.dataType,t.dims),z=[x,$];y&&z.push($e("past_value",s.dataType,s.dims));let R=o?$e("seq_lens",o.dataType,o.dims):void 0;o&&z.push(R);let Q=a?$e("total_sequence_length_input",a.dataType,a.dims):void 0;a&&z.push(Q);let q=[tt("output",r.dataType,_)];u&&q.push(tt("present_value",r.dataType,g));let U=[{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 = ${P}u; + var tileQ: array<${x.type.value}, ${P*P}>; + var tileV: array<${x.type.value}, ${P*P}>; + ${w.registerUniforms(U).declareVariables(...z,...q)} + ${w.mainStart([P,P,1])} + let headIdx = workgroup_id.z % uniforms.num_heads; + let batchIdx = workgroup_id.z / uniforms.num_heads; + let kvHeadIdx = ${c===1?"headIdx":"headIdx / uniforms.n_reps"}; + let kv_num_heads = ${c===1?"uniforms.num_heads":"uniforms.num_heads / uniforms.n_reps"}; + let m = global_id.y; + let n = global_id.x; + let sequence_length = uniforms.M; + var total_sequence_length = uniforms.K; + ${Pa(R,Q,!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 + ${y&&u?"let pastValueOffset = absKvHeadIdx * uniforms.N * uniforms.past_sequence_length + n;":""}; + let vOffset = absKvHeadIdx * uniforms.N * uniforms.kv_sequence_length + n; + ${u?"let presentValueOffset = absKvHeadIdx * uniforms.N * uniforms.K + n;":""} + var value = ${x.type.storage}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (m < uniforms.M && w + local_id.x < uniforms.K) { + tileQ[TILE_SIZE * local_id.y + local_id.x] = probs[offsetA + w + local_id.x]; + } + if (n < uniforms.N && w + local_id.y < uniforms.K) { + var idx = TILE_SIZE * local_id.y + local_id.x; + ${y&&u?` + if (w + local_id.y < past_sequence_length) { + tileV[idx] = past_value[pastValueOffset + (w + local_id.y) * uniforms.N]; + } else if (w + local_id.y - past_sequence_length < uniforms.kv_sequence_length) { + tileV[idx] = v[vOffset + (w + local_id.y - past_sequence_length) * uniforms.N]; + } + `:` + if (w + local_id.y < uniforms.kv_sequence_length) { + tileV[idx] = v[vOffset + (w + local_id.y) * uniforms.N]; + }`} + ${u?` + if (w + local_id.y < present_sequence_length) { + present_value[presentValueOffset + (w + local_id.y) * uniforms.N] = tileV[idx]; + }`:""} + } + workgroupBarrier(); + for (var k: u32 = 0u; k < TILE_SIZE && w+k < total_sequence_length; k++) { + value += tileQ[TILE_SIZE * local_id.y + k] * tileV[TILE_SIZE * k + local_id.x]; + } + workgroupBarrier(); + } + + // we need to transpose output from BNSH_v to BSND_v + if (m < uniforms.M && n < uniforms.N) { + let outputIdx = batchIdx * uniforms.M * uniforms.v_hidden_size + m * uniforms.v_hidden_size + + headIdx * uniforms.N + n; + output[outputIdx] = value; + } + }`};return{name:"AttentionScore",shaderCache:{hint:`${s!==void 0};${e}`,inputDependencies:k},getRunData:()=>({outputs:E,dispatchGroup:A,programUniforms:v}),getShaderSource:M}},Oi=(e,r,t,s,i,n,o,a,l,c,p=void 0,u=void 0)=>{let h=Math.min(e.outputCount,1+(o?1:0)+(a?1:0)),g=h>1?c.pastSequenceLength:0,_=g+c.kvSequenceLength,P=l&&Te.size(l.dims)>0?l:void 0,A=[r,t];h>1&&o&&Te.size(o.dims)>0&&A.push(o),P&&A.push(P),p&&A.push(p),u&&A.push(u);let v=e.compute(Nh(h,r,t,o,P,c,g,p,u),{inputs:A,outputs:h>1?[-1,1]:[-1]})[0];e.compute(Rh(v,c.batchSize,c.numHeads,g,c.sequenceLength,_,p,u),{inputs:p&&u?[v,p,u]:[v],outputs:[]});let y=[v,s];h>1&&a&&Te.size(a.dims)>0&&y.push(a),p&&y.push(p),u&&y.push(u),e.compute(jh(h,v,s,a,c,g,p,u),{inputs:y,outputs:h>1?[0,2]:[0]})},Vh=(e,r)=>{let t=[r.batchSize,r.numHeads,r.sequenceLength,r.headSize],s=r.sequenceLength,i=r.inputHiddenSize,n=r.headSize,o=12,a={x:Math.ceil(r.headSize/o),y:Math.ceil(r.sequenceLength/o),z:r.batchSize*r.numHeads},l=[e.inputs[0],e.inputs[1],e.inputs[2]],c=[{type:12,data:s},{type:12,data:i},{type:12,data:n},{type:12,data:r.numHeads},{type:12,data:r.headSize},{type:12,data:r.hiddenSize},{type:12,data:r.hiddenSize+r.hiddenSize+r.vHiddenSize}],p=u=>{let h=tt("output_q",l[0].dataType,t),g=tt("output_k",l[0].dataType,t),_=tt("output_v",l[0].dataType,t),P=$e("input",l[0].dataType,l[0].dims),A=$e("weight",l[1].dataType,l[1].dims),v=$e("bias",l[2].dataType,l[2].dims),y=P.type.storage,k=[{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<${y}, ${o*o}>; + var tileWeightQ: array<${y}, ${o*o}>; + var tileWeightK: array<${y}, ${o*o}>; + var tileWeightV: array<${y}, ${o*o}>; + ${u.registerUniforms(k).declareVariables(P,A,v,h,g,_)} + ${u.mainStart([o,o,1])} + let batchIndex = workgroup_id.z / uniforms.num_heads; + let headNumber = workgroup_id.z % uniforms.num_heads; + let m = global_id.y; + let n = global_id.x; + + let inputOffset = batchIndex * (uniforms.M * uniforms.K) + m * uniforms.K; + let biasOffsetQ = headNumber * uniforms.head_size; + let biasOffsetK = uniforms.hidden_size + biasOffsetQ; + let biasOffsetV = uniforms.hidden_size + biasOffsetK; + + var valueQ = ${y}(0); + var valueK = ${y}(0); + var valueV = ${y}(0); + for (var w: u32 = 0u; w < uniforms.K; w += TILE_SIZE) { + if (m < uniforms.M && w + local_id.x < uniforms.K) { + tileInput[TILE_SIZE * local_id.y + local_id.x] = input[inputOffset + w + local_id.x]; + } + if (n < uniforms.N && w + local_id.y < uniforms.K) { + let offset = n + (w + local_id.y) * uniforms.ldb; + tileWeightQ[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetQ + offset]; + tileWeightK[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetK + offset]; + tileWeightV[TILE_SIZE * local_id.y + local_id.x] = weight[biasOffsetV + offset]; + } + workgroupBarrier(); + for (var k: u32 = 0u; k({outputs:[{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0},{dims:t,dataType:e.inputs[0].dataType,gpuDataType:0}],dispatchGroup:a,programUniforms:c}),getShaderSource:p},{inputs:l,outputs:[-1,-1,-1]})},Uh=(e,r)=>{let t=Bh(e.inputs,r),[s,i,n]=Vh(e,t);return Oi(e,s,i,n,e.inputs[4],void 0,void 0,void 0,e.inputs[5],t)}}),Wh,Gh,Kh,Hh,mv=Ve(()=>{ss(),pt(),Mt(),Yt(),Tt(),Wh=(e,r)=>{if(!e||e.length!==5)throw new Error("BatchNormalization requires 5 inputs");let t=(s,i,n)=>{let o=i.length;if(o!==s.length)throw new Error(`${n}: num dimensions != ${o}`);i.forEach((a,l)=>{if(a!==s[l])throw new Error(`${n}: dim[${l}] do not match`)})};if(e[0].dims.length>1){let s=r.format==="NHWC"?r.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,r.spatial?2:void 0);t(e[1].dims,s,"Invalid input scale"),t(e[2].dims,s,"Invalid input B"),t(e[3].dims,s,"Invalid input mean"),t(e[4].dims,s,"Invalid input var")}else t(e[1].dims,[1],"Invalid input scale"),t(e[2].dims,[1],"Invalid input B"),t(e[3].dims,[1],"Invalid input mean"),t(e[4].dims,[1],"Invalid input var")},Gh=(e,r)=>{let{epsilon:t,spatial:s,format:i}=r,n=e[0].dims,o=s?Xt(n[n.length-1]):1,a=i==="NHWC"&&n.length>1?o:1,l=Te.size(n)/o,c=s,p=c?n.length:n,u=$e("x",e[0].dataType,e[0].dims,o),h=$e("scale",e[1].dataType,e[1].dims,a),g=$e("bias",e[2].dataType,e[2].dims,a),_=$e("inputMean",e[3].dataType,e[3].dims,a),P=$e("inputVar",e[4].dataType,e[4].dims,a),A=tt("y",e[0].dataType,p,o),v=()=>{let k="";if(s)k=`let cOffset = ${n.length===1?"0u":i==="NHWC"?`outputIndices[${n.length-1}] / ${o}`:"outputIndices[1]"};`;else if(i==="NCHW")k=` + ${A.indicesSet("outputIndices","0","0")} + let cOffset = ${A.indicesToOffset("outputIndices")};`;else{k=`var cIndices = ${h.type.indices}(0); + cIndices[0] = outputIndices[${n.length-1}];`;for(let E=1;E` + const epsilon = ${t}; + ${k.registerUniform("outputSize","u32").declareVariables(u,h,g,_,P,A)} + ${k.mainStart()} + ${k.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + var outputIndices = ${A.offsetToIndices(`global_idx * ${o}`)}; + ${v()} + let scale = ${h.getByOffset("cOffset")}; + let bias = ${g.getByOffset("cOffset")}; + let inputMean = ${_.getByOffset("cOffset")}; + let inputVar = ${P.getByOffset("cOffset")}; + let x = ${u.getByOffset("global_idx")}; + let value = (x - inputMean) * inverseSqrt(inputVar + epsilon) * scale + bias; + ${A.setByOffset("global_idx","value")} + }`;return{name:"BatchNormalization",shaderCache:{hint:`${r.epsilon}_${r.format}_${s}_${o}`,inputDependencies:c?["rank","type","type","type","type"]:void 0},getShaderSource:y,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:c?[{type:12,data:l},...nt(n)]:[{type:12,data:l}]})}},Kh=e=>Dt(e),Hh=(e,r)=>{let{inputs:t,outputCount:s}=e,i=Kh({...r,outputCount:s});if(Ut.webgpu.validateInputContent&&Wh(t,i),r.trainingMode)throw new Error("BatchNormalization trainingMode is not supported yet.");e.compute(Gh(t,i))}}),qh,Qh,Xh,fv=Ve(()=>{Mt(),Tt(),qh=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![320,640,1280].includes(e[0].dims[2]))throw new Error("number of channels should be 320, 640 or 1280");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},Qh=e=>{let r=e[0].dims,t=e[0].dims[2],s=Te.size(r)/4,i=e[0].dataType,n=$e("input",i,r,4),o=$e("bias",i,[t],4),a=$e("residual",i,r,4),l=tt("output",i,r,4);return{name:"BiasAdd",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(s/64)}}),getShaderSource:c=>` + const channels = ${t}u / 4; + ${c.declareVariables(n,o,a,l)} + + ${c.mainStart()} + ${c.guardAgainstOutOfBoundsWorkgroupSizes(s)} + let value = ${n.getByOffset("global_idx")} + + ${o.getByOffset("global_idx % channels")} + ${a.getByOffset("global_idx")}; + ${l.setByOffset("global_idx","value")} + }`}},Xh=e=>{qh(e.inputs),e.compute(Qh(e.inputs))}}),Jh,$t,Yh,Zh,em,tm,rm,sm,nm,im,om,am,lm,dm,cm,um,Di,pm,Ca,hm,mm,fm,_m,gm,wm,ym,Mm,bm,vm,Tm,xm,Em,Pm,Cm,Sm,Xd,$m,Jd,Yd,km,Im,Am,Fm,Om,Dm,Zd=Ve(()=>{pt(),Mt(),Yt(),Tt(),Jh=(e,r,t,s,i,n,o)=>{let a=Math.ceil(r/4),l="";typeof i=="string"?l=`${i}(a)`:l=i("a");let c=$e("inputData",t,[a],4),p=tt("outputData",s,[a],4),u=[{name:"vec_size",type:"u32"}];return o&&u.push(...o),` + ${e.registerUniforms(u).declareVariables(c,p)} + + ${n??""} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} + + let a = ${c.getByOffset("global_idx")}; + ${p.setByOffset("global_idx",l)} + }`},$t=(e,r,t,s,i,n=e.dataType,o,a)=>{let l=[{type:12,data:Math.ceil(Te.size(e.dims)/4)}];return o&&l.push(...o),{name:r,shaderCache:{hint:i,inputDependencies:["type"]},getShaderSource:c=>Jh(c,Te.size(e.dims),e.dataType,n,t,s,a),getRunData:c=>({outputs:[{dims:e.dims,dataType:n}],dispatchGroup:{x:Math.ceil(Te.size(c[0].dims)/64/4)},programUniforms:l})}},Yh=e=>{e.compute($t(e.inputs[0],"Abs","abs"))},Zh=e=>{e.compute($t(e.inputs[0],"Acos","acos"))},em=e=>{e.compute($t(e.inputs[0],"Acosh","acosh"))},tm=e=>{e.compute($t(e.inputs[0],"Asin","asin"))},rm=e=>{e.compute($t(e.inputs[0],"Asinh","asinh"))},sm=e=>{e.compute($t(e.inputs[0],"Atan","atan"))},nm=e=>{e.compute($t(e.inputs[0],"Atanh","atanh"))},im=e=>Dt(e),om=(e,r)=>{let t;switch(r.to){case 10:t="vec4";break;case 1:t="vec4";break;case 12:t="vec4";break;case 6:t="vec4";break;case 9:t="vec4";break;default:throw new RangeError(`not supported type (specified in attribute 'to' from 'Cast' operator): ${r.to}`)}e.compute($t(e.inputs[0],"Cast",t,void 0,r.cacheKey,r.to))},am=e=>{let r,t,s=e.length>=2&&e[1].data!==0,i=e.length>=3&&e[2].data!==0;switch(e[0].dataType){case 1:r=s?e[1].getFloat32Array()[0]:-34028234663852886e22,t=i?e[2].getFloat32Array()[0]:34028234663852886e22;break;case 10:r=s?e[1].getUint16Array()[0]:64511,t=i?e[2].getUint16Array()[0]:31743;break;default:throw new Error("Unsupport data type")}return Dt({min:r,max:t})},lm=(e,r)=>{let t=r||am(e.inputs),s=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Clip",i=>`clamp(${i}, vec4<${s}>(uniforms.min), vec4<${s}>(uniforms.max))`,void 0,t.cacheKey,void 0,[{type:e.inputs[0].dataType,data:t.min},{type:e.inputs[0].dataType,data:t.max}],[{name:"min",type:s},{name:"max",type:s}]),{inputs:[0]})},dm=e=>{e.compute($t(e.inputs[0],"Ceil","ceil"))},cm=e=>{e.compute($t(e.inputs[0],"Cos","cos"))},um=e=>{e.compute($t(e.inputs[0],"Cosh","cosh"))},Di=e=>Dt(e),pm=(e,r)=>{let t=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Elu",s=>`elu_vf32(${s})`,` + const elu_alpha_ = ${t}(${r.alpha}); + + fn elu_f32(a: ${t}) -> ${t} { + return select((exp(a) - 1.0) * elu_alpha_, a, a >= 0.0); + } + + fn elu_vf32(v: vec4<${t}>) -> vec4<${t}> { + return vec4(elu_f32(v.x), elu_f32(v.y), elu_f32(v.z), elu_f32(v.w)); + }`,r.cacheKey))},Ca=(e="f32")=>` +const r0: ${e} = 0.3275911; +const r1: ${e} = 0.254829592; +const r2: ${e} = -0.284496736; +const r3: ${e} = 1.421413741; +const r4: ${e} = -1.453152027; +const r5: ${e} = 1.061405429; + +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)); +}`,hm=e=>{let r=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Erf",t=>`erf_vf32(${t})`,Ca(r)))},mm=e=>{e.compute($t(e.inputs[0],"Exp","exp"))},fm=e=>{e.compute($t(e.inputs[0],"Floor","floor"))},_m=e=>{let r=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Gelu",t=>`0.5 * ${t} * (1.0 + erf_vf32(${t} * 0.7071067811865475))`,Ca(r)))},gm=(e,r)=>{let t=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"LeakyRelu",s=>`select(leaky_relu_alpha_ * ${s}, ${s}, ${s} >= vec4<${t}>(0.0))`,`const leaky_relu_alpha_ = ${t}(${r.alpha});`,r.cacheKey))},wm=e=>{e.compute($t(e.inputs[0],"Not",r=>`!${r}`))},ym=e=>{e.compute($t(e.inputs[0],"Neg",r=>`-${r}`))},Mm=e=>{e.compute($t(e.inputs[0],"Reciprocal",r=>`1.0/${r}`))},bm=e=>{let r=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"Relu",t=>`select(vec4<${r}>(0.0), ${t}, ${t} > vec4<${r}>(0.0))`))},vm=e=>{e.compute($t(e.inputs[0],"Sigmoid",r=>`(1.0 / (1.0 + exp(-${r})))`))},Tm=e=>Dt(e),xm=(e,r)=>{let t=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"HardSigmoid",s=>`max(vec4<${t}>(0.0), min(vec4<${t}>(1.0), ${r.alpha} * ${s} + vec4<${t}>(${r.beta})))`,void 0,r.cacheKey))},Em=e=>{e.compute($t(e.inputs[0],"Sin","sin"))},Pm=e=>{e.compute($t(e.inputs[0],"Sinh","sinh"))},Cm=e=>{e.compute($t(e.inputs[0],"Sqrt","sqrt"))},Sm=e=>{e.compute($t(e.inputs[0],"Tan","tan"))},Xd=e=>`sign(${e}) * (1 - exp(-2 * abs(${e}))) / (1 + exp(-2 * abs(${e})))`,$m=e=>{e.compute($t(e.inputs[0],"Tanh",Xd))},Jd=(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 ${Xd("v")}; +} +`,Yd=e=>`(fast_gelu_a + fast_gelu_a * tanh_v(${e} * (fast_gelu_c * ${e} * ${e} + fast_gelu_b))) * ${e}`,km=e=>{let r=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"FastGelu",Yd,Jd(r),void 0,e.inputs[0].dataType))},Im=(e,r)=>{let t=xr(e.inputs[0].dataType);return e.compute($t(e.inputs[0],"ThresholdedRelu",s=>`select(vec4<${t}>(0.0), ${s}, ${s} > thresholded_relu_alpha_)`,`const thresholded_relu_alpha_ = vec4<${t}>(${r.alpha});`,r.cacheKey)),0},Am=e=>{e.compute($t(e.inputs[0],"Log","log"))},Fm=(e,r)=>` +const alpha = vec4<${e}>(${r}); +const one = ${e}(1.0); +const zero = ${e}(0.0); + +fn quick_gelu_impl(x: vec4<${e}>) -> vec4<${e}> { + let v = x *alpha; + var x1 : vec4<${e}>; + for (var i = 0; i < 4; i = i + 1) { + if (v[i] >= zero) { + x1[i] = one / (one + exp(-v[i])); + } else { + x1[i] = one - one / (one + exp(v[i])); + } + } + return x * x1; +} +`,Om=e=>`quick_gelu_impl(${e})`,Dm=(e,r)=>{let t=xr(e.inputs[0].dataType);e.compute($t(e.inputs[0],"QuickGelu",Om,Fm(t,r.alpha),r.cacheKey,e.inputs[0].dataType))}}),Lm,zm,Bm,_v=Ve(()=>{Mt(),Tt(),Zd(),Lm=e=>{if(e[0].dims.length!==3)throw new Error("input should have 3 dimensions");if(![2560,5120,10240].includes(e[0].dims[2]))throw new Error("hidden state should be 2560, 5120 or 10240");if(e[1].dims.length!==1)throw new Error("bias is expected to have 1 dimensions");if(e[0].dims[2]!==e[1].dims[0])throw new Error("last dimension of input and bias are not the same")},zm=e=>{let r=e[0].dims.slice();r[2]=r[2]/2;let t=$e("input",e[0].dataType,e[0].dims,4),s=$e("bias",e[0].dataType,[e[0].dims[2]],4),i=tt("output",e[0].dataType,r,4),n=Te.size(r)/4,o=lr(e[0].dataType);return{name:"BiasSplitGelu",getRunData:()=>({outputs:[{dims:r,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)}}),getShaderSource:a=>` + const M_SQRT2 = sqrt(2.0); + const halfChannels = ${e[0].dims[2]/4/2}u; + + ${a.declareVariables(t,s,i)} + + ${Ca(o)} + + ${a.mainStart()} + ${a.guardAgainstOutOfBoundsWorkgroupSizes(n)} + let biasIdx = global_idx % halfChannels; + let batchIndex = global_idx / halfChannels; + let inputOffset = biasIdx + batchIndex * halfChannels * 2; + let valueLeft = input[inputOffset] + bias[biasIdx]; + let valueRight = input[inputOffset + halfChannels] + bias[biasIdx + halfChannels]; + let geluRight = valueRight * 0.5 * (erf_vf32(valueRight / M_SQRT2) + 1); + + ${i.setByOffset("global_idx","valueLeft * geluRight")} + }`}},Bm=e=>{Lm(e.inputs),e.compute(zm(e.inputs))}}),Rm,Nm,ls,jm,Vm,Um,Wm,Gm,Km,Hm,qm,Qm,Xm,gv=Ve(()=>{pt(),Mt(),Tt(),Rm=(e,r,t,s,i,n,o,a,l,c,p,u)=>{let h,g;typeof a=="string"?h=g=(y,k)=>`${a}((${y}),(${k}))`:typeof a=="function"?h=g=a:(h=a.scalar,g=a.vector);let _=tt("outputData",p,s.length,4),P=$e("aData",l,r.length,4),A=$e("bData",c,t.length,4),v;if(i)if(n){let y=Te.size(r)===1,k=Te.size(t)===1,E=r.length>0&&r[r.length-1]%4===0,M=t.length>0&&t[t.length-1]%4===0;y||k?v=_.setByOffset("global_idx",g(y?`${P.type.value}(${P.getByOffset("0")}.x)`:P.getByOffset("global_idx"),k?`${A.type.value}(${A.getByOffset("0")}.x)`:A.getByOffset("global_idx"))):v=` + let outputIndices = ${_.offsetToIndices("global_idx * 4u")}; + let offsetA = ${P.broadcastedIndicesToOffset("outputIndices",_)}; + let offsetB = ${A.broadcastedIndicesToOffset("outputIndices",_)}; + ${_.setByOffset("global_idx",g(o||E?P.getByOffset("offsetA / 4u"):`${P.type.value}(${P.getByOffset("offsetA / 4u")}[offsetA % 4u])`,o||M?A.getByOffset("offsetB / 4u"):`${A.type.value}(${A.getByOffset("offsetB / 4u")}[offsetB % 4u])`))} + `}else v=_.setByOffset("global_idx",g(P.getByOffset("global_idx"),A.getByOffset("global_idx")));else{if(!n)throw new Error("no necessary to use scalar implementation for element-wise binary op implementation.");let y=(k,E,M="")=>{let w=`aData[indexA${E}][componentA${E}]`,x=`bData[indexB${E}][componentB${E}]`;return` + let outputIndices${E} = ${_.offsetToIndices(`global_idx * 4u + ${E}u`)}; + let offsetA${E} = ${P.broadcastedIndicesToOffset(`outputIndices${E}`,_)}; + let offsetB${E} = ${A.broadcastedIndicesToOffset(`outputIndices${E}`,_)}; + let indexA${E} = offsetA${E} / 4u; + let indexB${E} = offsetB${E} / 4u; + let componentA${E} = offsetA${E} % 4u; + let componentB${E} = offsetB${E} % 4u; + ${k}[${E}] = ${M}(${h(w,x)}); + `};p===9?v=` + var data = vec4(0); + ${y("data",0,"u32")} + ${y("data",1,"u32")} + ${y("data",2,"u32")} + ${y("data",3,"u32")} + outputData[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:v=` + ${y("outputData[global_idx]",0)} + ${y("outputData[global_idx]",1)} + ${y("outputData[global_idx]",2)} + ${y("outputData[global_idx]",3)} + `}return` + ${e.registerUniform("vec_size","u32").declareVariables(P,A,_)} + + ${u??""} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} + ${v} + }`},Nm=(e,r,t,s,i,n,o=t.dataType)=>{let a=t.dims.map(P=>Number(P)??1),l=s.dims.map(P=>Number(P)??1),c=!Te.areEqual(a,l),p=a,u=Te.size(a),h=!1,g=!1,_=[c];if(c){let P=Nn.calcShape(a,l,!1);if(!P)throw new Error("Can't perform binary op on the given tensors");p=P.slice(),u=Te.size(p);let A=Te.size(a)===1,v=Te.size(l)===1,y=a.length>0&&a[a.length-1]%4===0,k=l.length>0&&l[l.length-1]%4===0;_.push(A),_.push(v),_.push(y),_.push(k);let E=1;for(let M=1;MP.toString()).join("_"),inputDependencies:["rank","rank"]},getShaderSource:P=>Rm(P,a,l,p,h,c,g,i,t.dataType,s.dataType,o,n),getRunData:()=>({outputs:[{dims:p,dataType:o}],dispatchGroup:{x:Math.ceil(u/64/4)},programUniforms:[{type:12,data:Math.ceil(Te.size(p)/4)},...nt(a,l,p)]})}},ls=(e,r,t,s,i,n)=>{e.compute(Nm(r,i??"",e.inputs[0],e.inputs[1],t,s,n))},jm=e=>{ls(e,"Add",(r,t)=>`${r}+${t}`)},Vm=e=>{ls(e,"Div",(r,t)=>`${r}/${t}`)},Um=e=>{ls(e,"Equal",{scalar:(r,t)=>`u32(${r}==${t})`,vector:(r,t)=>`vec4(${r}==${t})`},void 0,void 0,9)},Wm=e=>{ls(e,"Mul",(r,t)=>`${r}*${t}`)},Gm=e=>{let r=$e("input",e.inputs[0].dataType,e.inputs[0].dims).type.value;ls(e,"Pow",{scalar:(t,s)=>`pow_custom(${t},${s})`,vector:(t,s)=>`pow_vector_custom(${t},${s})`},` + fn pow_custom(a : ${r}, b : ${r}) -> ${r} { + if (b == ${r}(0.0)) { + return ${r}(1.0); + } else if (a < ${r}(0.0) && f32(b) != floor(f32(b))) { + return ${r}(pow(f32(a), f32(b))); // NaN + } + return select(sign(a), ${r}(1.0), round(f32(abs(b) % ${r}(2.0))) != 1.0) * ${r}(${r==="i32"?"round":""}(pow(f32(abs(a)), f32(b)))); + } + fn pow_vector_custom(a : vec4<${r}>, b : vec4<${r}>) -> vec4<${r}> { + // TODO: implement vectorized pow + return vec4<${r}>(pow_custom(a.x, b.x), pow_custom(a.y, b.y), pow_custom(a.z, b.z), pow_custom(a.w, b.w)); + } + `)},Km=e=>{ls(e,"Sub",(r,t)=>`${r}-${t}`)},Hm=e=>{ls(e,"Greater",{scalar:(r,t)=>`u32(${r}>${t})`,vector:(r,t)=>`vec4(${r}>${t})`},void 0,void 0,9)},qm=e=>{ls(e,"Less",{scalar:(r,t)=>`u32(${r}<${t})`,vector:(r,t)=>`vec4(${r}<${t})`},void 0,void 0,9)},Qm=e=>{ls(e,"GreaterOrEqual",{scalar:(r,t)=>`u32(${r}>=${t})`,vector:(r,t)=>`vec4(${r}>=${t})`},void 0,void 0,9)},Xm=e=>{ls(e,"LessOrEqual",{scalar:(r,t)=>`u32(${r}<=${t})`,vector:(r,t)=>`vec4(${r}<=${t})`},void 0,void 0,9)}}),Jm,Ym,Zm,ef,tf,rf,wv=Ve(()=>{pt(),Mt(),Yt(),Tt(),Jm=(e,r)=>{if(!e||e.length<1)throw new Error("too few inputs");let t=0,s=e[t],i=s.dataType,n=s.dims.length;e.forEach((o,a)=>{if(a!==t){if(o.dataType!==i)throw new Error("input tensors should be one type");if(o.dims.length!==n)throw new Error("input tensors should have the same shape");o.dims.forEach((l,c)=>{if(c!==r&&l!==s.dims[c])throw new Error("non concat dimensions must match")})}})},Ym=(e,r)=>` + fn calculateInputIndex(index: u32) -> u32 { + let sizeInConcatAxis = array(${r}); + for (var i: u32 = 0u; i < ${e}; i += 1u ) { + if (index < sizeInConcatAxis[i]) { + return i; + } + } + return ${e}u; + }`,Zm=(e,r)=>{let t=e.length,s=[];for(let i=0;i{let i=Te.size(t),n=new Array(e.length),o=new Array(e.length),a=0,l=[],c=[],p=[{type:12,data:i}];for(let P=0;P`uniforms.sizeInConcatAxis${P}`).join(","),_=P=>` + + ${(()=>{P.registerUniform("outputSize","u32");for(let A=0;A(${g}); + ${h} -= sizeInConcatAxis[inputIndex - 1u]; + } + + ${Zm(o,u)} + }`;return{name:"Concat",shaderCache:{hint:`${r}`,inputDependencies:l},getRunData:()=>({outputs:[{dims:t,dataType:s}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:p}),getShaderSource:_}},tf=(e,r)=>{let t=e.inputs,s=t[0].dims,i=Te.normalizeAxis(r.axis,s.length);Jm(t,i);let n=s.slice();n[i]=t.reduce((a,l)=>a+(l.dims.length>i?l.dims[i]:0),0);let o=t.filter(a=>Te.size(a.dims)>0);e.compute(ef(o,i,n,t[0].dataType),{inputs:o})},rf=e=>Dt({axis:e.axis})}),_n,gn,wn,ec,yn=Ve(()=>{pt(),Mt(),_n=(e,r,t="f32")=>{switch(e.activation){case"Relu":return`value = max(value, ${r}(0.0));`;case"Sigmoid":return`value = (${r}(1.0) / (${r}(1.0) + exp(-value)));`;case"Clip":return`value = clamp(value, ${r}(${t}(uniforms.clip_min)), ${r}(${t}(uniforms.clip_max)));`;case"HardSigmoid":return`value = max(${r}(0.0), min(${r}(1.0), ${t}(uniforms.alpha) * value + ${t}(uniforms.beta)));`;case"LeakyRelu":return`value = select(${t}(uniforms.alpha) * value, value, value >= ${r}(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 new Error(`Unsupported activation ${e.activation}`)}},gn=(e,r)=>{e.activation==="Clip"?r.push({type:1,data:e.clipMax},{type:1,data:e.clipMin}):e.activation==="HardSigmoid"?r.push({type:1,data:e.alpha},{type:1,data:e.beta}):e.activation==="LeakyRelu"&&r.push({type:1,data:e.alpha})},wn=(e,r)=>{e.activation==="Clip"?r.push({name:"clip_max",type:"f32"},{name:"clip_min",type:"f32"}):e.activation==="HardSigmoid"?r.push({name:"alpha",type:"f32"},{name:"beta",type:"f32"}):e.activation==="LeakyRelu"&&r.push({name:"alpha",type:"f32"})},ec=e=>{let r=(e==null?void 0:e.activation)||"";if(r==="HardSigmoid"){let[t,s]=(e==null?void 0:e.activation_params)||[.2,.5];return{activation:r,alpha:t,beta:s}}else if(r==="Clip"){let[t,s]=(e==null?void 0:e.activation_params)||[zp,Bp];return{activation:r,clipMax:s,clipMin:t}}else if(r==="LeakyRelu"){let[t]=(e==null?void 0:e.activation_params)||[.01];return{activation:r,alpha:t}}return{activation:r}}}),hr,sf,tc=Ve(()=>{hr=(e,r)=>{switch(e){case 1:return r;case 2:return`vec2<${r}>`;case 3:return`vec3<${r}>`;case 4:return`vec4<${r}>`;default:throw new Error(`${e}-component is not supported.`)}},sf=e=>` + ${e?"value = value + getBiasByOutputCoords(coords);":""} + `}),nf,yv=Ve(()=>{nf=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)); +} +fn getOutputIndexFromCoords(coords : vec4) -> i32 { + return dot(coords, vec4( + i32(${e}.x), i32(${e}.y), i32(${e}.z), 1)); +} +`}),Li,rc,sc=Ve(()=>{pt(),Mt(),Tt(),yn(),Li=(e,r,t,s,i)=>{let n=s-t;return` + ${Array.from({length:t}).map((o,a)=>` + if (${rt(r.shape,a,r.rank)} != 1) { + ${r.indicesSet(e,a,rt(i,a+n,s))} + } else { + ${r.indicesSet(e,a,0)} + }`).join("")} +`},rc=(e,r,t,s,i=!1,n)=>{let o=e[0].dims,a=e[1].dims,l=o[o.length-2],c=a[a.length-1],p=o[o.length-1],u=Xt(c),h=Xt(p),g=Xt(l),_=Te.size(t)/u/g,P=e.length>2,A=s?s.slice(0,-2):t.slice(0,-2),v=[Te.size(A),l,c],y=[{type:12,data:_},{type:12,data:l},{type:12,data:c},{type:12,data:p}];gn(r,y),y.push(...nt(A,o,a)),P&&y.push(...nt(e[2].dims)),y.push(...nt(v));let k=E=>{let M=Ud("batch_dims",e[0].dataType,A.length),w=$e("a",e[0].dataType,o.length,h),x=$e("b",e[1].dataType,a.length,u),$=tt("output",e[0].dataType,v.length,u),z=lr($.type.tensor),R=_n(r,$.type.value,z),Q=[w,x],q="";if(P){let H=i?u:1;Q.push($e("bias",e[2].dataType,e[2].dims.length,H)),q=`${i?`value += bias[col / ${H}];`:`value += ${$.type.value}(bias[row + i]);`}`}let U=[{name:"output_size",type:"u32"},{name:"M",type:"u32"},{name:"N",type:"u32"},{name:"K",type:"u32"}];wn(r,U);let Z=()=>{let H=`var a_data: ${w.type.value};`;for(let J=0;J; + for (var k: u32 = 0u; k < uniforms.K; k = k + ${h}) { + ${Z()} + } + for (var i = 0u; i < ${g}u; i++) { + var value = values[i]; + ${q} + ${R} + let cur_indices = ${$.type.indices}(batch, row + i, col); + let offset = ${$.indicesToOffset("cur_indices")}; + ${$.setByOffset(`offset / ${u}`,"value")}; + } + } + `};return{name:"MatMulNaive",shaderCache:{hint:`${r.activation};${u};${h};${g};${i}`,inputDependencies:P?["rank","rank","rank"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:n?n(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(_/64)},programUniforms:y}),getShaderSource:k}}}),of,af,nc,ic,lf,oc,df,Sa,ac=Ve(()=>{pt(),Mt(),Tt(),yn(),sc(),tc(),of=(e,r)=>e?` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + kStart + inputRow, + globalRowStart / innerElementSize + inputCol${r?", batchIndices":""}); + `:` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + globalRow + innerRow, + kStart / innerElementSize + inputCol${r?", batchIndices":""}); + `,af=(e,r)=>e?` + let ACached0 = mm_Asub[k * innerElementSize][localRow]; + let ACached1 = mm_Asub[k * innerElementSize + 1][localRow]; + let ACached2 = mm_Asub[k * innerElementSize + 2][localRow]; + ${r===3?"":"let ACached3 = mm_Asub[k * innerElementSize + 3][localRow];"} + for (var i = 0; i < rowPerThread; i = i + 1) { + acc[i] = BCached0 * ACached0[i] + acc[i]; + acc[i] = BCached1 * ACached1[i] + acc[i]; + acc[i] = BCached2 * ACached2[i] + acc[i]; + ${r===3?"":"acc[i] = BCached3 * ACached3[i] + acc[i];"} + }`:` + for (var i = 0; i < rowPerThread; i = i + 1) { + let ACached = mm_Asub[tileRow + i][k]; + acc[i] = BCached0 * ACached.x + acc[i]; + acc[i] = BCached1 * ACached.y + acc[i]; + acc[i] = BCached2 * ACached.z + acc[i]; + ${r===3?"":"acc[i] = BCached3 * ACached.w + acc[i];"} + }`,nc=(e,r,t="f32",s,i=!1,n=32,o=!1,a=32)=>{let l=r[1]*e[1],c=r[0]*e[0],p=i?l:n,u=i?n:l,h=p/r[0],g=n/r[1];if(!((i&&h===4&&e[1]===4||!i&&(h===3||h===4))&&p%r[0]===0&&n%r[1]===0&&e[0]===4))throw new Error(`If transposeA ${i} is true, innerElementSize ${h} and workPerThread[1] ${e[1]} must be 4. + Otherwise, innerElementSize ${h} must be 3 or 4. + tileAWidth ${p} must be divisible by workgroupSize[0]${r[0]}. tileInner ${n} must be divisible by workgroupSize[1] ${r[1]}. colPerThread ${e[0]} must be 4.`);return` +var mm_Asub: array, ${p/h}>, ${u}>; +var mm_Bsub: array, ${c/e[0]}>, ${n}>; + +const rowPerThread = ${e[1]}; +const colPerThread = ${e[0]}; +const innerElementSize = ${h}; +const tileInner = ${n}; + +@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]}) +fn main(@builtin(local_invocation_id) localId : vec3, + @builtin(global_invocation_id) globalId : vec3, + @builtin(workgroup_id) workgroupId : vec3) { + let localRow = i32(localId.y); + let tileRow = localRow * rowPerThread; + let tileCol = i32(localId.x); + + let globalRow =i32(globalId.y) * rowPerThread; + let globalCol = i32(globalId.x); + let batch = ${o?"0":"i32(globalId.z)"}; + ${s?`let batchIndices = ${s.offsetToIndices("u32(batch)")};`:""} + let globalRowStart = i32(workgroupId.y) * ${l}; + + let num_tiles = ${o?`${Math.ceil(a/n)}`:"(uniforms.dim_inner - 1) / tileInner + 1"}; + var kStart = ${o?`i32(globalId.z) * ${a}`:"0"}; + + var acc: array, rowPerThread>; + + // Loop over shared dimension. + let tileRowB = localRow * ${g}; + for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let inputRow = tileRow + innerRow; + let inputCol = tileCol; + ${of(i,s)} + } + + // Load one tile of B into local memory. + for (var innerRow = 0; innerRow < ${g}; innerRow = innerRow + 1) { + let inputRow = tileRowB + innerRow; + let inputCol = tileCol; + mm_Bsub[inputRow][inputCol] = mm_readB(batch, kStart + inputRow, globalCol${s?", batchIndices":""}); + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + for (var k = 0; k < tileInner / innerElementSize; k = k + 1) { + let BCached0 = mm_Bsub[k * innerElementSize][tileCol]; + let BCached1 = mm_Bsub[k * innerElementSize + 1][tileCol]; + let BCached2 = mm_Bsub[k * innerElementSize + 2][tileCol]; + ${h===3?"":"let BCached3 = mm_Bsub[k * innerElementSize + 3][tileCol];"} + + ${af(i,h)} + } + + workgroupBarrier(); + } + + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); + } +}`},ic=(e,r)=>e?` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + kStart + inputRow, + globalRowStart + inputCol${r?", batchIndices":""}); + `:` + mm_Asub[inputRow][inputCol] = mm_readA(batch, + globalRowStart + inputRow, + kStart + inputCol${r?", batchIndices":""}); + `,lf=e=>e?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];",oc=(e,r,t="f32",s,i=!1,n=32,o=!1,a=32,l=!1)=>{let c=e[1]*r[1],p=e[0]*r[0],u=i?c:n,h=i?n:c;if(!(h%r[1]===0&&u%r[0]===0&&n%r[1]===0))throw new Error(`tileAHight ${h} must be divisible by workgroupSize[1]${r[1]}, tileAWidth ${u} must be divisible by workgroupSize[0]${r[0]}, tileInner ${n} must be divisible by workgroupSize[1]${r[1]}`);let g=h/r[1],_=u/r[0],P=n/r[1],A=l?` + let localRow = i32(localId.y); + let localCol = i32(localId.x); + let globalRowStart = i32(workgroupId.y) * ${c}; + let globalColStart = i32(workgroupId.x) * ${p}; + + // Loop over shared dimension. + for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var inputRow = localRow; inputRow < ${h}; inputRow = inputRow + ${r[1]}) { + for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${r[0]}) { + ${ic(i,s)} + } + } + // Load one tile of B into local memory. + for (var inputRow = localRow; inputRow < ${n}; inputRow = inputRow + ${r[1]}) { + for (var inputCol = localCol; inputCol < ${p}; inputCol = inputCol + ${r[0]}) { + mm_Bsub[inputRow][inputCol] = mm_readB(batch, + kStart + inputRow, + globalColStart + inputCol${s?", batchIndices":""}); + } + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + var BCached : array<${t}, colPerThread>; + for (var k = 0; k < tileInner; k = k + 1) { + for (var inner = 0; inner < colPerThread; inner = inner + 1) { + BCached[inner] = mm_Bsub[k][localCol + inner * ${r[0]}]; + } + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let ACached = ${i?`mm_Asub[k][localRow + innerRow * ${r[1]}];`:`mm_Asub[localRow + innerRow * ${r[1]}][k];`} + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + acc[innerRow][innerCol] = acc[innerRow][innerCol] + + ACached * BCached[innerCol]; + } + } + } + workgroupBarrier(); + } + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + let gRow = globalRowStart + localRow + innerRow * ${r[1]}; + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + let gCol = globalColStart + localCol + innerCol * ${r[0]}; + mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); + } + } + `:` +let tileRow = i32(localId.y) * rowPerThread; +let tileCol = i32(localId.x) * colPerThread; + +let globalRow = i32(globalId.y) * rowPerThread; +let globalCol = i32(globalId.x) * colPerThread; +let globalRowStart = i32(workgroupId.y) * ${c}; + +let tileRowA = i32(localId.y) * ${g}; +let tileColA = i32(localId.x) * ${_}; +let tileRowB = i32(localId.y) * ${P}; +// Loop over shared dimension. +for (var t = 0; t < num_tiles; t = t + 1) { + // Load one tile of A into local memory. + for (var innerRow = 0; innerRow < ${g}; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < ${_}; innerCol = innerCol + 1) { + let inputRow = tileRowA + innerRow; + let inputCol = tileColA + innerCol; + ${ic(i,s)} + } + } + + // Load one tile of B into local memory. + for (var innerRow = 0; innerRow < ${P}; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + let inputRow = tileRowB + innerRow; + let inputCol = tileCol + innerCol; + mm_Bsub[inputRow][inputCol] = mm_readB(batch, + kStart + inputRow, + globalCol + innerCol${s?", batchIndices":""}); + } + } + kStart = kStart + tileInner; + workgroupBarrier(); + + // Compute acc values for a single thread. + var BCached : array<${t}, colPerThread>; + for (var k = 0; k < tileInner; k = k + 1) { + for (var inner = 0; inner < colPerThread; inner = inner + 1) { + BCached[inner] = mm_Bsub[k][tileCol + inner]; + } + + for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + ${lf(i)} + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + acc[innerRow][innerCol] = acc[innerRow][innerCol] + ACached * BCached[innerCol]; + } + } + } + + workgroupBarrier(); +} + +for (var innerRow = 0; innerRow < rowPerThread; innerRow = innerRow + 1) { + for (var innerCol = 0; innerCol < colPerThread; innerCol = innerCol + 1) { + mm_write(batch, globalRow + innerRow, globalCol + innerCol, + acc[innerRow][innerCol]); + } +} +`;return` + var mm_Asub : array, ${h}>; + var mm_Bsub : array, ${n}>; + const rowPerThread = ${e[1]}; + const colPerThread = ${e[0]}; + const tileInner = ${n}; + +@compute @workgroup_size(${r[0]}, ${r[1]}, ${r[2]}) +fn main(@builtin(local_invocation_id) localId : vec3, + @builtin(global_invocation_id) globalId : vec3, + @builtin(workgroup_id) workgroupId : vec3) { + let batch = ${o?"0":"i32(globalId.z)"}; + ${s?`let batchIndices = ${s.offsetToIndices("u32(batch)")};`:""} + let num_tiles = ${o?`${Math.ceil(a/n)}`:"(uniforms.dim_inner - 1) / tileInner + 1"}; + var kStart = ${o?`i32(globalId.z) * ${a}`:"0"}; + + var acc : array, rowPerThread>; + ${A} + } +`},df=(e,r,t,s,i=!1)=>{let[n,o,a,l]=s,c=lr(s[0].type.tensor);return` + fn mm_readA(batch: i32, row: i32, colIn: i32, batchIndices: ${n.type.indices}) -> ${hr(e,c)} { + var value = ${hr(e,c)}(0.0); + let col = colIn * ${e}; + if(row < uniforms.dim_a_outer && col < uniforms.dim_inner) + { + var aIndices: ${o.type.indices}; + ${Li("aIndices",o,o.rank-2,n.rank,"batchIndices")} + ${o.indicesSet("aIndices",o.rank-2,"u32(row)")} + ${o.indicesSet("aIndices",o.rank-1,"u32(colIn)")} + value = ${o.getByIndices("aIndices")}; + } + return value; + } + + fn mm_readB(batch: i32, row: i32, colIn: i32, batchIndices: ${n.type.indices}) -> ${hr(e,c)} { + var value = ${hr(e,c)}(0.0); + let col = colIn * ${e}; + if(row < uniforms.dim_inner && col < uniforms.dim_b_outer) + { + var bIndices: ${a.type.indices}; + ${Li("bIndices",a,a.rank-2,n.rank,"batchIndices")} + ${a.indicesSet("bIndices",a.rank-2,"u32(row)")} + ${a.indicesSet("bIndices",a.rank-1,"u32(colIn)")} + value = ${a.getByIndices("bIndices")}; + } + return value; + } + + fn mm_write(batch: i32, row: i32, colIn: i32, valueIn: ${hr(e,c)}) { + let col = colIn * ${e}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) { + var value = valueIn; + let coords = vec3(batch, row, colIn); + ${r?`value = value + ${i?"bias[colIn]":`${hr(e,c)}(bias[row])`};`:""} + ${t} + ${l.setByIndices("vec3(coords)","value")} + } + } + `},Sa=(e,r,t,s,i=!1,n)=>{let o=e[0].dims,a=e[1].dims,l=o.slice(0,-2),c=a.slice(0,-2),p=s?s.slice(0,-2):t.slice(0,-2),u=Te.size(p),h=o[o.length-2],g=o[o.length-1],_=a[a.length-1],P=g%4===0&&_%4===0,A=h<=8?[4,1,1]:[4,4,1],v=[8,8,1],y=[Math.ceil(_/v[0]/A[0]),Math.ceil(h/v[1]/A[1]),Math.ceil(u/v[2]/A[2])],k=P?4:1,E=[...l,h,g/k],M=E.length,w=[...c,g,_/k],x=w.length,$=[u,h,_/k],z=[{type:6,data:h},{type:6,data:_},{type:6,data:g}];gn(r,z),z.push(...nt(p,E,w));let R=["rank","rank"],Q=e.length>2;Q&&(z.push(...nt(e[2].dims)),R.push("rank")),z.push(...nt($));let q=U=>{let Z=p.length,H=Ud("batchDims",e[0].dataType,Z,1),J=lr(e[0].dataType),ie=$e("a",e[0].dataType,M,k),ae=$e("b",e[1].dataType,x,k),ce=tt("result",e[0].dataType,$.length,k),he=[ie,ae];if(Q){let X=i?k:1;he.push($e("bias",e[2].dataType,e[2].dims.length,X))}let N=[{name:"dim_a_outer",type:"i32"},{name:"dim_b_outer",type:"i32"},{name:"dim_inner",type:"i32"}];wn(r,N);let O=lr(ce.type.tensor),G=_n(r,ce.type.value,O),se=df(k,Q,G,[H,ie,ae,ce],i);return` + ${U.registerUniforms(N).registerInternalVariables(H).declareVariables(...he,ce)} + ${se} + ${P?nc(A,v,J,H):oc(A,v,J,H)} + `};return{name:"MatMul",shaderCache:{hint:`${A};${r.activation};${P};${i}`,inputDependencies:R},getRunData:()=>({outputs:[{dims:n?n(t):t,dataType:e[0].dataType}],dispatchGroup:{x:y[0],y:y[1],z:y[2]},programUniforms:z}),getShaderSource:q}}}),cf,uf,Mv=Ve(()=>{pt(),Is(),Tt(),yn(),tc(),yv(),ac(),cf=(e,r,t,s,i=!1,n,o=4,a=4,l=4,c="f32")=>{let p=z=>{switch(z){case 1:return"resData = x[xIndex];";case 3:return`resData = vec3<${c}>(x[xIndex], x[xIndex + 1], x[xIndex + 2]);`;case 4:return"resData = x[xIndex / 4];";default:throw new Error(`innerElementSize ${z} is not supported.`)}},u=z=>{switch(z){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 new Error(`innerElementSize ${z} is not supported.`)}},h=e?` + let coord = vec4(batch, xRow, xCol, xCh); + `:` + let coord = vec4(batch, xCh, xRow, xCol); + `,g=e?` + let coords = vec4( + batch, + row / outWidth, + row % outWidth, + col); + `:` + let coords = vec4( + batch, + row, + col / outWidth, + col % outWidth); + `,_=e?"i32(uniforms.x_shape[1])":"i32(uniforms.x_shape[2])",P=e?"i32(uniforms.x_shape[2])":"i32(uniforms.x_shape[3])",A=e?"row":"col",v=e?"col":"row",y=` + let inChannels = i32(uniforms.w_shape[2]); + let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"}; + let outRow = ${A} / outWidth; + let outCol = ${A} % outWidth; + + let WRow = ${v} / (i32(uniforms.w_shape[1]) * inChannels); + let WCol = ${v} / inChannels % i32(uniforms.w_shape[1]); + 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 = ${v} % inChannels; + var resData = ${hr(o,c)}(0.0); + // The bounds checking is always needed since we use it to pad zero for + // the 'same' padding type. + if (xRow >= 0 && xRow < ${_} && xCol >= 0 && xCol < ${P}) { + ${h} + let xIndex = getIndexFromCoords4D(coord, vec4(uniforms.x_shape)); + ${p(o)} + } + return resData;`,k=e?r&&s?` + let col = colIn * ${o}; + ${y}`:` + let col = colIn * ${o}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_inner) { + ${y} + } + return ${hr(o,c)}(0.0);`:s&&t?` + let col = colIn * ${o}; + ${y}`:` + let col = colIn * ${o}; + if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { + ${y} + } + return ${hr(o,c)}(0.0);`,E=e?s&&t?u(a):` + let col = colIn * ${a}; + if (row < uniforms.dim_inner && col < uniforms.dim_b_outer) { + ${u(a)} + } + return ${hr(a,c)}(0.0);`:` + let col = colIn * ${a}; + if (row < uniforms.dim_inner && col < uniforms.dim_a_outer) { + ${u(a)} + } + return ${hr(a,c)}(0.0);`,M=hr(l,c),w=hr(e?o:a,c),x=hr(e?a:o,c),$=_n(n,M,c);return` + fn mm_readA(batch: i32, row : i32, colIn : i32) -> ${w} { + ${e?k:E} + } + + fn mm_readB(batch: i32, row : i32, colIn : i32) -> ${x} { + ${e?E:k} + } + + fn mm_write(batch: i32, row : i32, colIn : i32, valueIn : ${M}) { + let col = colIn * ${l}; + if (row < uniforms.dim_a_outer && col < uniforms.dim_b_outer) + { + var value = valueIn; + let outWidth = ${e?"i32(uniforms.result_shape[2])":"i32(uniforms.result_shape[3])"}; + ${g} + ${sf(i)} + ${$} + setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); + } + }`},uf=(e,r,t,s,i,n,o,a,l)=>{let c=r.format==="NHWC",p=c?e[0].dims[3]:e[0].dims[1],u=t[0],h=c?t[2]:t[3],g=c?t[1]:t[2],_=c?t[3]:t[1],P=c&&(p%4===0||p%3===0)&&_%4===0,A=c?_:h*g,v=c?h*g:_,y=[8,8,1],k=s<=8?[4,1,1]:[4,4,1],E=[Math.ceil(A/y[0]/k[0]),Math.ceil(v/y[1]/k[1]),Math.ceil(u/y[2]/k[2])];St("verbose",()=>`[conv2d_mm_webgpu] dispatch = ${E}`);let M=P?c&&p%4!==0?3:4:1,w=y[1]*k[1],x=y[0]*k[0],$=Math.max(y[0]*M,y[1]),z=s%w===0,R=i%x===0,Q=n%$===0,q=P?[M,4,4]:[1,1,1],U=[{type:6,data:s},{type:6,data:i},{type:6,data:n},{type:6,data:[r.pads[0],r.pads[1]]},{type:6,data:r.strides},{type:6,data:r.dilations}];gn(r,U),U.push(...nt(e[0].dims,e[1].dims));let Z=["rank","rank"];o&&(U.push(...nt(e[2].dims)),Z.push("rank")),U.push(...nt(t));let H=J=>{let ie=[{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}];wn(r,ie);let ae=P?4:1,ce=lr(e[0].dataType),he=` + fn setOutputAtIndex(flatIndex : i32, value : ${P?`vec4<${ce}>`:ce}) { + result[flatIndex] = ${P?`vec4<${ce}>`:ce}(value); + } + fn setOutputAtCoords(d0 : i32, d1 : i32, d2 : i32, d3 : i32, value : ${P?`vec4<${ce}>`:ce}) { + let flatIndex = getOutputIndexFromCoords(vec4(d0, d1, d2, d3)); + setOutputAtIndex(flatIndex ${P?"/ 4":""}, value); + }`,N=$e("x",e[0].dataType,e[0].dims.length,M===3?1:M),O=$e("w",e[1].dataType,e[1].dims.length,ae),G=[N,O],se=tt("result",e[0].dataType,t.length,ae);if(o){let X=$e("bias",e[2].dataType,e[2].dims.length,ae);G.push(X),he+=` + fn getBiasByOutputCoords(coords : vec4) -> ${P?`vec4<${ce}>`:ce} { + return bias[coords.${c?"w":"y"}${P?"/ 4":""}]; + }`}return` + ${nf("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 }; + ${J.registerUniforms(ie).declareVariables(...G,se)} + ${he} + ${cf(c,z,R,Q,o,r,q[0],q[1],q[2],ce)} + ${P?nc(k,y,ce,void 0,!c,$):oc(k,y,ce,void 0,!c,$,!1,void 0,a)}`};return{name:"Conv2DMatMul",shaderCache:{hint:`${r.cacheKey};${M};${P};${z};${R};${Q};${w};${x};${$}`,inputDependencies:Z},getRunData:()=>({outputs:[{dims:l?l(t):t,dataType:e[0].dataType}],dispatchGroup:{x:E[0],y:E[1],z:E[2]},programUniforms:U}),getShaderSource:H}}}),pf,lc,zi,hf,dc,mf,ff,_f,bv=Ve(()=>{pt(),Is(),Mt(),Tt(),yn(),tc(),pf=e=>{let r=1;for(let t=0;ttypeof e=="number"?[e,e,e]:e,zi=(e,r)=>r<=1?e:e+(e-1)*(r-1),hf=(e,r,t,s=1)=>{let i=zi(r,s);return Math.floor((e[0]*(t-1)-t+i)/2)},dc=(e,r,t,s,i)=>{i==null&&(i=hf(e,r[0],s[0]));let n=[0,0,0,t];for(let o=0;o<3;o++)e[o]+2*i>=r[o]&&(n[o]=Math.trunc((e[o]-r[o]+2*i)/s[o]+1));return n},mf=(e,r,t,s,i,n,o,a,l,c)=>{let p,u,h,g;if(e==="VALID"&&(e=0),typeof e=="number"){p={top:e,bottom:e,left:e,right:e,front:e,back:e};let _=dc([r,t,s,1],[a,l,c],1,[i,n,o],e);u=_[0],h=_[1],g=_[2]}else if(Array.isArray(e)){if(!e.every((P,A,v)=>P===v[0]))throw Error(`Unsupported padding parameter: ${e}`);p={top:e[0],bottom:e[1],left:e[2],right:e[3],front:e[4],back:e[5]};let _=dc([r,t,s,1],[a,l,c],1,[i,n,o],e[0]);u=_[0],h=_[1],g=_[2]}else if(e==="SAME_UPPER"){u=Math.ceil(r/i),h=Math.ceil(t/n),g=Math.ceil(s/o);let _=(u-1)*i+a-r,P=(h-1)*n+l-t,A=(g-1)*o+c-s,v=Math.floor(_/2),y=_-v,k=Math.floor(P/2),E=P-k,M=Math.floor(A/2),w=A-M;p={top:k,bottom:E,left:M,right:w,front:v,back:y}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:p,outDepth:u,outHeight:h,outWidth:g}},ff=(e,r,t,s,i,n=!1,o="channelsLast")=>{let a,l,c,p,u;if(o==="channelsLast")[a,l,c,p,u]=e;else if(o==="channelsFirst")[a,u,l,c,p]=e;else throw new Error(`Unknown dataFormat ${o}`);let[h,,g,_,P]=r,[A,v,y]=lc(t),[k,E,M]=lc(s),w=zi(g,k),x=zi(_,E),$=zi(P,M),{padInfo:z,outDepth:R,outHeight:Q,outWidth:q}=mf(i,l,c,p,A,v,y,w,x,$),U=n?h*u:h,Z=[0,0,0,0,0];return o==="channelsFirst"?Z=[a,U,R,Q,q]:o==="channelsLast"&&(Z=[a,R,Q,q,U]),{batchSize:a,dataFormat:o,inDepth:l,inHeight:c,inWidth:p,inChannels:u,outDepth:R,outHeight:Q,outWidth:q,outChannels:U,padInfo:z,strideDepth:A,strideHeight:v,strideWidth:y,filterDepth:g,filterHeight:_,filterWidth:P,effectiveFilterDepth:w,effectiveFilterHeight:x,effectiveFilterWidth:$,dilationDepth:k,dilationHeight:E,dilationWidth:M,inShape:e,outShape:Z,filterShape:r}},_f=(e,r,t,s,i,n)=>{let o=n==="channelsLast";o?e[0].dims[3]:e[0].dims[1];let a=[64,1,1],l={x:t.map((A,v)=>v)},c=[Math.ceil(pf(l.x.map(A=>t[A]))/a[0]),1,1];St("verbose",()=>`[conv3d_naive_webgpu] dispatch = ${c}`);let p=1,u=Te.size(t),h=[{type:12,data:u},{type:12,data:s},{type:12,data:i},{type:12,data:r.strides},{type:12,data:r.dilations}];gn(r,h),h.push(...nt(e[0].dims,e[1].dims));let g=["rank","rank"],_=e.length===3;_&&(h.push(...nt(e[2].dims)),g.push("rank")),h.push(...nt(t));let P=A=>{let v=[{name:"output_size",type:"u32"},{name:"filter_dims",type:"u32",length:s.length},{name:"pads",type:"u32",length:i.length},{name:"strides",type:"u32",length:r.strides.length},{name:"dilations",type:"u32",length:r.dilations.length}];wn(r,v);let y=1,k=lr(e[0].dataType),E=$e("x",e[0].dataType,e[0].dims.length,p),M=$e("W",e[1].dataType,e[1].dims.length,y),w=[E,M],x=tt("result",e[0].dataType,t.length,y),$="";if(_){let Q=$e("bias",e[2].dataType,e[2].dims.length,y);w.push(Q),$+=` + fn getBiasByOutputCoords(coords : array) -> ${k} { + return bias[${o?rt("coords",4,5):rt("coords",1,5)}]; + }`}let z=hr(p,k),R=_n(r,z,k);return` + ${$} + fn getX(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { + let aIndices = array(d0, d1, d2, d3, d4); + return ${E.getByIndices("aIndices")}; + } + fn getW(d0 : u32, d1 : u32, d2 : u32, d3 : u32, d4 : u32) -> f32 { + let aIndices = array(d0, d1, d2, d3, d4); + return ${M.getByIndices("aIndices")}; + } + ${A.registerUniforms(v).declareVariables(...w,x)} + ${A.mainStart()} + ${A.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + let coords = ${x.offsetToIndices("global_idx")}; + let batch = ${rt("coords",0,E.rank)}; + let d2 = ${o?rt("coords",E.rank-1,E.rank):rt("coords",1,E.rank)}; + let xFRCCorner = vec3(${o?rt("coords",1,E.rank):rt("coords",2,E.rank)}, + ${o?rt("coords",2,E.rank):rt("coords",3,E.rank)}, + ${o?rt("coords",3,E.rank):rt("coords",4,E.rank)}) * uniforms.strides - uniforms.pads; + let xFCorner = xFRCCorner.x; + let xRCorner = xFRCCorner.y; + let xCCorner = xFRCCorner.z; + let xShapeY = ${o?rt("uniforms.x_shape",1,E.rank):rt("uniforms.x_shape",2,E.rank)}; + let xShapeZ = ${o?rt("uniforms.x_shape",2,E.rank):rt("uniforms.x_shape",3,E.rank)}; + let xShapeW = ${o?rt("uniforms.x_shape",3,E.rank):rt("uniforms.x_shape",4,E.rank)}; + let xShapeU = ${o?rt("uniforms.x_shape",4,E.rank):rt("uniforms.x_shape",1,E.rank)}; + let inputDepthNearestVec4 = (xShapeU / 4) * 4; + let inputDepthVec4Remainder = xShapeU % 4; + + var value = 0.0; + for (var wF = 0u; wF < uniforms.filter_dims[0]; wF++) { + let xF = xFCorner + wF * uniforms.dilations[0]; + if (xF < 0 || xF >= xShapeY) { + continue; + } + + for (var wR = 0u; wR < uniforms.filter_dims[1]; wR++) { + let xR = xRCorner + wR * uniforms.dilations[1]; + if (xR < 0 || xR >= xShapeZ) { + continue; + } + + for (var wC = 0u; wC < uniforms.filter_dims[2]; wC++) { + let xC = xCCorner + wC * uniforms.dilations[2]; + if (xC < 0 || xC >= xShapeW) { + continue; + } + + for (var d1 = 0u; d1 < inputDepthNearestVec4; d1 += 4) { + ${o?`let xValues = vec4( + getX(batch, xF, xR, xC, d1), + getX(batch, xF, xR, xC, d1 + 1), + getX(batch, xF, xR, xC, d1 + 2), + getX(batch, xF, xR, xC, d1 + 3)); + `:`let xValues = vec4( + getX(batch, d1, xF, xR, xC), + getX(batch, d1 + 1, xF, xR, xC), + getX(batch, d1 + 2, xF, xR, xC), + getX(batch, d1 + 3, xF, xR, xC)); + `} + let wValues = vec4( + getW(d2, d1, wF, wR, wC), + getW(d2, d1 + 1, wF, wR, wC), + getW(d2, d1 + 2, wF, wR, wC), + getW(d2, d1 + 3, wF, wR, wC)); + value += dot(xValues, wValues); + } + if (inputDepthVec4Remainder == 1) { + ${o?`value += getX(batch, xF, xR, xC, inputDepthNearestVec4) + * getW(d2, inputDepthNearestVec4, wF, wR, wC);`:`value += getX(batch, inputDepthNearestVec4, xF, xR, xC) + * getW(d2, inputDepthNearestVec4, wF, wR, wC);`} + } else if (inputDepthVec4Remainder == 2) { + ${o?`let xValues = vec2( + getX(batch, xF, xR, xC, inputDepthNearestVec4), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)); + `:`let xValues = vec2( + getX(batch, inputDepthNearestVec4, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC)); + `} + let wValues = vec2( + getW(d2, inputDepthNearestVec4, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC)); + value += dot(xValues, wValues); + } else if (inputDepthVec4Remainder == 3) { + ${o?`let xValues = vec3( + getX(batch, xF, xR, xC, inputDepthNearestVec4), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1), + getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)); + `:`let xValues = vec3( + getX(batch, inputDepthNearestVec4, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 1, xF, xR, xC), + getX(batch, inputDepthNearestVec4 + 2, xF, xR, xC)); + `} + let wValues = vec3( + getW(d2, inputDepthNearestVec4, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 1, wF, wR, wC), + getW(d2, inputDepthNearestVec4 + 2, wF, wR, wC)); + value += dot(xValues, wValues); + } + } + } + } + ${_?"value = value + getBiasByOutputCoords(coords)":""}; + ${R} + result[global_idx] = f32(value); + }`};return{name:"Conv3DNaive",shaderCache:{hint:`${r.cacheKey};${o};${p};${_}`,inputDependencies:g},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:c[0],y:c[1],z:c[2]},programUniforms:h}),getShaderSource:P}}}),gf,wf,vv=Ve(()=>{pt(),Mt(),Tt(),yn(),gf=(e,r,t,s)=>{let i=e.length>2,n=i?"value += b[output_channel];":"",o=e[0].dims,a=e[1].dims,l=r.format==="NHWC",c=l?t[3]:t[1],p=c/r.group,u=l&&p>=4?Xt(c):1,h=Te.size(t)/u,g=[{type:12,data:h},{type:12,data:r.dilations},{type:12,data:[r.strides[0],r.strides[1]]},{type:12,data:[r.pads[0],r.pads[1]]},{type:12,data:p}];gn(r,g),g.push(...nt(o,[a[0],a[1],a[2],a[3]/u]));let _=i?["rank","rank","rank"]:["rank","rank"];g.push(...nt([t[0],t[1],t[2],t[3]/u]));let P=A=>{let v=tt("output",e[0].dataType,t.length,u),y=lr(v.type.tensor),k=_n(r,v.type.value,y),E=$e("x",e[0].dataType,o.length),M=$e("w",e[1].dataType,a.length,u),w=[E,M];i&&w.push($e("b",e[2].dataType,e[2].dims,u));let x=[{name:"output_size",type:"u32"},{name:"dilations",type:"u32",length:r.dilations.length},{name:"strides",type:"u32",length:2},{name:"pads",type:"u32",length:2},{name:"output_channels_per_group",type:"u32"}];wn(r,x);let $=l?` + for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[0]; wHeight++) { + let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; + + if (xHeight < 0u || xHeight >= uniforms.x_shape[1]) { + continue; + } + + for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[1]; wWidth++) { + let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; + if (xWidth < 0u || xWidth >= uniforms.x_shape[2]) { + continue; + } + + for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[2]; wInChannel++) { + let input_channel = in_channel_offset + wInChannel; + let xVal = ${E.get("batch","xHeight","xWidth","input_channel")}; + let wVal = ${M.get("wHeight","wWidth","wInChannel","output_channel")}; + value += xVal * wVal; + } + } + } + `:` + for (var wInChannel: u32 = 0u; wInChannel < uniforms.w_shape[1]; wInChannel++) { + let input_channel = in_channel_offset + wInChannel; + for (var wHeight: u32 = 0u; wHeight < uniforms.w_shape[2]; wHeight++) { + let xHeight = xRCCorner.x + wHeight * uniforms.dilations[0]; + + if (xHeight < 0u || xHeight >= uniforms.x_shape[2]) { + continue; + } + + for (var wWidth: u32 = 0u; wWidth < uniforms.w_shape[3]; wWidth++) { + let xWidth = xRCCorner.y + wWidth * uniforms.dilations[1]; + if (xWidth < 0u || xWidth >= uniforms.x_shape[3]) { + continue; + } + + let xVal = ${E.get("batch","input_channel","xHeight","xWidth")}; + let wVal = ${M.get("output_channel","wInChannel","wHeight","wWidth")}; + value += xVal * wVal; + } + } + } + `;return` + ${A.registerUniforms(x).declareVariables(...w,v)} + + ${A.mainStart()} + ${A.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + + let outputIndices = ${v.offsetToIndices("global_idx")}; + let batch: u32 = outputIndices[0]; + let output_channel: u32 = outputIndices[${l?3:1}]; + let xRCCorner: vec2 = vec2(outputIndices[${l?1:2}], outputIndices[${l?2:3}]) * uniforms.strides - uniforms.pads; + let group_id: u32 = output_channel * ${u} / uniforms.output_channels_per_group; + var in_channel_offset = group_id * uniforms.w_shape[${l?2:1}]; + + var value: ${v.type.value} = ${v.type.value}(0); + ${$} + ${n} + ${k} + ${v.setByOffset("global_idx","value")} + }`};return{name:"GroupedConv",shaderCache:{hint:`${r.cacheKey}_${u}`,inputDependencies:_},getRunData:()=>({outputs:[{dims:s?s(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:g}),getShaderSource:P}},wf=(e,r,t,s)=>{let i=e.length>2,n=Xt(t[3]),o=Xt(t[2]),a=Te.size(t)/n/o,l=[e[0].dims[0],e[0].dims[1],e[0].dims[2],e[0].dims[3]/n],c=[e[1].dims[0],e[1].dims[1],e[1].dims[2],e[1].dims[3]/n],p=[t[0],t[1],t[2],t[3]/n],u=[{type:12,data:a},{type:6,data:[r.strides[0],r.strides[1]]},{type:6,data:[r.pads[0],r.pads[1]]}];gn(r,u),u.push(...nt(l,c,p));let h=(o-1)*r.strides[1]+c[1],g=_=>{let P=tt("output",e[0].dataType,p.length,n),A=lr(P.type.tensor),v=_n(r,P.type.value,A),y=$e("x",e[0].dataType,l.length,n),k=$e("w",e[1].dataType,c.length,n),E=[y,k];i&&E.push($e("b",e[2].dataType,e[2].dims,n));let M=i?"value += b[output_channel];":"",w=[{name:"output_size",type:"u32"},{name:"strides",type:"i32",length:2},{name:"pads",type:"i32",length:2}];return wn(r,w),` + ${_.registerUniforms(w).declareVariables(...E,P)} + ${_.mainStart()} + ${_.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + let width0 = uniforms.output_shape[3]; + let output_channel = global_idx % width0; + var index1 = global_idx / width0; + let width1 = uniforms.output_shape[2] / ${o}u; + let col = (index1 % width1) * ${o}u; + index1 = index1 / width1; + let row = index1 % uniforms.output_shape[1]; + let batch = index1 / uniforms.output_shape[1]; + + let x_corner = vec2(i32(row), i32(col)) * uniforms.strides - uniforms.pads; + + var x_vals: array<${y.type.value}, ${h}>; + var values: array<${P.type.value}, ${o}>; + let input_channel = output_channel; + // Use constant instead of uniform can give better performance for w's height/width. + for (var w_height: u32 = 0u; w_height < ${c[0]}; w_height++) { + let x_height = x_corner.x + i32(w_height); + if (x_height >= 0 && u32(x_height) < uniforms.x_shape[1]) { + for (var i = 0; i < ${h}; i++) { + let x_width = x_corner.y + i; + if (x_width >= 0 && u32(x_width) < uniforms.x_shape[2]) { + x_vals[i] = ${y.get("batch","u32(x_height)","u32(x_width)","input_channel")}; + } else { + x_vals[i] = ${y.type.value}(0); + } + } + for (var w_width: u32 = 0u; w_width < ${c[1]}; w_width++) { + let w_val = ${k.get("w_height","w_width","0","output_channel")}; + for (var i = 0u; i < ${o}u; i++) { + values[i] = fma(x_vals[i * u32(uniforms.strides[1]) + w_width], w_val, values[i]); + } + } + } + } + + for (var i = 0u; i < ${o}u; i++) { + var value = values[i]; + ${M} + ${v} + ${P.set("batch","row","col + i","output_channel","value")}; + } + }`};return{name:"GroupedConv-Vectorize",shaderCache:{hint:`${r.cacheKey};${n};${o};${h};${c[0]};${c[1]}`,inputDependencies:i?["rank","rank","type"]:["rank","rank"]},getRunData:()=>({outputs:[{dims:s?s(t):t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(a/64)},programUniforms:u}),getShaderSource:g}}}),yf,$a,Mf,ka,cc,uc,bf,vf,pc,Tv=Ve(()=>{Mt(),Mv(),bv(),ac(),vv(),yn(),sc(),Ks(),yf=(e,r,t,s,i,n)=>{let o=e[0],a=e.slice(n?1:2,n?3:4),l=a.length,c=r[0],p=r.slice(2).map((h,g)=>h+(h-1)*(t[g]-1)),u=a.map((h,g)=>h+s[g]+s[g+l]).map((h,g)=>Math.floor((h-p[g]+i[g])/i[g]));return u.splice(0,0,o),u.splice(n?3:1,0,c),u},$a=[2,3,1,0],Mf=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length>5)throw new Error("greater than 5D is not supported");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let t=e[0].dims[r.format==="NHWC"?e[0].dims.length-1:1],s=e[1].dims[1]*r.group;if(t!==s)throw new 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 new Error("invalid bias");let i=e[0].dims.length-2;if(r.dilations.length!==i)throw new Error(`dilations should be ${i}D`);if(r.strides.length!==i)throw new Error(`strides should be ${i}D`);if(r.pads.length!==i*2)throw new Error(`pads should be ${i*2}D`);if(r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape")},ka=(e,r)=>{let t=e.kernelShape.slice();t.length{let r=ec(e),t=e.format,s=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][e.auto_pad],i=e.dilations,n=e.group,o=e.kernel_shape,a=e.pads,l=e.strides,c=e.w_is_const();return{autoPad:s,format:t,dilations:i,group:n,kernelShape:o,pads:a,strides:l,wIsConst:c,...r,cacheKey:`${e.format};${r.activation};`}},uc=(e,r,t,s)=>{let i=t.format==="NHWC",n=yf(r[0].dims,r[1].dims,t.dilations,t.pads,t.strides,i);if(t.group!==1){let w=[r[0]];if(i){let x=e.kernelCustomData.wT??e.compute(Nr(r[1],$a),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=x),w.push(x)}else w.push(r[1]);r.length===3&&w.push(r[2]),!e.adapterInfo.isArchitecture("ampere")&&i&&r[1].dims[0]===t.group&&r[1].dims[1]===1&&t.dilations[0]===1&&t.dilations[1]===1?e.compute(wf(w,t,n,s),{inputs:w}):e.compute(gf(w,t,n,s),{inputs:w});return}let o=r.length===3,a=r[0].dims[i?1:2],l=r[0].dims[i?2:3],c=r[0].dims[i?3:1],p=r[1].dims[2],u=r[1].dims[3],h=n[i?1:2],g=n[i?2:3],_=n[i?3:1],P=i&&p===a&&u===l&&t.pads[0]===0&&t.pads[1]===0;if(P||p===1&&u===1&&t.dilations[0]===1&&t.dilations[1]===1&&t.strides[0]===1&&t.strides[1]===1&&t.pads[0]===0&&t.pads[1]===0){let w=n[0],x,$,z,R=[];if(i){let U=e.kernelCustomData.wT??e.compute(Nr(r[1],$a),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];if(t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=U),P){let Z=a*l*c;x=r[0].reshape([1,w,Z]),$=U.reshape([1,Z,_]),z=[1,w,_]}else x=r[0].reshape([w,a*l,c]),$=U.reshape([1,c,_]),z=[w,h*g,_];R.push(x),R.push($)}else x=r[0].reshape([w,c,a*l]),$=r[1].reshape([1,_,c]),z=[w,_,h*g],R.push($),R.push(x);o&&R.push(r[2]);let Q=z[2],q=R[0].dims[R[0].dims.length-1];Q<8&&q<8?e.compute(rc(R,t,n,z,i,s),{inputs:R}):e.compute(Sa(R,t,n,z,i,s),{inputs:R});return}let A=!0,v=e.kernelCustomData.wT??e.compute(Nr(r[1],$a),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=v);let y=[r[0],v];o&&y.push(r[2]);let k=i?h*g:_,E=i?_:h*g,M=p*u*c;e.compute(uf(y,t,n,k,E,M,o,A,s),{inputs:y})},bf=(e,r)=>{let t=r.format==="NHWC",s=[e.inputs[0].reshape(t?[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&&s.push(e.inputs[2]);let i=[0,r.pads[0],0,r.pads[1]],n=[1].concat(r.strides),o=[1].concat(r.dilations),a=[1].concat(r.kernelShape),l=ka({...r,pads:i,strides:n,dilations:o,kernelShape:a},s);uc(e,s,l,c=>t?[c[0],c[2],c[3]]:[c[0],c[1],c[3]])},vf=(e,r,t)=>{let s=t.format==="NHWC"?"channelsLast":"channelsFirst",i=ka(t,r),n=t.autoPad==="NOTSET"?t.pads:t.autoPad,o=ff(r[0].dims,r[1].dims,t.strides,t.dilations,n,!1,s);e.compute(_f(r,i,o.outShape,[o.filterDepth,o.filterHeight,o.filterWidth],[o.padInfo.front,o.padInfo.top,o.padInfo.left],s))},pc=(e,r)=>{if(Mf(e.inputs,r),e.inputs[0].dims.length===3)bf(e,r);else if(e.inputs[0].dims.length===5)vf(e,e.inputs,r);else{let t=ka(r,e.inputs);uc(e,e.inputs,t)}}}),Tf,xv=Ve(()=>{pt(),Is(),Mt(),Tt(),Tf=(e,r,t)=>{let s=e.length>2,i=r.outputShape,n=r.format==="NHWC",o=r.group,a=e[1].dims,l=a[2]/o,c=a[3],p=n?Xt(l):1,u=n&&c===1&&l>=4,h=u?Math.floor(l/4)*4:Math.floor(l/p)*p,g=l-h,_=n?Xt(c):1,P=n?c===1?p:_:1,A=Te.size(i)/_,v=[Math.ceil(A/64),1,1];St("verbose",()=>`[conv2d_backprop_webgpu] dispatch = ${v}`);let y=["rank","rank"],k=[r.strides[0],r.strides[1]],E=[r.kernelShape[n?1:2],r.kernelShape[n?2:3]],M=[r.dilations[0],r.dilations[1]],w=[E[0]+(r.dilations[0]<=1?0:(r.kernelShape[n?1:2]-1)*(r.dilations[0]-1)),E[1]+(r.dilations[1]<=1?0:(r.kernelShape[n?2:3]-1)*(r.dilations[1]-1))],x=[w[0]-1-Math.floor((r.pads[0]+r.pads[2])/2),w[1]-1-Math.floor((r.pads[1]+r.pads[3])/2)],$=[{type:12,data:A},{type:12,data:k},{type:12,data:E},{type:12,data:M},{type:12,data:w},{type:6,data:x},{type:12,data:h},{type:12,data:l},{type:12,data:c},...nt(e[0].dims,e[1].dims)];s&&($.push(...nt(e[2].dims)),y.push("rank")),$.push(...nt(i));let z=R=>{let Q=[{name:"output_size",type:"u32"},{name:"strides",type:"u32",length:k.length},{name:"filter_dims",type:"u32",length:E.length},{name:"dilations",type:"u32",length:E.length},{name:"effective_filter_dims",type:"u32",length:w.length},{name:"pads",type:"i32",length:x.length},{name:"input_channels_per_group_int",type:"u32"},{name:"input_channels_per_group",type:"u32"},{name:"output_channels_per_group",type:"u32"}],q=lr(e[0].dataType),U=n?1:2,Z=n?2:3,H=n?3:1,J=$e("W",e[1].dataType,e[1].dims.length,P),ie=$e("Dy",e[0].dataType,e[0].dims.length,p),ae=[ie,J];s&&ae.push($e("bias",e[2].dataType,[i[H]].length,_));let ce=tt("result",e[0].dataType,i.length,_),he=()=>{let G="";if(u)p===4?G+=` + let xValue = ${ie.getByOffset("x_offset")}; + let wValue = ${J.getByOffset("w_offset")}; + dotProd = dotProd + dot(xValue, wValue); + x_offset += 1u; + w_offset += 1u;`:p===2?G+=` + dotProd = dotProd + dot(vec4<${q}>(${ie.getByOffset("x_offset")}, ${ie.getByOffset("x_offset + 1u")}), vec4<${q}>(${J.getByOffset("w_offset")}, ${J.getByOffset("w_offset + 1u")})); + x_offset += 2u; + w_offset += 2u;`:p===1&&(G+=` + dotProd = dotProd + dot(vec4<${q}>(${ie.getByOffset("x_offset")}, ${ie.getByOffset("x_offset + 1u")}, ${ie.getByOffset("x_offset + 2u")}, ${ie.getByOffset("x_offset + 3u")}), vec4<${q}>(${J.getByOffset("w_offset")}, ${J.getByOffset("w_offset + 1u")}, ${J.getByOffset("w_offset + 2u")}, ${J.getByOffset("w_offset + 3u")})); + x_offset += 4u; + w_offset += 4u;`);else if(G+=` + let xValue = ${n?ie.getByOffset(`${ie.indicesToOffset(`${ie.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}`):ie.get("batch","inputChannel","idyR","idyC")}; + `,p===1)G+=` + let w_offset = ${J.indicesToOffset(`${J.type.indices}(u32(wRPerm), u32(wCPerm), inputChannel, wOutChannel)`)}; + let wValue = ${J.getByOffset(`w_offset / ${P}`)}; + dotProd = dotProd + xValue * wValue;`;else for(let se=0;se{if(g===0)return"";if(!u)throw new Error(`packInputAs4 ${u} is not true.`);let G="";if(p===1){G+="dotProd = dotProd";for(let se=0;se(i32(r), i32(c)) - uniforms.pads; + let dyRCorner = dyCorner.x; + let dyCCorner = dyCorner.y; + let groupId = d1 / uniforms.output_channels_per_group; + let wOutChannel = d1 - groupId * uniforms.output_channels_per_group; + // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). + // ? = to be determined. : = across all values in that axis. + var dotProd = ${ce.type.value}(0.0); + var wR: u32 = 0; + if (uniforms.dilations.x == 1) { + // Minimum wR >= 0 that satisfies (dyRCorner + wR) % (uniforms.strides.x) == 0 + wR = u32(((dyRCorner + i32(uniforms.strides.x) - 1) / i32(uniforms.strides.x)) * i32(uniforms.strides.x) - dyRCorner); + } + for (; wR < uniforms.effective_filter_dims.x; wR = wR + 1) { + if (wR % uniforms.dilations.x != 0) { + continue; + } + let dyR = (${q}(dyRCorner) + ${q}(wR)) / ${q}(uniforms.strides[0]); + let wRPerm = uniforms.filter_dims.x - 1 - wR / uniforms.dilations.x; + if (dyR < 0.0 || dyR >= ${q}(uniforms.Dy_shape[${U}]) || fract(dyR) > 0.0 || + wRPerm < 0) { + continue; + } + let idyR: u32 = u32(dyR); + var wC: u32 = 0; + if (uniforms.dilations.y == 1) { + // Minimum wC >= 0 that satisfies (dyCCorner + wC) % (uniforms.strides.y) == 0 + wC = u32(((dyCCorner + i32(uniforms.strides.y) - 1) / i32(uniforms.strides.y)) * i32(uniforms.strides.y) - dyCCorner); + } + for (; wC < uniforms.effective_filter_dims.y; wC = wC + 1) { + if (wC % uniforms.dilations.y != 0) { + continue; + } + let dyC = (${q}(dyCCorner) + ${q}(wC)) / ${q}(uniforms.strides.y); + let wCPerm = uniforms.filter_dims.y - 1 - wC / uniforms.dilations.y; + if (dyC < 0.0 || dyC >= ${q}(uniforms.Dy_shape[${Z}]) || + fract(dyC) > 0.0 || wCPerm < 0) { + continue; + } + let idyC: u32 = u32(dyC); + var inputChannel = groupId * uniforms.input_channels_per_group; + ${u?` + var x_offset = ${ie.indicesToOffset(`${ie.type.indices}(batch, idyR, idyC, inputChannel)`)} / ${p}; + var w_offset = ${J.indicesToOffset(`${J.type.indices}(wRPerm, wCPerm, inputChannel, wOutChannel)`)} / ${P}; + `:""} + for (var d2: u32 = 0; d2 < uniforms.input_channels_per_group_int; d2 = d2 + ${u?4:p}) { + ${he()} + inputChannel = inputChannel + ${u?4:p}; + } + ${N()} + wC = wC + uniforms.strides.y - 1; + } + wR = wR + uniforms.strides[0] - 1; + } + let value = dotProd${s?` + bias[d1 / ${_}]`:""}; + ${ce.setByOffset("global_idx","value")}; + `;return` + ${R.registerUniforms(Q).declareVariables(...ae,ce)} + ${R.mainStart()} + ${R.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")}; + ${O}}`};return{name:"ConvTranspose2D",shaderCache:{hint:`${r.cacheKey};${p}${P}${_}${u}${g}`,inputDependencies:y},getRunData:()=>({dispatchGroup:{x:v[0],y:v[1],z:v[2]},outputs:[{dims:t?t(i):i,dataType:e[0].dataType}],programUniforms:$}),getShaderSource:z}}}),xf,Ef,Pf,hc,Cf,Sf,mc,$f,kf,Ev=Ve(()=>{xv(),yn(),Ks(),xf=(e,r,t,s,i,n)=>(e-1)*r+t+(s-1)*i+1-n,Ef=(e,r,t,s,i)=>{let n=Math.floor(e/2);r==="SAME_UPPER"?(t[s]=n,t[i]=e-n):r==="SAME_LOWER"&&(t[s]=e-n,t[i]=n)},Pf=(e,r,t,s,i,n,o,a,l,c)=>{let p=e.length-2,u=c.length===0;l.length{let t=e.kernelShape.slice();if(e.kernelShape.length===0||e.kernelShape.reduce((u,h)=>u*h,1)===0){t.length=0;for(let u=2;uu+h,0)===0){let u=r[0].dims.length-2;l=new Array(u).fill(1)}let c=e.strides.slice();if(c.reduce((u,h)=>u+h,0)===0){let u=r[0].dims.length-2;c=new Array(u).fill(1)}Pf(a,t,l,e.autoPad,e.group,i,c,s,o,n);let p=Object.assign({},e);return Object.assign(p,{kernelShape:t,pads:i,outputPadding:o,outputShape:n,dilations:l,strides:c}),p},Cf=e=>{let r=ec(e),t=e.format,s=["NOTSET","VALID","SAME_UPPER","SAME_LOWER"][typeof e.autoPad>"u"?0:e.autoPad],i=e.dilations,n=e.group,o=e.kernelShape,a=e.pads,l=e.strides,c=e.wIsConst(),p=e.outputPadding,u=e.outputShape;return{autoPad:s,format:t,dilations:i,group:n,kernelShape:o,outputPadding:p,outputShape:u,pads:a,strides:l,wIsConst:c,...r,cacheKey:`${e.format};${r.activation};`}},Sf=(e,r)=>{if(!e||e.length!==2&&e.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(e[0].dims.length!==4&&e[0].dims.length!==3)throw new Error("currently only support 2-dimensional conv");if(e[0].dims.length!==e[1].dims.length)throw new Error("filter does not have same dimension as input");let t=e[0].dims[r.format==="NHWC"?e[0].dims.length-1:1],s=e[1].dims[0];if(t!==s)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");let i=e[1].dims[1]*r.group;if(e.length===3&&(e[2].dims.length!==1||e[2].dims[0]!==i))throw new Error("invalid bias");let n=e[0].dims.length-2;if(r.dilations.reduce((o,a)=>o+a,0)>0&&r.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(r.strides.reduce((o,a)=>o+a,0)>0&&r.strides.length!==n)throw new Error(`strides should be ${n}D`);if(r.pads.reduce((o,a)=>o+a,0)>0&&r.pads.length!==n*2)throw new Error(`pads should be ${n*2}D`);if(r.outputPadding.length!==n&&r.outputPadding.length!==0)throw new Error(`output_padding should be ${n}D`);if(r.kernelShape.reduce((o,a)=>o+a,0)>0&&r.kernelShape.length!==0&&r.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(r.outputShape.length!==0&&r.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape")},mc=(e,r,t,s)=>{let i=e.kernelCustomData.wT??e.compute(Nr(r[1],[2,3,0,1]),{inputs:[1],outputs:[t.wIsConst?-2:-1]})[0];t.wIsConst&&!e.kernelCustomData.wT&&(e.kernelCustomData.wT=i);let n=[r[0],i];r.length===3&&n.push(r[2]),e.compute(Tf(n,t,s),{inputs:n})},$f=(e,r)=>{let t=r.format==="NHWC",s=[e.inputs[0].reshape(t?[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&&s.push(e.inputs[2]);let i=r.kernelShape;(i.length===0||i[0]===0)&&(i=[e.inputs[1].dims[2]]);let n=r.dilations;(n.length===0||n[0]===0)&&(n=[1]);let o=r.strides;(o.length===0||o[0]===0)&&(o=[1]);let a=r.pads;a.length===0&&(a=[0,0]),a=[0,a[0],0,a[1]],o=[1].concat(o),n=[1].concat(n),i=[1].concat(i);let l=r.outputPadding;l=[0].concat(l);let c=hc({...r,pads:a,strides:o,dilations:n,kernelShape:i,outputPadding:l},s);mc(e,s,c,p=>t?[p[0],p[2],p[3]]:[p[0],p[1],p[3]])},kf=(e,r)=>{if(Sf(e.inputs,r),e.inputs[0].dims.length===3)$f(e,r);else{let t=hc(r,e.inputs);mc(e,e.inputs,t)}}}),If,Af,Ff,Pv=Ve(()=>{pt(),Mt(),Yt(),Tt(),If=(e,r,t,s)=>{let i=Te.size(r),n=r.length,o=$e("input",e,n),a=tt("output",e,n),l=t.dataType===6?t.getInt32Array()[0]:Number(t.getBigInt64Array()[0]),c=Te.normalizeAxis(l,n),p=u=>{let h=` i32(${o.indicesGet("inputIndices","uniforms.axis")}) `,g=rt("uniforms.input_shape","uniforms.axis",n),_=s.reverse?h+(s.exclusive?" + 1":""):"0",P=s.reverse?g:h+(s.exclusive?"":" + 1");return` + ${u.registerUniform("outputSize","u32").registerUniform("axis","u32").declareVariables(o,a)} + ${u.mainStart()} + ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + var inputIndices = ${a.offsetToIndices("global_idx")}; + var sum = ${a.type.value}(0); + let first : i32 = ${_}; + let last : i32 = ${P}; + for (var i : i32 = first; i < last; i++) { + ${o.indicesSet("inputIndices","uniforms.axis","u32(i)")}; + sum = sum + ${o.getByIndices("inputIndices")}; + } + ${a.setByOffset("global_idx","sum")}; + }`};return{name:"CumSum",shaderCache:{hint:s.cacheKey,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:r,dataType:e}],dispatchGroup:{x:Math.ceil(i/64)},programUniforms:[{type:12,data:i},{type:12,data:c},...nt(r,r)]}),getShaderSource:p}},Af=(e,r)=>{let t=e.inputs[0].dims,s=e.inputs[0].dataType,i=e.inputs[1];e.compute(If(s,t,i,r),{inputs:[0]})},Ff=e=>{let r=e.exclusive===1,t=e.reverse===1;return Dt({exclusive:r,reverse:t})}}),Of,Df,Lf,zf,Bf,Cv=Ve(()=>{pt(),Mt(),Yt(),Tt(),Of=e=>{if(!e||e.length!==1)throw new Error("DepthToSpace requires 1 input.");if(e[0].dims.length!==4)throw new Error("DepthToSpace requires 4D input.")},Df=(e,r,t,s)=>{let i=[];i.push(`fn perm(i: ${s.type.indices}) -> ${t.type.indices} { + var a: ${t.type.indices};`);for(let n=0;n{let t,s,i,n,o,a,l=r.format==="NHWC",c=r.blocksize,p=r.mode==="DCR";l?([t,s,i,n]=e.dims,o=p?[t,s,i,c,c,n/c**2]:[t,s,i,n/c**2,c,c],a=p?[0,1,3,2,4,5]:[0,1,4,2,5,3]):([t,s,i,n]=[e.dims[0],e.dims[2],e.dims[3],e.dims[1]],o=p?[t,c,c,n/c**2,s,i]:[t,n/c**2,c,c,s,i],a=p?[0,3,4,1,5,2]:[0,1,4,2,5,3]);let u=e.reshape(o),h=u.dims.length,g=e.dataType,_=$e("a",g,h),P=tt("output",g,h),A=v=>` + ${v.registerUniform("output_size","u32").declareVariables(_,P)} + + ${Df(a,h,_,P)} + + ${v.mainStart()} + ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + + let indices = ${P.offsetToIndices("global_idx")}; + let aIndices = perm(indices); + + ${P.setByOffset("global_idx",_.getByIndices("aIndices"))} + }`;return{name:"DepthToSpace",shaderCache:{hint:`${e.dims};${r.blocksize};${r.mode}`,inputDependencies:["rank"]},getRunData:v=>{let y=l?[t,s*c,i*c,n/c**2]:[t,n/c**2,s*c,i*c],k=Te.size(y),E=u.dims,M=Te.sortBasedOnPerm(E,a);return{outputs:[{dims:y,dataType:v[0].dataType}],dispatchGroup:{x:Math.ceil(k/64)},programUniforms:[{type:12,data:k},...nt(E,M)]}},getShaderSource:A}},zf=(e,r)=>{Of(e.inputs),e.compute(Lf(e.inputs[0],r))},Bf=e=>Dt({blocksize:e.blocksize,mode:e.mode,format:e.format})}),Ia,Bi,fc,Rf,Nf,jf,Vf,_c,Uf,Wf,Gf,Sv=Ve(()=>{pt(),Mt(),Yt(),Tt(),Ia="[a-zA-Z]|\\.\\.\\.",Bi="("+Ia+")+",fc="^"+Bi+"$",Rf="("+Bi+",)*"+Bi,Nf="^"+Rf+"$",jf=class{constructor(e=-1){this.symbolToIndices=new Map,this.inputIndex=e}addSymbol(e,r){let t=this.symbolToIndices.get(e);t===void 0?t=[r]:t.push(r),this.symbolToIndices.set(e,t)}},Vf=class{constructor(e,r){var i;this.equation=r,this.hasEllipsis=!1,this.symbolToInfo=new Map,this.lhs=new Array,this.outputDims=[];let[t,s]=r.includes("->")?r.split("->",2):[r,""];if(!t.match(RegExp(Nf)))throw new Error("Invalid LHS term");if(t.split(",").forEach((n,o)=>{let a=e[o].dims.slice();if(!n.match(RegExp(fc)))throw new Error("Invalid LHS term");let l=this.processTerm(n,!0,a,o);this.lhs.push(l)}),s==="")s+=[...this.symbolToInfo.entries()].filter(([n,o])=>o.count===1||n==="...").map(([n])=>n).join("");else if(!s.match(RegExp(Bi)))throw new Error("Invalid RHS");(i=s.match(RegExp(Ia,"g")))==null||i.forEach(n=>{if(n==="...")this.outputDims=this.outputDims.concat(this.ellipsisDims);else{let o=this.symbolToInfo.get(n);if(o===void 0)throw new Error("Invalid RHS symbol");this.outputDims.push(o.dimValue)}}),this.rhs=this.processTerm(s,!1,this.outputDims)}addSymbol(e,r,t){let s=this.symbolToInfo.get(e);if(s!==void 0){if(s.dimValue!==r&&s.count!==1)throw new Error("Dimension mismatch");s.count++,s.inputIndices.push(t)}else s={count:1,dimValue:r,inputIndices:[t]};this.symbolToInfo.set(e,s)}processTerm(e,r,t,s=-1){let i=t.length,n=!1,o=[],a=0;if(!e.match(RegExp(fc))&&!r&&e!=="")throw new Error("Invalid LHS term");let l=e.match(RegExp(Ia,"g")),c=new jf(s);return l==null||l.forEach((p,u)=>{if(p==="..."){if(n)throw new Error("Only one ellipsis is allowed per input term");n=!0;let h=i-l.length+1;if(h<0)throw new Error("Ellipsis out of bounds");if(o=t.slice(a,a+h),this.hasEllipsis){if(this.ellipsisDims.length!==o.length||this.ellipsisDims.toString()!==o.toString())throw new Error("Ellipsis dimensions mismatch")}else if(r)this.hasEllipsis=!0,this.ellipsisDims=o;else throw new Error("Ellipsis must be specified in the LHS");for(let g=0;ge+"_max",Uf=(e,r,t,s)=>{let i=e.map(c=>c.length).map((c,p)=>$e(`input${p}`,r,c)),n=Te.size(s),o=tt("output",r,s.length),a=[...t.symbolToInfo.keys()].filter(c=>!t.rhs.symbolToIndices.has(c)),l=c=>{let p=[],u="var prod = 1.0;",h="var sum = 0.0;",g="sum += prod;",_=[],P=[],A=[],v=[],y=t.symbolToInfo.size===t.rhs.symbolToIndices.size;t.symbolToInfo.forEach((E,M)=>{var w;if(t.rhs.symbolToIndices.has(M)){let x=(w=t.rhs.symbolToIndices.get(M))==null?void 0:w[0];x!==void 0&&t.lhs.forEach(($,z)=>{if(E.inputIndices.includes(z)){let R=$.symbolToIndices.get(M);if(R===void 0)throw new Error("Invalid symbol error");R.forEach(Q=>{p.push(`${i[z].indicesSet(`input${z}Indices`,Q,o.indicesGet("outputIndices",x))}`)})}})}else t.lhs.forEach((x,$)=>{if(E.inputIndices.includes($)){let z=x.symbolToIndices.get(M);if(z===void 0)throw new Error("Invalid symbol error");z.forEach(R=>{_.push(`${i[$].indicesSet(`input${$}Indices`,R,`${M}`)}`)}),v.push(`prod *= ${i[$].getByIndices(`input${$}Indices`)};`)}}),P.push(`for(var ${M}: u32 = 0; ${M} < uniforms.${_c(M)}; ${M}++) {`),A.push("}")});let k=y?[...p,`let sum = ${i.map((E,M)=>E.getByIndices(`input${M}Indices`)).join(" * ")};`]:[...p,h,...P,..._,u,...v,g,...A];return` + ${c.registerUniforms(a.map(E=>({name:`${_c(E)}`,type:"u32"}))).registerUniform("outputSize","u32").declareVariables(...i,o)} + + ${c.mainStart()} + ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + var outputIndices = ${o.offsetToIndices("global_idx")}; + ${i.map((E,M)=>`var input${M}Indices: ${i[M].type.indices};`).join(` +`)} + ${k.join(` +`)}; + ${o.setByOffset("global_idx","sum")}; + }`};return{name:"Einsum",shaderCache:{hint:t.equation,inputDependencies:e.map(()=>"rank")},getRunData:()=>{let c=a.filter(u=>t.symbolToInfo.has(u)).map(u=>{var h;return{type:12,data:((h=t.symbolToInfo.get(u))==null?void 0:h.dimValue)||0}});c.push({type:12,data:n});let p=e.map((u,h)=>[...nt(u)]).reduce((u,h)=>u.concat(h),c);return p.push(...nt(s)),{outputs:[{dims:s,dataType:r}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:p}},getShaderSource:l}},Wf=(e,r)=>{let t=new Vf(e.inputs,r.equation),s=t.outputDims,i=e.inputs.map((n,o)=>n.dims);e.compute(Uf(i,e.inputs[0].dataType,t,s))},Gf=e=>{let r=e.equation.replace(/\s+/g,"");return Dt({equation:r})}}),Kf,gc,Hf,qf,Qf,$v=Ve(()=>{pt(),Mt(),Tt(),Kf=e=>{if(!e||e.length!==2)throw new Error("Expand requires 2 input.");let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),s=t.length{let t=e.length-r.length,s=[];for(let i=0;ie.length>r.length?gc(e,r):gc(r,e),qf=e=>{let r=e[0].dims,t=Array.from(e[1].getBigInt64Array(),Number),s=Hf(r,t),i=e[0].dataType,n=i===9||Te.size(r)===1,o=i===9||r.length>0&&r[r.length-1]%4===0?4:1,a=n||s.length>0&&s[s.length-1]%4===0?4:1,l=Math.ceil(Te.size(s)/a),c=u=>{let h=$e("input",i,r.length,o),g=tt("output",i,s.length,a),_;if(i===9){let P=(A,v,y="")=>` + let outputIndices${v} = ${g.offsetToIndices(`outputOffset + ${v}u`)}; + let offset${v} = ${h.broadcastedIndicesToOffset(`outputIndices${v}`,g)}; + let index${v} = offset${v} / 4u; + let component${v} = offset${v} % 4u; + ${A}[${v}] = ${y}(${h.getByOffset(`index${v}`)}[component${v}]); + `;_=` + let outputOffset = global_idx * ${a}; + var data = vec4(0); + ${P("data",0,"u32")} + ${P("data",1,"u32")} + ${P("data",2,"u32")} + ${P("data",3,"u32")} + ${g.setByOffset("global_idx","data")} + }`}else _=` + let outputIndices = ${g.offsetToIndices(`global_idx * ${a}`)}; + let inputOffset = ${h.broadcastedIndicesToOffset("outputIndices",g)}; + let data = ${g.type.value}(${h.getByOffset(`inputOffset / ${o}`)}); + ${g.setByOffset("global_idx","data")} + }`;return` + ${u.registerUniform("vec_size","u32").declareVariables(h,g)} + ${u.mainStart()} + ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} + ${_}`},p=[{type:12,data:l},...nt(r,s)];return{name:"Expand",shaderCache:{hint:`${s.length};${o}${a}`,inputDependencies:["rank"]},getShaderSource:c,getRunData:()=>({outputs:[{dims:s,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:p})}},Qf=e=>{Kf(e.inputs),e.compute(qf(e.inputs),{inputs:[0]})}}),Xf,Jf,kv=Ve(()=>{pt(),Mt(),Tt(),Zd(),Xf=e=>{let r=e[0].dataType,t=Te.size(e[0].dims),s=Te.size(e[1].dims),i=s%4===0,n=o=>{let a=$e("x",r,[1],4),l=$e("bias",r,[1],4),c=tt("y",r,[1],4),p=[{name:"output_vec_size",type:"u32"},{name:"bias_size",type:"u32"}],u=g=>` + let bias${g}_offset: u32 = (global_idx * 4 + ${g}) % uniforms.bias_size; + let bias${g} = ${l.getByOffset(`bias${g}_offset / 4`)}[bias${g}_offset % 4];`,h=i?` + let bias = ${l.getByOffset("global_idx % (uniforms.bias_size / 4)")};`:`${u(0)}${u(1)}${u(2)}${u(3)} + let bias = ${a.type.value}(bias0, bias1, bias2, bias3);`;return`${o.registerUniforms(p).declareVariables(a,l,c)} + + ${Jd(xr(r))} + + ${o.mainStart(jn)} + ${o.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_vec_size")} + + let x = ${a.getByOffset("global_idx")}; + ${h} + let x_in = x + bias; + ${c.setByOffset("global_idx",Yd("x_in"))} + }`};return{name:"FastGeluWithBias",shaderCache:{hint:`${i}`,inputDependencies:["type","type"]},getShaderSource:n,getRunData:o=>({outputs:[{dims:o[0].dims,dataType:o[0].dataType}],programUniforms:[{type:12,data:Math.ceil(t/4)},{type:12,data:s}],dispatchGroup:{x:Math.ceil(t/jn/4)}})}},Jf=e=>{e.inputs.length<2||Te.size(e.inputs[1].dims)===0?km(e):e.compute(Xf(e.inputs))}}),Yf,Zf,e_,t_,Iv=Ve(()=>{pt(),Mt(),Yt(),Tt(),Yf=e=>{if(!e||e.length!==2)throw new Error("Gather requires 2 inputs.")},Zf=(e,r)=>{let t=e[0].dims,s=e[1].dims,i=t.length,n=Te.normalizeAxis(r.axis,i),o=t.slice(0);o.splice(n,1,...s);let a=t[n],l=e[0].dataType===9?4:1,c=Math.ceil(Te.size(o)/l),p=[{type:12,data:c},{type:6,data:a},{type:12,data:n},...nt(e[0].dims,e[1].dims,o)],u=h=>{let g=$e("data",e[0].dataType,e[0].dims.length,l),_=$e("inputIndices",e[1].dataType,e[1].dims.length),P=tt("output",e[0].dataType,o.length,l),A=y=>{let k=s.length,E=`var indicesIndices${y} = ${_.type.indices}(0);`;for(let M=0;M1?`indicesIndices${y}[${M}]`:`indicesIndices${y}`} = ${o.length>1?`outputIndices${y}[uniforms.axis + ${M}]`:`outputIndices${y}`};`;E+=` + var idx${y} = ${_.getByIndices(`indicesIndices${y}`)}; + if (idx${y} < 0) { + idx${y} = idx${y} + uniforms.axisDimLimit; + } + var dataIndices${y} : ${g.type.indices}; + `;for(let M=0,w=0;M1?`dataIndices${y}[${M}]`:`dataIndices${y}`} = u32(idx${y});`,w+=k):(E+=`${i>1?`dataIndices${y}[${M}]`:`dataIndices${y}`} = ${o.length>1?`outputIndices${y}[${w}]`:`outputIndices${y}`};`,w++);return E},v;if(e[0].dataType===9){let y=(k,E,M="")=>` + let outputIndices${E} = ${P.offsetToIndices(`outputOffset + ${E}u`)}; + ${A(E)}; + let offset${E} = ${g.indicesToOffset(`dataIndices${E}`)}; + let index${E} = offset${E} / 4u; + let component${E} = offset${E} % 4u; + ${k}[${E}] = ${M}(${g.getByOffset(`index${E}`)}[component${E}]); + `;v=` + let outputOffset = global_idx * ${l}; + var value = vec4(0); + ${y("value",0,"u32")} + ${y("value",1,"u32")} + ${y("value",2,"u32")} + ${y("value",3,"u32")} + ${P.setByOffset("global_idx","value")} + `}else v=` + let outputIndices = ${P.offsetToIndices("global_idx")}; + ${A("")}; + let value = ${g.getByIndices("dataIndices")}; + ${P.setByOffset("global_idx","value")}; + `;return` + ${h.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(g,_,P)} + ${h.mainStart()} + ${h.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + ${v} + }`};return{name:"Gather",shaderCache:{hint:r.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:o,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:p}),getShaderSource:u}},e_=e=>Dt({axis:e.axis}),t_=(e,r)=>{let t=e.inputs;Yf(t),e.compute(Zf(e.inputs,r))}}),r_,s_,n_,Av=Ve(()=>{pt(),Mt(),Tt(),r_=(e,r,t,s,i,n,o,a,l)=>{let c=[{type:12,data:n},{type:12,data:s},{type:12,data:i},{type:12,data:t},{type:12,data:o},{type:12,data:a},{type:12,data:l}],p=[n];c.push(...nt(r.dims,p));let u=h=>{let g=$e("indices_data",r.dataType,r.dims.length),_=tt("input_slice_offsets_data",12,1,1),P=[g,_],A=[{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:t.length},{name:"num_slices_per_batch",type:"u32"},{name:"input_batch_stride",type:"u32"},{name:"num_slice_dims",type:"u32"}];return` + ${h.registerUniforms(A).declareVariables(...P)} + ${h.mainStart()} + ${h.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + let batch_idx = global_idx / uniforms.num_slices_per_batch; + let base_offset = batch_idx * uniforms.input_batch_stride; + + let slice_indices_base_offset = global_idx * uniforms.num_slice_dims; + var relative_slice_offset = 0; + for (var dim_idx = 0u; dim_idx < uniforms.num_slice_dims; dim_idx ++) { + var index = i32(indices_data[dim_idx + slice_indices_base_offset].x); + let input_dim_idx = uniforms.batch_dims + dim_idx; + if (index < 0) { + ${i.length===1?"index += i32(uniforms.input_dims);":"index += i32(uniforms.input_dims[input_dim_idx]);"} + } + ${t.length===1?"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data);":"relative_slice_offset += index * i32(uniforms.sizes_from_slice_dims_data[dim_idx]);"} + } + + input_slice_offsets_data[global_idx] = base_offset + u32(relative_slice_offset); + }`};return e.compute({name:"computeSliceOffsets",shaderCache:{hint:`${i.length}_${t.length}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:p,dataType:e.inputs[1].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:c}),getShaderSource:u},{inputs:[r],outputs:[-1]})[0]},s_=(e,r)=>{let t=e.inputs,s=t[0].dims,i=t[0].dataType,n=t[1].dims,o=n[n.length-1],a=Te.sizeToDimension(n,n.length-1),l=Te.sizeFromDimension(s,r.batchDims+o),c=Te.sizeToDimension(s,r.batchDims),p=Te.sizeFromDimension(s,r.batchDims),u=a/c,h=new Array(o),g=l;for(let E=0;Es.length)throw new Error("last dimension of indices must not be larger than rank of input tensor");let A=n.slice(0,-1).concat(s.slice(P)),v=Te.size(A),y=[{type:12,data:v},{type:12,data:l},...nt(t[0].dims,_.dims,A)],k=E=>{let M=$e("data",t[0].dataType,t[0].dims.length),w=$e("slice_offsets",12,_.dims.length),x=tt("output",t[0].dataType,A.length);return` + ${E.registerUniform("output_size","u32").registerUniform("slice_size","u32").declareVariables(M,w,x)} + ${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:r.cacheKey,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:A,dataType:i}],dispatchGroup:{x:Math.ceil(v/64)},programUniforms:y}),getShaderSource:k},{inputs:[t[0],_]})},n_=e=>({batchDims:e.batch_dims,cacheKey:""})}),i_,o_,a_,l_,Fv=Ve(()=>{pt(),Mt(),Yt(),Tt(),i_=(e,r)=>{if(e.length<3||e.length>4)throw new Error("GatherBlockQuantized requires 3 or 4 inputs.");let t=Te.normalizeAxis(r.quantizeAxis,e[0].dims.length),s=r.blockSize,i=e[0],n=e[2],o=e.length===4?e[3]:void 0;if(n.dims.length!==i.dims.length||!i.dims.map((a,l)=>l===t?Math.ceil(a/s)===n.dims[l]:a===n.dims[l]).reduce((a,l)=>a&&l,!0))throw new 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 new Error("Zero point must have the same data type as the input tensor.");if(o.dims.length!==n.dims.length||!o.dims.map((a,l)=>a===n.dims[l]).reduce((a,l)=>a&&l,!0))throw new Error("Zero point must have the same rank as the input tensor and the dims should match except on quantizeAxis.")}},o_=(e,r)=>{let t=e[0].dims,s=e[1].dims,i=t.length,n=Te.normalizeAxis(r.gatherAxis,i),o=Te.normalizeAxis(r.quantizeAxis,i),a=t.slice(0);a.splice(n,1,...s);let l=Te.size(a),c=e[2].dataType,p=e[0].dataType===22,u=[{type:12,data:l},{type:12,data:o},{type:12,data:n},{type:12,data:r.blockSize},...nt(...e.map((g,_)=>g.dims),a)],h=g=>{let _=$e("data",e[0].dataType,e[0].dims.length),P=$e("inputIndices",e[1].dataType,e[1].dims.length),A=$e("scales",e[2].dataType,e[2].dims.length),v=e.length>3?$e("zeroPoint",e[3].dataType,e[3].dims.length):void 0,y=tt("output",c,a.length),k=[_,P,A];v&&k.push(v);let E=[{name:"output_size",type:"u32"},{name:"quantize_axis",type:"u32"},{name:"gather_axis",type:"u32"},{name:"block_size",type:"u32"}];return` + ${g.registerUniforms(E).declareVariables(...k,y)} + ${g.mainStart()} + let output_indices = ${y.offsetToIndices("global_idx")}; + var indices_indices = ${P.type.indices}(0); + ${s.length>1?` + for (var i: u32 = 0; i < ${s.length}; i++) { + let index = ${y.indicesGet("output_indices","uniforms.gather_axis + i")}; + ${P.indicesSet("indices_indices","i","index")}; + }`:`indices_indices = ${y.indicesGet("output_indices","uniforms.gather_axis")};`}; + var data_indices = ${_.type.indices}(0); + for (var i: u32 = 0; i < uniforms.gather_axis; i++) { + let index = ${y.indicesGet("output_indices","i")}; + ${_.indicesSet("data_indices","i","index")}; + } + var index_from_indices = ${P.getByIndices("indices_indices")}; + if (index_from_indices < 0) { + index_from_indices += ${t[n]}; + } + ${_.indicesSet("data_indices","uniforms.gather_axis","u32(index_from_indices)")}; + for (var i = uniforms.gather_axis + 1; i < ${a.length}; i++) { + let index = ${y.indicesGet("output_indices",`i + ${s.length} - 1`)}; + ${_.indicesSet("data_indices","i","index")}; + } + let data_offset = ${_.indicesToOffset("data_indices")}; + let data_index = data_offset % 8; + // Convert 4-bit packed data to 8-bit packed data. + let packed_4bit_quantized_data = ${_.getByOffset("data_offset / 8")}; + let packed_8bit_quantized_data = (packed_4bit_quantized_data >> (4 * (data_index % 2))) & 0x0f0f0f0f; + let quantized_data_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_quantized_data)); + let quantized_data = quantized_data_vec[data_index / 2]; + var scale_indices = data_indices; + let quantize_axis_index = ${A.indicesGet("data_indices","uniforms.quantize_axis")} / uniforms.block_size; + ${A.indicesSet("scale_indices","uniforms.quantize_axis","quantize_axis_index")}; + var scale = ${A.getByIndices("scale_indices")}; + ${v?` + let zero_point_indices = scale_indices; + let zero_point_offset = ${v.indicesToOffset("zero_point_indices")}; + let zero_point_index = zero_point_offset % 8; + let packed_4bit_zero_points = ${v.getByOffset("zero_point_offset / 8")}; + let packed_8bit_zero_points = (packed_4bit_zero_points >> (4 * (zero_point_index % 2))) & 0x0f0f0f0f; + let zero_point_vec = ${p?"unpack4xI8":"unpack4xU8"}(u32(packed_8bit_zero_points)); + let zero_point = zero_point_vec[zero_point_index / 2];`:"var zero_point = 0"}; + let dequantized_data = ${xr(c)}(quantized_data - zero_point) * scale; + ${y.setByOffset("global_idx","dequantized_data")}; + }`};return{name:"GatherBlockQuantized",shaderCache:{hint:`${r.cacheKey};${e.filter((g,_)=>_!==1).map(g=>g.dims.join("_")).join(";")}`,inputDependencies:Array.from({length:e.length},(g,_)=>"rank")},getRunData:()=>({outputs:[{dims:a,dataType:c}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:u}),getShaderSource:h}},a_=(e,r)=>{let t=e.inputs;i_(t,r),e.compute(o_(e.inputs,r))},l_=e=>Dt({blockSize:e.blockSize,gatherAxis:e.gatherAxis,quantizeAxis:e.quantizeAxis})}),d_,c_,u_,p_,Ov=Ve(()=>{pt(),Mt(),Yt(),Tt(),d_=e=>{if(!e||e.length!==2)throw new Error("GatherElements requires 2 inputs.");if(e[0].dims.length<1)throw new Error("GatherElements requires that the data input be rank >= 1.");if(e[0].dims.length!==e[1].dims.length)throw new Error(`GatherElements requires that the data input and + indices input tensors be of same rank.`)},c_=(e,r)=>{let t=e[0].dims,s=e[0].dataType,i=t.length,n=e[1].dims,o=e[1].dataType,a=Te.normalizeAxis(r.axis,i),l=t[a],c=n.slice(0),p=Te.size(c),u=$e("input",s,i),h=$e("indicesInput",o,n.length),g=tt("output",s,c.length),_=[{type:12,data:p},{type:6,data:l},{type:12,data:a}];return _.push(...nt(t,n,c)),{name:"GatherElements",shaderCache:{inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:c,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:_}),getShaderSource:P=>` + ${P.registerUniform("outputSize","u32").registerUniform("axisDimLimit","i32").registerUniform("axis","u32").declareVariables(u,h,g)} + ${P.mainStart()} + ${P.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + + let outputIndices = ${g.offsetToIndices("global_idx")}; + + var idx = ${h.getByOffset("global_idx")}; + if (idx < 0) { + idx = idx + uniforms.axisDimLimit; + } + var inputIndices = ${u.type.indices}(outputIndices); + ${u.indicesSet("inputIndices","uniforms.axis","u32(idx)")}; + let value = ${u.getByIndices("inputIndices")}; + + ${g.setByOffset("global_idx","value")}; + }`}},u_=e=>Dt({axis:e.axis}),p_=(e,r)=>{let t=e.inputs;d_(t),e.compute(c_(e.inputs,r))}}),h_,m_,f_,__,Dv=Ve(()=>{pt(),Mt(),Tt(),h_=e=>{if(!e)throw new Error("Input is missing");if(e.length<2||e.length>3)throw new Error("Invaid input number.");if(e.length===3&&e[2].dims.length>2)throw new Error("Invalid input shape of C");if(e[0].dataType!==e[1].dataType||e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("Input types are mismatched")},m_=(e,r)=>{let t=e[0].dims.slice(),s=e[1].dims.slice(),[i,n,o]=Lp.getShapeOfGemmResult(t,r.transA,s,r.transB,e.length===3?e[2].dims:void 0),a=[i,n];if(!a)throw new Error("Can't use gemm on the given tensors");let l=16,c=Math.ceil(n/l),p=Math.ceil(i/l),u=!0,h=Te.size(a),g=[{type:12,data:u?c:h},{type:12,data:i},{type:12,data:n},{type:12,data:o},{type:1,data:r.alpha},{type:1,data:r.beta}],_=["type","type"];e.length===3&&(g.push(...nt(e[2].dims)),_.push("rank")),g.push(...nt(a));let P=v=>{let y="";r.transA&&r.transB?y="value += a[k * uniforms.M + m] * b[n * uniforms.K + k];":r.transA&&!r.transB?y="value += a[k * uniforms.M + m] * b[k * uniforms.N + n];":!r.transA&&r.transB?y="value += a[m * uniforms.K + k] * b[n * uniforms.K + k];":!r.transA&&!r.transB&&(y="value += a[m * uniforms.K + k] * b[k * uniforms.N + n];");let k=r.alpha===1?"":"value *= uniforms.alpha;",E=$e("a",e[0].dataType,e[0].dims),M=$e("b",e[1].dataType,e[1].dims),w=E.type.value,x=null,$=[E,M];e.length===3&&(x=$e("c",e[2].dataType,e[2].dims.length),$.push(x));let z=tt("output",e[0].dataType,a.length);$.push(z);let R=[{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` + ${v.registerUniforms(R).declareVariables(...$)} + + ${v.mainStart()} + ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + + let m = global_idx / uniforms.N; + let n = global_idx % uniforms.N; + + var value = ${w}(0); + for (var k: u32 = 0u; k < uniforms.K; k++) { + ${y} + } + + ${k} + ${x!=null?`let cOffset = ${x.broadcastedIndicesToOffset("vec2(m, n)",z)}; value += ${w}(uniforms.beta) * ${x.getByOffset("cOffset")};`:""} + output[global_idx] = value; + }`},A=v=>{let y=$e("a",e[0].dataType,e[0].dims),k=$e("b",e[1].dataType,e[1].dims),E=null,M=[y,k];e.length===3&&(E=$e("c",e[2].dataType,e[2].dims.length),M.push(E));let w=tt("output",e[0].dataType,a.length);M.push(w);let x=[{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"}],$="",z="";r.transA&&r.transB?(z=` + var col = tile_row_start + local_id.x; + var row = k_start + local_id.y; + if (col < uniforms.M && row < uniforms.K) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; + } else { + tile_a[local_id.y][local_id.x] = ${y.type.value}(0); + } + + col = k_start + local_id.x; + row = tile_col_start + local_id.y; + if (col < uniforms.K && row < uniforms.N) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; + } else { + tile_b[local_id.y][local_id.x] = ${k.type.value}(0); + } + `,$="value += tile_a[k][local_id.y] * tile_b[local_id.x][k];"):r.transA&&!r.transB?(z=` + var col = tile_row_start + local_id.x; + var row = k_start + local_id.y; + if (col < uniforms.M && row < uniforms.K) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.M + col]; + } else { + tile_a[local_id.y][local_id.x] = ${y.type.value}(0); + } + + col = tile_col_start + local_id.x; + row = k_start + local_id.y; + if (col < uniforms.N && row < uniforms.K) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; + } else { + tile_b[local_id.y][local_id.x] = ${k.type.value}(0); + } + `,$="value += tile_a[k][local_id.y] * tile_b[k][local_id.x];"):!r.transA&&r.transB?(z=` + var col = k_start + local_id.x; + var row = tile_row_start + local_id.y; + if (col < uniforms.K && row < uniforms.M) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; + } else { + tile_a[local_id.y][local_id.x] = ${y.type.value}(0); + } + + col = k_start + local_id.x; + row = tile_col_start + local_id.y; + if (col < uniforms.K && row < uniforms.N) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.K + col]; + } else { + tile_b[local_id.y][local_id.x] = ${k.type.value}(0); + } + `,$="value += tile_a[local_id.y][k] * tile_b[local_id.x][k];"):!r.transA&&!r.transB&&(z=` + var col = k_start + local_id.x; + var row = tile_row_start + local_id.y; + if (col < uniforms.K && row < uniforms.M) { + tile_a[local_id.y][local_id.x] = a[row * uniforms.K + col]; + } else { + tile_a[local_id.y][local_id.x] = ${y.type.value}(0); + } + + col = tile_col_start + local_id.x; + row = k_start + local_id.y; + if (col < uniforms.N && row < uniforms.K) { + tile_b[local_id.y][local_id.x] = b[row * uniforms.N + col]; + } else { + tile_b[local_id.y][local_id.x] = ${k.type.value}(0); + } + `,$="value += tile_a[local_id.y][k] * tile_b[k][local_id.x];");let R=r.alpha===1?"":"value *= uniforms.alpha;";return` + ${v.registerUniforms(x).declareVariables(...M)} + var tile_a: array, ${l}>; + var tile_b: array, ${l}>; + ${v.mainStart([l,l,1])} + let tile_col_start = (workgroup_index % uniforms.num_tile_n) * ${l}; + let tile_row_start = (workgroup_index / uniforms.num_tile_n) * ${l}; + let num_tiles = (uniforms.K - 1) / ${l} + 1; + var k_start = 0u; + var value = ${w.type.value}(0); + for (var t: u32 = 0u; t < num_tiles; t++) { + ${z} + k_start = k_start + ${l}; + workgroupBarrier(); + + for (var k: u32 = 0u; k < ${l}; k++) { + ${$} + } + workgroupBarrier(); + } + + ${R} + let m = tile_row_start + local_id.y; + let n = tile_col_start + local_id.x; + ${E!=null?`let cOffset = ${E.broadcastedIndicesToOffset("vec2(m, n)",w)}; value += ${w.type.value}(uniforms.beta) * ${E.getByOffset("cOffset")};`:""} + if (m < uniforms.M && n < uniforms.N) { + output[m * uniforms.N + n] = value; + } + }`};return u?{name:"GemmShared",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:_},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:c*p},programUniforms:g}),getShaderSource:A}:{name:"Gemm",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:_},getRunData:()=>({outputs:[{dims:a,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:g}),getShaderSource:P}},f_=e=>{let r=e.transA,t=e.transB,s=e.alpha,i=e.beta;return{transA:r,transB:t,alpha:s,beta:i,cacheKey:`${e.transA};${e.transB};${e.alpha===1}`}},__=(e,r)=>{h_(e.inputs),e.compute(m_(e.inputs,r))}}),vs,As,Mn,bn,g_,w_,y_,M_,b_,v_,T_,x_,E_,P_,Lv=Ve(()=>{pt(),Mt(),Yt(),Tt(),[vs,As,Mn,bn]=[0,1,2,3],g_=e=>{if(e[0].dims.length!==4)throw new Error("only 4-D tensor is supported.");if(e[0].dims.length!==e[1].dims.length)throw new Error("input dimensions must be equal to grid dimensions");if(e[0].dims.length-2!==e[1].dims[e[1].dims.length-1])throw new Error(`last dimension of grid must be equal to ${e[0].dims.length-2}`);if(e[0].dims[0]!==e[1].dims[0])throw new Error("grid batch size must match input batch size")},w_=` + fn gs_get_cubic_coeffs(x: f32) -> vec4 { + let cubic_alpha = -0.75f; + let x_abs = abs(x); + var coeffs: vec4; + coeffs[0] = (((cubic_alpha * (x_abs + 1) - 5 * cubic_alpha) * (x_abs + 1) + 8 * cubic_alpha) * (x_abs + 1) - 4 * cubic_alpha); + coeffs[1] = (((cubic_alpha + 2) * x_abs - (cubic_alpha + 3)) * x_abs * x_abs + 1); + coeffs[2] = (((cubic_alpha + 2) * (1 - x_abs) - (cubic_alpha + 3)) * (1 - x_abs) * (1 - x_abs) + 1); + coeffs[3] = (((cubic_alpha * (2 - x_abs) - 5 * cubic_alpha) * (2 - x_abs) + 8 * cubic_alpha) * (2 - x_abs) - 4 * cubic_alpha); + return coeffs; + } +`,y_=e=>` + fn gs_bicubic_interpolate(p: mat4x4<${e}>, x: f32, y: f32) -> ${e} { + var v: vec4; + var coeffs = gs_get_cubic_coeffs(x); + for (var i = 0; i < 4; i++) { + v[i] = coeffs[0] * p[i][0] + coeffs[1] * p[i][1] + coeffs[2] * p[i][2] + coeffs[3] * p[i][3]; + } + coeffs = gs_get_cubic_coeffs(y); + let pixel = ${e}(coeffs[0] * v[0] + coeffs[1] * v[1] + coeffs[2] * v[2] + coeffs[3] * v[3]); + return pixel; + } +`,M_=e=>` + fn gs_denormalize(n: f32, length: i32) -> f32 { + ${e.alignCorners===0?` + // alignCorners: false => [-1, 1] to [-0.5, length - 0.5] + return ((n + 1.0) * f32(length) - 1.0) / 2.0; + `:` + // alignCorners: true => [-1, 1] to [0, length - 1] + return (n + 1.0) / 2.0 * (f32(length - 1)); + `} + } +`,b_=e=>` + ${e.paddingMode==="reflection"?` + fn gs_reflect(x: i32, x_min: f32, x_max: f32) -> u32 { + var dx = 0.0; + var fx = f32(x); + let range = x_max - x_min; + if (fx < x_min) { + dx = x_min - fx; + let n = u32(dx / range); + let r = dx - f32(n) * range; + if (n % 2 == 0) { + fx = x_min + r; + } else { + fx = x_max - r; + } + } else if (fx > x_max) { + dx = fx - x_max; + let n = u32(dx / range); + let r = dx - f32(n) * range; + if (n % 2 == 0) { + fx = x_max - r; + } else { + fx = x_min + r; + } + } + return u32(fx); + }`:""} +`,v_=(e,r,t)=>` + fn pixel_at_grid(r: i32, c: i32, H: i32, W: i32, batch: u32, channel: u32, border: vec4) -> ${r} { + var pixel = ${r}(0); + var indices = vec4(0); + indices[${vs}] = batch; + indices[${As}] = channel;`+(()=>{switch(t.paddingMode){case"zeros":return` + if (r >= 0 && r < H && c >=0 && c < W) { + indices[${Mn}] = u32(r); + indices[${bn}] = u32(c); + } + `;case"border":return` + indices[${Mn}] = u32(clamp(r, 0, H - 1)); + indices[${bn}] = u32(clamp(c, 0, W - 1)); + `;case"reflection":return` + indices[${Mn}] = gs_reflect(r, border[1], border[3]); + indices[${bn}] = gs_reflect(c, border[0], border[2]); + `;default:throw new Error(`padding mode ${t.paddingMode} is not supported`)}})()+` + return ${e.getByIndices("indices")}; + } +`,T_=(e,r,t)=>(()=>{switch(t.mode){case"nearest":return` + let result = pixel_at_grid(i32(round(y)), i32(round(x)), H_in, W_in, indices[${vs}], indices[${As}], 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[${vs}], indices[${As}], border); + let p12 = pixel_at_grid(y1, x2, H_in, W_in, indices[${vs}], indices[${As}], border); + let p21 = pixel_at_grid(y2, x1, H_in, W_in, indices[${vs}], indices[${As}], border); + let p22 = pixel_at_grid(y2, x2, H_in, W_in, indices[${vs}], indices[${As}], border); + + let dx2 = ${r}(f32(x2) - x); + let dx1 = ${r}(x - f32(x1)); + let dy2 = ${r}(f32(y2) - y); + let dy1 = ${r}(y - f32(y1)); + let result = dy2 * (dx2 * p11 + dx1 * p12) + dy1 * (dx2 * p21 + dx1 * p22); + `;case"bicubic":return` + let x0 = i32(floor(x)) - 1; + let y0 = i32(floor(y)) - 1; + var p: mat4x4<${r}>; + 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[${vs}], indices[${As}], border); + } + } + + let dx = x - f32(x0 + 1); + let dy = y - f32(y0 + 1); + let result = gs_bicubic_interpolate(p, dx, dy); + `;default:throw new Error(`mode ${t.mode} is not supported`)}})()+`${e.setByOffset("global_idx","result")}`,x_=(e,r)=>{let t=$e("x",e[0].dataType,e[0].dims.length),s=[e[1].dims[0],e[1].dims[1],e[1].dims[2]],i=$e("grid",e[1].dataType,s.length,2),n=[e[0].dims[0],e[0].dims[1],e[1].dims[1],e[1].dims[2]];r.format==="NHWC"&&(n=[e[0].dims[0],e[1].dims[1],e[1].dims[2],e[0].dims[3]],[vs,As,Mn,bn]=[0,3,1,2]);let o=tt("output",e[0].dataType,n.length),a=t.type.value,l=Te.size(n),c=[{type:12,data:l},...nt(e[0].dims,s,n)],p=u=>` + ${u.registerUniform("output_size","u32").declareVariables(t,i,o)} + ${w_} + ${y_(a)} + ${M_(r)} + ${b_(r)} + ${v_(t,a,r)} + + ${u.mainStart()} + ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + let H_in = i32(uniforms.x_shape[${Mn}]); + let W_in = i32(uniforms.x_shape[${bn}]); + + ${r.alignCorners===0?` + let x_min = -0.5; + let x_max = f32(W_in) - 0.5; + let y_min = -0.5; + let y_max = f32(H_in) - 0.5; + `:` + let x_min = 0.0; + let x_max = f32(W_in) - 1.0; + let y_min = 0.0; + let y_max = f32(H_in) - 1.0; + `}; + let border = vec4(x_min, y_min, x_max, y_max); + + let indices = ${o.offsetToIndices("global_idx")}; + var grid_indices = vec3(indices[${vs}], indices[${Mn}], indices[${bn}]); + let nxy = ${i.getByIndices("grid_indices")}; + var x = gs_denormalize(f32(nxy[0]), W_in); + var y = gs_denormalize(f32(nxy[1]), H_in); + + ${T_(o,a,r)} + }`;return{name:"GridSample",shaderCache:{hint:`${r.cacheKey}`,inputDependencies:["type","type"]},getRunData:u=>{let h=Te.size(n);return{outputs:[{dims:n,dataType:u[0].dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:c}},getShaderSource:p}},E_=(e,r)=>{g_(e.inputs),e.compute(x_(e.inputs,r))},P_=e=>Dt({alignCorners:e.align_corners,mode:e.mode,paddingMode:e.padding_mode,format:e.format})}),$r,C_,S_,wc,$_,Ri,k_,I_=Ve(()=>{pt(),Mt(),Yt(),Bd(),Qd(),Tt(),Ks(),$r=(e,r)=>e.length>r&&e[r].dims.length>0?e[r]:void 0,C_=(e,r)=>{let t=e[0],s=$r(e,1),i=$r(e,2),n=$r(e,3),o=$r(e,4),a=$r(e,5),l=$r(e,6),c=$r(e,7);if(t.dims.length!==3&&t.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let p=t.dims[0],u=t.dims[1],h=t.dims.length===3?t.dims[2]:r.numHeads*t.dims[4],g=u,_=0,P=0,A=Math.floor(h/r.numHeads);if(l&&c&&Te.size(l.dims)&&Te.size(c.dims)){if(l.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(l.dims[0]!==p||l.dims[1]!==r.numHeads||l.dims[3]!==A)throw new Error('Input "past_key" shape (batch_size, num_heads, past_sequence_length, head_size)');if(c.dims[0]!==p||c.dims[1]!==r.numHeads||c.dims[3]!==A)throw new Error('Input "past_value" shape (batch_size, num_heads, past_sequence_length, head_size)');if(l.dims[2]!==c.dims[2])throw new Error('Input "past_key" and "past_value" shall have same dim 2 (past_sequence_length)');if(c.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');_=l.dims[2],P=l.dims[2]}else if(l&&Te.size(l.dims)||c&&Te.size(c.dims))throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let v;if(s&&Te.size(s.dims)>0){if(t.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(s.dims.length<3||s.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(s.dims.length===3){if(s.dims[2]!==t.dims[2])throw new Error('Input "query" and "key" shall have same dim 2 (hidden_size)');v=2,g=s.dims[1]}else if(s.dims.length===5){if(s.dims[2]!==r.numHeads||s.dims[3]!==2||s.dims[4]!==A)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(i)throw new Error('Expect "value" be none when "key" has packed kv format.');v=5,g=s.dims[1]}else{if(s.dims[1]!==r.numHeads||s.dims[3]!==A)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');v=0,g=s.dims[2]}}else{if(t.dims.length!==5)throw new Error('Input "query" is expected to have 5 dimensions when key is empty');if(t.dims[2]!==r.numHeads||t.dims[3]!==3)throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');v=3}if(n&&Te.size(n.dims)>0){if(n.dims.length!==1)throw new Error('Input "bias" is expected to have 1 dimension');if(s&&s.dims.length===5&&s.dims[3]===2)throw new Error("bias is not allowed for packed kv.")}let y=_+g,k=0;if(o&&Te.size(o.dims)>0){k=8;let x=o.dims;throw x.length===1?x[0]===p?k=1:x[0]===3*p+2&&(k=3):x.length===2&&x[0]===p&&x[1]===y&&(k=5),k===8?new Error('Input "key_padding_mask" shape shall be (batch_size) or (batch_size, total_sequence_length)'):new Error("Mask not supported")}let E=!1,M=h;if(i&&Te.size(i.dims)>0){if(i.dims.length!==3&&i.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(t.dims[0]!==i.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(i.dims.length===3){if(g!==i.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');M=i.dims[2]}else{if(g!==i.dims[2])throw new Error('Input "key" and "value" shall have the same dim 2 (kv_sequence_length)');M=i.dims[1]*i.dims[3],E=!0}}let w=!1;if(o&&Te.size(o.dims)>0)throw new Error("Key padding mask is not supported");if(a&&Te.size(a.dims)>0){if(a.dims.length!==4)throw new Error('Input "attention_bias" is expected to have 4 dimensions');if(a.dims[0]!==p||a.dims[1]!==r.numHeads||a.dims[2]!==u||a.dims[3]!==y)throw new Error('Expect "attention_bias" shape (batch_size, num_heads, sequence_length, total_sequence_length)')}return{batchSize:p,sequenceLength:u,pastSequenceLength:_,kvSequenceLength:g,totalSequenceLength:y,maxSequenceLength:P,inputHiddenSize:0,hiddenSize:h,vHiddenSize:M,headSize:A,vHeadSize:Math.floor(M/r.numHeads),numHeads:r.numHeads,isUnidirectional:!1,pastPresentShareBuffer:!1,maskFilterValue:r.maskFilterValue,maskType:k,scale:r.scale,broadcastResPosBias:w,passPastInKv:E,qkvFormat:v}},S_=e=>Dt({...e}),wc=Dt({perm:[0,2,1,3]}),$_=(e,r,t,s,i,n,o)=>{let a=[s,i,n],l=Te.size(a),c=[{type:12,data:l},{type:12,data:o},{type:12,data:n}],p=u=>{let h=tt("qkv_with_bias",r.dataType,a),g=$e("qkv",r.dataType,a),_=$e("bias",t.dataType,a),P=[{name:"output_size",type:"u32"},{name:"bias_offset",type:"u32"},{name:"hidden_size",type:"u32"}];return` + ${u.registerUniforms(P).declareVariables(g,_,h)} + ${u.mainStart()} + ${u.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:a,dataType:r.dataType,gpuDataType:0}],dispatchGroup:{x:Math.ceil(l/64)},programUniforms:c}),getShaderSource:p},{inputs:[r,t],outputs:[-1]})[0]},Ri=(e,r,t,s,i,n,o,a)=>{let l=n;if(o&&Te.size(o.dims)>0){if(s===1)throw new Error("AddBiasReshape is not implemented. Please export your model with packed QKV or KV");return l=$_(e,n,o,r,s,t*i,a),l=l.reshape([r,s,t,i]),t===1||s===1?l:e.compute(Nr(l,wc.perm),{inputs:[l],outputs:[-1]})[0]}else return n.dims.length===3&&(l=n.reshape([r,s,t,i])),t===1||s===1?l:e.compute(Nr(l,wc.perm),{inputs:[l],outputs:[-1]})[0]},k_=(e,r)=>{let t=C_(e.inputs,r),s=e.inputs[0],i=$r(e.inputs,1),n=$r(e.inputs,2),o=$r(e.inputs,3),a=$r(e.inputs,4),l=$r(e.inputs,5),c=$r(e.inputs,6),p=$r(e.inputs,7);if(s.dims.length===5)throw new Error("Packed QKV is not implemented");if((i==null?void 0:i.dims.length)===5)throw new Error("Packed KV is not implemented");let u=i&&n&&i.dims.length===4&&n.dims.length===4,h=Ri(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,s,o,0);if(u)return Oi(e,h,i,n,a,void 0,c,p,l,t);if(!i||!n)throw new Error("key and value must be provided");let g=Ri(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.headSize,i,o,t.hiddenSize),_=Ri(e,t.batchSize,t.numHeads,t.kvSequenceLength,t.vHeadSize,n,o,2*t.hiddenSize);Oi(e,h,g,_,a,void 0,c,p,l,t)}}),A_,F_,O_,D_,yc,L_,z_,B_=Ve(()=>{pt(),Mt(),Yt(),Tt(),A_=e=>{if(!e||e.length<1)throw new Error("too few inputs")},F_=(e,r)=>{let t=[],s=r.numOutputs;return e[1].dims[0]>0&&(e[1].getBigInt64Array().forEach(i=>t.push(Number(i))),s=t.length),Dt({numOutputs:s,axis:r.axis,splitSizes:t})},O_=e=>` +fn calculateOutputIndex(index: u32) -> u32 { + for (var i: u32 = 0u; i < ${e}u; i += 1u ) { + if (index < ${rt("uniforms.size_in_split_axis","i",e)}) { + return i; + } + } + return ${e}u; +}`,D_=e=>{let r=e.length,t=[];for(let s=0;s{let t=e[0].dims,s=Te.size(t),i=e[0].dataType,n=Te.normalizeAxis(r.axis,t.length),o=new Array(r.numOutputs),a=$e("input",i,t.length),l=new Array(r.numOutputs),c=[],p=[],u=0,h=[{type:12,data:s}];for(let _=0;_` + ${_.registerUniform("input_size","u32").registerUniform("size_in_split_axis","u32",l.length).declareVariables(a,...o)} + ${O_(l.length)} + ${D_(o)} + + ${_.mainStart()} + ${_.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.input_size")} + + var indices = ${a.offsetToIndices("global_idx")}; + var index = ${a.indicesGet("indices",n)}; + let output_number = calculateOutputIndex(index); + if (output_number != 0) { + index -= ${rt("uniforms.size_in_split_axis","output_number - 1u",l.length)}; + ${a.indicesSet("indices",n,"index")}; + } + writeBufferData(output_number, indices, global_idx); + }`;return{name:"Split",shaderCache:{hint:r.cacheKey,inputDependencies:["rank"]},getShaderSource:g,getRunData:()=>({outputs:c,dispatchGroup:{x:Math.ceil(s/64)},programUniforms:h})}},L_=(e,r)=>{A_(e.inputs);let t=e.inputs.length===1?r:F_(e.inputs,r);e.compute(yc(e.inputs,t),{inputs:[0]})},z_=e=>{let r=e.axis,t=e.splitSizes,s=e.numOutputs<0?t.length:e.numOutputs;if(s!==t.length)throw new Error("numOutputs and splitSizes lengh must be equal");return Dt({axis:r,numOutputs:s,splitSizes:t})}}),R_,N_,Mc,j_,zv=Ve(()=>{Yt(),Qd(),I_(),B_(),Ks(),R_=(e,r)=>{if(r.doRotary)throw new Error("GroupQuerryAttention do_rotary attribute is not supported");if(r.doRotary&&e.length<=7)throw new Error("cos_cache and sin_cache inputs are required if do_rotary is specified");let t=e[0],s=e[1],i=e[2],n=e[3],o=e[4];if(r.localWindowSize!==-1)throw new Error("Local attention is not supported");if(r.softcap!==0)throw new Error("Softcap is not supported");if(r.rotaryInterleaved!==0)throw new Error("Rotary interleaved is not supported");if(r.smoothSoftmax)throw new Error("Smooth softmax is not supported");if(t.dims.length!==3&&t.dims.length!==5)throw new Error("Input query is expected to have 3 or 5 dimensions");let a=!1,l=t.dims[0],c=t.dims[1],p=t.dims.length===3?a?t.dims[2]/3:t.dims[2]:r.numHeads*t.dims[4],u=c,h=0,g=!s||s.dims.length===0,_=Math.floor(g?p/(r.numHeads+2*r.kvNumHeads):p/r.numHeads);g&&(p=_*r.numHeads);let P=n&&n.dims.length!==0,A=o&&o.dims.length!==0;if(P&&n.dims.length===4&&n.dims[0]===l&&n.dims[1]!==r.kvNumHeads&&n.dims[2]===r.kvNumHeads&&n.dims[3]===_)throw new Error("BSNH pastKey/pastValue is not supported");if(P&&A){if(n.dims.length!==4)throw new Error('Input "past_key" is expected to have 4 dimensions');if(o.dims.length!==4)throw new Error('Input "past_value" is expected to have 4 dimensions');h=n.dims[2]}else if(P||A)throw new Error('Input "past_key" and "past_value" shall be both present or both absent');let v=1;if(s&&s.dims.length>0){if(t.dims.length!==3)throw new Error('Input "query" is expected to have 3 dimensions when key is given');if(s.dims.length<3||s.dims.length>5)throw new Error('Input "key" is expected to have 3, 4, or 5 dimensions');if(t.dims[0]!==s.dims[0])throw new Error('Input "query" and "key" shall have same dim 0 (batch size)');if(s.dims.length===3){if(t.dims[2]%s.dims[2]!==0)throw new Error('Dimension 2 of "query" should be a multiple of "key"');u=s.dims[1]}else if(s.dims.length===5){if(s.dims[2]!==r.numHeads||s.dims[3]!==2||s.dims[4]!==_)throw new Error('Expect "key" shape (batch_size, kv_sequence_length, num_heads, 2, head_size) for packed kv');if(i)throw new Error('Expect "value" be none when "key" has packed kv format.');u=s.dims[1]}else{if(s.dims[1]!==r.numHeads||s.dims[3]!==_)throw new Error('Expect "key" shape (batch_size, num_heads, kv_sequence_length, head_size) for past_key');u=s.dims[2]}}else{if(t.dims.length!==3&&t.dims.length!==5)throw new Error('Input "query" is expected to have 3 or 5 dimensions when key is empty');if(t.dims.length===5&&(t.dims[2]!==r.numHeads||t.dims[3]!==3))throw new Error('Expect "query" shape (batch_size, kv_sequence_length, num_heads, 3, head_size) for packed kv');v=3}let y=0,k=!1,E=r.kvNumHeads?_*r.kvNumHeads:p;if(i&&i.dims.length>0){if(i.dims.length!==3&&i.dims.length!==4)throw new Error('Input "value" is expected to have 3 or 4 dimensions');if(t.dims[0]!==i.dims[0])throw new Error('Input "query" and "value" shall have same dim 0 (batch_size)');if(i.dims.length===3){if(u!==i.dims[1])throw new Error('Input "key" and "value" shall have the same dim 1 (kv_sequence_length)');E=i.dims[2]}else{if(u!==i.dims[2])throw new Error('Input "past_key" and "past_value" shall have the same dim 2 (kv_sequence_length)');E=i.dims[1]*i.dims[3],k=!0}}let M=e.length>4?e[5]:void 0;if(M&&M.dims.length!==1&&M.dims[0]!==l)throw new Error('Input "seqlens" is expected to have 1 dimension and the same dim 0 as batch_size');return{batchSize:l,sequenceLength:c,pastSequenceLength:h,kvSequenceLength:u,totalSequenceLength:-1,maxSequenceLength:-1,inputHiddenSize:0,hiddenSize:p,vHiddenSize:E,headSize:_,vHeadSize:Math.floor(E/r.kvNumHeads),numHeads:r.numHeads,kvNumHeads:r.kvNumHeads,nReps:r.numHeads/r.kvNumHeads,pastPresentShareBuffer:!1,maskType:y,scale:r.scale,broadcastResPosBias:!1,passPastInKv:k,qkvFormat:v}},N_=Dt({perm:[0,2,1,3]}),Mc=(e,r,t)=>{let s=r,i=t.kvNumHeads;return r.dims.length===3&&t.kvSequenceLength!==0&&(s=r.reshape([t.batchSize,t.kvSequenceLength,i,t.headSize]),s=e.compute(Nr(s,N_.perm),{inputs:[s],outputs:[-1]})[0]),s},j_=(e,r)=>{var A;let t=R_(e.inputs,r);if(e.inputs[0].dims.length===5)throw new Error("Packed QKV is not implemented");if(((A=e.inputs[1])==null?void 0:A.dims.length)===5)throw new Error("Packed KV is not implemented");let s=e.inputs[0],i=e.inputs[1]&&e.inputs[1].dims.length>0?e.inputs[1]:void 0,n=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,a=e.inputs[4]&&e.inputs[4].dims.length!==0?e.inputs[4]:void 0,l=e.inputs.length>4?e.inputs[5]:void 0,c=e.inputs.length>5?e.inputs[6]:void 0,p=t.kvNumHeads?t.kvNumHeads:t.numHeads,u=Dt({axis:2,numOutputs:3,splitSizes:[t.numHeads*t.headSize,p*t.headSize,p*t.headSize]}),[h,g,_]=!i&&!n?e.compute(yc([s],u),{inputs:[s],outputs:[-1,-1,-1]}):[s,i,n],P=Ri(e,t.batchSize,t.numHeads,t.sequenceLength,t.headSize,h,void 0,0);Oi(e,P,Mc(e,g,t),Mc(e,_,t),void 0,void 0,o,a,void 0,t,l,c)}}),bc,V_,U_,W_,Bv=Ve(()=>{pt(),Mt(),Ks(),Tt(),bc=(e,r,t,s,i,n,o,a)=>{let l=Xt(n),c=l===1?"f32":`vec${l}f`,p=l===1?"vec2f":`mat2x${l}f`,u=i*o,h=64;u===1&&(h=256);let g=[i,o,n/l],_=[i,o,2],P=["rank","type","type"],A=[];A.push(...nt(g,_));let v=y=>{let k=$e("x",r.dataType,3,l),E=$e("scale",t.dataType,t.dims),M=$e("bias",s.dataType,s.dims),w=tt("output",1,3,2),x=[k,E,M,w];return` + var workgroup_shared : array<${p}, ${h}>; + const workgroup_size = ${h}u; + ${y.declareVariables(...x)} + ${y.mainStart(h)} + let batch = workgroup_index / uniforms.x_shape[1]; + let channel = workgroup_index % uniforms.x_shape[1]; + let hight = uniforms.x_shape[2]; + // initialize workgroup memory + var sum = ${c}(0); + var squared_sum = ${c}(0); + for (var h = local_idx; h < hight; h += workgroup_size) { + let value = ${c}(${k.get("batch","channel","h")}); + sum += value; + squared_sum += value * value; + } + workgroup_shared[local_idx] = ${p}(sum, squared_sum); + workgroupBarrier(); + + for (var currSize = workgroup_size >> 1; currSize > 0; currSize = currSize >> 1) { + if (local_idx < currSize) { + workgroup_shared[local_idx] = workgroup_shared[local_idx] + workgroup_shared[local_idx + currSize]; + } + workgroupBarrier(); + } + if (local_idx == 0) { + let sum_final = ${Gs("workgroup_shared[0][0]",l)} / f32(hight * ${l}); + let squared_sum_final = ${Gs("workgroup_shared[0][1]",l)} / f32(hight * ${l}); + + let inv_std_dev = inverseSqrt(squared_sum_final - sum_final * sum_final + f32(${a})); + 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:`${l};${a};${h}`,inputDependencies:P},getRunData:()=>({outputs:[{dims:_,dataType:1}],dispatchGroup:{x:u},programUniforms:A}),getShaderSource:v},{inputs:[r,t,s],outputs:[-1]})[0]},V_=(e,r,t)=>{let s=r[0].dims,i=s,n=2,o=s[0],a=s[1],l=Te.sizeFromDimension(s,n),c=Xt(l),p=Te.size(i)/c,u=bc(e,r[0],r[1],r[2],o,l,a,t.epsilon),h=[o,a,l/c],g=[o,a],_=["type","none"],P=A=>{let v=$e("x",r[0].dataType,h.length,c),y=$e("scale_shift",1,g.length,2),k=tt("output",r[0].dataType,h.length,c),E=[v,y,k];return` + ${A.registerUniform("output_size","u32").declareVariables(...E)} + ${A.mainStart()} + ${A.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + let outputIndices = ${k.offsetToIndices("global_idx")}; + let batch = outputIndices[0]; + let channel = outputIndices[1]; + let scale_shift = ${y.getByIndices("vec2(batch, channel)")}; + let value = ${v.getByOffset("global_idx")} * ${k.type.value}(scale_shift.x) + ${k.type.value}(scale_shift.y); + ${k.setByOffset("global_idx","value")}; + }`};e.compute({name:"InstanceNormalization",shaderCache:{hint:`${c}`,inputDependencies:_},getRunData:()=>({outputs:[{dims:i,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(p/64)},programUniforms:[{type:12,data:p},...nt(h,g,h)]}),getShaderSource:P},{inputs:[r[0],u]})},U_=(e,r,t)=>{let s=r[0].dims,i=s,n=s[0],o=s[s.length-1],a=Te.sizeFromDimension(s,1)/o,l=Xt(o),c=Te.size(i)/l,p=[{type:12,data:a},{type:12,data:Math.floor(o/l)}],u=["type","type"],h=!1,g=[0,s.length-1];for(let v=0;vs[g[y]])),P=bc(e,_,r[1],r[2],n,a,o,t.epsilon),A=v=>{let y=lr(r[0].dataType),k=l===1?"vec2f":`mat${l}x2f`,E=x=>{let $=x===0?"x":"y",z=l===1?"f32":`vec${l}f`;switch(l){case 1:return`${y}(${z}(scale.${$}))`;case 2:return`vec2<${y}>(${z}(scale[0].${$}, scale[1].${$}))`;case 4:return`vec4<${y}>(${z}(scale[0].${$}, scale[1].${$}, scale[2].${$}, scale[3].${$}))`;default:throw new Error(`Not supported compoents ${l}`)}},M=$e("input",r[0].dataType,r[0].dims,l),w=tt("output",r[0].dataType,i,l);return` + @group(0) @binding(0) var input : array<${M.type.storage}>; + @group(0) @binding(1) var scale_input : array<${k}>; + @group(0) @binding(2) var output : array<${w.type.storage}>; + struct Uniforms {H: u32, C : u32}; + @group(0) @binding(3) var uniforms: Uniforms; + + ${v.mainStart()} + let current_image_number = global_idx / (uniforms.C * uniforms.H); + let current_channel_number = global_idx % uniforms.C; + + let scale_offset = current_image_number * uniforms.C + current_channel_number; + let scale = scale_input[scale_offset]; + output[global_idx] = fma(input[global_idx], ${E(0)}, ${E(1)}); + }`};e.compute({name:"InstanceNormalizationNHWC",shaderCache:{hint:`${l}`,inputDependencies:u},getRunData:()=>({outputs:[{dims:i,dataType:r[0].dataType}],dispatchGroup:{x:Math.ceil(c/64)},programUniforms:p}),getShaderSource:A},{inputs:[r[0],P]})},W_=(e,r)=>{r.format==="NHWC"?U_(e,e.inputs,r):V_(e,e.inputs,r)}}),G_,K_,H_,Rv=Ve(()=>{pt(),Mt(),Tt(),G_=e=>{if(!e||e.length<2)throw new Error("layerNorm requires at least 2 inputs.")},K_=(e,r,t)=>{let s=r.simplified,i=e[0].dims,n=e[1],o=!s&&e[2],a=i,l=Te.normalizeAxis(r.axis,i.length),c=Te.sizeToDimension(i,l),p=Te.sizeFromDimension(i,l),u=Te.size(n.dims),h=o?Te.size(o.dims):0;if(u!==p||o&&h!==p)throw new Error(`Size of X.shape()[axis:] == ${p}. + Size of scale and bias (if provided) must match this. + Got scale size of ${u} and bias size of ${h}`);let g=[];for(let M=0;M1,y=t>2,k=M=>{let w=lr(e[0].dataType),x=[$e("x",e[0].dataType,e[0].dims,_),$e("scale",n.dataType,n.dims,_)];o&&x.push($e("bias",o.dataType,o.dims,_)),x.push(tt("output",e[0].dataType,a,_)),v&&x.push(tt("mean_data_output",1,g)),y&&x.push(tt("inv_std_output",1,g));let $=[{name:"norm_count",type:"u32"},{name:"norm_size",type:"f32"},{name:"norm_size_vectorized",type:"u32"},{name:"epsilon",type:"f32"}];return` + ${M.registerUniforms($).declareVariables(...x)} + ${M.mainStart()} + ${M.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.norm_count")} + let offset = global_idx * uniforms.norm_size_vectorized; + var mean_vector = ${Vd("f32",_)}; + var mean_square_vector = ${Vd("f32",_)}; + + for (var h: u32 = 0u; h < uniforms.norm_size_vectorized; h++) { + let value = ${Vn(w,_,"x[h + offset]")}; + mean_vector += value; + mean_square_vector += value * value; + } + let mean = ${Gs("mean_vector",_)} / uniforms.norm_size; + let inv_std_dev = inverseSqrt(${Gs("mean_square_vector",_)} / uniforms.norm_size ${s?"":"- mean * mean"} + uniforms.epsilon); + + for (var j: u32 = 0; j < uniforms.norm_size_vectorized; j++) { + let f32input = ${Vn(w,_,"x[j + offset]")}; + let f32scale = ${Vn(w,_,"scale[j]")}; + output[j + offset] = ${x[0].type.value}((f32input ${s?"":"- mean"}) * inv_std_dev * f32scale + ${o?`+ ${Vn(w,_,"bias[j]")}`:""} + ); + } + + ${v?"mean_data_output[global_idx] = mean":""}; + ${y?"inv_std_output[global_idx] = inv_std_dev":""}; + }`},E=[{dims:a,dataType:e[0].dataType}];return v&&E.push({dims:g,dataType:1}),y&&E.push({dims:g,dataType:1}),{name:"LayerNormalization",shaderCache:{hint:`${_};${t};${s}`,inputDependencies:P},getRunData:()=>({outputs:E,dispatchGroup:{x:Math.ceil(c/64)},programUniforms:A}),getShaderSource:k}},H_=(e,r)=>{G_(e.inputs),e.compute(K_(e.inputs,r,e.outputCount))}}),q_,Q_,Nv=Ve(()=>{Mt(),sc(),ac(),q_=e=>{if(!e||e.length!==2)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.")},Q_=e=>{q_(e.inputs);let r=Nn.calcShape(e.inputs[0].dims,e.inputs[1].dims,!0);if(!r)throw new Error("Can't use matmul on the given tensors");let t=r[r.length-1],s=e.inputs[0].dims[e.inputs[0].dims.length-1];if(t<8&&s<8)e.compute(rc(e.inputs,{activation:""},r));else{let i=r[r.length-2],n=Te.size(e.inputs[0].dims.slice(0,-2)),o=Te.size(e.inputs[1].dims.slice(0,-2));if(n!==1&&i===1&&o===1){let a=e.inputs[0].reshape([1,n,s]),l=e.inputs[1].reshape([1,s,t]),c=[1,n,t],p=[a,l];e.compute(Sa(p,{activation:""},r,c),{inputs:p})}else e.compute(Sa(e.inputs,{activation:""},r))}}}),X_,J_,Y_,Z_,eg,jv=Ve(()=>{pt(),Mt(),Yt(),Tt(),X_=(e,r)=>{if(e.length<3||e.length>4)throw new Error("MatMulNBits requires 3 or 4 inputs");let t=e[0],s=t.dims.length;if(t.dims[s-1]!==r.k)throw new Error("The last dim of input shape does not match the k value");let i=Math.floor((r.k+r.blockSize-1)/r.blockSize),n=r.blockSize/8*r.bits,o=e[1];if(!Te.areEqual(o.dims,[r.n,i,n]))throw new Error("The second inputs must be 3D tensor with shape N X nBlocksPerCol X blobSize");let a=e[2].dims;if(Te.size(a)!==r.n*i)throw new Error("scales input size error.");if(e.length===4){let l=e[3].dims,c=r.bits>4?r.n*i:r.n*Math.floor((i+1)/2);if(Te.size(l)!==c)throw new Error("zeroPoints input size error.")}},J_=(e,r)=>{let t=e[0].dims,s=t.length,i=t[s-2],n=r.k,o=r.n,a=t.slice(0,s-2),l=Te.size(a),c=e[1].dims[2]/4,p=e[0].dataType,u=Xt(r.k),h=Xt(c),g=Xt(o),_=a.concat([i,o]),P=i>1&&o/g%2===0?2:1,A=Te.size(_)/g/P,v=64,y=[],k=[l,i,n/u],E=Te.convertShape(e[1].dims).slice();E.splice(-1,1,c/h),y.push(...nt(k)),y.push(...nt(E)),y.push(...nt(e[2].dims)),e.length===4&&y.push(...nt(Te.convertShape(e[3].dims)));let M=[l,i,o/g];y.push(...nt(M));let w=x=>{let $=k.length,z=$e("a",e[0].dataType,$,u),R=$e("b",12,E.length,h),Q=$e("scales",e[2].dataType,e[2].dims.length),q=[z,R,Q],U=e.length===4?$e("zero_points",12,e[3].dims.length):void 0;U&&q.push(U);let Z=M.length,H=tt("output",e[0].dataType,Z,g),J=lr(e[0].dataType),ie=(()=>{switch(u){case 1:return`array<${J}, 8>`;case 2:return`mat4x2<${J}>`;case 4:return`mat2x4<${J}>`;default:throw new Error(`${u}-component is not supported.`)}})(),ae=()=>{let N=` + // reuse a data + var input_offset = ${z.indicesToOffset(`${z.type.indices}(batch, row, word_offset)`)}; + var a_data: ${ie}; + for (var j: u32 = 0; j < ${8/u}; j++) { + a_data[j] = ${z.getByOffset("input_offset")}; + input_offset++; + } + `;for(let O=0;O> 4) & b_mask); + b_quantized_values = ${ie}(${Array.from({length:4},(G,se)=>`${J}(b_value_lower[${se}]), ${J}(b_value_upper[${se}])`).join(", ")}); + b_dequantized_values = ${u===1?`${ie}(${Array.from({length:8},(G,se)=>`(b_quantized_values[${se}] - ${U?`zero_point${O}`:"zero_point"}) * scale${O}`).join(", ")});`:`(b_quantized_values - ${ie}(${Array(8).fill(`${U?`zero_point${O}`:"zero_point"}`).join(",")})) * scale${O};`}; + workgroup_shared[local_id.x * ${P} + ${Math.floor(O/g)}]${g>1?`[${O%g}]`:""} += ${Array.from({length:8/u},(G,se)=>`${u===1?`a_data[${se}] * b_dequantized_values[${se}]`:`dot(a_data[${se}], b_dequantized_values[${se}])`}`).join(" + ")}; + `;return N},ce=()=>{let N=` + var col_index = col * ${g}; + ${U?` + let zero_point_bytes_per_col = (nBlocksPerCol + 1) / 2; + var zero_point_byte_count: u32; + var zero_point_word_index: u32; + var zero_point_byte_offset: u32; + let zero_point_nibble_offset: u32 = block & 0x1u; + var zero_point_bits_offset: u32; + var zero_point_word: u32;`:` + // The default zero point is 8 for unsigned 4-bit quantization. + let zero_point = ${J}(8);`} + `;for(let O=0;O> 0x1u); + zero_point_word_index = zero_point_byte_count >> 0x2u; + zero_point_byte_offset = zero_point_byte_count & 0x3u; + zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); + zero_point_word = ${U.getByOffset("zero_point_word_index")} >> zero_point_bits_offset; + let zero_point${O} = ${J}((zero_point_word) & 0xFu);`:""} + col_index += 1;`;return N},he=()=>{let N=`col_index = col * ${g};`;for(let O=0;O; + var b_value_upper: vec4; + var b_quantized_values: ${ie}; + var b_dequantized_values: ${ie};`,N};return` + var workgroup_shared: array<${H.type.value}, ${P*v}>; + ${x.declareVariables(...q,H)} + ${x.mainStart([v,1,1])} + let output_indices = ${H.offsetToIndices(`(global_idx / ${v}) * ${P}`)}; + let col = output_indices[2]; + let row = output_indices[1]; + let batch = output_indices[0]; + let nBlocksPerCol = uniforms.b_shape[1]; + + for (var block = local_id.x; block < nBlocksPerCol; block += ${v}) { + //process one block + var word_offset: u32 = block * ${r.blockSize/u}; + ${ce()} + for (var word: u32 = 0; word < ${c}; word += ${h}) { + ${he()} + for (var i: u32 = 0; i < ${h}; i++) { + ${ae()} + word_offset += ${8/u}; + } + } + } + workgroupBarrier(); + + if (local_id.x < ${P}) { + var output_value: ${H.type.value} = ${H.type.value}(0); + var workgroup_shared_offset: u32 = local_id.x; + for (var b: u32 = 0u; b < ${v}u; b++) { + output_value += workgroup_shared[workgroup_shared_offset]; + workgroup_shared_offset += ${P}; + } + ${H.setByIndices(`${H.type.indices}(batch, row, col + local_id.x)`,"output_value")}; + } + }`};return{name:"MatMulNBits",shaderCache:{hint:`${r.blockSize};${r.bits};${u};${h};${g};${P};${v}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:_,dataType:p}],dispatchGroup:{x:A},programUniforms:y}),getShaderSource:w}},Y_=(e,r)=>{let t=e[0].dims,s=t.length,i=t[s-2],n=r.k,o=r.n,a=t.slice(0,s-2),l=Te.size(a),c=e[1].dims[2]/4,p=e[0].dataType,u=Xt(r.k),h=Xt(c),g=a.concat([i,o]),_=128,P=o%8===0?8:o%4===0?4:1,A=_/P,v=A*h*8,y=v/u,k=v/r.blockSize,E=Te.size(g)/P,M=[],w=[l,i,n/u],x=Te.convertShape(e[1].dims).slice();x.splice(-1,1,c/h),M.push(...nt(w)),M.push(...nt(x)),M.push(...nt(e[2].dims)),e.length===4&&M.push(...nt(Te.convertShape(e[3].dims)));let $=[l,i,o];M.push(...nt($));let z=R=>{let Q=w.length,q=$e("a",e[0].dataType,Q,u),U=$e("b",12,x.length,h),Z=$e("scales",e[2].dataType,e[2].dims.length),H=[q,U,Z],J=e.length===4?$e("zero_points",12,e[3].dims.length):void 0;J&&H.push(J);let ie=$.length,ae=tt("output",e[0].dataType,ie),ce=lr(e[0].dataType),he=()=>{switch(u){case 1:return` + let a_data0 = vec4<${ce}>(sub_a[word_offset], sub_a[word_offset + 1], sub_a[word_offset + 2], sub_a[word_offset + 3]); + let a_data1 = vec4<${ce}>(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<${ce}>(sub_a[word_offset], sub_a[word_offset + 1]); + let a_data1 = vec4<${ce}>(sub_a[word_offset + 2], sub_a[word_offset + 3]);`;case 4:return` + let a_data0 = sub_a[word_offset]; + let a_data1 = sub_a[word_offset + 1];`;default:throw new Error(`${u}-component is not supported.`)}};return` + var sub_a: array<${q.type.value}, ${y}>; + var inter_results: array, ${P}>; + ${R.declareVariables(...H,ae)} + ${R.mainStart([A,P,1])} + let output_indices = ${ae.offsetToIndices(`workgroup_index * ${P}`)}; + let col = output_indices[2]; + let row = output_indices[1]; + let batch = output_indices[0]; + let n_blocks_per_col = uniforms.b_shape[1]; + let num_tiles = (n_blocks_per_col - 1) / ${k} + 1; + + // Loop over shared dimension. + for (var tile: u32 = 0; tile < num_tiles; tile += 1) { + let a_col_start = tile * ${y}; + // load one tile A data into shared memory. + for (var a_offset = local_idx; a_offset < ${y}; a_offset += ${_}) + { + let a_col = a_col_start + a_offset; + if (a_col < uniforms.a_shape[2]) + { + sub_a[a_offset] = ${q.getByIndices(`${q.type.indices}(batch, row, a_col)`)}; + } else { + sub_a[a_offset] = ${q.type.value}(0); + } + } + workgroupBarrier(); + + // each thread process one block + let b_row = col + local_id.y; + let block = tile * ${k} + local_id.x; + ${J?` + let zero_point_bytes_per_col = (n_blocks_per_col + 1) / 2; + let zero_point_byte_count = b_row * zero_point_bytes_per_col + (block >> 0x1u); + let zero_point_word_index = zero_point_byte_count >> 0x2u; + let zero_point_byte_offset = zero_point_byte_count & 0x3u; + let zero_point_nibble_offset: u32 = block & 0x1u; + let zero_point_bits_offset = (zero_point_byte_offset << 3) + (zero_point_nibble_offset << 2); + let zero_point_word = ${J.getByOffset("zero_point_word_index")} >> zero_point_bits_offset; + let zero_point = ${ce}((zero_point_word) & 0xFu);`:` + // The default zero point is 8 for unsigned 4-bit quantization. + let zero_point = ${ce}(8);`} + let scale = ${Z.getByOffset("b_row * n_blocks_per_col + block")}; + let b_data = ${U.getByIndices(`${U.type.indices}(b_row, block, 0)`)}; + var word_offset = local_id.x * ${r.blockSize/u}; + for (var i: u32 = 0; i < ${h}; i++) { + ${he()} + let b_value = ${h===1?"b_data":"b_data[i]"}; + let b_value_lower = unpack4xU8(b_value & 0x0F0F0F0Fu); + let b_value_upper = unpack4xU8((b_value >> 4) & 0x0F0F0F0Fu); + let b_quantized_values = mat2x4<${ce}>(${Array.from({length:4},(N,O)=>`${ce}(b_value_lower[${O}]), ${ce}(b_value_upper[${O}])`).join(", ")}); + let b_dequantized_values = (b_quantized_values - mat2x4<${ce}>(${Array(8).fill("zero_point").join(",")})) * scale; + inter_results[local_id.y][local_id.x] += ${Array.from({length:2},(N,O)=>`${`dot(a_data${O}, b_dequantized_values[${O}])`}`).join(" + ")}; + word_offset += ${8/u}; + } + workgroupBarrier(); + } + + if (local_idx < ${P}) { + var output_value: ${ae.type.value} = ${ae.type.value}(0); + for (var b = 0u; b < ${A}; b++) { + output_value += inter_results[local_idx][b]; + } + if (col + local_idx < uniforms.output_shape[2]) + { + ${ae.setByIndices(`${ae.type.indices}(batch, row, col + local_idx)`,"output_value")} + } + } + }`};return{name:"BlockwiseMatMulNBits32",shaderCache:{hint:`${r.blockSize};${u};${h};${A};${P}`,inputDependencies:Array(e.length).fill("rank")},getRunData:()=>({outputs:[{dims:g,dataType:p}],dispatchGroup:{x:E},programUniforms:M}),getShaderSource:z}},Z_=(e,r)=>{X_(e.inputs,r),r.blockSize===32&&e.adapterInfo.isVendor("intel")&&e.adapterInfo.isArchitecture("gen-12lp")?e.compute(Y_(e.inputs,r)):e.compute(J_(e.inputs,r))},eg=e=>Dt(e)}),tg,rg,sg,ng,ig,og,ag,lg,dg,Vv=Ve(()=>{pt(),Mt(),Tt(),tg=e=>{if(!e||e.length<1)throw new Error("Too few inputs");if(e[0].dataType!==1&&e[0].dataType!==10)throw new Error("Input type must be float or float16.");if(e.length>=2){let r=e[0].dims.length*2===e[1].dims[0];if(e.length===4&&(r=e[3].dims[0]*2===e[1].dims[0]),!r)throw new Error("The pads should be a 1D tensor of shape [2 * input_rank] or [2 * num_axes].")}},rg=(e,r,t)=>{let s="";for(let i=r-1;i>=0;--i)s+=` + k = i32(${e.indicesGet("indices",i)}) - ${rt("uniforms.pads",i,t)}; + if (k < 0) { + break; + } + if (k >= i32(${rt("uniforms.x_shape",i,r)})) { + break; + } + offset += k * i32(${rt("uniforms.x_strides",i,r)}); + `;return` + value = ${e.type.value}(uniforms.constant_value); + for (var i = 0; i < 1; i++) { + var offset = 0; + var k = 0; + ${s} + value = x[offset]; + } + `},sg=(e,r,t)=>{let s="";for(let i=r-1;i>=0;--i)s+=` + k = i32(${e.indicesGet("indices",i)}) - ${rt("uniforms.pads",i,t)}; + if (k < 0) { + k = -k; + } + { + let _2n_1 = 2 * (i32(${rt("uniforms.x_shape",i,r)}) - 1); + k = k % _2n_1; + if(k >= i32(${rt("uniforms.x_shape",i,r)})) { + k = _2n_1 - k; + } + } + offset += k * i32(${rt("uniforms.x_strides",i,r)}); + `;return` + var offset = 0; + var k = 0; + ${s} + value = x[offset]; + `},ng=(e,r,t)=>{let s="";for(let i=r-1;i>=0;--i)s+=` + k = i32(${e.indicesGet("indices",i)}) - ${rt("uniforms.pads",i,t)}; + if (k < 0) { + k = 0; + } + if (k >= i32(${rt("uniforms.x_shape",i,r)})) { + k = i32(${rt("uniforms.x_shape",i,r)}) - 1; + } + offset += k * i32(${rt("uniforms.x_strides",i,r)}); + `;return` + var offset = 0; + var k = 0; + ${s} + value = x[offset]; + `},ig=(e,r,t)=>{let s="";for(let i=r-1;i>=0;--i)s+=` + k = i32(${e.indicesGet("indices",i)}) - ${rt("uniforms.pads",i,t)}; + if (k < 0) { + k += i32(${rt("uniforms.x_shape",i,r)}]); + } + if (k >= i32(${rt("uniforms.x_shape",i,r)})) { + k -= i32(${rt("uniforms.x_shape",i,r)}); + } + offset += k * i32(${rt("uniforms.x_strides",i,r)}); + `;return` + var offset = 0; + var k = 0; + ${s} + value = x[offset]; + `},og=(e,r,t)=>{switch(t.mode){case 0:return rg(e,r,t.pads.length);case 1:return sg(e,r,t.pads.length);case 2:return ng(e,r,t.pads.length);case 3:return ig(e,r,t.pads.length);default:throw new Error("Invalid mode")}},ag=(e,r)=>{let t=Te.padShape(e[0].dims.slice(),r.pads),s=e[0].dims,i=Te.size(t),n=[{type:12,data:i},{type:6,data:r.pads}],o=e.length>=3&&e[2].data;r.mode===0&&n.push({type:o?e[2].dataType:1,data:r.value}),n.push(...nt(e[0].dims,t));let a=["rank"],l=c=>{let p=tt("output",e[0].dataType,t.length),u=$e("x",e[0].dataType,s.length),h=u.type.value,g=og(p,s.length,r),_=[{name:"output_size",type:"u32"},{name:"pads",type:"i32",length:r.pads.length}];return r.mode===0&&_.push({name:"constant_value",type:o?h:"f32"}),` + ${c.registerUniforms(_).declareVariables(u,p)} + ${c.mainStart()} + ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + + let indices = ${p.offsetToIndices("global_idx")}; + + var value = ${h}(0); + ${g} + output[global_idx] = value; + }`};return{name:"Pad",shaderCache:{hint:`${r.mode}${o}`,inputDependencies:a},getRunData:()=>({outputs:[{dims:t,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Te.size(t)/64)},programUniforms:n}),getShaderSource:l}},lg=(e,r)=>{if(e.length>1){let t=e[1].getBigInt64Array(),s=e.length>=3&&e[2].data?e[2].dataType===10?e[2].getUint16Array()[0]:e[2].getFloat32Array()[0]:0,i=e[0].dims.length,n=new Int32Array(2*i).fill(0);if(e.length>=4){let a=e[3].getBigInt64Array();for(let l=0;ln[Number(l)]=Number(a));let o=[];return n.forEach(a=>o.push(a)),{mode:r.mode,value:s,pads:o}}else return r},dg=(e,r)=>{tg(e.inputs);let t=lg(e.inputs,r);e.compute(ag(e.inputs,t),{inputs:[0]})}}),Ni,vc,Tc,xc,Ec,cg,ug,Pc,Cc,pg,hg,Sc,mg,fg,$c,_g,gg,wg,yg,Uv=Ve(()=>{ss(),pt(),Mt(),Tt(),Ni=e=>{if(Ut.webgpu.validateInputContent&&(!e||e.length!==1))throw new Error("Pool ops requires 1 input.")},vc=(e,r,t)=>{let s=r.format==="NHWC",i=e.dims.slice();s&&i.splice(1,0,i.pop());let n=Object.hasOwnProperty.call(r,"dilations"),o=r.kernelShape.slice(),a=r.strides.slice(),l=n?r.dilations.slice():[],c=r.pads.slice();Ta.adjustPoolAttributes(t,i,o,a,l,c);let p=Ta.computePoolOutputShape(t,i,a,l,o,c,r.autoPad),u=Object.assign({},r);n?Object.assign(u,{kernelShape:o,strides:a,pads:c,dilations:l,cacheKey:r.cacheKey}):Object.assign(u,{kernelShape:o,strides:a,pads:c,cacheKey:r.cacheKey});let h=p.slice();return h.push(h.splice(1,1)[0]),[u,s?h:p]},Tc=(e,r)=>{let t=r.format==="NHWC",s=Te.size(e),i=Te.size(r.kernelShape),n=[{type:12,data:s},{type:12,data:i}],o=[{name:"outputSize",type:"u32"},{name:"kernelSize",type:"u32"}];if(r.kernelShape.length<=2){let a=r.kernelShape[r.kernelShape.length-1],l=r.strides[r.strides.length-1],c=r.pads[r.pads.length/2-1],p=r.pads[r.pads.length-1],u=!!(c+p);n.push({type:12,data:a},{type:12,data:l},{type:12,data:c},{type:12,data:p}),o.push({name:"kw",type:"u32"},{name:"sw",type:"u32"},{name:"pwStart",type:"u32"},{name:"pwEnd",type:"u32"});let h=!1;if(r.kernelShape.length===2){let g=r.kernelShape[r.kernelShape.length-2],_=r.strides[r.strides.length-2],P=r.pads[r.pads.length/2-2],A=r.pads[r.pads.length-2];h=!!(P+A),n.push({type:12,data:g},{type:12,data:_},{type:12,data:P},{type:12,data:A}),o.push({name:"kh",type:"u32"},{name:"sh",type:"u32"},{name:"phStart",type:"u32"},{name:"phEnd",type:"u32"})}return[n,o,!0,u,h]}else{if(t)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let a=Te.computeStrides(r.kernelShape);n.push({type:12,data:a},{type:12,data:r.pads},{type:12,data:r.strides}),o.push({name:"kernelStrides",type:"u32",length:a.length},{name:"pads",type:"u32",length:r.pads.length},{name:"strides",type:"u32",length:r.strides.length});let l=r.pads.reduce((c,p)=>c+p);return[n,o,!!l,!1,!1]}},xc=(e,r,t,s,i,n,o,a,l,c,p,u)=>{let h=i.format==="NHWC",g=r.type.value,_=tt("output",r.type.tensor,s);if(i.kernelShape.length<=2){let P="",A="",v="",y=t-(h?2:1);if(p?P=` + for (var i: u32 = 0u; i < uniforms.kw; i++) { + xIndices[${y}] = indices[${y}] * uniforms.sw - uniforms.pwStart + i; + if (xIndices[${y}] < 0 || xIndices[${y}] + >= uniforms.x_shape[${y}]) { + pad++; + continue; + } + let x_val = x[${r.indicesToOffset("xIndices")}]; + ${n} + }`:P=` + for (var i: u32 = 0u; i < uniforms.kw; i++) { + xIndices[${y}] = indices[${y}] * uniforms.sw - uniforms.pwStart + i; + let x_val = x[${r.indicesToOffset("xIndices")}]; + ${n} + }`,i.kernelShape.length===2){let k=t-(h?3:2);u?A=` + for (var j: u32 = 0u; j < uniforms.kh; j++) { + xIndices[${k}] = indices[${k}] * uniforms.sh - uniforms.phStart + j; + if (xIndices[${k}] < 0 || xIndices[${k}] >= uniforms.x_shape[${k}]) { + pad += i32(uniforms.kw); + continue; + } + `:A=` + for (var j: u32 = 0u; j < uniforms.kh; j++) { + xIndices[${k}] = indices[${k}] * uniforms.sh - uniforms.phStart + j; + `,v=` + } + `}return` + ${e.registerUniforms(l).declareVariables(r,_)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + + let indices = ${_.offsetToIndices("global_idx")}; + var xIndices = ${_.offsetToIndices("global_idx")}; + + var value = ${g}(${a}); + var pad = 0; + ${A} + ${P} + ${v} + ${o} + + output[global_idx] = value; + }`}else{if(h)throw new Error("Pooling with kernelShape.length > 2 is not supported for NHWC format.");let P=i.kernelShape.length,A=i.pads.length,v="";return c?v=` + if (xIndices[j] >= uniforms.x_shape[j]) { + pad++; + isPad = true; + break; + } + } + if (!isPad) { + let x_val = x[${r.indicesToOffset("xIndices")}]; + ${n} + }`:v=` + } + let x_val = x[${r.indicesToOffset("xIndices")}]; + ${n} + `,` + ${e.registerUniforms(l).declareVariables(r,_)} + + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + let indices = ${_.offsetToIndices("global_idx")}; + var xIndices = ${_.offsetToIndices("global_idx")}; + + var offsets: array; + + var value = ${g}(${a}); + var pad = 0; + var isPad = false; + + for (var i: u32 = 0u; i < uniforms.kernelSize; i++) { + var offset = i; + for (var j = 0u; j < ${P-1}u; j++) { + offsets[j] = offset / ${rt("uniforms.kernelStrides","j",P)}; + offset -= offsets[j] * ${rt("uniforms.kernelStrides","j",P)}; + } + offsets[${P-1}] = offset; + + isPad = false; + for (var j = ${t-P}u; j < ${t}u; j++) { + xIndices[j] = indices[j] * ${rt("uniforms.strides",`j - ${t-P}u`,P)} + + offsets[j - ${t-P}u] - ${rt("uniforms.pads","j - 2u",A)}; + ${v} + } + ${o} + + output[global_idx] = value; + }`}},Ec=e=>`${e.format};${e.ceilMode};${e.autoPad};${e.kernelShape.length}`,cg=e=>`${Ec(e)};${e.countIncludePad}`,ug=e=>`${Ec(e)};${e.storageOrder};${e.dilations}`,Pc=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}),Cc=(e,r,t,s)=>{let[i,n]=vc(r,s,t),o=$e("x",r.dataType,r.dims.length),a=o.type.value,l="value += x_val;",c="";i.countIncludePad?c+=`value /= ${a}(uniforms.kernelSize);`:c+=`value /= ${a}(i32(uniforms.kernelSize) - pad);`;let[p,u,h,g,_]=Tc(n,i);p.push(...nt(r.dims,n));let P=["rank"];return{name:e,shaderCache:{hint:`${s.cacheKey};${h};${g};${_}`,inputDependencies:P},getRunData:()=>({outputs:[{dims:n,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(Te.size(n)/64)},programUniforms:p}),getShaderSource:A=>xc(A,o,r.dims.length,n.length,i,l,c,0,u,h,g,_)}},pg=e=>{let r=e.count_include_pad!==0,t=Pc(e);if(t.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");let s={countIncludePad:r,...t,cacheKey:""};return{...s,cacheKey:cg(s)}},hg=(e,r)=>{Ni(e.inputs),e.compute(Cc("AveragePool",e.inputs[0],!1,r))},Sc={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[]},mg=e=>{let r=e.format;return{format:r,...Sc,cacheKey:r}},fg=(e,r)=>{Ni(e.inputs),e.compute(Cc("GlobalAveragePool",e.inputs[0],!0,r))},$c=(e,r,t,s)=>{let[i,n]=vc(r,s,t),o=` + value = max(x_val, value); + `,a="",l=$e("x",r.dataType,r.dims.length),c=["rank"],[p,u,h,g,_]=Tc(n,i);return p.push(...nt(r.dims,n)),{name:e,shaderCache:{hint:`${s.cacheKey};${h};${g};${_}`,inputDependencies:c},getRunData:()=>({outputs:[{dims:n,dataType:r.dataType}],dispatchGroup:{x:Math.ceil(Te.size(n)/64)},programUniforms:p}),getShaderSource:P=>xc(P,l,r.dims.length,n.length,i,o,a,r.dataType===10?-65504:-1e5,u,h,g,_)}},_g=(e,r)=>{Ni(e.inputs),e.compute($c("MaxPool",e.inputs[0],!1,r))},gg=e=>{let r=e.storage_order,t=e.dilations,s=Pc(e);if(r!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(s.ceilMode!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");let i={storageOrder:r,dilations:t,...s,cacheKey:""};return{...i,cacheKey:ug(i)}},wg=e=>{let r=e.format;return{format:r,...Sc,cacheKey:r}},yg=(e,r)=>{Ni(e.inputs),e.compute($c("GlobalMaxPool",e.inputs[0],!0,r))}}),Mg,bg,vg,Tg,Wv=Ve(()=>{pt(),Mt(),Yt(),Tt(),Mg=(e,r)=>{if(e.length<2||e.length>3)throw new Error("DequantizeLinear requires 2 or 3 inputs.");if(e.length===3&&e[1].dims===e[2].dims)throw new Error("x-scale and x-zero-point must have the same shape.");if(e.length===3&&e[0].dataType!==e[2].dataType)throw new Error("x and x-zero-point must have the same data type.");if(e[0].dataType===6&&e.length>2)throw new 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 new 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 new Error("x and x-zero-point must have the same data type.");if(e[1].dims.length!==e[2].dims.length)throw new Error("scale and zero-point inputs must have the same rank.");if(!e[1].dims.map((t,s)=>t===e[2].dims[s]).reduce((t,s)=>t&&s,!0))throw new Error("scale and zero-point inputs must have the same shape.")}if(r.blockSize>0){if(e[1].dims.length===0||e[1].dims.length===1&&e[1].dims[0]===1)throw new Error("blockSize must be set only for block quantization.");if(!e[1].dims.map((i,n)=>n===r.axis||i===e[0].dims[n]).reduce((i,n)=>i&&n,!0))throw new 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 new Error("For block qunatization the scale input rank must be the same as the x rank.");let t=e[0].dims[r.axis],s=e[1].dims[r.axis];if(r.blockSizeMath.ceil(t/(s-1)-1))throw new Error("blockSize must be with in the range [ceil(dI / Si), ceil(dI / (Si - 1) - 1)].")}},bg=(e,r)=>{let t=Te.normalizeAxis(r.axis,e[0].dims.length),s=e[0].dataType,i=s===3,n=e[0].dims,o=e[1].dataType,a=Te.size(n),l=s===3||s===2,c=l?[Math.ceil(Te.size(e[0].dims)/4)]:e[0].dims,p=e[1].dims,u=e.length>2?e[2]:void 0,h=u?l?[Math.ceil(Te.size(u.dims)/4)]:u.dims:void 0,g=p.length===0||p.length===1&&p[0]===1,_=g===!1&&p.length===1,P=Xt(a),A=g&&(!l||P===4),v=A?P:1,y=A&&!l?P:1,k=$e("input",l?12:s,c.length,y),E=$e("scale",o,p.length),M=u?$e("zero_point",l?12:s,h.length):void 0,w=tt("output",o,n.length,v),x=[k,E];M&&x.push(M);let $=[c,p];u&&$.push(h);let z=[{type:12,data:a/v},{type:12,data:t},{type:12,data:r.blockSize},...nt(...$,n)],R=Q=>{let q=[{name:"output_size",type:"u32"},{name:"axis",type:"u32"},{name:"block_size",type:"u32"}];return` + ${Q.registerUniforms(q).declareVariables(...x,w)} + ${Q.mainStart()} + ${Q.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + let output_indices = ${w.offsetToIndices("global_idx")}; + + // Set input x + ${l?` + let input = ${k.getByOffset("global_idx / 4")}; + let x_vec = ${i?"unpack4xI8(input)":"unpack4xU8(input)"}; + let x_value = ${v===1?"x_vec[global_idx % 4]":"x_vec"};`:`let x_value = ${k.getByOffset("global_idx")};`}; + + // Set scale input + ${g?`let scale_value= ${E.getByOffset("0")}`:_?` + let scale_index = ${w.indicesGet("output_indices","uniforms.axis")}; + let scale_value= ${E.getByOffset("scale_index")};`:` + var scale_indices: ${E.type.indices} = output_indices; + let index = ${E.indicesGet("scale_indices","uniforms.axis")} / uniforms.block_size; + ${E.indicesSet("scale_indices","uniforms.axis","index")}; + let scale_value= ${E.getByIndices("scale_indices")};`}; + + // Set zero-point input + ${M?g?l?` + let zero_point_input = ${M.getByOffset("0")}; + let zero_point_vec = ${i?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; + let zero_point_value= zero_point_vec[0]`:`let zero_point_value = ${M.getByOffset("0")}`:_?l?` + let zero_point_index = ${w.indicesGet("output_indices","uniforms.axis")}; + let zero_point_input = ${M.getByOffset("zero_point_index / 4")}; + let zero_point_vec = ${i?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; + let zero_point_value = zero_point_vec[zero_point_index % 4]`:` + let zero_point_index = ${w.indicesGet("output_indices","uniforms.axis")}; + let zero_point_value = ${M.getByOffset("zero_point_index")};`:l?` + let zero_point_offset = ${E.indicesToOffset("scale_indices")}; + let zero_point_input = ${M.getByOffset("zero_point_offset / 4")}; + let zero_point_vec = ${i?"unpack4xI8(zero_point_input)":"unpack4xU8(zero_point_input)"}; + let zero_point_value = zero_point_vec[zero_point_offset % 4];`:`let zero_point_value = ${M.getByIndices("scale_indices")};`:`let zero_point_value = ${l?i?"i32":"u32":k.type.value}(0);`}; + // Compute and write output + ${w.setByOffset("global_idx",`${w.type.value}(x_value - zero_point_value) * scale_value`)}; + }`};return{name:"DequantizeLinear",shaderCache:{hint:r.cacheKey,inputDependencies:M?["rank","rank","rank"]:["rank","rank"]},getShaderSource:R,getRunData:()=>({outputs:[{dims:n,dataType:o}],dispatchGroup:{x:Math.ceil(a/v/64),y:1,z:1},programUniforms:z})}},vg=(e,r)=>{Mg(e.inputs,r),e.compute(bg(e.inputs,r))},Tg=e=>Dt({axis:e.axis,blockSize:e.blockSize})}),xg,Eg,Pg,Gv=Ve(()=>{ss(),pt(),Tt(),xg=(e,r,t)=>{let s=e===r,i=er&&t>0;if(s||i||n)throw new Error("Range these inputs' contents are invalid.")},Eg=(e,r,t,s)=>{let i=Math.abs(Math.ceil((r-e)/t)),n=[i],o=i,a=[{type:12,data:o},{type:s,data:e},{type:s,data:t},...nt(n)],l=c=>{let p=tt("output",s,n.length),u=p.type.value,h=[{name:"outputSize",type:"u32"},{name:"start",type:u},{name:"delta",type:u}];return` + ${c.registerUniforms(h).declareVariables(p)} + ${c.mainStart()} + ${c.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + output[global_idx] = uniforms.start + ${u}(global_idx) * uniforms.delta; + }`};return{name:"Range",shaderCache:{hint:`${s}`},getShaderSource:l,getRunData:()=>({outputs:[{dims:n,dataType:s}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:a})}},Pg=e=>{let r=0,t=0,s=0;e.inputs[0].dataType===6?(r=e.inputs[0].getInt32Array()[0],t=e.inputs[1].getInt32Array()[0],s=e.inputs[2].getInt32Array()[0]):e.inputs[0].dataType===1&&(r=e.inputs[0].getFloat32Array()[0],t=e.inputs[1].getFloat32Array()[0],s=e.inputs[2].getFloat32Array()[0]),Ut.webgpu.validateInputContent&&xg(r,t,s),e.compute(Eg(r,t,s,e.inputs[0].dataType),{inputs:[]})}}),Cg,Sg,$g,kg,Kv=Ve(()=>{pt(),Mt(),Yt(),Tt(),Cg=(e,r,t,s)=>{if(e!=="none"&&s!=="i32"&&s!=="u32"&&s!=="f32")throw new Error(`Input ${s} is not supported with reduction ${e}.`);let i=`{ + var oldValue = 0; + loop { + let newValueF32 =`,n=`; + let newValue = bitcast(newValueF32); + let res = atomicCompareExchangeWeak(&${r}, oldValue, newValue); + if res.exchanged { + break; + } + oldValue = res.old_value; + } + }`;switch(e){case"none":return`${r}=${t};`;case"add":return s==="i32"||s==="u32"?`atomicAdd(&${r}, bitcast<${s}>(${t}));`:` + ${i}bitcast<${s}>(oldValue) + (${t})${n}`;case"max":return s==="i32"||s==="u32"?`atomicMax(&${r}, bitcast<${s}>(${t}));`:` + ${i}max(bitcast(oldValue), (${t}))${n}`;case"min":return s==="i32"||s==="u32"?`atomicMin(&${r}, bitcast<${s}>(${t}));`:`${i}min(bitcast<${s}>(oldValue), (${t}))${n}`;case"mul":return`${i}(bitcast<${s}>(oldValue) * (${t}))${n}`;default:throw new Error(`Reduction ${e} is not supported.`)}},Sg=(e,r)=>{let t=e[0].dims,s=e[1].dims,i=t,n=1,o=Math.ceil(Te.size(s)/n),a=s[s.length-1],l=Te.sizeFromDimension(t,a),c=[{type:12,data:o},{type:12,data:a},{type:12,data:l},...nt(e[1].dims,e[2].dims,i)],p=u=>{let h=$e("indices",e[1].dataType,e[1].dims.length),g=$e("updates",e[2].dataType,e[2].dims.length,n),_=r.reduction!=="none"&&r.reduction!==""?Rp("output",e[0].dataType,i.length):tt("output",e[0].dataType,i.length,n);return` + ${u.registerUniform("output_size","u32").registerUniform("last_index_dimension","u32").registerUniform("num_updates_elements","u32").declareVariables(h,g,_)} + ${u.mainStart()} + ${u.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + var hasDuplicates = false; + if (${r.reduction==="none"}) { + let n = ${Te.size(s)}; + for (var i = 0; i < n; i = i + 1) { + for (var j = i + 1; j < n; j = j + 1) { + var index_i = i32(indices[i].x); + var index_j = i32(indices[j].x); + if (index_i == index_j) { + hasDuplicates = true; + break; + } + } + if (hasDuplicates) { + break; + } + } + } + + var data_offset = 0u; + var indices_start = uniforms.last_index_dimension * global_idx; + if (${r.reduction==="none"} && hasDuplicates) { + if (global_idx != 0u) { + return; + } + indices_start = 0u; + } + let indices_end = indices_start + uniforms.last_index_dimension; + for (var i = indices_start; i < indices_end; i++) { + var index = i32(indices[i].x); + ${e[0].dims.length===1?` + let element_count_dim = uniforms.output_strides; + let dim_value = uniforms.output_shape;`:` + let element_count_dim = uniforms.output_strides[i - indices_start]; + let dim_value = uniforms.output_shape[i - indices_start + uniforms.last_index_dimension];`} + if (index >= 0) { + if (index >= i32(dim_value)) { + index = i32(dim_value - 1); + } + } else { + if (index < -i32(dim_value)) { + index = 0; + } else { + index += i32(dim_value); + } + } + data_offset += u32((u32(index) * element_count_dim)); + } + + for (var i = 0u; i < uniforms.num_updates_elements; i++) { + let value = updates[uniforms.num_updates_elements * global_idx + i]; + ${Cg(r.reduction,"output[data_offset + i]","value",_.type.value)} + } + + }`};return{name:"ScatterND",shaderCache:{hint:`${r.cacheKey}_${r.reduction}`,inputDependencies:["rank","rank"]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(o/64)},programUniforms:c}),getShaderSource:p}},$g=e=>Dt({reduction:e.reduction}),kg=(e,r)=>{e.compute(Sg(e.inputs,r),{inputs:[e.inputs[1],e.inputs[2]],outputs:[]})}}),Ig,Ag,Fg,kc,Og,Dg,Lg,zg,Bg,Rg,Ng,jg,Ic,Vg,Ug,Wg,Gg,Kg,Hg,qg,Hv=Ve(()=>{pt(),Mt(),Yt(),Tt(),Ig=(e,r)=>{if(e.every(t=>t>0||(()=>{throw new Error("Resize requires scales input values to be positive")})),e.length>0){if(r.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 new 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(r.mode==="cubic"&&!(e.length===2||e.length===4&&e[0]===1&&e[1]===1||e.length===4&&e[0]===1&&e[3]===1))throw new Error("Resize requires scales input size to be 2 or 4 for cubic mode")}},Ag=(e,r,t)=>{r.every(i=>i>=0&&i{throw new Error("Resize requires axes input values to be positive and less than rank")}));let s=new Array(t).fill(1);return r.forEach((i,n)=>s[i]=e[n]),s},Fg=(e,r,t,s,i,n)=>{let[o,a,l]=t>10?[1,2,3]:[-1,e.length>1?1:-1,-1],c=e[0].dims.length;if(o>0&&e.length>o&&e[o].dims.length>0)e[o].getFloat32Array().forEach(p=>n.push(p));else if(r.coordinateTransformMode==="tf_crop_and_resize")throw new Error("Resize requires RoI input to be specified when coordinateTransformMode is tfCropAndResize");if(a>0&&e.length>a&&e[a].dims.length===1&&e[a].dims[0]>0){if(e[a].getFloat32Array().forEach(p=>s.push(p)),s.length!==0&&s.length!==c&&t>=18&&s.length!==r.axes.length)throw new Error("Resize requires scales input size to be same as input rank or axes size for opset 18 and up");Ig(s,r),r.axes.length>0&&Ag(s,r.axes,c).forEach((p,u)=>s[u]=p)}if(l>0&&e.length>l&&e[l].dims.length===1&&e[l].dims[0]>0&&(e[l].getBigInt64Array().forEach(p=>i.push(Number(p))),i.length!==0&&i.length!==c&&t>=18&&i.length!==r.axes.length))throw new Error("Resize requires sizes input size to be same as input rank or axes size for opset 18 and up");if(r.axes.length>0){if(s.length!==0&&s.length!==r.axes.length)throw new Error('Resize requires "scales" input size to be of axes rank when axes attributes is specified');if(i.length!==0&&i.length!==r.axes.length)throw new Error('Resize requires "sizes" input size to be of rank axes rank when axes attributes is specified')}if(typeof s<"u"&&typeof i<"u"&&s.length>0&&i.length>c)throw new Error("Resize requires only of scales or sizes to be specified")},kc=(e,r,t,s)=>` + // 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 + // offset-by-one error later in floor(). + let big = (${e}) * (${r}); + let whole = ${s}(big / (${t})); + let fract = ${s}(big % (${t})) / ${s}(${t}); + return whole + fract; +`,Og=(e,r)=>`fn getOriginalCoordinateFromResizedCoordinate(xResized: u32, xScale: f32, lengthResized: u32, + lengthOriginal: u32, roiStart: f32, roiEnd: f32) -> ${r} { `+(()=>{switch(e){case"asymmetric":return` + if (xScale < 1.0 || floor(xScale) != xScale) { + return ${r}(xResized) / ${r}(xScale); + } else { + ${kc("xResized","lengthOriginal","lengthResized",r)} + } + `;case"pytorch_half_pixel":return`if (lengthResized > 1) { + return (${r}(xResized) + 0.5) / ${r}(xScale) - 0.5; + } else { + return 0.0; + }`;case"tf_half_pixel_for_nn":return`return (${r}(xResized) + 0.5) / ${r}(xScale);`;case"align_corners":return`if (lengthResized == 1) { + return 0.0; + } else { + ${kc("xResized","lengthOriginal - 1","lengthResized - 1",r)} + }`;case"tf_crop_and_resize":return`if (lengthResized > 1) { + return ${r}(roiStart) * ${r}(lengthOriginal - 1) + + (${r}(xResized) * ${r}(roiEnd - roiStart) * ${r}(lengthOriginal - 1)) / + ${r}(lengthResized - 1); + } else { + return 0.5 * ${r}(roiStart + roiEnd) * ${r}(lengthOriginal - 1); + }`;case"half_pixel_symmetric":return`const outputWidth = ${r}xScale * ${r}(lengthResized); + const adjustment = ${r}(lengthResized) / outputWidth; + const center = ${r}(lengthOriginal) / 2; + const offset = center * (1 - adjustment); + return offset + ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;case"half_pixel":return`return ((${r}(xResized) + 0.5) / ${r}(xScale)) - 0.5;`;default:throw new Error(`Coordinate transform mode ${e} is not supported`)}})()+"}",Dg=(e,r,t)=>`fn getNearestPixelFromOriginal(xOriginal: ${t}, isDownSample: bool) -> ${t} {`+(()=>{switch(e){case"round_prefer_ceil":return"if (fract(xOriginal) == 0.5) { return ceil(xOriginal); } else { return round(xOriginal); }";case"floor":return"return floor(xOriginal);";case"ceil":return"return ceil(xOriginal);";case"round_prefer_floor":return"if (fract(xOriginal) == 0.5) { return floor(xOriginal); } else { return round(xOriginal); }";case"simple":default:if(r<11)return"if (isDownSample) { return ceil(xOriginal); } else { return xOriginal; }";throw new Error(`Nearest mode ${e} is not supported`)}})()+"}",Lg=(e,r,t)=>{let s=new Array(t).fill(0).concat(new Array(t).fill(1)),i=e.length===0?s:e.slice();return r.length>0?(r.forEach((n,o)=>{s[n]=i[o],s[o+t]=i[r.length+o]}),s):i},zg=(e,r,t,s)=>{let i=[];if(t.length>0)if(s.length>0){if(e.forEach(n=>i.push(n)),Math.max(...s)>e.length)throw new Error("axes is out of bound");s.forEach((n,o)=>i[n]=t[o])}else t.forEach(n=>i.push(n));else{if(r.length===0)throw new Error("Resize requires either scales or sizes.");i=e.map((n,o)=>Math.round(n*r[o]))}return i},Bg=(e,r,t)=>{let s=(()=>{switch(t.keepAspectRatioPolicy){case"not_larger":return t.axes.length>0?Math.min(...t.axes.map(n=>r[n]),Number.MAX_VALUE):Math.min(...r,Number.MAX_VALUE);case"not_smaller":return t.axes.length>0?Math.max(...t.axes.map(n=>r[n]),Number.MIN_VALUE):Math.max(...r,Number.MIN_VALUE);default:throw new Error(`Keep aspect ratio policy ${t.keepAspectRatioPolicy} is not supported`)}})();r.fill(1,0,r.length);let i=e.slice();return t.axes.length>0?(t.axes.forEach(n=>r[n]=s),t.axes.forEach(n=>i[n]=Math.round(e[n]*r[n]))):(r.fill(s,0,r.length),i.forEach((n,o)=>i[o]=Math.round(n*r[o]))),i},Rg=(e,r,t,s,i)=>` + fn calculateOriginalIndicesFromOutputIndices(output_indices: ${e.type.indices}) -> array<${e.type.value}, ${t.length}> { + var original_indices: array<${e.type.value}, ${t.length}>; + for (var i:u32 = 0; i < ${t.length}; i++) { + var output_index = ${e.indicesGet("output_indices","i")}; + var scale = ${rt("uniforms.scales","i",s)}; + var roi_low = ${rt("uniforms.roi","i",i)}; + var roi_hi = ${rt("uniforms.roi",`i + ${r.length}`,i)}; + if (scale == 1.0) { + original_indices[i] = ${e.type.value}(output_index); + } else { + var input_shape_i = ${rt("uniforms.input_shape","i",r.length)}; + var output_shape_i = ${rt("uniforms.output_shape","i",t.length)}; + original_indices[i] = getOriginalCoordinateFromResizedCoordinate(output_index, scale, output_shape_i, + input_shape_i, roi_low, roi_hi); + } + } + return original_indices; + }`,Ng=(e,r,t,s,i,n,o)=>` + fn calculateInputIndicesFromOutputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} { + var input_indices: ${e.type.indices}; + for (var i:u32 = 0; i < ${s.length}; i++) { + var output_index = ${r.indicesGet("output_indices","i")}; + var input_index: u32; + var scale = ${rt("uniforms.scales","i",i)}; + if (scale == 1.0) { + input_index = output_index; + } else { + var roi_low = ${rt("uniforms.roi","i",n)}; + var roi_hi = ${rt("uniforms.roi",`i + ${t.length}`,n)}; + var input_shape_i = ${rt("uniforms.input_shape","i",t.length)}; + var output_shape_i = ${rt("uniforms.output_shape","i",s.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 < ${r.type.value}(input_shape_i))) { + if (original_idx < 0) { + input_index = 0; + } else if (original_idx > ${r.type.value}(input_shape_i - 1)) { + input_index = input_shape_i - 1; + } else { + input_index = u32(getNearestPixelFromOriginal(original_idx, scale < 1)); + } + } else { + input_index = u32(original_idx); + } + } + ${e.indicesSet("input_indices","i","input_index")} + } + return input_indices; + }`,jg=(e,r)=>` + fn checkInputIndices(input_indices: ${e.type.indices}) -> bool { + for (var i:u32 = 0; i < ${r.length}; i++) { + var input_index = ${e.indicesGet("input_indices","i")}; + if (input_index < 0 || input_index >= ${rt("uniforms.input_shape","i",r.length)}) { + return false; + } + } + return true; + }`,Ic=(e,r,t,s)=>e.rank>s?` + ${e.indicesSet("input_indices",r,"channel")}; + ${e.indicesSet("input_indices",t,"batch")}; +`:"",Vg=(e,r,t,s,i)=>{let[n,o,a,l]=t.length===2?[-1,0,1,-1]:[0,2,3,1],c=e.type.value;return` + fn getInputValue(batch: u32, channel: u32, row: u32, col: u32) -> ${c} { + var input_indices: ${e.type.indices}; + ${e.indicesSet("input_indices",o,`max(0, min(row, ${t[o]} - 1))`)}; + ${e.indicesSet("input_indices",a,`max(0, min(col, ${t[a]} - 1))`)}; + ${Ic(e,l,n,2)} + return ${e.getByIndices("input_indices")}; + } + + fn bilinearInterpolation(output_indices: ${r.type.indices}) -> ${c} { + var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); + var row:${c} = originalIndices[${o}]; + var col:${c} = originalIndices[${a}]; + ${s?`if (row < 0 || row > (${t[o]} - 1) || col < 0 || col > (${t[a]} - 1)) { + return ${i}; + }`:""}; + row = max(0, min(row, ${t[o]} - 1)); + col = max(0, min(col, ${t[a]} - 1)); + var row1: u32 = u32(row); + var col1: u32 = u32(col); + var row2: u32 = u32(row + 1); + var col2: u32 = u32(col + 1); + var channel: u32 = ${t.length>2?`u32(originalIndices[${l}])`:"0"}; + var batch: u32 = ${t.length>2?`u32(originalIndices[${n}])`:"0"}; + var x11: ${c} = getInputValue(batch, channel, row1, col1); + var x12: ${c} = getInputValue(batch, channel, row1, col2); + var x21: ${c} = getInputValue(batch, channel, row2, col1); + var x22: ${c} = getInputValue(batch, channel, row2, col2); + var dx1: ${c} = abs(row - ${c}(row1)); + var dx2: ${c} = abs(${c}(row2) - row); + var dy1: ${c} = abs(col - ${c}(col1)); + var dy2: ${c} = abs(${c}(col2) - col); + if (row1 == row2) { + dx1 = 0.5; + dx2 = 0.5; + } + if (col1 == col2) { + dy1 = 0.5; + dy2 = 0.5; + } + return (x11 * dx2 * dy2 + x12 * dx2 * dy1 + x21 * dx1 * dy2 + x22 * dx1 * dy1); + }`},Ug=(e,r,t,s,i,n,o,a,l,c)=>{let p=t.length===2,[u,h]=p?[0,1]:[2,3],g=e.type.value,_=P=>{let A=P===u?"row":"col";return` + fn ${A}CubicInterpolation(input_indices: ${e.type.indices}, output_indices: ${r.type.indices}) -> ${g} { + var output_index = ${r.indicesGet("output_indices",P)}; + var originalIdx: ${g} = getOriginalCoordinateFromResizedCoordinate(output_index, ${i[P]}, + ${s[P]}, ${t[P]}, ${n[P]}, ${n[P]} + ${t.length}); + var fractOriginalIdx: ${g} = originalIdx - floor(originalIdx); + var coefs = getCubicInterpolationCoefs(fractOriginalIdx); + + if (${a} && (originalIdx < 0 || originalIdx > (${t[P]} - 1))) { + return ${l}; + } + var data: array<${g}, 4> = array<${g}, 4>(0.0, 0.0, 0.0, 0.0); + for (var i: i32 = -1; i < 3; i++) { + var ${A}: ${g} = originalIdx + ${g}(i); + if (${A} < 0 || ${A} >= ${t[P]}) { + ${c?`coefs[i + 1] = 0.0; + continue;`:a?`return ${l};`:`${A} = max(0, min(${A}, ${t[P]} - 1));`}; + } + var input_indices_copy: ${e.type.indices} = input_indices; + ${e.indicesSet("input_indices_copy",P,`u32(${A})`)}; + data[i + 1] = ${P===u?e.getByIndices("input_indices_copy"):"rowCubicInterpolation(input_indices_copy, output_indices)"}; + } + return cubicInterpolation1D(data, coefs); + }`};return` + ${_(u)}; + ${_(h)}; + fn getCubicInterpolationCoefs(s: ${g}) -> array<${g}, 4> { + var absS = abs(s); + var coeffs: array<${g}, 4> = array<${g}, 4>(0.0, 0.0, 0.0, 0.0); + var oneMinusAbsS: ${g} = 1.0 - absS; + var twoMinusAbsS: ${g} = 2.0 - absS; + var onePlusAbsS: ${g} = 1.0 + absS; + coeffs[0] = ((${o} * onePlusAbsS - 5 * ${o}) * onePlusAbsS + 8 * ${o}) * onePlusAbsS - 4 * ${o}; + coeffs[1] = ((${o} + 2) * absS - (${o} + 3)) * absS * absS + 1; + coeffs[2] = ((${o} + 2) * oneMinusAbsS - (${o} + 3)) * oneMinusAbsS * oneMinusAbsS + 1; + coeffs[3] = ((${o} * twoMinusAbsS - 5 * ${o}) * twoMinusAbsS + 8 * ${o}) * twoMinusAbsS - 4 * ${o}; + return coeffs; + } + + fn cubicInterpolation1D(x: array<${g}, 4>, coefs: array<${g}, 4>) -> ${g} { + var coefsSum: ${g} = coefs[0] + coefs[1] + coefs[2] + coefs[3]; + return (x[0] * coefs[0] + x[1] * coefs[1]+ x[2] * coefs[2]+ x[3] * coefs[3]) / coefsSum; + } + + fn bicubicInterpolation(output_indices: ${r.type.indices}) -> ${g} { + var input_indices: ${e.type.indices} = output_indices; + return colCubicInterpolation(input_indices, output_indices); + } + `},Wg=(e,r,t,s,i)=>{let[n,o,a,l,c]=t.length===3?[-1,0,1,2,-1]:[0,2,3,4,1],p=e.type.value;return` + fn getInputValue(batch: u32, channel: u32, depth:u32, height: u32, width: u32) -> ${p} { + var input_indices: ${e.type.indices}; + ${e.indicesSet("input_indices",o,`max(0, min(depth, ${t[o]} - 1))`)}; + ${e.indicesSet("input_indices",a,`max(0, min(height, ${t[a]} - 1))`)}; + ${e.indicesSet("input_indices",l,`max(0, min(width, ${t[l]} - 1))`)}; + ${Ic(e,c,n,3)} + return ${e.getByIndices("input_indices")}; + } + + fn trilinearInterpolation(output_indices: ${r.type.indices}) -> ${p} { + var originalIndices = calculateOriginalIndicesFromOutputIndices(output_indices); + var depth:${p} = originalIndices[${o}]; + var height:${p} = originalIndices[${a}]; + var width:${p} = originalIndices[${l}]; + ${s?`if (depth < 0 || depth > (${t[o]} - 1) || height < 0 || height > (${t[a]} - 1) || width < 0 || (width > ${t[l]} - 1)) { + return ${i}; + }`:""}; + + depth = max(0, min(depth, ${t[o]} - 1)); + height = max(0, min(height, ${t[a]} - 1)); + width = max(0, min(width, ${t[l]} - 1)); + var depth1: u32 = u32(depth); + var height1: u32 = u32(height); + var width1: u32 = u32(width); + var depth2: u32 = u32(depth + 1); + var height2: u32 = u32(height + 1); + var width2: u32 = u32(width + 1); + var channel: u32 = ${t.length>3?`u32(originalIndices[${c}])`:"0"}; + var batch: u32 = ${t.length>3?`u32(originalIndices[${n}])`:"0"}; + + var x111: ${p} = getInputValue(batch, channel, depth1, height1, width1); + var x112: ${p} = getInputValue(batch, channel, depth1, height1, width2); + var x121: ${p} = getInputValue(batch, channel, depth1, height2, width1); + var x122: ${p} = getInputValue(batch, channel, depth1, height2, width2); + var x211: ${p} = getInputValue(batch, channel, depth2, height1, width1); + var x212: ${p} = getInputValue(batch, channel, depth2, height1, width2); + var x221: ${p} = getInputValue(batch, channel, depth2, height2, width1); + var x222: ${p} = getInputValue(batch, channel, depth2, height2, width2); + var dx1: ${p} = abs(depth - ${p}(depth1)); + var dx2: ${p} = abs(${p}(depth2) - depth); + var dy1: ${p} = abs(height - ${p}(height1)); + var dy2: ${p} = abs(${p}(height2) - height); + var dz1: ${p} = abs(width - ${p}(width1)); + var dz2: ${p} = abs(${p}(width2) - width); + if (depth1 == depth2) { + dx1 = 0.5; + dx2 = 0.5; + } + if (height1 == height2) { + dy1 = 0.5; + dy2 = 0.5; + } + if (width1 == width2) { + dz1 = 0.5; + dz2 = 0.5; + } + 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); + }`},Gg=(e,r,t,s,i,n)=>{let o=e.dims,a=Lg(n,r.axes,o.length),l=zg(o,s,i,r.axes),c=s.slice();s.length===0&&(c=o.map((y,k)=>y===0?1:l[k]/y),r.keepAspectRatioPolicy!=="stretch"&&(l=Bg(o,c,r)));let p=tt("output",e.dataType,l.length),u=$e("input",e.dataType,o.length),h=Te.size(l),g=o.length===l.length&&o.every((y,k)=>y===l[k]),_=r.coordinateTransformMode==="tf_crop_and_resize",P=r.extrapolationValue,A=u.type.value,v=y=>` + ${g?"":` + ${Og(r.coordinateTransformMode,A)}; + ${(()=>{switch(r.mode){case"nearest":return` + ${jg(u,o)}; + ${Dg(r.nearestMode,t,A)}; + ${Ng(u,p,o,l,c.length,a.length,_)}; + `;case"linear":return` + ${Rg(p,o,l,c.length,a.length)}; + ${(()=>{if(o.length===2||o.length===4)return`${Vg(u,p,o,_,P)}`;if(o.length===3||o.length===5)return`${Wg(u,p,o,_,P)}`;throw Error("Linear mode only supports input dims 2, 3, 4 and 5 are supported in linear mode.")})()}; + `;case"cubic":return` + ${(()=>{if(o.length===2||o.length===4)return`${Ug(u,p,o,l,c,a,r.cubicCoeffA,_,r.extrapolationValue,r.excludeOutside)}`;throw Error("Cubic mode only supports input dims 2 and 4 are supported in linear mode.")})()}; + `;default:throw Error("Invalid resize mode")}})()}; + `} + ${y.registerUniform("output_size","u32").registerUniform("scales","f32",c.length).registerUniform("roi","f32",a.length).declareVariables(u,p)} + ${y.mainStart()} + ${y.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + ${g?"output[global_idx] = input[global_idx];":` + let output_indices = ${p.offsetToIndices("global_idx")}; + var input_indices: ${u.type.indices}; + ${(()=>{switch(r.mode){case"nearest":return`input_indices = calculateInputIndicesFromOutputIndices(output_indices); + if (checkInputIndices(input_indices)) { + output[global_idx] = ${u.getByIndices("input_indices")}; + } else { + output[global_idx] = ${r.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: ${r.mode}`)}})()}; +`} + }`;return{name:"Resize",shaderCache:{hint:`${r.cacheKey}|${t}|${c.length>0?r.mode==="cubic"?c:c.length:""}|${i.length>0?i:""}|${a.length>0?a:""}|${g}|${r.mode==="nearest"?o.length:o}`,inputDependencies:["rank"]},getShaderSource:v,getRunData:()=>({outputs:[{dims:l,dataType:e.dataType}],dispatchGroup:{x:Math.ceil(h/64)},programUniforms:[{type:12,data:h},{type:1,data:c},{type:1,data:a},...nt(o,l)]})}},Kg=e=>{let r=e.customDataBuffer;return new Uint32Array(r,r.byteOffset,1)[0]},Hg=(e,r)=>{let t=[],s=[],i=[],n=Kg(e);if(r.antialias!==0)throw Error("Only default value (0) for Antialias attribute is supported");Fg(e.inputs,r,n,t,s,i),e.compute(Gg(e.inputs[0],r,n,t,s,i),{inputs:[0]})},qg=e=>{let r=e.antialias,t=e.axes,s=e.coordinateTransformMode,i=e.cubicCoeffA,n=e.excludeOutside!==0,o=e.extrapolationValue,a=e.keepAspectRatioPolicy,l=e.mode,c=e.nearestMode===""?"simple":e.nearestMode;return Dt({antialias:r,axes:t,coordinateTransformMode:s,cubicCoeffA:i,excludeOutside:n,extrapolationValue:o,keepAspectRatioPolicy:a,mode:l,nearestMode:c})}}),Qg,Xg,Jg,qv=Ve(()=>{pt(),Mt(),Yt(),Tt(),Qg=(e,r)=>{let[t,s,i,n]=e,{numHeads:o,rotaryEmbeddingDim:a}=r;if(t.dims.length!==3&&t.dims.length!==4)throw new Error(`Input 'x' is expected to have 3 or 4 dimensions, got ${t.dims.length}`);if(!Te.areEqual(s.dims,[])&&!Te.areEqual(s.dims,[1])&&s.dims.length!==2)throw new Error(`Input 'position_ids' is expected to have 0, 1, or 2 dimensions, got ${s.dims.length}`);if(i.dims.length!==2)throw new Error(`Input 'cos_cache' is expected to have 2 dimensions, got ${i.dims.length}`);if(n.dims.length!==2)throw new Error(`Input 'sin_cache' is expected to have 2 dimensions, got ${n.dims.length}`);if(!Te.areEqual(i.dims,n.dims))throw new Error("Inputs 'cos_cache' and 'sin_cache' are expected to have the same shape");if(a>0&&o===0)throw new Error("num_heads must be provided if rotary_embedding_dim is specified");let l=t.dims[0],c=t.dims[t.dims.length-2],p=i.dims[0],u=Te.sizeFromDimension(t.dims,1)/c,h=a===0?i.dims[1]*2:u/o;if(a>h)throw new Error("rotary_embedding_dim must be less than or equal to head_size");if(s.dims.length===2){if(l!==s.dims[0])throw new Error(`Input 'position_ids' dimension 0 should be of size batch_size, got ${s.dims[0]}`);if(c!==s.dims[1])throw new Error(`Input 'position_ids' dimension 1 should be of size sequence_length, got ${s.dims[1]}`)}if(h/2!==i.dims[1]&&a/2!==i.dims[1])throw new Error(`Input 'cos_cache' dimension 1 should be same as head_size / 2 or rotary_embedding_dim / 2, got ${i.dims[1]}`);if(c>p)throw new Error("Updating cos_cache and sin_cache in RotaryEmbedding is not currently supported")},Xg=(e,r)=>{let{interleaved:t,numHeads:s,rotaryEmbeddingDim:i,scale:n}=r,o=e[0].dims[0],a=Te.sizeFromDimension(e[0].dims,1),l=e[0].dims[e[0].dims.length-2],c=a/l,p=e[2].dims[1],u=i===0?p*2:c/s,h=new Array(o,l,c/u,u-p),g=Te.computeStrides(h),_=[{type:1,data:n},{type:12,data:h},{type:12,data:g},...e[0].dims.length===3?new Array({type:12,data:[a,c,u,1]}):[],...e[0].dims.length===4?new Array({type:12,data:[a,u,l*u,1]}):[],...nt(e[0].dims,e[1].dims,e[2].dims,e[3].dims,e[0].dims)],P=A=>{let v=$e("input",e[0].dataType,e[0].dims.length),y=$e("position_ids",e[1].dataType,e[1].dims.length),k=$e("cos_cache",e[2].dataType,e[2].dims.length),E=$e("sin_cache",e[3].dataType,e[3].dims.length),M=tt("output",e[0].dataType,e[0].dims.length);return A.registerUniforms([{name:"scale",type:"f32"},{name:"global_shape",type:"u32",length:h.length},{name:"global_strides",type:"u32",length:g.length},{name:"input_output_strides",type:"u32",length:g.length}]),` + ${A.declareVariables(v,y,k,E,M)} + + ${A.mainStart(jn)} + let half_rotary_emb_dim = uniforms.${k.name}_shape[1]; + let bsnh = global_idx / uniforms.global_strides % uniforms.global_shape; + let size = uniforms.global_shape[0] * uniforms.global_strides[0]; + ${A.guardAgainstOutOfBoundsWorkgroupSizes("size")} + + if (bsnh[3] < half_rotary_emb_dim) { + let position_ids_idx = + ${y.broadcastedIndicesToOffset("bsnh.xy",tt("",y.type.tensor,2))}; + let position_id = + u32(${y.getByOffset("position_ids_idx")}) + select(0, bsnh[1], position_ids_idx == 0); + let i = dot(bsnh, uniforms.input_output_strides) + select(0, bsnh[3], ${t}); + let j = i + select(half_rotary_emb_dim, 1, ${t}); + let re = ${v.getByOffset("i")} * ${k.get("position_id","bsnh[3]")} - + ${v.getByOffset("j")} * ${E.get("position_id","bsnh[3]")}; + ${M.setByOffset("i","re")} + let im = ${v.getByOffset("i")} * ${E.get("position_id","bsnh[3]")} + + ${v.getByOffset("j")} * ${k.get("position_id","bsnh[3]")}; + ${M.setByOffset("j","im")} + } else { + let k = dot(bsnh, uniforms.input_output_strides) + half_rotary_emb_dim; + ${M.setByOffset("k",v.getByOffset("k"))} + } + }`};return{name:"RotaryEmbedding",shaderCache:{hint:Dt({interleaved:t}).cacheKey,inputDependencies:["rank","rank","rank","rank"]},getShaderSource:P,getRunData:()=>({outputs:[{dims:e[0].dims,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(Te.size(h)/jn)},programUniforms:_})}},Jg=(e,r)=>{Qg(e.inputs,r),e.compute(Xg(e.inputs,r))}}),Yg,Zg,ew,Qv=Ve(()=>{pt(),Mt(),Tt(),Yg=e=>{if(!e||e.length<3)throw new Error("layerNorm requires at least 3 inputs.");let r=e[0],t=e[1],s=e[2];if(r.dataType!==t.dataType||r.dataType!==s.dataType)throw new Error("All inputs must have the same data type");if(r.dims.length!==3&&r.dims.length!==2)throw new Error("Input must be 2D or 3D");if(t.dims.length!==3&&t.dims.length!==2)throw new Error("Skip must be 2D or 3D");let i=r.dims[r.dims.length-1],n=r.dims[r.dims.length-2];if(t.dims[t.dims.length-1]!==i)throw new Error("Skip must have the same hidden size as input");if(t.dims[t.dims.length-2]!==n)throw new Error("Skip must have the same sequence length as input");if(s.dims.length!==1)throw new Error("Gamma must be 1D");if(s.dims[s.dims.length-1]!==i)throw new Error("Gamma must have the same hidden size as input");if(e.length>3){let o=e[3];if(o.dims.length!==1)throw new Error("Beta must be 1D");if(o.dims[o.dims.length-1]!==i)throw new Error("Beta must have the same hidden size as input")}if(e.length>4){let o=e[4];if(o.dims.length!==1)throw new Error("Bias must be 1D");if(o.dims[o.dims.length-1]!==i)throw new Error("Bias must have the same hidden size as input")}},Zg=(e,r,t,s)=>{let i=r.simplified,n=e[0].dims,o=Te.size(n),a=n,l=o,c=n.slice(-1)[0],p=s?n.slice(0,-1).concat(1):[],u=!i&&e.length>3,h=e.length>4,g=s&&t>1,_=s&&t>2,P=t>3,A=64,v=Xt(c),y=[{type:12,data:l},{type:12,data:v},{type:12,data:c},{type:1,data:r.epsilon}],k=M=>{let w=[{name:"output_size",type:"u32"},{name:"components",type:"u32"},{name:"hidden_size",type:"u32"},{name:"epsilon",type:"f32"}],x=[$e("x",e[0].dataType,e[0].dims,v),$e("skip",e[1].dataType,e[1].dims,v),$e("gamma",e[2].dataType,e[2].dims,v)];u&&x.push($e("beta",e[3].dataType,e[3].dims,v)),h&&x.push($e("bias",e[4].dataType,e[4].dims,v)),x.push(tt("output",e[0].dataType,a,v)),g&&x.push(tt("mean_output",1,p)),_&&x.push(tt("inv_std_output",1,p)),P&&x.push(tt("input_skip_bias_sum",e[0].dataType,a,v));let $=lr(e[0].dataType),z=lr(1,v);return` + + ${M.registerUniforms(w).declareVariables(...x)} + var sum_shared : array<${z}, ${A}>; + var sum_squared_shared : array<${z}, ${A}>; + + ${M.mainStart([A,1,1])} + let ix = local_id.x; + let iy = global_id.x / ${A}; + + let hidden_size_vectorized: u32 = uniforms.hidden_size / uniforms.components; + var stride = hidden_size_vectorized / ${A}; + let offset = ix * stride + iy * hidden_size_vectorized; + let offset1d = stride * ix; + if (ix == ${A-1}) { + stride = hidden_size_vectorized - stride * ix; + } + for (var i: u32 = 0; i < stride; i++) { + let skip_value = skip[offset + i]; + let bias_value = ${h?"bias[offset1d + i]":$+"(0.0)"}; + let input_value = x[offset + i]; + let value = input_value + skip_value + bias_value; + ${P?"input_skip_bias_sum[offset + i] = value;":""} + output[offset + i] = value; + let f32_value = ${Vn($,v,"value")}; + sum_shared[ix] += f32_value; + sum_squared_shared[ix] += f32_value * f32_value; + } + workgroupBarrier(); + + var reduce_size : u32 = ${A}; + for (var curr_size = reduce_size >> 1; curr_size > 0; curr_size = reduce_size >> 1) { + reduce_size = curr_size + (reduce_size & 1); + if (ix < curr_size) { + sum_shared[ix] += sum_shared[ix + reduce_size]; + sum_squared_shared[ix] += sum_squared_shared[ix + reduce_size]; + } + workgroupBarrier(); + } + + let sum = sum_shared[0]; + let square_sum = sum_squared_shared[0]; + let mean = ${Gs("sum",v)} / f32(uniforms.hidden_size); + let inv_std_dev = inverseSqrt(${Gs("square_sum",v)} / f32(uniforms.hidden_size) ${i?"":"- mean * mean"} + uniforms.epsilon); + ${g?"mean_output[global_idx] = mean;":""} + ${_?"inv_std_output[global_idx] = inv_std_dev;":""} + + for (var i: u32 = 0; i < stride; i++) { + output[offset + i] = (output[offset + i] ${i?"":`- ${$}(mean)`}) * + ${$}(inv_std_dev) * gamma[offset1d + i] + ${u?"+ beta[offset1d + i]":""}; + } + }`},E=[{dims:a,dataType:e[0].dataType}];return t>1&&E.push({dims:p,dataType:1}),t>2&&E.push({dims:p,dataType:1}),t>3&&E.push({dims:n,dataType:e[0].dataType}),{name:"SkipLayerNormalization",shaderCache:{hint:`${v};${g};${_};${P}`,inputDependencies:e.map((M,w)=>"type")},getShaderSource:k,getRunData:()=>({outputs:E,dispatchGroup:{x:Math.ceil(l/c)},programUniforms:y})}},ew=(e,r)=>{Yg(e.inputs);let t=[0];e.outputCount>1&&t.push(-3),e.outputCount>2&&t.push(-3),e.outputCount>3&&t.push(3),e.compute(Zg(e.inputs,r,e.outputCount,!1),{outputs:t})}}),tw,ji,rw,Ac,sw,nw,iw,ow,Xv=Ve(()=>{pt(),Mt(),Yt(),Tt(),tw=(e,r)=>{if(!e||e.length<1)throw new Error("too few inputs");if(r.axes.length!==0){if(r.axes.length!==r.starts.length||r.axes.length!==r.ends.length)throw new Error("axes, starts and ends must have the same length")}else if(r.starts.length!==r.ends.length)throw new Error("starts and ends must have the same length");e.slice(1).forEach((t,s)=>{if(e[s+1].dataType!==6&&e[s+1].dataType!==7)throw new Error(`Input ${s} must be an array of int32 or int64`)})},ji=(e,r)=>{let t=[];if(e.length>r)if(e[r].dataType===7)e[r].getBigInt64Array().forEach(s=>t.push(Number(s)));else if(e[r].dataType===6)e[r].getInt32Array().forEach(s=>t.push(Number(s)));else throw new Error(`Input ${r} must be an array of int32 or int64`);return t},rw=(e,r)=>{if(e.length>1){let t=ji(e,1),s=ji(e,2),i=ji(e,3);return i.length===0&&(i=[...Array(e[0].dims.length).keys()]),Dt({starts:t,ends:s,axes:i})}else return r},Ac=(e,r,t,s,i)=>{let n=e;return e<0&&(n+=t[s[r]]),i[r]<0?Math.max(0,Math.min(n,t[s[r]]-1)):Math.max(0,Math.min(n,t[s[r]]))},sw=(e,r,t)=>`fn calculateInputIndices(output_indices: ${r.type.indices}) -> ${e.type.indices} { + var input_indices: ${e.type.indices}; + var carry = 0u; + for (var i = ${t.length}; i >= 0; i--) { + let input_shape_i = ${rt("uniforms.input_shape","i",t.length)}; + let steps_i = ${rt("uniforms.steps","i",t.length)}; + let signs_i = ${rt("uniforms.signs","i",t.length)}; + let starts_i = ${rt("uniforms.starts","i",t.length)}; + var output_index = ${r.indicesGet("output_indices","i")}; + var input_index = output_index * steps_i + starts_i + carry; + carry = input_index / input_shape_i; + input_index = input_index % input_shape_i; + if (signs_i < 0) { + input_index = input_shape_i - input_index - 1u + starts_i; + } + ${e.indicesSet("input_indices","i","input_index")}; + } + return input_indices; + }`,nw=(e,r)=>{let t=e[0].dims,s=Te.size(t),i=r.axes.length>0?Te.normalizeAxes(r.axes,t.length):[...Array(t.length).keys()],n=ji(e,4);n.forEach(v=>v!==0||(()=>{throw new Error("step cannot be 0")})),n.length===0&&(n=Array(i.length).fill(1));let o=r.starts.map((v,y)=>Ac(v,y,t,i,n)),a=r.ends.map((v,y)=>Ac(v,y,t,i,n));if(i.length!==o.length||i.length!==a.length)throw new Error("start, ends and axes should have the same number of elements");if(i.length!==t.length)for(let v=0;vMath.sign(v));n.forEach((v,y,k)=>{if(v<0){let E=(a[y]-o[y])/v,M=o[y],w=M+E*n[y];o[y]=w,a[y]=M,k[y]=-v}});let c=t.slice(0);i.forEach((v,y)=>{c[v]=Math.ceil((a[v]-o[v])/n[v])});let p={dims:c,dataType:e[0].dataType},u=tt("output",e[0].dataType,c.length),h=$e("input",e[0].dataType,e[0].dims.length),g=Te.size(c),_=[{name:"outputSize",type:"u32"},{name:"starts",type:"u32",length:o.length},{name:"signs",type:"i32",length:l.length},{name:"steps",type:"u32",length:n.length}],P=[{type:12,data:g},{type:12,data:o},{type:6,data:l},{type:12,data:n},...nt(e[0].dims,c)],A=v=>` + ${v.registerUniforms(_).declareVariables(h,u)} + ${sw(h,u,t)} + ${v.mainStart()} + ${v.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.outputSize")} + let output_indices = ${u.offsetToIndices("global_idx")}; + let input_indices = calculateInputIndices(output_indices); + ${u.setByOffset("global_idx",h.getByIndices("input_indices"))} + }`;return{name:"Slice",shaderCache:{hint:`${l.length}_${o.length}_${n.length}`,inputDependencies:["rank"]},getShaderSource:A,getRunData:()=>({outputs:[p],dispatchGroup:{x:Math.ceil(s/64)},programUniforms:P})}},iw=(e,r)=>{tw(e.inputs,r);let t=rw(e.inputs,r);e.compute(nw(e.inputs,t),{inputs:[0]})},ow=e=>{let r=e.starts,t=e.ends,s=e.axes;return Dt({starts:r,ends:t,axes:s})}}),aw,lw,dw,cw,Jv=Ve(()=>{pt(),Mt(),Yt(),Ks(),Tt(),aw=e=>{if(!e||e.length!==1)throw new Error("Softmax op requires 1 input.")},lw=(e,r)=>{let t=e.inputs[0],s=t.dims,i=Te.size(s),n=s.length,o=Te.normalizeAxis(r.axis,n),a=o$),c[o]=n-1,c[n-1]=o,l=e.compute(Nr(t,c),{inputs:[t],outputs:[-1]})[0]):l=t;let p=l.dims,u=p[n-1],h=i/u,g=Xt(u),_=u/g,P=64;h===1&&(P=256);let A=(x,$)=>$===4?`max(max(${x}.x, ${x}.y), max(${x}.z, ${x}.w))`:$===2?`max(${x}.x, ${x}.y)`:$===3?`max(max(${x}.x, ${x}.y), ${x}.z)`:x,v=$e("x",l.dataType,l.dims,g),y=tt("result",l.dataType,l.dims,g),k=v.type.value,E=lr(l.dataType)==="f32"?`var threadMax = ${k}(-3.402823e+38f);`:`var threadMax = ${k}(-65504.0h);`,M=x=>` + var rowMaxShared : ${k}; + var rowSumShared : ${k}; + var threadShared : array<${k}, ${P}>; + + fn getValue(row: i32, col: i32, row_stride: i32) -> ${k} { + let index = row * row_stride + col; + return x[index]; + } + + fn setValue(row: i32, col: i32, row_stride: i32, value: ${k}) { + let index = row * row_stride + col; + result[index] = value; + } + ${x.registerUniform("packedCols","i32").declareVariables(v,y)} + ${x.mainStart(P)} + let gindex = i32(global_idx); + let lindex = i32(local_idx); + const wg = ${P}; + let row = gindex / wg; + let cols = uniforms.packedCols; + let row_stride : i32 = uniforms.packedCols; + + // find the rows max + ${E} + for (var col = lindex; col < cols; col += wg) { + let value = getValue(row, col, row_stride); + threadMax = max(threadMax, value); + } + if (lindex < cols) { + threadShared[lindex] = threadMax; + } + workgroupBarrier(); + + var reduceSize = min(cols, wg); + for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) { + reduceSize = currSize + (reduceSize & 1); + if (lindex < currSize) { + threadShared[lindex] = max(threadShared[lindex], threadShared[lindex + reduceSize]); + } + workgroupBarrier(); + } + if (lindex == 0) { + rowMaxShared = ${k}(${A("threadShared[0]",g)}); + } + workgroupBarrier(); + + // find the rows sum + var threadSum = ${k}(0.0); + for (var col = lindex; col < cols; col += wg) { + let subExp = exp(getValue(row, col, row_stride) - rowMaxShared); + threadSum += subExp; + } + threadShared[lindex] = threadSum; + workgroupBarrier(); + + for (var currSize = wg >> 1; currSize > 0; currSize = currSize >> 1) { + if (lindex < currSize) { + threadShared[lindex] = threadShared[lindex] + threadShared[lindex + currSize]; + } + workgroupBarrier(); + } + if (lindex == 0) { + rowSumShared = ${k}(${Gs("threadShared[0]",g)}); + } + workgroupBarrier(); + + // calculate final value for each element in the row + for (var col = lindex; col < cols; col += wg) { + let value = exp(getValue(row, col, row_stride) - rowMaxShared) / rowSumShared; + setValue(row, col, row_stride, value); + } + }`,w=e.compute({name:"Softmax",shaderCache:{hint:`${g};${P}`,inputDependencies:["type"]},getRunData:()=>({outputs:[{dims:p,dataType:l.dataType}],dispatchGroup:{x:h},programUniforms:[{type:6,data:_}]}),getShaderSource:M},{inputs:[l],outputs:[a?-1:0]})[0];a&&e.compute(Nr(w,c),{inputs:[w]})},dw=(e,r)=>{aw(e.inputs),lw(e,r)},cw=e=>Dt({axis:e.axis})}),Fc,uw,pw,hw,mw,Yv=Ve(()=>{pt(),Mt(),Tt(),Fc=e=>Array.from(e.getBigInt64Array(),Number),uw=e=>{if(!e||e.length!==2)throw new Error("Tile requires 2 inputs.");if(e[0].dataType!==1&&e[0].dataType!==10&&e[0].dataType!==6&&e[0].dataType!==12)throw new Error("Tile only support float, float16, int32, and uint32 data types");if(e[1].dataType!==7)throw new Error("Tile `repeats` input should be of int64 data type");if(e[1].dims.length!==1)throw new Error("Tile `repeats` input should be 1-D");if(Fc(e[1]).length!==e[0].dims.length)throw new Error("Tile `repeats` input should have same number of elements as rank of input data tensor")},pw=(e,r)=>{let t=[];for(let s=0;s{let t=e[0].dims,s=r??Fc(e[1]),i=pw(t,s),n=Te.size(i),o=e[0].dataType,a=$e("input",o,t.length),l=tt("output",o,i.length),c=p=>` + const inputShape = ${a.indices(...t)}; + ${p.registerUniform("output_size","u32").declareVariables(a,l)} + ${p.mainStart()} + ${p.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.output_size")} + let output_indices = ${l.offsetToIndices("global_idx")}; + var input_indices: ${a.type.indices}; + for (var i = 0; i < ${t.length}; i++) { + let input_dim_i = ${a.indicesGet("uniforms.input_shape","i")}; + let input_dim_value = ${l.indicesGet("output_indices","i")} % input_dim_i; + + ${a.indicesSet("input_indices","i","input_dim_value")} + } + ${l.setByOffset("global_idx",a.getByIndices("input_indices"))} + }`;return{name:"Tile",shaderCache:{hint:`${s}`,inputDependencies:["rank"]},getRunData:()=>({outputs:[{dims:i,dataType:e[0].dataType}],dispatchGroup:{x:Math.ceil(n/64)},programUniforms:[{type:12,data:n},...nt(e[0].dims,i)]}),getShaderSource:c}},mw=e=>{uw(e.inputs),e.compute(hw(e.inputs),{inputs:[0]})}}),fw,_w,gw,Zv=Ve(()=>{pt(),Mt(),Tt(),fw=(e,r,t,s,i)=>{let n=tt("output_data",i,t.length,4),o=$e("a_data",r[1].dataType,r[1].dims.length,4),a=$e("b_data",r[2].dataType,r[2].dims.length,4),l=$e("c_data",r[0].dataType,r[0].dims.length,4),c,p=(u,h,g)=>`select(${h}, ${u}, ${g})`;if(!s)c=n.setByOffset("global_idx",p(o.getByOffset("global_idx"),a.getByOffset("global_idx"),l.getByOffset("global_idx")));else{let u=(h,g,_="")=>{let P=`a_data[index_a${g}][component_a${g}]`,A=`b_data[index_b${g}][component_b${g}]`,v=`bool(c_data[index_c${g}] & (0xffu << (component_c${g} * 8)))`;return` + let output_indices${g} = ${n.offsetToIndices(`global_idx * 4u + ${g}u`)}; + let offset_a${g} = ${o.broadcastedIndicesToOffset(`output_indices${g}`,n)}; + let offset_b${g} = ${a.broadcastedIndicesToOffset(`output_indices${g}`,n)}; + let offset_c${g} = ${l.broadcastedIndicesToOffset(`output_indices${g}`,n)}; + let index_a${g} = offset_a${g} / 4u; + let index_b${g} = offset_b${g} / 4u; + let index_c${g} = offset_c${g} / 4u; + let component_a${g} = offset_a${g} % 4u; + let component_b${g} = offset_b${g} % 4u; + let component_c${g} = offset_c${g} % 4u; + ${h}[${g}] = ${_}(${p(P,A,v)}); + `};i===9?c=` + var data = vec4(0); + ${u("data",0,"u32")} + ${u("data",1,"u32")} + ${u("data",2,"u32")} + ${u("data",3,"u32")} + output_data[global_idx] = dot(vec4(0x1, 0x100, 0x10000, 0x1000000), vec4(data));`:c=` + ${u("output_data[global_idx]",0)} + ${u("output_data[global_idx]",1)} + ${u("output_data[global_idx]",2)} + ${u("output_data[global_idx]",3)} + `}return` + ${e.registerUniform("vec_size","u32").declareVariables(l,o,a,n)} + ${e.mainStart()} + ${e.guardAgainstOutOfBoundsWorkgroupSizes("uniforms.vec_size")} + ${c} + }`},_w=e=>{let r=e[1].dims,t=e[2].dims,s=e[0].dims,i=e[1].dataType,n=!(Te.areEqual(r,t)&&Te.areEqual(t,s)),o=r,a=Te.size(r);if(n){let c=Nn.calcShape(Nn.calcShape(r,t,!1),s,!1);if(!c)throw new Error("Can't perform where op on the given tensors");o=c,a=Te.size(o)}let l=Math.ceil(a/4);return{name:"Where",shaderCache:{inputDependencies:["rank","rank","rank"]},getShaderSource:c=>fw(c,e,o,n,i),getRunData:()=>({outputs:[{dims:o,dataType:i}],dispatchGroup:{x:Math.ceil(a/64/4)},programUniforms:[{type:12,data:l},...nt(s,r,t,o)]})}},gw=e=>{e.compute(_w(e.inputs))}}),ww,eT=Ve(()=>{hv(),Qd(),mv(),fv(),_v(),gv(),wv(),Tv(),Ev(),Pv(),Cv(),Sv(),$v(),kv(),Iv(),Av(),Fv(),Ov(),Dv(),Lv(),zv(),Bv(),Rv(),Nv(),jv(),I_(),Vv(),Uv(),Wv(),Gv(),Kv(),Kd(),Hv(),qv(),Qv(),Xv(),Jv(),B_(),Yv(),Ks(),Zd(),Zv(),ww=new Map([["Abs",[Yh]],["Acos",[Zh]],["Acosh",[em]],["Add",[jm]],["ArgMax",[zh,qd]],["ArgMin",[Lh,qd]],["Asin",[tm]],["Asinh",[rm]],["Atan",[sm]],["Atanh",[nm]],["Attention",[Uh]],["AveragePool",[hg,pg]],["BatchNormalization",[Hh]],["BiasAdd",[Xh]],["BiasSplitGelu",[Bm]],["Cast",[om,im]],["Ceil",[dm]],["Clip",[lm]],["Concat",[tf,rf]],["Conv",[pc,cc]],["ConvTranspose",[kf,Cf]],["Cos",[cm]],["Cosh",[um]],["CumSum",[Af,Ff]],["DepthToSpace",[zf,Bf]],["DequantizeLinear",[vg,Tg]],["Div",[Vm]],["Einsum",[Wf,Gf]],["Elu",[pm,Di]],["Equal",[Um]],["Erf",[hm]],["Exp",[mm]],["Expand",[Qf]],["FastGelu",[Jf]],["Floor",[fm]],["FusedConv",[pc,cc]],["Gather",[t_,e_]],["GatherElements",[p_,u_]],["GatherBlockQuantized",[a_,l_]],["GatherND",[s_,n_]],["Gelu",[_m]],["Gemm",[__,f_]],["GlobalAveragePool",[fg,mg]],["GlobalMaxPool",[yg,wg]],["Greater",[Hm]],["GreaterOrEqual",[Qm]],["GridSample",[E_,P_]],["GroupQueryAttention",[j_]],["HardSigmoid",[xm,Tm]],["InstanceNormalization",[W_]],["LayerNormalization",[H_]],["LeakyRelu",[gm,Di]],["Less",[qm]],["LessOrEqual",[Xm]],["Log",[Am]],["MatMul",[Q_]],["MatMulNBits",[Z_,eg]],["MaxPool",[_g,gg]],["Mul",[Wm]],["MultiHeadAttention",[k_,S_]],["Neg",[ym]],["Not",[wm]],["Pad",[dg]],["Pow",[Gm]],["QuickGelu",[Dm,Di]],["Range",[Pg]],["Reciprocal",[Mm]],["ReduceMin",[Ih]],["ReduceMean",[Ph]],["ReduceMax",[kh]],["ReduceSum",[Fh]],["ReduceProd",[Ah]],["ReduceL1",[Ch]],["ReduceL2",[Sh]],["ReduceLogSum",[Dh]],["ReduceLogSumExp",[$h]],["ReduceSumSquare",[Oh]],["Relu",[bm]],["Resize",[Hg,qg]],["RotaryEmbedding",[Jg]],["ScatterND",[kg,$g]],["Sigmoid",[vm]],["Sin",[Em]],["Sinh",[Pm]],["Slice",[iw,ow]],["SkipLayerNormalization",[ew]],["Split",[L_,z_]],["Sqrt",[Cm]],["Softmax",[dw,cw]],["Sub",[Km]],["Tan",[Sm]],["Tanh",[$m]],["ThresholdedRelu",[Im,Di]],["Tile",[mw]],["Transpose",[Hp,qp]],["Where",[gw]]])}),yw,tT=Ve(()=>{ss(),Is(),Tt(),yw=class{constructor(e){this.backend=e,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,r){this.repo.set(e,r)}run(e,r,t,s,i){rs(e.programInfo.name);let n=this.backend.device,o=this.backend.getComputePassEncoder();this.backend.writeTimestamp(this.backend.pendingDispatchNumber*2);let a=[];for(let c of r)a.push({binding:a.length,resource:{buffer:c.buffer}});for(let c of t)a.push({binding:a.length,resource:{buffer:c.buffer}});i&&a.push({binding:a.length,resource:i});let l=n.createBindGroup({layout:e.computePipeline.getBindGroupLayout(0),entries:a,label:e.programInfo.name});if(this.backend.sessionStatus==="capturing"){let c={kernelId:this.backend.currentKernelId,computePipeline:e.computePipeline,bindGroup:l,dispatchGroup:s};this.backend.capturedCommandList.get(this.backend.currentSessionId).push(c)}o.setPipeline(e.computePipeline),o.setBindGroup(0,l),o.dispatchWorkgroups(...s),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(),Hr(e.programInfo.name)}dispose(){}build(e,r){rs(e.name);let t=this.backend.device,s=[];[{feature:"shader-f16",extension:"f16"},{feature:"subgroups",extension:"subgroups"}].forEach(c=>{t.features.has(c.feature)&&s.push(`enable ${c.extension};`)});let i=jp(r,this.backend.device.limits),n=e.getShaderSource(i),o=`${s.join(` +`)} +${i.additionalImplementations} +${n}`,a=t.createShaderModule({code:o,label:e.name});St("verbose",()=>`[WebGPU] ${e.name} shader code: ${o}`);let l=t.createComputePipeline({compute:{module:a,entryPoint:"main"},layout:"auto",label:e.name});return Hr(e.name),{programInfo:e,computePipeline:l,uniformVariablesInfo:i.variablesInfo}}normalizeDispatchGroupSize(e){let r=typeof e=="number"?e:e.x,t=typeof e=="number"?1:e.y||1,s=typeof e=="number"?1:e.z||1,i=this.backend.device.limits.maxComputeWorkgroupsPerDimension;if(r<=i&&t<=i&&s<=i)return[r,t,s];let n=r*t*s,o=Math.ceil(Math.sqrt(n));if(o>i){if(o=Math.ceil(Math.cbrt(n)),o>i)throw new Error("Total dispatch size exceeds WebGPU maximum.");return[o,o,o]}else return[o,o,1]}}}),Mw,bw,vw,Tw,rT=Ve(()=>{ss(),pt(),Is(),$p(),uv(),eT(),tT(),Mw=(e,r)=>{if(r.length!==e.length)throw new Error(`inputDependencies length ${r.length} is not equal to inputTensors length ${e.length}.`);let t=[];for(let s=0;s{var i,n;let s=e.name;return(i=e.shaderCache)!=null&&i.hint&&(s+="["+e.shaderCache.hint+"]"),s+=":"+t+`:${Mw(r,((n=e.shaderCache)==null?void 0:n.inputDependencies)??new Array(r.length).fill("dims"))}`,s},vw=class{constructor(e){e&&(this.architecture=e.architecture,this.vendor=e.vendor)}isArchitecture(e){return this.architecture===e}isVendor(e){return this.vendor===e}},Tw=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 new 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,r){this.env=e;let t=[],s={requiredLimits:{maxComputeWorkgroupStorageSize:r.limits.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:r.limits.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:r.limits.maxStorageBufferBindingSize,maxBufferSize:r.limits.maxBufferSize,maxComputeInvocationsPerWorkgroup:r.limits.maxComputeInvocationsPerWorkgroup,maxComputeWorkgroupSizeX:r.limits.maxComputeWorkgroupSizeX,maxComputeWorkgroupSizeY:r.limits.maxComputeWorkgroupSizeY,maxComputeWorkgroupSizeZ:r.limits.maxComputeWorkgroupSizeZ},requiredFeatures:t},i=n=>r.features.has(n)&&t.push(n)&&!0;i("chromium-experimental-timestamp-query-inside-passes")||i("timestamp-query"),i("shader-f16"),i("subgroups"),this.device=await r.requestDevice(s),this.adapterInfo=new vw(r.info||await r.requestAdapterInfo()),this.gpuDataManager=Fp(this),this.programManager=new yw(this),this.kernels=new Map,this.kernelPersistentData=new Map,this.kernelCustomData=new Map,Ld(e.logLevel,!!e.debug),this.device.onuncapturederror=n=>{n.error instanceof GPUValidationError&&console.error(`An uncaught WebGPU validation error was raised: ${n.error.message}`)},Object.defineProperty(this.env.webgpu,"device",{value:this.device,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(this.env.webgpu,"adapter",{value:r,writable:!1,enumerable:!0,configurable:!1}),this.setQueryType()}dispose(){typeof this.querySet<"u"&&this.querySet.destroy(),this.gpuDataManager.dispose()}getCommandEncoder(){return this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder()),this.commandEncoder}getComputePassEncoder(){if(!this.computePassEncoder){let e=this.getCommandEncoder(),r={};this.queryType==="at-passes"&&(r.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:this.pendingDispatchNumber*2,endOfPassWriteIndex:this.pendingDispatchNumber*2+1}),this.computePassEncoder=e.beginComputePass(r)}return this.computePassEncoder}endComputePass(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}flush(){if(!this.commandEncoder)return;rs(),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(()=>{var s;let r=new BigUint64Array(e.getMappedRange()),t=this.pendingQueries.get(e);for(let i=0;i"u"&&(this.queryTimeBase=g);let P=Number(g-this.queryTimeBase),A=Number(_-this.queryTimeBase);if(!Number.isSafeInteger(P)||!Number.isSafeInteger(A))throw new RangeError("incorrect timestamp range");if((s=this.env.webgpu.profiling)!=null&&s.ondata)this.env.webgpu.profiling.ondata({version:1,inputsMetadata:u.map(v=>({dims:v.dims,dataType:mn(v.dataType)})),outputsMetadata:h.map(v=>({dims:v.dims,dataType:mn(v.dataType)})),kernelId:o,kernelType:l,kernelName:c,programName:p,startTime:P,endTime:A});else{let v="";u.forEach((k,E)=>{v+=`input[${E}]: [${k.dims}] | ${mn(k.dataType)}, `});let y="";h.forEach((k,E)=>{y+=`output[${E}]: [${k.dims}] | ${mn(k.dataType)}, `}),console.log(`[profiling] kernel "${o}|${l}|${c}|${p}" ${v}${y}execution time: ${A-P} ns`)}Ii("GPU",`${p}::${g}::${_}`)}e.unmap(),this.pendingQueries.delete(e)}),Hr()}run(e,r,t,s,i,n){rs(e.name);let o=[];for(let y=0;yk):t;if(p.length!==a.length)throw new Error(`Output size ${p.length} must be equal to ${a.length}.`);let u=[],h=[];for(let y=0;y=n)throw new Error(`Invalid output index: ${p[y]}`);if(p[y]===-3)continue;let k=p[y]===-1,E=p[y]===-2,M=k||E?i(a[y].dataType,a[y].dims):s(p[y],a[y].dataType,a[y].dims);if(u.push(M),M.data===0)continue;let w=this.gpuDataManager.get(M.data);if(!w)throw new Error(`no GPU data for output: ${M.data}`);if(k&&this.temporaryData.push(w),E){let x=this.kernelPersistentData.get(this.currentKernelId);x||(x=[],this.kernelPersistentData.set(this.currentKernelId,x)),x.push(w)}h.push(w)}if(o.length!==r.length||h.length!==u.length){if(h.length===0)return Hr(e.name),u;throw new Error(`Program ${e.name} has zero-sized tensor(s) in inputs or outputs. This is not supported now.`)}let g;if(c){let y=0,k=[];c.forEach(x=>{let $=typeof x.data=="number"?[x.data]:x.data;if($.length===0)return;let z=x.type===10?2:4,R,Q;x.type===10?(Q=$.length>4?16:$.length>2?8:$.length*z,R=$.length>4?16:z*$.length):(Q=$.length<=2?$.length*z:16,R=16),y=Math.ceil(y/Q)*Q,k.push(y);let q=x.type===10?8:4;y+=$.length>4?Math.ceil($.length/q)*R:$.length*z});let E=16;y=Math.ceil(y/E)*E;let M=new ArrayBuffer(y);c.forEach((x,$)=>{let z=k[$],R=typeof x.data=="number"?[x.data]:x.data;if(x.type===6)new Int32Array(M,z,R.length).set(R);else if(x.type===12)new Uint32Array(M,z,R.length).set(R);else if(x.type===10)new Uint16Array(M,z,R.length).set(R);else if(x.type===1)new Float32Array(M,z,R.length).set(R);else throw new Error(`Unsupported uniform type: ${mn(x.type)}`)});let w=this.gpuDataManager.create(y,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);this.device.queue.writeBuffer(w.buffer,0,M,0,y),this.gpuDataManager.release(w.id),g={offset:0,size:y,buffer:w.buffer}}let _=this.programManager.normalizeDispatchGroupSize(l),P=_[1]===1&&_[2]===1,A=bw(e,r,P),v=this.programManager.getArtifact(A);if(v||(v=this.programManager.build(e,_),this.programManager.setArtifact(A,v),St("info",()=>`[artifact] key: ${A}, programName: ${e.name}`)),c&&v.uniformVariablesInfo){if(c.length!==v.uniformVariablesInfo.length)throw new Error(`Uniform variables count mismatch: expect ${v.uniformVariablesInfo.length}, got ${c.length} in program "${v.programInfo.name}".`);for(let y=0;y`[ProgramManager] run "${e.name}" (key=${A}) with ${_[0]}x${_[1]}x${_[2]}`),this.queryType!=="none"||this.sessionStatus==="capturing"){let y={kernelId:this.currentKernelId,programName:v.programInfo.name,inputTensorViews:r,outputTensorViews:u};this.pendingKernels.push(y),this.sessionStatus==="capturing"&&this.capturedPendingKernels.get(this.currentSessionId).push(y)}return this.programManager.run(v,o,h,_,g),Hr(e.name),u}upload(e,r){this.gpuDataManager.upload(e,r)}memcpy(e,r){this.gpuDataManager.memcpy(e,r)}async download(e,r){await this.gpuDataManager.download(e,r)}alloc(e){return this.gpuDataManager.create(e).id}free(e){return this.gpuDataManager.release(e)}createKernel(e,r,t,s){let i=ww.get(e);if(!i)throw new Error(`kernel not implemented: ${e}`);let n={kernelType:e,kernelName:s,kernelEntry:i[0],attributes:[i[1],t]};this.kernels.set(r,n)}releaseKernel(e){let r=this.kernelPersistentData.get(e);if(r){for(let t of r)this.gpuDataManager.release(t.id);this.kernelPersistentData.delete(e)}this.kernelCustomData.delete(e),this.kernels.delete(e)}computeKernel(e,r,t){let s=this.kernels.get(e);if(!s)throw new Error(`kernel not created: ${e}`);let i=s.kernelType,n=s.kernelName,o=s.kernelEntry,a=s.attributes;if(this.currentKernelId!==null)throw new Error(`kernel "[${i}] ${n}" is not allowed to be called recursively`);this.currentKernelId=e,a[0]&&(a[1]=a[0](a[1]),a[0]=void 0),St("info",()=>`[WebGPU] Start to run kernel "[${i}] ${n}"...`);let l=this.env.debug;this.temporaryData=[];try{return l&&this.device.pushErrorScope("validation"),o(r,a[1]),0}catch(c){return t.push(Promise.resolve(`[WebGPU] Kernel "[${i}] ${n}" failed. ${c}`)),1}finally{l&&t.push(this.device.popErrorScope().then(c=>c?`GPU validation error for kernel "[${i}] ${n}": ${c.message}`:null));for(let c of this.temporaryData)this.gpuDataManager.release(c.id);this.temporaryData=[],this.currentKernelId=null}}registerBuffer(e,r,t,s){let i=this.sessionExternalDataMapping.get(e);i||(i=new Map,this.sessionExternalDataMapping.set(e,i));let n=i.get(r),o=this.gpuDataManager.registerExternalBuffer(t,s,n);return i.set(r,[o,t]),o}unregisterBuffers(e){let r=this.sessionExternalDataMapping.get(e);r&&(r.forEach(t=>this.gpuDataManager.unregisterExternalBuffer(t[0])),this.sessionExternalDataMapping.delete(e))}getBuffer(e){let r=this.gpuDataManager.get(e);if(!r)throw new Error(`no GPU data for buffer: ${e}`);return r.buffer}createDownloader(e,r,t){return async()=>{let s=await jd(this,e,r);return zd(s.buffer,t)}}writeTimestamp(e){this.queryType==="inside-passes"&&this.computePassEncoder.writeTimestamp(this.querySet,e)}setQueryType(){var e;this.queryType="none",(((e=this.env.webgpu.profiling)==null?void 0:e.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(){St("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(){St("info","captureEnd"),this.flush(),this.sessionStatus="default"}replay(){St("info","replay"),this.sessionStatus="replaying";let e=this.capturedCommandList.get(this.currentSessionId),r=this.capturedPendingKernels.get(this.currentSessionId),t=e.length;this.pendingKernels=[];for(let s=0;s=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()}}}),xw,Oc,Ew,Dc,Lc,zc,Pw,Cw,sT=Ve(()=>{Is(),xw=1,Oc=()=>xw++,Ew=new Map([["float32",32],["float16",16],["int32",32],["uint32",32],["int64",64],["uint64",64],["int8",8],["uint8",8],["int4",4],["uint4",4]]),Dc=(e,r)=>{let t=Ew.get(e);if(!t)throw new Error("Unsupported data type.");return r.length>0?Math.ceil(r.reduce((s,i)=>s*i)*t/8):0},Lc=class{constructor(e){this.sessionId=e.sessionId,this.mlContext=e.context,this.mlTensor=e.tensor,this.dataType=e.dataType,this.tensorShape=e.shape}get tensor(){return this.mlTensor}get type(){return this.dataType}get shape(){return this.tensorShape}get byteLength(){return Dc(this.dataType,this.tensorShape)}destroy(){St("verbose",()=>"[WebNN] TensorWrapper.destroy"),this.mlTensor.destroy()}write(e){this.mlContext.writeTensor(this.mlTensor,e)}async read(e){return e?this.mlContext.readTensor(this.mlTensor,e):this.mlContext.readTensor(this.mlTensor)}canReuseTensor(e,r,t){return this.mlContext===e&&this.dataType===r&&this.tensorShape.length===t.length&&this.tensorShape.every((s,i)=>s===t[i])}},zc=class{constructor(e,r){this.tensorManager=e,this.wrapper=r}get tensorWrapper(){return this.wrapper}releaseTensor(){this.tensorWrapper&&(this.tensorManager.releaseTensor(this.tensorWrapper),this.wrapper=void 0)}async ensureTensor(e,r,t,s){let i=this.tensorManager.getMLContext(e);if(this.wrapper){if(this.wrapper.canReuseTensor(i,r,t))return this.wrapper.tensor;if(s){if(this.wrapper.byteLength!==Dc(r,t))throw new Error("Unable to copy data to tensor with different size.");this.activeUpload=new Uint8Array(await this.wrapper.read())}this.tensorManager.releaseTensor(this.wrapper)}let n=typeof MLTensorUsage>"u"?void 0:MLTensorUsage.READ|MLTensorUsage.WRITE;return this.wrapper=await this.tensorManager.getCachedTensor(e,r,t,n,!0,!0),s&&this.activeUpload&&(this.wrapper.write(this.activeUpload),this.activeUpload=void 0),this.wrapper.tensor}upload(e){if(this.wrapper)if(e.byteLength===this.wrapper.byteLength){this.wrapper.write(e);return}else St("verbose",()=>"Data size does not match tensor size. Releasing tensor."),this.releaseTensor();this.activeUpload?this.activeUpload.set(e):this.activeUpload=new Uint8Array(e)}async download(e){if(this.activeUpload)if(e){e instanceof ArrayBuffer?new Uint8Array(e).set(this.activeUpload):new Uint8Array(e.buffer,e.byteOffset,e.byteLength).set(this.activeUpload);return}else return this.activeUpload.buffer;if(!this.wrapper)throw new Error("Tensor has not been created.");return e?this.wrapper.read(e):this.wrapper.read()}},Pw=class{constructor(e){this.backend=e,this.tensorTrackersById=new Map,this.freeTensors=[],this.externalTensors=new Set}getMLContext(e){let r=this.backend.getMLContext(e);if(!r)throw new Error("MLContext not found for session.");return r}reserveTensorId(){let e=Oc();return this.tensorTrackersById.set(e,new zc(this)),e}releaseTensorId(e){let r=this.tensorTrackersById.get(e);r&&(this.tensorTrackersById.delete(e),r.tensorWrapper&&this.releaseTensor(r.tensorWrapper))}async ensureTensor(e,r,t,s,i){St("verbose",()=>`[WebNN] TensorManager.ensureTensor {tensorId: ${r}, dataType: ${t}, shape: ${s}, copyOld: ${i}}`);let n=this.tensorTrackersById.get(r);if(!n)throw new Error("Tensor not found.");return n.ensureTensor(e,t,s,i)}upload(e,r){let t=this.tensorTrackersById.get(e);if(!t)throw new Error("Tensor not found.");t.upload(r)}async download(e,r){St("verbose",()=>`[WebNN] TensorManager.download {tensorId: ${e}, dstBuffer: ${r==null?void 0:r.byteLength}}`);let t=this.tensorTrackersById.get(e);if(!t)throw new Error("Tensor not found.");return t.download(r)}releaseTensorsForSession(e){for(let r of this.freeTensors)r.sessionId===e&&r.destroy();this.freeTensors=this.freeTensors.filter(r=>r.sessionId!==e)}registerTensor(e,r,t,s){let i=this.getMLContext(e),n=Oc(),o=new Lc({sessionId:e,context:i,tensor:r,dataType:t,shape:s});return this.tensorTrackersById.set(n,new zc(this,o)),this.externalTensors.add(o),n}async getCachedTensor(e,r,t,s,i,n){let o=this.getMLContext(e);for(let[l,c]of this.freeTensors.entries())if(c.canReuseTensor(o,r,t)){St("verbose",()=>`[WebNN] Reusing tensor {dataType: ${r}, shape: ${t}}`);let p=this.freeTensors.splice(l,1)[0];return p.sessionId=e,p}St("verbose",()=>`[WebNN] MLContext.createTensor {dataType: ${r}, shape: ${t}}`);let a=await o.createTensor({dataType:r,shape:t,dimensions:t,usage:s,writable:i,readable:n});return new Lc({sessionId:e,context:o,tensor:a,dataType:r,shape:t})}releaseTensor(e){this.externalTensors.has(e)&&this.externalTensors.delete(e),this.freeTensors.push(e)}},Cw=(...e)=>new Pw(...e)}),Aa,Sw,$w,nT=Ve(()=>{pt(),hn(),$p(),sT(),Is(),Aa=new Map([[1,"float32"],[10,"float16"],[6,"int32"],[12,"uint32"],[7,"int64"],[13,"uint64"],[22,"int4"],[21,"uint4"],[3,"int8"],[2,"uint8"],[9,"uint8"]]),Sw=(e,r)=>{if(e===r)return!0;if(e===void 0||r===void 0)return!1;let t=Object.keys(e).sort(),s=Object.keys(r).sort();return t.length===s.length&&t.every((i,n)=>i===s[n]&&e[i]===r[i])},$w=class{constructor(e){this.tensorManager=Cw(this),this.mlContextBySessionId=new Map,this.sessionIdsByMLContext=new Map,this.mlContextCache=[],this.sessionGraphInputs=new Map,this.temporaryGraphInputs=[],this.temporarySessionTensorIds=new Map,Ld(e.logLevel,!!e.debug)}get currentSessionId(){if(this.activeSessionId===void 0)throw new Error("No active session");return this.activeSessionId}onRunStart(e){St("verbose",()=>`[WebNN] onRunStart {sessionId: ${e}}`),this.activeSessionId=e}onRunEnd(e){St("verbose",()=>`[WebNN] onRunEnd {sessionId: ${e}}`);let r=this.temporarySessionTensorIds.get(e);if(r){for(let t of r)St("verbose",()=>`[WebNN] releasing temporary tensor {tensorId: ${t}}`),this.tensorManager.releaseTensorId(t);this.temporarySessionTensorIds.delete(e),this.activeSessionId=void 0}}async createMLContext(e){if(e instanceof GPUDevice){let t=this.mlContextCache.findIndex(s=>s.gpuDevice===e);if(t!==-1)return this.mlContextCache[t].mlContext;{let s=await navigator.ml.createContext(e);return this.mlContextCache.push({gpuDevice:e,mlContext:s}),s}}else if(e===void 0){let t=this.mlContextCache.findIndex(s=>s.options===void 0&&s.gpuDevice===void 0);if(t!==-1)return this.mlContextCache[t].mlContext;{let s=await navigator.ml.createContext();return this.mlContextCache.push({mlContext:s}),s}}let r=this.mlContextCache.findIndex(t=>Sw(t.options,e));if(r!==-1)return this.mlContextCache[r].mlContext;{let t=await navigator.ml.createContext(e);return this.mlContextCache.push({options:e,mlContext:t}),t}}registerMLContext(e,r){this.mlContextBySessionId.set(e,r);let t=this.sessionIdsByMLContext.get(r);t||(t=new Set,this.sessionIdsByMLContext.set(r,t)),t.add(e),this.temporaryGraphInputs.length>0&&(this.sessionGraphInputs.set(e,this.temporaryGraphInputs),this.temporaryGraphInputs=[])}onReleaseSession(e){this.sessionGraphInputs.delete(e);let r=this.mlContextBySessionId.get(e);if(!r)return;this.tensorManager.releaseTensorsForSession(e),this.mlContextBySessionId.delete(e);let t=this.sessionIdsByMLContext.get(r);if(t.delete(e),t.size===0){this.sessionIdsByMLContext.delete(r);let s=this.mlContextCache.findIndex(i=>i.mlContext===r);s!==-1&&this.mlContextCache.splice(s,1)}}getMLContext(e){return this.mlContextBySessionId.get(e)}reserveTensorId(){return this.tensorManager.reserveTensorId()}releaseTensorId(e){St("verbose",()=>`[WebNN] releaseTensorId {tensorId: ${e}}`),this.tensorManager.releaseTensorId(e)}async ensureTensor(e,r,t,s,i){let n=Aa.get(t);if(!n)throw new Error(`Unsupported ONNX data type: ${t}`);return this.tensorManager.ensureTensor(e??this.currentSessionId,r,n,s,i)}async createTemporaryTensor(e,r,t){St("verbose",()=>`[WebNN] createTemporaryTensor {onnxDataType: ${r}, shape: ${t}}`);let s=Aa.get(r);if(!s)throw new Error(`Unsupported ONNX data type: ${r}`);let i=this.tensorManager.reserveTensorId();await this.tensorManager.ensureTensor(e,i,s,t,!1);let n=this.temporarySessionTensorIds.get(e);return n?n.push(i):this.temporarySessionTensorIds.set(e,[i]),i}uploadTensor(e,r){if(!ar().shouldTransferToMLTensor)throw new Error("Trying to upload to a MLTensor while shouldTransferToMLTensor is false");St("verbose",()=>`[WebNN] uploadTensor {tensorId: ${e}, data: ${r.byteLength}}`),this.tensorManager.upload(e,r)}async downloadTensor(e,r){return this.tensorManager.download(e,r)}createMLTensorDownloader(e,r){return async()=>{let t=await this.tensorManager.download(e);return zd(t,r)}}registerMLTensor(e,r,t,s){let i=Aa.get(t);if(!i)throw new Error(`Unsupported ONNX data type: ${t}`);let n=this.tensorManager.registerTensor(e,r,i,s);return St("verbose",()=>`[WebNN] registerMLTensor {tensor: ${r}, dataType: ${i}, dimensions: ${s}} -> {tensorId: ${n}}`),n}registerMLConstant(e,r,t,s,i,n){if(!n)throw new Error("External mounted files are not available.");let o=e;e.startsWith("./")&&(o=e.substring(2));let a=n.get(o);if(!a)throw new Error(`File with name ${o} not found in preloaded files.`);if(r+t>a.byteLength)throw new Error("Out of bounds: data offset and length exceed the external file data size.");let l=a.slice(r,r+t).buffer,c;switch(i.dataType){case"float32":c=new Float32Array(l);break;case"float16":c=typeof Float16Array<"u"&&Float16Array.from?new Float16Array(l):new Uint16Array(l);break;case"int32":c=new Int32Array(l);break;case"uint32":c=new Uint32Array(l);break;case"int64":c=new BigInt64Array(l);break;case"uint64":c=new BigUint64Array(l);break;case"int8":c=new Int8Array(l);break;case"int4":case"uint4":case"uint8":c=new Uint8Array(l);break;default:throw new Error(`Unsupported data type: ${i.dataType} in creating WebNN Constant from external data.`)}return St("verbose",()=>`[WebNN] registerMLConstant {dataType: ${i.dataType}, shape: ${i.shape}}}`),s.constant(i,c)}registerGraphInput(e){this.temporaryGraphInputs.push(e)}isGraphInput(e,r){let t=this.sessionGraphInputs.get(e);return t?t.includes(r):!1}flush(){}}}),kw={};Si(kw,{init:()=>Aw});var Fa,Iw,Aw,iT=Ve(()=>{pt(),rT(),Is(),Mt(),nT(),Fa=class Cb{constructor(r,t,s,i){this.module=r,this.dataType=t,this.data=s,this.dims=i}getFloat32Array(){if(this.dataType!==1)throw new Error("Invalid data type");let r=Te.size(this.dims);return r===0?new Float32Array:new Float32Array(this.module.HEAP8.buffer,this.data,r)}getBigInt64Array(){if(this.dataType!==7)throw new Error("Invalid data type");let r=Te.size(this.dims);return r===0?new BigInt64Array:new BigInt64Array(this.module.HEAP8.buffer,this.data,r)}getInt32Array(){if(this.dataType!==6)throw new Error("Invalid data type");let r=Te.size(this.dims);return r===0?new Int32Array:new Int32Array(this.module.HEAP8.buffer,this.data,r)}getUint16Array(){if(this.dataType!==10&&this.dataType!==4)throw new Error("Invalid data type");let r=Te.size(this.dims);return r===0?new Uint16Array:new Uint16Array(this.module.HEAP8.buffer,this.data,r)}reshape(r){if(Te.size(r)!==Te.size(this.dims))throw new Error("Invalid new shape");return new Cb(this.module,this.dataType,this.data,r)}},Iw=class{constructor(e,r,t){this.module=e,this.backend=r,this.customDataOffset=0,this.customDataSize=0,this.adapterInfo=r.adapterInfo;let s=e.PTR_SIZE,i=t/e.PTR_SIZE,n=s===4?"i32":"i64";this.opKernelContext=Number(e.getValue(s*i++,n));let o=Number(e.getValue(s*i++,n));this.outputCount=Number(e.getValue(s*i++,n)),this.customDataOffset=Number(e.getValue(s*i++,"*")),this.customDataSize=Number(e.getValue(s*i++,n));let a=[];for(let l=0;ltypeof a=="number"?this.inputs[a]:a))??this.inputs,s=(r==null?void 0:r.outputs)??[],i=(a,l,c)=>new Fa(this.module,l,this.output(a,c),c),n=(a,l)=>{let c=fn(a,l);if(!c)throw new Error(`Unsupported data type: ${a}`);let p=c>0?this.backend.gpuDataManager.create(c).id:0;return new Fa(this.module,a,p,l)};return this.backend.run(e,t,s,i,n,this.outputCount)}output(e,r){let t=this.module.stackSave();try{let s=this.module.PTR_SIZE,i=s===4?"i32":"i64",n=this.module.stackAlloc((1+r.length)*s);this.module.setValue(n,r.length,i);for(let o=0;o{let i=r.jsepInit;if(!i)throw new Error("Failed to initialize JSEP. The WebAssembly module is not built with JSEP support.");if(e==="webgpu"){let n=new Tw;await n.initialize(t,s),i("webgpu",[n,o=>n.alloc(Number(o)),o=>n.free(o),(o,a,l,c=!1)=>{if(c)St("verbose",()=>`[WebGPU] jsepCopyGpuToGpu: src=${Number(o)}, dst=${Number(a)}, size=${Number(l)}`),n.memcpy(Number(o),Number(a));else{St("verbose",()=>`[WebGPU] jsepCopyCpuToGpu: dataOffset=${Number(o)}, gpuDataId=${Number(a)}, size=${Number(l)}`);let p=r.HEAPU8.subarray(Number(o>>>0),Number(o>>>0)+Number(l));n.upload(Number(a),p)}},async(o,a,l)=>{St("verbose",()=>`[WebGPU] jsepCopyGpuToCpu: gpuDataId=${o}, dataOffset=${a}, size=${l}`),await n.download(Number(o),()=>r.HEAPU8.subarray(Number(a)>>>0,Number(a+l)>>>0))},(o,a,l)=>n.createKernel(o,Number(a),l,r.UTF8ToString(r._JsepGetNodeName(Number(a)))),o=>n.releaseKernel(o),(o,a,l,c)=>{St("verbose",()=>`[WebGPU] jsepRun: sessionHandle=${l}, kernel=${o}, contextDataOffset=${a}`);let p=new Iw(r,n,Number(a));return n.computeKernel(Number(o),p,c)},()=>n.captureBegin(),()=>n.captureEnd(),()=>n.replay()])}else{let n=new $w(t);i("webnn",[n,()=>n.reserveTensorId(),o=>n.releaseTensorId(o),async(o,a,l,c,p)=>n.ensureTensor(o,a,l,c,p),(o,a)=>{n.uploadTensor(o,a)},async(o,a)=>n.downloadTensor(o,a)])}}}),Fw,Bc,Rc,Hs,Ow,Oa,Nc,jc,Vc,Uc,Wc,Gc,Dw=Ve(()=>{dv(),cv(),pt(),hn(),kd(),Tp(),Fw=(e,r)=>{ar()._OrtInit(e,r)!==0&&At("Can't initialize onnxruntime.")},Bc=async e=>{Fw(e.wasm.numThreads,Ma(e.logLevel))},Rc=async(e,r)=>{{let t=(iT(),fa(kw)).init;if(r==="webgpu"){if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not supported in current environment");let s=e.webgpu.adapter;if(s){if(typeof s.limits!="object"||typeof s.features!="object"||typeof s.requestDevice!="function")throw new Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let i=e.webgpu.powerPreference;if(i!==void 0&&i!=="low-power"&&i!=="high-performance")throw new Error(`Invalid powerPreference setting: "${i}"`);let n=e.webgpu.forceFallbackAdapter;if(n!==void 0&&typeof n!="boolean")throw new Error(`Invalid forceFallbackAdapter setting: "${n}"`);if(s=await navigator.gpu.requestAdapter({powerPreference:i,forceFallbackAdapter:n}),!s)throw new Error('Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.')}await t("webgpu",ar(),e,s)}if(r==="webnn"){if(typeof navigator>"u"||!navigator.ml)throw new Error("WebNN is not supported in current environment");await t("webnn",ar(),e)}}},Hs=new Map,Ow=e=>{let r=ar(),t=r.stackSave();try{let s=r.PTR_SIZE,i=r.stackAlloc(2*s);r._OrtGetInputOutputCount(e,i,i+s)!==0&&At("Can't get session input/output count.");let n=s===4?"i32":"i64";return[Number(r.getValue(i,n)),Number(r.getValue(i+s,n))]}finally{r.stackRestore(t)}},Oa=e=>{let r=ar(),t=r._malloc(e.byteLength);if(t===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${e.byteLength}.`);return r.HEAPU8.set(e,t),[t,e.byteLength]},Nc=async(e,r)=>{var u,h,g;let t,s,i=ar();Array.isArray(e)?[t,s]=e:e.buffer===i.HEAPU8.buffer?[t,s]=[e.byteOffset,e.byteLength]:[t,s]=Oa(e);let n=0,o=0,a=0,l=[],c=[],p=[];try{if([o,l]=vp(r),(r==null?void 0:r.externalData)&&i.mountExternalData){let M=[];for(let w of r.externalData){let x=typeof w=="string"?w:w.path;M.push(Dd(typeof w=="string"?w:w.data).then($=>{i.mountExternalData(x,$)}))}await Promise.all(M)}for(let M of(r==null?void 0:r.executionProviders)??[])if((typeof M=="string"?M:M.name)==="webnn"){if(i.shouldTransferToMLTensor=!1,typeof M!="string"){let w=M,x=w==null?void 0:w.context,$=w==null?void 0:w.gpuDevice,z=w==null?void 0:w.deviceType,R=w==null?void 0:w.powerPreference;x?i.currentContext=x:$?i.currentContext=await i.jsepCreateMLContext($):i.currentContext=await i.jsepCreateMLContext({deviceType:z,powerPreference:R})}else i.currentContext=await i.jsepCreateMLContext();break}n=await i._OrtCreateSession(t,s,o),n===0&&At("Can't create a session."),(u=i.jsepOnCreateSession)==null||u.call(i),i.currentContext&&(i.jsepRegisterMLContext(n,i.currentContext),i.currentContext=void 0,i.shouldTransferToMLTensor=!0);let[_,P]=Ow(n),A=!!(r!=null&&r.enableGraphCapture),v=[],y=[],k=[];for(let M=0;M<_;M++){let w=i._OrtGetInputName(n,M);w===0&&At("Can't get an input name."),c.push(w),v.push(i.UTF8ToString(w))}for(let M=0;MM==="gpu-buffer"||M==="ml-tensor")&&(a=i._OrtCreateBinding(n),a===0&&At("Can't create IO binding."),E={handle:a,outputPreferredLocations:k,outputPreferredLocationsEncoded:k.map(M=>Od(M))}),Hs.set(n,[n,c,p,E,A,!1]),[n,v,y]}catch(_){throw c.forEach(P=>i._OrtFree(P)),p.forEach(P=>i._OrtFree(P)),a!==0&&i._OrtReleaseBinding(a)!==0&&At("Can't release IO binding."),n!==0&&i._OrtReleaseSession(n)!==0&&At("Can't release session."),_}finally{i._free(t),o!==0&&i._OrtReleaseSessionOptions(o)!==0&&At("Can't release session options."),l.forEach(_=>i._free(_)),(g=i.unmountExternalData)==null||g.call(i)}},jc=e=>{var l;let r=ar(),t=Hs.get(e);if(!t)throw new Error(`cannot release session. invalid session id: ${e}`);let[s,i,n,o,a]=t;o&&(a&&r._OrtClearBoundOutputs(o.handle)!==0&&At("Can't clear bound outputs."),r._OrtReleaseBinding(o.handle)!==0&&At("Can't release IO binding.")),(l=r.jsepOnReleaseSession)==null||l.call(r,e),i.forEach(c=>r._OrtFree(c)),n.forEach(c=>r._OrtFree(c)),r._OrtReleaseSession(s)!==0&&At("Can't release session."),Hs.delete(e)},Vc=async(e,r,t,s,i,n=!1)=>{if(!e){r.push(0);return}let o=ar(),a=o.PTR_SIZE,l=e[0],c=e[1],p=e[3],u=p,h,g;if(l==="string"&&(p==="gpu-buffer"||p==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(n&&p!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${i} when enableGraphCapture is true.`);if(p==="gpu-buffer"){let A=e[2].gpuBuffer;g=fn(Rn(l),c);let v=o.jsepRegisterBuffer;if(!v)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');h=v(s,i,A,g)}else if(p==="ml-tensor"){let A=e[2].mlTensor;g=fn(Rn(l),c);let v=o.jsepRegisterMLTensor;if(!v)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');h=v(s,A,Rn(l),c)}else{let A=e[2];if(Array.isArray(A)){g=a*A.length,h=o._malloc(g),t.push(h);for(let v=0;vo.setValue(P+y*a,v,a===4?"i32":"i64"));let A=o._OrtCreateTensor(Rn(l),h,g,P,c.length,Od(u));A===0&&At(`Can't create tensor for input/output. session=${s}, index=${i}.`),r.push(A)}finally{o.stackRestore(_)}},Uc=async(e,r,t,s,i,n)=>{var Q,q,U;let o=ar(),a=o.PTR_SIZE,l=Hs.get(e);if(!l)throw new Error(`cannot run inference. invalid session id: ${e}`);let c=l[0],p=l[1],u=l[2],h=l[3],g=l[4],_=l[5],P=r.length,A=s.length,v=0,y=[],k=[],E=[],M=[],w=o.stackSave(),x=o.stackAlloc(P*a),$=o.stackAlloc(P*a),z=o.stackAlloc(A*a),R=o.stackAlloc(A*a);try{[v,y]=gp(n);for(let J=0;JMe*K,1);N=mn(se);let He=h==null?void 0:h.outputPreferredLocations[s[J]];if(N==="string"){if(He==="gpu-buffer"||He==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let Me=[];for(let K=0;K0){let Me=o.jsepGetBuffer;if(!Me)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let K=Me(O),j=fn(se,ke);if(j===void 0||!Ad(N))throw new Error(`Unsupported data type: ${N}`);he=!0,H.push([N,_e,{gpuBuffer:K,download:o.jsepCreateDownloader(K,j,N),dispose:()=>{o._OrtReleaseTensor(ie)!==0&&At("Can't release tensor.")}},"gpu-buffer"])}else if(He==="ml-tensor"&&ke>0){let Me=o.jsepEnsureTensor;if(!Me)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(fn(se,ke)===void 0||!Fd(N))throw new Error(`Unsupported data type: ${N}`);let K=await Me(e,O,se,_e,!1);he=!0,H.push([N,_e,{mlTensor:K,download:o.jsepCreateMLTensorDownloader(O,N),dispose:()=>{o.jsepReleaseTensorId(O),o._OrtReleaseTensor(ie)}},"ml-tensor"])}else{let Me=Id(N),K=new Me(ke);new Uint8Array(K.buffer,K.byteOffset,K.byteLength).set(o.HEAPU8.subarray(O,O+K.byteLength)),H.push([N,_e,K,"cpu"])}}finally{o.stackRestore(ae),N==="string"&&O&&o._free(O),he||o._OrtReleaseTensor(ie),(U=o.jsepOnRunEnd)==null||U.call(o,c)}}return h&&!g&&(o._OrtClearBoundOutputs(h.handle)!==0&&At("Can't clear bound outputs."),Hs.set(e,[c,p,u,h,g,!1])),H}finally{o.stackRestore(w),k.forEach(Z=>o._OrtReleaseTensor(Z)),E.forEach(Z=>o._OrtReleaseTensor(Z)),M.forEach(Z=>o._free(Z)),v!==0&&o._OrtReleaseRunOptions(v),y.forEach(Z=>o._free(Z))}},Wc=e=>{let r=ar(),t=Hs.get(e);if(!t)throw new Error("invalid session id");let s=t[0],i=r._OrtEndProfiling(s);i===0&&At("Can't get an profile file name."),r._OrtFree(i)},Gc=e=>{let r=[];for(let t of e){let s=t[2];!Array.isArray(s)&&"buffer"in s&&r.push(s.buffer)}return r}}),qs,Or,Un,Vi,Ui,Da,Kc,La,vn,Tn,Lw,zw,Bw,Rw,Nw,jw,Vw,Uw,Ww=Ve(()=>{ss(),Dw(),hn(),Pd(),qs=()=>!!Ut.wasm.proxy&&typeof document<"u",Un=!1,Vi=!1,Ui=!1,La=new Map,vn=(e,r)=>{let t=La.get(e);t?t.push(r):La.set(e,[r])},Tn=()=>{if(Un||!Vi||Ui||!Or)throw new Error("worker not ready")},Lw=e=>{switch(e.data.type){case"init-wasm":Un=!1,e.data.err?(Ui=!0,Kc[1](e.data.err)):(Vi=!0,Kc[0]()),Da&&(URL.revokeObjectURL(Da),Da=void 0);break;case"init-ep":case"copy-from":case"create":case"release":case"run":case"end-profiling":{let r=La.get(e.data.type);e.data.err?r.shift()[1](e.data.err):r.shift()[0](e.data.out);break}}},zw=async()=>{if(!Vi){if(Un)throw new Error("multiple calls to 'initWasm()' detected.");if(Ui)throw new Error("previous call to 'initWasm()' failed.");if(Un=!0,qs())return new Promise((e,r)=>{Or==null||Or.terminate(),hp().then(([t,s])=>{try{Or=s,Or.onerror=n=>r(n),Or.onmessage=Lw,Kc=[e,r];let i={type:"init-wasm",in:Ut};!i.in.wasm.wasmPaths&&(t||vd)&&(i.in.wasm.wasmPaths={wasm:new URL("/assets/ort-wasm-simd-threaded.jsep-BAR87mbD.wasm",self.location.href).href}),Or.postMessage(i),Da=t}catch(i){r(i)}},r)});try{await $d(Ut.wasm),await Bc(Ut),Vi=!0}catch(e){throw Ui=!0,e}finally{Un=!1}}},Bw=async e=>{if(qs())return Tn(),new Promise((r,t)=>{vn("init-ep",[r,t]);let s={type:"init-ep",in:{epName:e,env:Ut}};Or.postMessage(s)});await Rc(Ut,e)},Rw=async e=>qs()?(Tn(),new Promise((r,t)=>{vn("copy-from",[r,t]);let s={type:"copy-from",in:{buffer:e}};Or.postMessage(s,[e.buffer])})):Oa(e),Nw=async(e,r)=>{if(qs()){if(r!=null&&r.preferredOutputLocation)throw new Error('session option "preferredOutputLocation" is not supported for proxy.');return Tn(),new Promise((t,s)=>{vn("create",[t,s]);let i={type:"create",in:{model:e,options:{...r}}},n=[];e instanceof Uint8Array&&n.push(e.buffer),Or.postMessage(i,n)})}else return Nc(e,r)},jw=async e=>{if(qs())return Tn(),new Promise((r,t)=>{vn("release",[r,t]);let s={type:"release",in:e};Or.postMessage(s)});jc(e)},Vw=async(e,r,t,s,i,n)=>{if(qs()){if(t.some(o=>o[3]!=="cpu"))throw new Error("input tensor on GPU is not supported for proxy.");if(i.some(o=>o))throw new Error("pre-allocated output tensor is not supported for proxy.");return Tn(),new Promise((o,a)=>{vn("run",[o,a]);let l=t,c={type:"run",in:{sessionId:e,inputIndices:r,inputs:l,outputIndices:s,options:n}};Or.postMessage(c,Gc(l))})}else return Uc(e,r,t,s,i,n)},Uw=async e=>{if(qs())return Tn(),new Promise((r,t)=>{vn("end-profiling",[r,t]);let s={type:"end-profiling",in:e};Or.postMessage(s)});Wc(e)}}),Hc,Gw,Kw,oT=Ve(()=>{ss(),Ww(),pt(),_d(),Tp(),Hc=(e,r)=>{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 new Error(`invalid data location: ${e.location} for ${r()}`)}},Gw=e=>{switch(e[3]){case"cpu":return new ts(e[0],e[2],e[1]);case"gpu-buffer":{let r=e[0];if(!Ad(r))throw new Error(`not supported data type: ${r} for deserializing GPU tensor`);let{gpuBuffer:t,download:s,dispose:i}=e[2];return ts.fromGpuBuffer(t,{dataType:r,dims:e[1],download:s,dispose:i})}case"ml-tensor":{let r=e[0];if(!Fd(r))throw new Error(`not supported data type: ${r} for deserializing MLTensor tensor`);let{mlTensor:t,download:s,dispose:i}=e[2];return ts.fromMLTensor(t,{dataType:r,dims:e[1],download:s,dispose:i})}default:throw new Error(`invalid data location: ${e[3]}`)}},Kw=class{async fetchModelAndCopyToWasmMemory(e){return Rw(await Dd(e))}async loadModel(e,r){rs();let t;typeof e=="string"?t=await this.fetchModelAndCopyToWasmMemory(e):t=e,[this.sessionId,this.inputNames,this.outputNames]=await Nw(t,r),Hr()}async dispose(){return jw(this.sessionId)}async run(e,r,t){rs();let s=[],i=[];Object.entries(e).forEach(u=>{let h=u[0],g=u[1],_=this.inputNames.indexOf(h);if(_===-1)throw new Error(`invalid input '${h}'`);s.push(g),i.push(_)});let n=[],o=[];Object.entries(r).forEach(u=>{let h=u[0],g=u[1],_=this.outputNames.indexOf(h);if(_===-1)throw new Error(`invalid output '${h}'`);n.push(g),o.push(_)});let a=s.map((u,h)=>Hc(u,()=>`input "${this.inputNames[i[h]]}"`)),l=n.map((u,h)=>u?Hc(u,()=>`output "${this.outputNames[o[h]]}"`):null),c=await Vw(this.sessionId,i,a,o,l,t),p={};for(let u=0;uQc,initializeFlags:()=>qc,wasmBackend:()=>qw});var qc,Qc,qw,aT=Ve(()=>{ss(),Ww(),oT(),qc=()=>{if((typeof Ut.wasm.initTimeout!="number"||Ut.wasm.initTimeout<0)&&(Ut.wasm.initTimeout=0),Ut.wasm.simd===!1&&console.warn('Deprecated property "env.wasm.simd" is set to false. non-SIMD build is no longer provided, and this setting will be ignored.'),typeof Ut.wasm.proxy!="boolean"&&(Ut.wasm.proxy=!1),typeof Ut.wasm.trace!="boolean"&&(Ut.wasm.trace=!1),typeof Ut.wasm.numThreads!="number"||!Number.isInteger(Ut.wasm.numThreads)||Ut.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)Ut.wasm.numThreads=1;else{let e=typeof navigator>"u"?Kb("node:os").cpus().length:navigator.hardwareConcurrency;Ut.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Qc=class{async init(e){qc(),await zw(),await Bw(e)}async createInferenceSessionHandler(e,r){let t=new Kw;return await t.loadModel(e,r),Promise.resolve(t)}},qw=new Qc});ss(),ss(),ss();var lT="1.22.0-dev.20250306-ccf8fdd9ea",dT=rp;{let e=(aT(),fa(Hw)).wasmBackend;un("webgpu",e,5),un("webnn",e,5),un("cpu",e,10),un("wasm",e,10)}Object.defineProperty(Ut.versions,"web",{value:lT,enumerable:!0});/** +* @license +* Copyright 2021 Google LLC. All Rights Reserved. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================================= +*//** + * @license + * Copyright 2020 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + *//** + * @license + * Copyright 2019 Google LLC. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */var cT=Object.freeze({__proto__:null,get InferenceSession(){return fd},get TRACE(){return Ii},get TRACE_FUNC_BEGIN(){return rs},get TRACE_FUNC_END(){return Hr},get Tensor(){return ts},default:dT,get env(){return Ut},get registerBackend(){return un}}),Fs={},uT={"onnxruntime-common":e=>{e.exports=Vb},"onnxruntime-web":e=>{e.exports=cT},"?2ce3":()=>{},"?7a2c":()=>{},"?a42a":()=>{},"?2b25":()=>{},"?569f":()=>{},"?3f59":()=>{},"?154a":()=>{},"./node_modules/@huggingface/jinja/dist/index.js":(e,r,t)=>{t.r(r),t.d(r,{Environment:()=>Ae,Interpreter:()=>Ie,Template:()=>We,parse:()=>N,tokenize:()=>u});var s=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",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator",Macro:"Macro",EndMacro:"EndMacro"}),i=Object.freeze({set:s.Set,for:s.For,in:s.In,is:s.Is,if:s.If,else:s.Else,endif:s.EndIf,elif:s.ElseIf,endfor:s.EndFor,and:s.And,or:s.Or,not:s.Not,"not in":s.NotIn,macro:s.Macro,endmacro:s.EndMacro,true:s.BooleanLiteral,false:s.BooleanLiteral,none:s.NullLiteral,True:s.BooleanLiteral,False:s.BooleanLiteral,None:s.NullLiteral}),n=class{constructor(D,ee){this.value=D,this.type=ee}};function o(D){return/\w/.test(D)}function a(D){return/[0-9]/.test(D)}var l=[["{%",s.OpenStatement],["%}",s.CloseStatement],["{{",s.OpenExpression],["}}",s.CloseExpression],["(",s.OpenParen],[")",s.CloseParen],["{",s.OpenCurlyBracket],["}",s.CloseCurlyBracket],["[",s.OpenSquareBracket],["]",s.CloseSquareBracket],[",",s.Comma],[".",s.Dot],[":",s.Colon],["|",s.Pipe],["<=",s.ComparisonBinaryOperator],[">=",s.ComparisonBinaryOperator],["==",s.ComparisonBinaryOperator],["!=",s.ComparisonBinaryOperator],["<",s.ComparisonBinaryOperator],[">",s.ComparisonBinaryOperator],["+",s.AdditiveBinaryOperator],["-",s.AdditiveBinaryOperator],["*",s.MultiplicativeBinaryOperator],["/",s.MultiplicativeBinaryOperator],["%",s.MultiplicativeBinaryOperator],["=",s.Equals]],c=new Map([["n",` +`],["t"," "],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]);function p(D,ee={}){return D.endsWith(` +`)&&(D=D.slice(0,-1)),D=D.replace(/{#.*?#}/gs,"{##}"),ee.lstrip_blocks&&(D=D.replace(/^[ \t]*({[#%])/gm,"$1")),ee.trim_blocks&&(D=D.replace(/([#%]})\n/g,"$1")),D.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}function u(D,ee={}){var ve,Re,Fe;const B=[],te=p(D,ee);let de=0;const be=je=>{let qe="";for(;je(te[de]);){if(te[de]==="\\"){if(++de,de>=te.length)throw new SyntaxError("Unexpected end of input");const Xe=te[de++],ut=c.get(Xe);if(ut===void 0)throw new SyntaxError(`Unexpected escaped character: ${Xe}`);qe+=ut;continue}if(qe+=te[de++],de>=te.length)throw new SyntaxError("Unexpected end of input")}return qe};e:for(;de0){B.push(new n(Xe,s.Text));continue}}be(Xe=>/\s/.test(Xe));const qe=te[de];if(qe==="-"||qe==="+"){const Xe=(Re=B.at(-1))==null?void 0:Re.type;if(Xe===s.Text||Xe===void 0)throw new SyntaxError(`Unexpected character: ${qe}`);switch(Xe){case s.Identifier:case s.NumericLiteral:case s.BooleanLiteral:case s.NullLiteral:case s.StringLiteral:case s.CloseParen:case s.CloseSquareBracket:break;default:{++de;const ut=be(a);B.push(new n(`${qe}${ut}`,ut.length>0?s.NumericLiteral:s.UnaryOperator));continue}}}for(const[Xe,ut]of l)if(te.slice(de,de+Xe.length)===Xe){B.push(new n(Xe,ut)),de+=Xe.length;continue e}if(qe==="'"||qe==='"'){++de;const Xe=be(ut=>ut!==qe);B.push(new n(Xe,s.StringLiteral)),++de;continue}if(a(qe)){const Xe=be(a);B.push(new n(Xe,s.NumericLiteral));continue}if(o(qe)){const Xe=be(o),ut=Object.hasOwn(i,Xe)?i[Xe]:s.Identifier;ut===s.In&&((Fe=B.at(-1))==null?void 0:Fe.type)===s.Not?(B.pop(),B.push(new n("not in",s.NotIn))):B.push(new n(Xe,ut));continue}throw new SyntaxError(`Unexpected character: ${qe}`)}return B}var h=class{constructor(){re(this,"type","Statement")}},g=class extends h{constructor(ee){super();re(this,"type","Program");this.body=ee}},_=class extends h{constructor(ee,B,te){super();re(this,"type","If");this.test=ee,this.body=B,this.alternate=te}},P=class extends h{constructor(ee,B,te,de){super();re(this,"type","For");this.loopvar=ee,this.iterable=B,this.body=te,this.defaultBlock=de}},A=class extends h{constructor(ee,B){super();re(this,"type","Set");this.assignee=ee,this.value=B}},v=class extends h{constructor(ee,B,te){super();re(this,"type","Macro");this.name=ee,this.args=B,this.body=te}},y=class extends h{constructor(){super(...arguments);re(this,"type","Expression")}},k=class extends y{constructor(ee,B,te){super();re(this,"type","MemberExpression");this.object=ee,this.property=B,this.computed=te}},E=class extends y{constructor(ee,B){super();re(this,"type","CallExpression");this.callee=ee,this.args=B}},M=class extends y{constructor(ee){super();re(this,"type","Identifier");this.value=ee}},w=class extends y{constructor(ee){super();re(this,"type","Literal");this.value=ee}},x=class extends w{constructor(){super(...arguments);re(this,"type","NumericLiteral")}},$=class extends w{constructor(){super(...arguments);re(this,"type","StringLiteral")}},z=class extends w{constructor(){super(...arguments);re(this,"type","BooleanLiteral")}},R=class extends w{constructor(){super(...arguments);re(this,"type","NullLiteral")}},Q=class extends w{constructor(){super(...arguments);re(this,"type","ArrayLiteral")}},q=class extends w{constructor(){super(...arguments);re(this,"type","TupleLiteral")}},U=class extends w{constructor(){super(...arguments);re(this,"type","ObjectLiteral")}},Z=class extends y{constructor(ee,B,te){super();re(this,"type","BinaryExpression");this.operator=ee,this.left=B,this.right=te}},H=class extends y{constructor(ee,B){super();re(this,"type","FilterExpression");this.operand=ee,this.filter=B}},J=class extends y{constructor(ee,B){super();re(this,"type","SelectExpression");this.iterable=ee,this.test=B}},ie=class extends y{constructor(ee,B,te){super();re(this,"type","TestExpression");this.operand=ee,this.negate=B,this.test=te}},ae=class extends y{constructor(ee,B){super();re(this,"type","UnaryExpression");this.operator=ee,this.argument=B}},ce=class extends y{constructor(ee=void 0,B=void 0,te=void 0){super();re(this,"type","SliceExpression");this.start=ee,this.stop=B,this.step=te}},he=class extends y{constructor(ee,B){super();re(this,"type","KeywordArgumentExpression");this.key=ee,this.value=B}};function N(D){const ee=new g([]);let B=0;function te(Be,et){const it=D[B++];if(!it||it.type!==Be)throw new Error(`Parser Error: ${et}. ${it.type} !== ${Be}.`);return it}function de(){switch(D[B].type){case s.Text:return Re();case s.OpenStatement:return Fe();case s.OpenExpression:return je();default:throw new SyntaxError(`Unexpected token type: ${D[B].type}`)}}function be(...Be){return B+Be.length<=D.length&&Be.some((et,it)=>et!==D[B+it].type)}function ve(...Be){return B+Be.length<=D.length&&Be.every((et,it)=>et===D[B+it].type)}function Re(){return new $(te(s.Text,"Expected text token").value)}function Fe(){te(s.OpenStatement,"Expected opening statement token");let Be;switch(D[B].type){case s.Set:++B,Be=qe(),te(s.CloseStatement,"Expected closing statement token");break;case s.If:++B,Be=Xe(),te(s.OpenStatement,"Expected {% token"),te(s.EndIf,"Expected endif token"),te(s.CloseStatement,"Expected %} token");break;case s.Macro:++B,Be=ut(),te(s.OpenStatement,"Expected {% token"),te(s.EndMacro,"Expected endmacro token"),te(s.CloseStatement,"Expected %} token");break;case s.For:++B,Be=nr(),te(s.OpenStatement,"Expected {% token"),te(s.EndFor,"Expected endfor token"),te(s.CloseStatement,"Expected %} token");break;default:throw new SyntaxError(`Unknown statement type: ${D[B].type}`)}return Be}function je(){te(s.OpenExpression,"Expected opening expression token");const Be=jt();return te(s.CloseExpression,"Expected closing expression token"),Be}function qe(){const Be=jt();if(ve(s.Equals)){++B;const et=qe();return new A(Be,et)}return Be}function Xe(){var rr,zt,kr,ps,hs,Er,ms,fs;const Be=jt();te(s.CloseStatement,"Expected closing statement token");const et=[],it=[];for(;!(((rr=D[B])==null?void 0:rr.type)===s.OpenStatement&&(((zt=D[B+1])==null?void 0:zt.type)===s.ElseIf||((kr=D[B+1])==null?void 0:kr.type)===s.Else||((ps=D[B+1])==null?void 0:ps.type)===s.EndIf));)et.push(de());if(((hs=D[B])==null?void 0:hs.type)===s.OpenStatement&&((Er=D[B+1])==null?void 0:Er.type)!==s.EndIf)if(++B,ve(s.ElseIf))te(s.ElseIf,"Expected elseif token"),it.push(Xe());else for(te(s.Else,"Expected else token"),te(s.CloseStatement,"Expected closing statement token");!(((ms=D[B])==null?void 0:ms.type)===s.OpenStatement&&((fs=D[B+1])==null?void 0:fs.type)===s.EndIf);)it.push(de());return new _(Be,et,it)}function ut(){const Be=mr();if(Be.type!=="Identifier")throw new SyntaxError("Expected identifier following macro statement");const et=qr();te(s.CloseStatement,"Expected closing statement token");const it=[];for(;be(s.OpenStatement,s.EndMacro);)it.push(de());return new v(Be,et,it)}function wt(Be=!1){const et=Be?mr:jt,it=[et()],rr=ve(s.Comma);for(;rr&&(++B,it.push(et()),!!ve(s.Comma)););return rr?new q(it):it[0]}function nr(){const Be=wt(!0);if(!(Be instanceof M||Be instanceof q))throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${Be.type} instead`);te(s.In,"Expected `in` keyword following loop variable");const et=jt();te(s.CloseStatement,"Expected closing statement token");const it=[];for(;be(s.OpenStatement,s.EndFor)&&be(s.OpenStatement,s.Else);)it.push(de());const rr=[];if(ve(s.OpenStatement,s.Else))for(++B,++B,te(s.CloseStatement,"Expected closing statement token");be(s.OpenStatement,s.EndFor);)rr.push(de());return new P(Be,et,it,rr)}function jt(){return dr()}function dr(){const Be=ds();if(ve(s.If)){++B;const et=ds();if(ve(s.Else)){++B;const it=ds();return new _(et,[Be],[it])}else return new J(Be,et)}return Be}function ds(){let Be=Os();for(;ve(s.Or);){const et=D[B];++B;const it=Os();Be=new Z(et,Be,it)}return Be}function Os(){let Be=Dr();for(;ve(s.And);){const et=D[B];++B;const it=Dr();Be=new Z(et,Be,it)}return Be}function Dr(){let Be;for(;ve(s.Not);){const et=D[B];++B;const it=Dr();Be=new ae(et,it)}return Be??cs()}function cs(){let Be=Ds();for(;ve(s.ComparisonBinaryOperator)||ve(s.In)||ve(s.NotIn);){const et=D[B];++B;const it=Ds();Be=new Z(et,Be,it)}return Be}function Ds(){let Be=xs();for(;ve(s.AdditiveBinaryOperator);){const et=D[B];++B;const it=xs();Be=new Z(et,Be,it)}return Be}function jr(){const Be=Ts(mr());return ve(s.OpenParen)?dt(Be):Be}function dt(Be){let et=new E(Be,qr());return et=Ts(et),ve(s.OpenParen)&&(et=dt(et)),et}function qr(){te(s.OpenParen,"Expected opening parenthesis for arguments list");const Be=Vr();return te(s.CloseParen,"Expected closing parenthesis for arguments list"),Be}function Vr(){const Be=[];for(;!ve(s.CloseParen);){let et=jt();if(ve(s.Equals)){if(++B,!(et instanceof M))throw new SyntaxError("Expected identifier for keyword argument");const it=jt();et=new he(et,it)}Be.push(et),ve(s.Comma)&&++B}return Be}function us(){const Be=[];let et=!1;for(;!ve(s.CloseSquareBracket);)ve(s.Colon)?(Be.push(void 0),++B,et=!0):(Be.push(jt()),ve(s.Colon)&&(++B,et=!0));if(Be.length===0)throw new SyntaxError("Expected at least one argument for member/slice expression");if(et){if(Be.length>3)throw new SyntaxError("Expected 0-3 arguments for slice expression");return new ce(...Be)}return Be[0]}function Ts(Be){for(;ve(s.Dot)||ve(s.OpenSquareBracket);){const et=D[B];++B;let it;const rr=et.type!==s.Dot;if(rr)it=us(),te(s.CloseSquareBracket,"Expected closing square bracket");else if(it=mr(),it.type!=="Identifier")throw new SyntaxError("Expected identifier following dot operator");Be=new k(Be,it,rr)}return Be}function xs(){let Be=Es();for(;ve(s.MultiplicativeBinaryOperator);){const et=D[B];++B;const it=Es();Be=new Z(et,Be,it)}return Be}function Es(){let Be=Ls();for(;ve(s.Is);){++B;const et=ve(s.Not);et&&++B;let it=mr();if(it instanceof z?it=new M(it.value.toString()):it instanceof R&&(it=new M("none")),!(it instanceof M))throw new SyntaxError("Expected identifier for the test");Be=new ie(Be,et,it)}return Be}function Ls(){let Be=jr();for(;ve(s.Pipe);){++B;let et=mr();if(!(et instanceof M))throw new SyntaxError("Expected identifier for the filter");ve(s.OpenParen)&&(et=dt(et)),Be=new H(Be,et)}return Be}function mr(){const Be=D[B];switch(Be.type){case s.NumericLiteral:return++B,new x(Number(Be.value));case s.StringLiteral:return++B,new $(Be.value);case s.BooleanLiteral:return++B,new z(Be.value.toLowerCase()==="true");case s.NullLiteral:return++B,new R(null);case s.Identifier:return++B,new M(Be.value);case s.OpenParen:{++B;const et=wt();if(D[B].type!==s.CloseParen)throw new SyntaxError(`Expected closing parenthesis, got ${D[B].type} instead`);return++B,et}case s.OpenSquareBracket:{++B;const et=[];for(;!ve(s.CloseSquareBracket);)et.push(jt()),ve(s.Comma)&&++B;return++B,new Q(et)}case s.OpenCurlyBracket:{++B;const et=new Map;for(;!ve(s.CloseCurlyBracket);){const it=jt();te(s.Colon,"Expected colon between key and value in object literal");const rr=jt();et.set(it,rr),ve(s.Comma)&&++B}return++B,new U(et)}default:throw new SyntaxError(`Unexpected token: ${Be.type}`)}}for(;B=0?(ee=(ee??(ee=0))<0?Math.max(D.length+ee,0):Math.min(ee,D.length),B=(B??(B=D.length))<0?Math.max(D.length+B,0):Math.min(B,D.length)):(ee=(ee??(ee=D.length-1))<0?Math.max(D.length+ee,-1):Math.min(ee,D.length-1),B=(B??(B=-1))<-1?Math.max(D.length+B,-1):Math.min(B,D.length-1));const be=[];for(let ve=ee;de*veee.toUpperCase())}var X=class{constructor(D=void 0){re(this,"type","RuntimeValue");re(this,"value");re(this,"builtins",new Map);this.value=D}__bool__(){return new ke(!!this.value)}},we=class extends X{constructor(){super(...arguments);re(this,"type","NumericValue")}},_e=class extends X{constructor(){super(...arguments);re(this,"type","StringValue");re(this,"builtins",new Map([["upper",new me(()=>new _e(this.value.toUpperCase()))],["lower",new me(()=>new _e(this.value.toLowerCase()))],["strip",new me(()=>new _e(this.value.trim()))],["title",new me(()=>new _e(se(this.value)))],["length",new we(this.value.length)],["rstrip",new me(()=>new _e(this.value.trimEnd()))],["lstrip",new me(()=>new _e(this.value.trimStart()))],["split",new me(ee=>{const B=ee[0]??new Pe;if(!(B instanceof _e||B instanceof Pe))throw new Error("sep argument must be a string or null");const te=ee[1]??new we(-1);if(!(te instanceof we))throw new Error("maxsplit argument must be a number");let de=[];if(B instanceof Pe){const be=this.value.trimStart();for(const{0:ve,index:Re}of be.matchAll(/\S+/g)){if(te.value!==-1&&de.length>=te.value&&Re!==void 0){de.push(ve+be.slice(Re+ve.length));break}de.push(ve)}}else{if(B.value==="")throw new Error("empty separator");de=this.value.split(B.value),te.value!==-1&&de.length>te.value&&de.push(de.splice(te.value).join(B.value))}return new K(de.map(be=>new _e(be)))})]]))}},ke=class extends X{constructor(){super(...arguments);re(this,"type","BooleanValue")}},He=class extends X{constructor(){super(...arguments);re(this,"type","ObjectValue");re(this,"builtins",new Map([["get",new me(([ee,B])=>{if(!(ee instanceof _e))throw new Error(`Object key must be a string: got ${ee.type}`);return this.value.get(ee.value)??B??new Pe})],["items",new me(()=>new K(Array.from(this.value.entries()).map(([ee,B])=>new K([new _e(ee),B]))))]]))}__bool__(){return new ke(this.value.size>0)}},Me=class extends He{constructor(){super(...arguments);re(this,"type","KeywordArgumentsValue")}},K=class extends X{constructor(){super(...arguments);re(this,"type","ArrayValue");re(this,"builtins",new Map([["length",new we(this.value.length)]]))}__bool__(){return new ke(this.value.length>0)}},j=class extends K{constructor(){super(...arguments);re(this,"type","TupleValue")}},me=class extends X{constructor(){super(...arguments);re(this,"type","FunctionValue")}},Pe=class extends X{constructor(){super(...arguments);re(this,"type","NullValue")}},xe=class extends X{constructor(){super(...arguments);re(this,"type","UndefinedValue")}},Ae=class{constructor(D){re(this,"variables",new Map([["namespace",new me(D=>{if(D.length===0)return new He(new Map);if(D.length!==1||!(D[0]instanceof He))throw new Error("`namespace` expects either zero arguments or a single object argument");return D[0]})]]));re(this,"tests",new Map([["boolean",D=>D.type==="BooleanValue"],["callable",D=>D instanceof me],["odd",D=>{if(D.type!=="NumericValue")throw new Error(`Cannot apply test "odd" to type: ${D.type}`);return D.value%2!==0}],["even",D=>{if(D.type!=="NumericValue")throw new Error(`Cannot apply test "even" to type: ${D.type}`);return D.value%2===0}],["false",D=>D.type==="BooleanValue"&&!D.value],["true",D=>D.type==="BooleanValue"&&D.value],["none",D=>D.type==="NullValue"],["string",D=>D.type==="StringValue"],["number",D=>D.type==="NumericValue"],["integer",D=>D.type==="NumericValue"&&Number.isInteger(D.value)],["iterable",D=>D.type==="ArrayValue"||D.type==="StringValue"],["mapping",D=>D.type==="ObjectValue"],["lower",D=>{const ee=D.value;return D.type==="StringValue"&&ee===ee.toLowerCase()}],["upper",D=>{const ee=D.value;return D.type==="StringValue"&&ee===ee.toUpperCase()}],["none",D=>D.type==="NullValue"],["defined",D=>D.type!=="UndefinedValue"],["undefined",D=>D.type==="UndefinedValue"],["equalto",(D,ee)=>D.value===ee.value],["eq",(D,ee)=>D.value===ee.value]]));this.parent=D}set(D,ee){return this.declareVariable(D,Le(ee))}declareVariable(D,ee){if(this.variables.has(D))throw new SyntaxError(`Variable already declared: ${D}`);return this.variables.set(D,ee),ee}setVariable(D,ee){return this.variables.set(D,ee),ee}resolve(D){if(this.variables.has(D))return this;if(this.parent)return this.parent.resolve(D);throw new Error(`Unknown variable: ${D}`)}lookupVariable(D){try{return this.resolve(D).variables.get(D)??new xe}catch{return new xe}}},Ie=class{constructor(D){re(this,"global");this.global=D??new Ae}run(D){return this.evaluate(D,this.global)}evaluateBinaryExpression(D,ee){const B=this.evaluate(D.left,ee);switch(D.operator.value){case"and":return B.__bool__().value?this.evaluate(D.right,ee):B;case"or":return B.__bool__().value?B:this.evaluate(D.right,ee)}const te=this.evaluate(D.right,ee);switch(D.operator.value){case"==":return new ke(B.value==te.value);case"!=":return new ke(B.value!=te.value)}if(B instanceof xe||te instanceof xe)throw new Error("Cannot perform operation on undefined values");if(B instanceof Pe||te instanceof Pe)throw new Error("Cannot perform operation on null values");if(B instanceof we&&te instanceof we)switch(D.operator.value){case"+":return new we(B.value+te.value);case"-":return new we(B.value-te.value);case"*":return new we(B.value*te.value);case"/":return new we(B.value/te.value);case"%":return new we(B.value%te.value);case"<":return new ke(B.value":return new ke(B.value>te.value);case">=":return new ke(B.value>=te.value);case"<=":return new ke(B.value<=te.value)}else if(B instanceof K&&te instanceof K)switch(D.operator.value){case"+":return new K(B.value.concat(te.value))}else if(te instanceof K){const de=te.value.find(be=>be.value===B.value)!==void 0;switch(D.operator.value){case"in":return new ke(de);case"not in":return new ke(!de)}}if(B instanceof _e||te instanceof _e)switch(D.operator.value){case"+":return new _e(B.value.toString()+te.value.toString())}if(B instanceof _e&&te instanceof _e)switch(D.operator.value){case"in":return new ke(te.value.includes(B.value));case"not in":return new ke(!te.value.includes(B.value))}if(B instanceof _e&&te instanceof He)switch(D.operator.value){case"in":return new ke(te.value.has(B.value));case"not in":return new ke(!te.value.has(B.value))}throw new SyntaxError(`Unknown operator "${D.operator.value}" between ${B.type} and ${te.type}`)}evaluateArguments(D,ee){const B=[],te=new Map;for(const de of D)if(de.type==="KeywordArgumentExpression"){const be=de;te.set(be.key.value,this.evaluate(be.value,ee))}else{if(te.size>0)throw new Error("Positional arguments must come before keyword arguments");B.push(this.evaluate(de,ee))}return[B,te]}evaluateFilterExpression(D,ee){const B=this.evaluate(D.operand,ee);if(D.filter.type==="Identifier"){const te=D.filter;if(te.value==="tojson")return new _e(Ne(B));if(B instanceof K)switch(te.value){case"list":return B;case"first":return B.value[0];case"last":return B.value[B.value.length-1];case"length":return new we(B.value.length);case"reverse":return new K(B.value.reverse());case"sort":return new K(B.value.sort((de,be)=>{if(de.type!==be.type)throw new Error(`Cannot compare different types: ${de.type} and ${be.type}`);switch(de.type){case"NumericValue":return de.value-be.value;case"StringValue":return de.value.localeCompare(be.value);default:throw new Error(`Cannot compare type: ${de.type}`)}}));case"join":return new _e(B.value.map(de=>de.value).join(""));default:throw new Error(`Unknown ArrayValue filter: ${te.value}`)}else if(B instanceof _e)switch(te.value){case"length":return new we(B.value.length);case"upper":return new _e(B.value.toUpperCase());case"lower":return new _e(B.value.toLowerCase());case"title":return new _e(se(B.value));case"capitalize":return new _e(B.value.charAt(0).toUpperCase()+B.value.slice(1));case"trim":return new _e(B.value.trim());case"indent":return new _e(B.value.split(` +`).map((de,be)=>be===0||de.length===0?de:" "+de).join(` +`));case"join":case"string":return B;default:throw new Error(`Unknown StringValue filter: ${te.value}`)}else if(B instanceof we)switch(te.value){case"abs":return new we(Math.abs(B.value));default:throw new Error(`Unknown NumericValue filter: ${te.value}`)}else if(B instanceof He)switch(te.value){case"items":return new K(Array.from(B.value.entries()).map(([de,be])=>new K([new _e(de),be])));case"length":return new we(B.value.size);default:throw new Error(`Unknown ObjectValue filter: ${te.value}`)}throw new Error(`Cannot apply filter "${te.value}" to type: ${B.type}`)}else if(D.filter.type==="CallExpression"){const te=D.filter;if(te.callee.type!=="Identifier")throw new Error(`Unknown filter: ${te.callee.type}`);const de=te.callee.value;if(de==="tojson"){const[,be]=this.evaluateArguments(te.args,ee),ve=be.get("indent")??new Pe;if(!(ve instanceof we||ve instanceof Pe))throw new Error("If set, indent must be a number");return new _e(Ne(B,ve.value))}else if(de==="join"){let be;if(B instanceof _e)be=Array.from(B.value);else if(B instanceof K)be=B.value.map(je=>je.value);else throw new Error(`Cannot apply filter "${de}" to type: ${B.type}`);const[ve,Re]=this.evaluateArguments(te.args,ee),Fe=ve.at(0)??Re.get("separator")??new _e("");if(!(Fe instanceof _e))throw new Error("separator must be a string");return new _e(be.join(Fe.value))}if(B instanceof K){switch(de){case"selectattr":case"rejectattr":{const be=de==="selectattr";if(B.value.some(Xe=>!(Xe instanceof He)))throw new Error(`\`${de}\` can only be applied to array of objects`);if(te.args.some(Xe=>Xe.type!=="StringLiteral"))throw new Error(`arguments of \`${de}\` must be strings`);const[ve,Re,Fe]=te.args.map(Xe=>this.evaluate(Xe,ee));let je;if(Re){const Xe=ee.tests.get(Re.value);if(!Xe)throw new Error(`Unknown test: ${Re.value}`);je=Xe}else je=(...Xe)=>Xe[0].__bool__().value;const qe=B.value.filter(Xe=>{const ut=Xe.value.get(ve.value),wt=ut?je(ut,Fe):!1;return be?wt:!wt});return new K(qe)}case"map":{const[,be]=this.evaluateArguments(te.args,ee);if(be.has("attribute")){const ve=be.get("attribute");if(!(ve instanceof _e))throw new Error("attribute must be a string");const Re=be.get("default"),Fe=B.value.map(je=>{if(!(je instanceof He))throw new Error("items in map must be an object");return je.value.get(ve.value)??Re??new xe});return new K(Fe)}else throw new Error("`map` expressions without `attribute` set are not currently supported.")}}throw new Error(`Unknown ArrayValue filter: ${de}`)}else if(B instanceof _e){switch(de){case"indent":{const[be,ve]=this.evaluateArguments(te.args,ee),Re=be.at(0)??ve.get("width")??new we(4);if(!(Re instanceof we))throw new Error("width must be a number");const Fe=be.at(1)??ve.get("first")??new ke(!1),je=be.at(2)??ve.get("blank")??new ke(!1),qe=B.value.split(` +`),Xe=" ".repeat(Re.value),ut=qe.map((wt,nr)=>!Fe.value&&nr===0||!je.value&&wt.length===0?wt:Xe+wt);return new _e(ut.join(` +`))}}throw new Error(`Unknown StringValue filter: ${de}`)}else throw new Error(`Cannot apply filter "${de}" to type: ${B.type}`)}throw new Error(`Unknown filter: ${D.filter.type}`)}evaluateTestExpression(D,ee){const B=this.evaluate(D.operand,ee),te=ee.tests.get(D.test.value);if(!te)throw new Error(`Unknown test: ${D.test.value}`);const de=te(B);return new ke(D.negate?!de:de)}evaluateUnaryExpression(D,ee){const B=this.evaluate(D.argument,ee);switch(D.operator.value){case"not":return new ke(!B.value);default:throw new SyntaxError(`Unknown operator: ${D.operator.value}`)}}evalProgram(D,ee){return this.evaluateBlock(D.body,ee)}evaluateBlock(D,ee){let B="";for(const te of D){const de=this.evaluate(te,ee);de.type!=="NullValue"&&de.type!=="UndefinedValue"&&(B+=de.value)}return new _e(B)}evaluateIdentifier(D,ee){return ee.lookupVariable(D.value)}evaluateCallExpression(D,ee){const[B,te]=this.evaluateArguments(D.args,ee);te.size>0&&B.push(new Me(te));const de=this.evaluate(D.callee,ee);if(de.type!=="FunctionValue")throw new Error(`Cannot call something that is not a function: got ${de.type}`);return de.value(B,ee)}evaluateSliceExpression(D,ee,B){if(!(D instanceof K||D instanceof _e))throw new Error("Slice object must be an array or string");const te=this.evaluate(ee.start,B),de=this.evaluate(ee.stop,B),be=this.evaluate(ee.step,B);if(!(te instanceof we||te instanceof xe))throw new Error("Slice start must be numeric or undefined");if(!(de instanceof we||de instanceof xe))throw new Error("Slice stop must be numeric or undefined");if(!(be instanceof we||be instanceof xe))throw new Error("Slice step must be numeric or undefined");return D instanceof K?new K(G(D.value,te.value,de.value,be.value)):new _e(G(Array.from(D.value),te.value,de.value,be.value).join(""))}evaluateMemberExpression(D,ee){const B=this.evaluate(D.object,ee);let te;if(D.computed){if(D.property.type==="SliceExpression")return this.evaluateSliceExpression(B,D.property,ee);te=this.evaluate(D.property,ee)}else te=new _e(D.property.value);let de;if(B instanceof He){if(!(te instanceof _e))throw new Error(`Cannot access property with non-string: got ${te.type}`);de=B.value.get(te.value)??B.builtins.get(te.value)}else if(B instanceof K||B instanceof _e)if(te instanceof we)de=B.value.at(te.value),B instanceof _e&&(de=new _e(B.value.at(te.value)));else if(te instanceof _e)de=B.builtins.get(te.value);else throw new Error(`Cannot access property with non-string/non-number: got ${te.type}`);else{if(!(te instanceof _e))throw new Error(`Cannot access property with non-string: got ${te.type}`);de=B.builtins.get(te.value)}return de instanceof X?de:new xe}evaluateSet(D,ee){const B=this.evaluate(D.value,ee);if(D.assignee.type==="Identifier"){const te=D.assignee.value;ee.setVariable(te,B)}else if(D.assignee.type==="MemberExpression"){const te=D.assignee,de=this.evaluate(te.object,ee);if(!(de instanceof He))throw new Error("Cannot assign to member of non-object");if(te.property.type!=="Identifier")throw new Error("Cannot assign to member with non-identifier property");de.value.set(te.property.value,B)}else throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(D.assignee)}`);return new Pe}evaluateIf(D,ee){const B=this.evaluate(D.test,ee);return this.evaluateBlock(B.__bool__().value?D.body:D.alternate,ee)}evaluateFor(D,ee){const B=new Ae(ee);let te,de;if(D.iterable.type==="SelectExpression"){const je=D.iterable;de=this.evaluate(je.iterable,B),te=je.test}else de=this.evaluate(D.iterable,B);if(!(de instanceof K))throw new Error(`Expected iterable type in for loop: got ${de.type}`);const be=[],ve=[];for(let je=0;jewt.setVariable(D.loopvar.value,Xe);else if(D.loopvar.type==="TupleLiteral"){const wt=D.loopvar;if(Xe.type!=="ArrayValue")throw new Error(`Cannot unpack non-iterable type: ${Xe.type}`);const nr=Xe;if(wt.value.length!==nr.value.length)throw new Error(`Too ${wt.value.length>nr.value.length?"few":"many"} items to unpack`);ut=jt=>{for(let dr=0;dr0?be[je-1]:new xe],["nextitem",je{var ve;const de=new Ae(te);B=B.slice();let be;((ve=B.at(-1))==null?void 0:ve.type)==="KeywordArgumentsValue"&&(be=B.pop());for(let Re=0;Rethis.evaluate(B,ee)));case"TupleLiteral":return new j(D.value.map(B=>this.evaluate(B,ee)));case"ObjectLiteral":{const B=new Map;for(const[te,de]of D.value){const be=this.evaluate(te,ee);if(!(be instanceof _e))throw new Error(`Object keys must be strings: got ${be.type}`);B.set(be.value,this.evaluate(de,ee))}return new He(B)}case"Identifier":return this.evaluateIdentifier(D,ee);case"CallExpression":return this.evaluateCallExpression(D,ee);case"MemberExpression":return this.evaluateMemberExpression(D,ee);case"UnaryExpression":return this.evaluateUnaryExpression(D,ee);case"BinaryExpression":return this.evaluateBinaryExpression(D,ee);case"FilterExpression":return this.evaluateFilterExpression(D,ee);case"TestExpression":return this.evaluateTestExpression(D,ee);default:throw new SyntaxError(`Unknown node type: ${D.type}`)}}};function Le(D){switch(typeof D){case"number":return new we(D);case"string":return new _e(D);case"boolean":return new ke(D);case"undefined":return new xe;case"object":return D===null?new Pe:Array.isArray(D)?new K(D.map(Le)):new He(new Map(Object.entries(D).map(([ee,B])=>[ee,Le(B)])));case"function":return new me((ee,B)=>{const te=D(...ee.map(de=>de.value))??null;return Le(te)});default:throw new Error(`Cannot convert to runtime value: ${D}`)}}function Ne(D,ee,B){const te=B??0;switch(D.type){case"NullValue":case"UndefinedValue":return"null";case"NumericValue":case"StringValue":case"BooleanValue":return JSON.stringify(D.value);case"ArrayValue":case"ObjectValue":{const de=ee?" ".repeat(ee):"",be=` +`+de.repeat(te),ve=be+de;if(D.type==="ArrayValue"){const Re=D.value.map(Fe=>Ne(Fe,ee,te+1));return ee?`[${ve}${Re.join(`,${ve}`)}${be}]`:`[${Re.join(", ")}]`}else{const Re=Array.from(D.value.entries()).map(([Fe,je])=>{const qe=`"${Fe}": ${Ne(je,ee,te+1)}`;return ee?`${ve}${qe}`:qe});return ee?`{${Re.join(",")}${be}}`:`{${Re.join(", ")}}`}}default:throw new Error(`Cannot convert to JSON: ${D.type}`)}}var We=class{constructor(D){re(this,"parsed");const ee=u(D,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=N(ee)}render(D){const ee=new Ae;if(ee.set("false",!1),ee.set("true",!0),ee.set("raise_exception",de=>{throw new Error(de)}),ee.set("range",O),D)for(const[de,be]of Object.entries(D))ee.set(de,be);return new Ie(ee).run(this.parsed).value}}},"./src/backends/onnx.js":(e,r,t)=>{var s;t.r(r),t.d(r,{Tensor:()=>a.Tensor,createInferenceSession:()=>A,deviceToExecutionProviders:()=>_,isONNXProxy:()=>k,isONNXTensor:()=>v});var i=t("./src/env.js"),n=t("?2ce3"),o=t("onnxruntime-web"),a=t("onnxruntime-common");const l=Object.freeze({auto:null,gpu:null,cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:{name:"webnn",deviceType:"cpu"},"webnn-npu":{name:"webnn",deviceType:"npu"},"webnn-gpu":{name:"webnn",deviceType:"gpu"},"webnn-cpu":{name:"webnn",deviceType:"cpu"}}),c=[];let p,u;const h=Symbol.for("onnxruntime");if(h in globalThis)u=globalThis[h];else if(i.apis.IS_NODE_ENV){switch(u=n??(s||(s=t.t(n,2))),process.platform){case"win32":c.push("dml");break;case"linux":process.arch==="x64"&&c.push("cuda");break}c.push("cpu"),p=["cpu"]}else u=o,i.apis.IS_WEBNN_AVAILABLE&&c.push("webnn-npu","webnn-gpu","webnn-cpu","webnn"),i.apis.IS_WEBGPU_AVAILABLE&&c.push("webgpu"),c.push("wasm"),p=["wasm"];const g=u.InferenceSession;function _(E=null){if(!E)return p;switch(E){case"auto":return c;case"gpu":return c.filter(M=>["webgpu","cuda","dml","webnn-gpu"].includes(M))}if(c.includes(E))return[l[E]??E];throw new Error(`Unsupported device: "${E}". Should be one of: ${c.join(", ")}.`)}let P=null;async function A(E,M,w){P&&await P;const x=g.create(E,M);P??(P=x);const $=await x;return $.config=w,$}function v(E){return E instanceof u.Tensor}const y=u==null?void 0:u.env;y!=null&&y.wasm&&(!(typeof ServiceWorkerGlobalScope<"u"&&self instanceof ServiceWorkerGlobalScope)&&!y.wasm.wasmPaths&&(y.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${i.env.version}/dist/`),y.wasm.proxy=!1),y!=null&&y.webgpu&&(y.webgpu.powerPreference="high-performance");function k(){var E;return(E=y==null?void 0:y.wasm)==null?void 0:E.proxy}i.env.backends.onnx=y},"./src/base/feature_extraction_utils.js":(e,r,t)=>{t.r(r),t.d(r,{FeatureExtractor:()=>o,validate_audio_inputs:()=>a});var s=t("./src/utils/constants.js"),i=t("./src/utils/generic.js"),n=t("./src/utils/hub.js");class o extends i.Callable{constructor(c){super(),this.config=c}static async from_pretrained(c,p){const u=await(0,n.getModelJSON)(c,s.FEATURE_EXTRACTOR_NAME,!0,p);return new this(u)}}function a(l,c){var p;if(!(l instanceof Float32Array||l instanceof Float64Array))throw new Error(`${c} expects input to be a Float32Array or a Float64Array, but got ${((p=l==null?void 0:l.constructor)==null?void 0:p.name)??typeof l} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}},"./src/base/image_processors_utils.js":(e,r,t)=>{t.r(r),t.d(r,{ImageProcessor:()=>E,center_to_corners_format:()=>u,post_process_instance_segmentation:()=>k,post_process_object_detection:()=>h,post_process_panoptic_segmentation:()=>y,post_process_semantic_segmentation:()=>g});var s=t("./src/utils/generic.js"),i=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");t("./src/utils/image.js");var o=t("./src/utils/core.js"),a=t("./src/utils/hub.js"),l=t("./src/utils/constants.js");function c(M,w,x=0,$=null){const z=M/w;let R=(0,n.bankers_round)(z)*w;return $!==null&&R>$&&(R=Math.floor(z)*w),Rw&&O.push(se)}else{let se=(0,n.max)(N.data)[1];if(se===U-1||(G=(0,n.softmax)(N.data),G[se]we*J[(_e+1)%2])),ie.boxes.push(X),ie.classes.push(se),ie.scores.push(G[se])}}Z.push(ie)}return Z}function g(M,w=null){const x=M.logits,$=x.dims[0];if(w!==null&&w.length!==$)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const z=[];for(let R=0;R<$;++R){const Q=w!==null?w[R]:null;let q=x[R];Q!==null&&(q=(0,i.interpolate)(q,Q,"bilinear",!1));const[U,Z]=Q??q.dims.slice(-2),H=new i.Tensor("int32",new Int32Array(U*Z),[U,Z]),J=q[0].data,ie=H.data;for(let he=1;heJ[O]&&(J[O]=N[O],ie[O]=he)}const ae=new Array(q.dims[0]);for(let he=0;hehe!==void 0);z.push({segmentation:H,labels:ce})}return z}function _(M,w,x,$){const z=[],R=[],Q=[];for(let q=0;qx&&(z.push(Z),R.push(ie),Q.push(H))}return[z,R,Q]}function P(M,w,x,$=.5,z=.8){const R=[];let Q=0,q=0;const U=w[x].data;for(let H=0;H=$&&++q;let Z=Q>0&&q>0;return Z&&(Z=Q/q>z),[Z,R]}function A(M,w,x,$,z,R=null,Q=null){const[q,U]=Q??M[0].dims,Z=new i.Tensor("int32",new Int32Array(q*U),[q,U]),H=[];if(Q!==null)for(let he=0;heie[G]&&(J[G]=he,ie[G]=O[G])}let ae=0;const ce=Z.data;for(let he=0;he200)throw new Error(`absolute aspect ratio must be smaller than 200, got ${Math.max(M,w)/Math.min(M,w)}`);let R=Math.round(M/x)*x,Q=Math.round(w/x)*x;if(R*Q>z){const q=Math.sqrt(M*w/z);R=Math.floor(M/q/x)*x,Q=Math.floor(w/q/x)*x}else if(R*Q<$){const q=Math.sqrt($/(M*w));R=Math.ceil(M*q/x)*x,Q=Math.ceil(w*q/x)*x}return[R,Q]}function y(M,w=.5,x=.5,$=.8,z=null,R=null){z===null&&(console.warn("`label_ids_to_fuse` unset. No instance will be fused."),z=new Set);const Q=M.class_queries_logits??M.logits,U=(M.masks_queries_logits??M.pred_masks).sigmoid();let[Z,H,J]=Q.dims;if(J-=1,R!==null&&R.length!==Z)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");let ie=[];for(let ae=0;aeR?Z=Math.floor(R*U/z):R>z&&(U=Math.floor(z*Z/R)),await w.resize(Z,U,{resample:$}))}async crop_margin(w,x=200){const $=w.clone().grayscale(),z=(0,n.min)($.data)[0],Q=(0,n.max)($.data)[0]-z;if(Q===0)return w;const q=x/255;let U=$.width,Z=$.height,H=0,J=0;const ie=$.data;for(let ae=0;ae<$.height;++ae){const ce=ae*$.width;for(let he=0;he<$.width;++he)(ie[ce+he]-z)/Qthis.preprocess(R)));return{pixel_values:(0,i.stack)($.map(R=>R.pixel_values),0),original_sizes:$.map(R=>R.original_size),reshaped_input_sizes:$.map(R=>R.reshaped_input_size)}}static async from_pretrained(w,x){const $=await(0,a.getModelJSON)(w,l.IMAGE_PROCESSOR_NAME,!0,x);return new this($)}}},"./src/base/processing_utils.js":(e,r,t)=>{t.r(r),t.d(r,{Processor:()=>o});var s=t("./src/utils/constants.js"),i=t("./src/utils/generic.js"),n=t("./src/utils/hub.js");class o extends i.Callable{constructor(l,c){super(),this.config=l,this.components=c}get image_processor(){return this.components.image_processor}get tokenizer(){return this.components.tokenizer}get feature_extractor(){return this.components.feature_extractor}apply_chat_template(l,c={}){if(!this.tokenizer)throw new Error("Unable to apply chat template without a tokenizer.");return this.tokenizer.apply_chat_template(l,{tokenize:!1,...c})}batch_decode(...l){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.batch_decode(...l)}decode(...l){if(!this.tokenizer)throw new Error("Unable to decode without a tokenizer.");return this.tokenizer.decode(...l)}async _call(l,...c){for(const p of[this.image_processor,this.feature_extractor,this.tokenizer])if(p)return p(l,...c);throw new Error("No image processor, feature extractor, or tokenizer found.")}static async from_pretrained(l,c){const[p,u]=await Promise.all([this.uses_processor_config?(0,n.getModelJSON)(l,s.PROCESSOR_NAME,!0,c):{},Promise.all(this.classes.filter(h=>h in this).map(async h=>{const g=await this[h].from_pretrained(l,c);return[h.replace(/_class$/,""),g]})).then(Object.fromEntries)]);return new this(p,u)}}re(o,"classes",["image_processor_class","tokenizer_class","feature_extractor_class"]),re(o,"uses_processor_config",!1)},"./src/configs.js":(e,r,t)=>{t.r(r),t.d(r,{AutoConfig:()=>c,PretrainedConfig:()=>l,getKeyValueShapes:()=>a});var s=t("./src/utils/core.js"),i=t("./src/utils/hub.js");async function n(p,u){return await(0,i.getModelJSON)(p,"config.json",!0,u)}function o(p){const u={};let h={};switch(p.model_type){case"llava":case"paligemma":case"gemma3":case"florence2":case"llava_onevision":case"idefics3":case"ultravox":case"smolvlm":h=o(p.text_config);break;case"moondream1":h=o(p.phi_config);break;case"musicgen":h=o(p.decoder);break;case"multi_modality":h=o(p.language_config);break;case"gpt2":case"gptj":case"jais":case"codegen":case"gpt_bigcode":u.num_heads="n_head",u.num_layers="n_layer",u.hidden_size="n_embd";break;case"gpt_neox":case"stablelm":case"opt":case"falcon":u.num_heads="num_attention_heads",u.num_layers="num_hidden_layers",u.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":u.num_heads="num_key_value_heads",u.num_layers="num_hidden_layers",u.hidden_size="hidden_size",u.num_attention_heads="num_attention_heads";break;case"gemma":case"gemma2":case"gemma3_text":case"glm":case"helium":u.num_heads="num_key_value_heads",u.num_layers="num_hidden_layers",u.dim_kv="head_dim";break;case"openelm":u.num_heads="num_kv_heads",u.num_layers="num_transformer_layers",u.dim_kv="head_dim";break;case"gpt_neo":case"donut-swin":u.num_heads="num_heads",u.num_layers="num_layers",u.hidden_size="hidden_size";break;case"bloom":u.num_heads="n_head",u.num_layers="n_layer",u.hidden_size="hidden_size";break;case"mpt":u.num_heads="n_heads",u.num_layers="n_layers",u.hidden_size="d_model";break;case"exaone":u.num_heads="num_key_value_heads",u.num_layers="num_layers",u.dim_kv="head_dim",u.num_attention_heads="num_attention_heads";break;case"t5":case"mt5":case"longt5":u.num_decoder_layers="num_decoder_layers",u.num_decoder_heads="num_heads",u.decoder_dim_kv="d_kv",u.num_encoder_layers="num_layers",u.num_encoder_heads="num_heads",u.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":u.num_decoder_layers="decoder_layers",u.num_decoder_heads="decoder_attention_heads",u.decoder_hidden_size="d_model",u.num_encoder_layers="encoder_layers",u.num_encoder_heads="encoder_attention_heads",u.encoder_hidden_size="d_model";break;case"speecht5":u.num_decoder_layers="decoder_layers",u.num_decoder_heads="decoder_attention_heads",u.decoder_hidden_size="hidden_size",u.num_encoder_layers="encoder_layers",u.num_encoder_heads="encoder_attention_heads",u.encoder_hidden_size="hidden_size";break;case"trocr":u.num_encoder_layers=u.num_decoder_layers="decoder_layers",u.num_encoder_heads=u.num_decoder_heads="decoder_attention_heads",u.encoder_hidden_size=u.decoder_hidden_size="d_model";break;case"musicgen_decoder":u.num_encoder_layers=u.num_decoder_layers="num_hidden_layers",u.num_encoder_heads=u.num_decoder_heads="num_attention_heads",u.encoder_hidden_size=u.decoder_hidden_size="hidden_size";break;case"moonshine":u.num_decoder_layers="decoder_num_hidden_layers",u.num_decoder_heads="decoder_num_key_value_heads",u.num_encoder_layers="encoder_num_hidden_layers",u.num_encoder_heads="encoder_num_key_value_heads",u.encoder_hidden_size=u.decoder_hidden_size="hidden_size";break;case"vision-encoder-decoder":const _=o(p.decoder),P="num_decoder_layers"in _,A=(0,s.pick)(p,["model_type","is_encoder_decoder"]);return P?(A.num_decoder_layers=_.num_decoder_layers,A.num_decoder_heads=_.num_decoder_heads,A.decoder_hidden_size=_.decoder_hidden_size,A.num_encoder_layers=_.num_encoder_layers,A.num_encoder_heads=_.num_encoder_heads,A.encoder_hidden_size=_.encoder_hidden_size):(A.num_layers=_.num_layers,A.num_heads=_.num_heads,A.hidden_size=_.hidden_size),A}const g={...h,...(0,s.pick)(p,["model_type","multi_query","is_encoder_decoder"])};for(const _ in u)g[_]=p[u[_]];return g}function a(p,{prefix:u="past_key_values",batch_size:h=1}={}){const g={},_=p.normalized_config;if(_.is_encoder_decoder&&"num_encoder_heads"in _&&"num_decoder_heads"in _){const P=_.encoder_dim_kv??_.encoder_hidden_size/_.num_encoder_heads,A=_.decoder_dim_kv??_.decoder_hidden_size/_.num_decoder_heads,v=[h,_.num_encoder_heads,0,P],y=[h,_.num_decoder_heads,0,A];for(let k=0;k<_.num_decoder_layers;++k)g[`${u}.${k}.encoder.key`]=v,g[`${u}.${k}.encoder.value`]=v,g[`${u}.${k}.decoder.key`]=y,g[`${u}.${k}.decoder.value`]=y}else{const P=_.num_heads,A=_.num_layers,v=_.dim_kv??_.hidden_size/(_.num_attention_heads??P);if(_.model_type==="falcon"){const y=[h*P,0,v];for(let k=0;k{var $,z;t.r(r),t.d(r,{apis:()=>A,env:()=>w});var s=t("?569f"),i=t("?3f59"),n=t("?154a");const o="3.4.2",a=typeof window<"u"&&typeof window.document<"u",l=typeof self<"u"&&(($=self.constructor)==null?void 0:$.name)==="DedicatedWorkerGlobalScope",c=typeof self<"u"&&"caches"in self,p=typeof navigator<"u"&&"gpu"in navigator,u=typeof navigator<"u"&&"ml"in navigator,h=typeof process<"u",g=h&&((z=process==null?void 0:process.release)==null?void 0:z.name)==="node",_=!x(s),P=!x(i),A=Object.freeze({IS_BROWSER_ENV:a,IS_WEBWORKER_ENV:l,IS_WEB_CACHE_AVAILABLE:c,IS_WEBGPU_AVAILABLE:p,IS_WEBNN_AVAILABLE:u,IS_PROCESS_AVAILABLE:h,IS_NODE_ENV:g,IS_FS_AVAILABLE:_,IS_PATH_AVAILABLE:P}),v=_&&P;let y="./";if(v){const R=Object({url:self.location.href}).url;R?y=i.dirname(i.dirname(n.fileURLToPath(R))):typeof __dirname<"u"&&(y=i.dirname(__dirname))}const k=v?i.join(y,"/.cache/"):null,E="/models/",M=v?i.join(y,E):E,w={version:o,backends:{onnx:{}},allowRemoteModels:!0,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!(a||l),localModelPath:M,useFS:_,useBrowserCache:c,useFSCache:_,cacheDir:k,useCustomCache:!1,customCache:null};function x(R){return Object.keys(R).length===0}},"./src/generation/configuration_utils.js":(e,r,t)=>{t.r(r),t.d(r,{GenerationConfig:()=>i});var s=t("./src/utils/core.js");class i{constructor(o){re(this,"max_length",20);re(this,"max_new_tokens",null);re(this,"min_length",0);re(this,"min_new_tokens",null);re(this,"early_stopping",!1);re(this,"max_time",null);re(this,"do_sample",!1);re(this,"num_beams",1);re(this,"num_beam_groups",1);re(this,"penalty_alpha",null);re(this,"use_cache",!0);re(this,"temperature",1);re(this,"top_k",50);re(this,"top_p",1);re(this,"typical_p",1);re(this,"epsilon_cutoff",0);re(this,"eta_cutoff",0);re(this,"diversity_penalty",0);re(this,"repetition_penalty",1);re(this,"encoder_repetition_penalty",1);re(this,"length_penalty",1);re(this,"no_repeat_ngram_size",0);re(this,"bad_words_ids",null);re(this,"force_words_ids",null);re(this,"renormalize_logits",!1);re(this,"constraints",null);re(this,"forced_bos_token_id",null);re(this,"forced_eos_token_id",null);re(this,"remove_invalid_values",!1);re(this,"exponential_decay_length_penalty",null);re(this,"suppress_tokens",null);re(this,"streamer",null);re(this,"begin_suppress_tokens",null);re(this,"forced_decoder_ids",null);re(this,"guidance_scale",null);re(this,"num_return_sequences",1);re(this,"output_attentions",!1);re(this,"output_hidden_states",!1);re(this,"output_scores",!1);re(this,"return_dict_in_generate",!1);re(this,"pad_token_id",null);re(this,"bos_token_id",null);re(this,"eos_token_id",null);re(this,"encoder_no_repeat_ngram_size",0);re(this,"decoder_start_token_id",null);re(this,"generation_kwargs",{});Object.assign(this,(0,s.pick)(o,Object.getOwnPropertyNames(this)))}}},"./src/generation/logits_process.js":(e,r,t)=>{t.r(r),t.d(r,{ClassifierFreeGuidanceLogitsProcessor:()=>v,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>c,LogitsProcessor:()=>n,LogitsProcessorList:()=>a,LogitsWarper:()=>o,MinLengthLogitsProcessor:()=>_,MinNewTokensLengthLogitsProcessor:()=>P,NoBadWordsLogitsProcessor:()=>A,NoRepeatNGramLogitsProcessor:()=>h,RepetitionPenaltyLogitsProcessor:()=>g,SuppressTokensAtBeginLogitsProcessor:()=>p,TemperatureLogitsWarper:()=>y,TopKLogitsWarper:()=>E,TopPLogitsWarper:()=>k,WhisperTimeStampLogitsProcessor:()=>u});var s=t("./src/utils/generic.js");t("./src/utils/tensor.js");var i=t("./src/utils/maths.js");class n extends s.Callable{_call(w,x){throw Error("`_call` should be implemented in a subclass")}}class o extends s.Callable{_call(w,x){throw Error("`_call` should be implemented in a subclass")}}class a extends s.Callable{constructor(){super(),this.processors=[]}push(w){this.processors.push(w)}extend(w){this.processors.push(...w)}_call(w,x){let $=x;for(const z of this.processors)$=z(w,$);return $}[Symbol.iterator](){return this.processors.values()}}class l extends n{constructor(w){super(),this.bos_token_id=w}_call(w,x){for(let $=0;$=1&&R[R.length-1]>=this.timestamp_begin,q=R.length<2||R[R.length-2]>=this.timestamp_begin;if(Q&&(q?z.subarray(this.timestamp_begin).fill(-1/0):z.subarray(0,this.eos_token_id).fill(-1/0)),w[$].length===this.begin_index&&this.max_initial_timestamp_index!==null){const J=this.timestamp_begin+this.max_initial_timestamp_index;z.subarray(J+1).fill(-1/0)}const U=(0,i.log_softmax)(z),Z=Math.log(U.subarray(this.timestamp_begin).map(Math.exp).reduce((J,ie)=>J+ie)),H=(0,i.max)(U.subarray(0,this.timestamp_begin))[0];Z>H&&z.subarray(0,this.timestamp_begin).fill(-1/0)}return x}}class h extends n{constructor(w){super(),this.no_repeat_ngram_size=w}getNgrams(w){const x=w.length,$=[];for(let R=0;R1 to use the classifier free guidance processor, got guidance scale ${w}.`);this.guidance_scale=w}_call(w,x){if(x.dims[0]!==2*w.length)throw new Error(`Logits should have twice the batch size of the input ids, the first half of batches corresponding to the conditional inputs, and the second half of batches corresponding to the unconditional inputs. Got batch size ${x.dims[0]} for the logits and ${w.length} for the input ids.`);const $=w.length,z=x.slice([0,$],null),R=x.slice([$,x.dims[0]],null);for(let Q=0;Q1)throw new Error(`\`top_p\` must be a float > 0 and < 1, but is ${w}`);if(!Number.isInteger($)||$<1)throw new Error(`\`min_tokens_to_keep\` must be a positive integer, but is ${$}`);this.top_p=w,this.filter_value=x,this.min_tokens_to_keep=$}}class E extends o{constructor(w,{filter_value:x=-1/0,min_tokens_to_keep:$=1}={}){if(super(),!Number.isInteger(w)||w<0)throw new Error(`\`top_k\` must be a positive integer, but is ${w}`);this.top_k=Math.max(w,$),this.filter_value=x}}},"./src/generation/logits_sampler.js":(e,r,t)=>{t.r(r),t.d(r,{LogitsSampler:()=>o});var s=t("./src/utils/generic.js"),i=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");t("./src/generation/configuration_utils.js");class o extends s.Callable{constructor(u){super(),this.generation_config=u}async _call(u){return this.sample(u)}async sample(u){throw Error("sample should be implemented in subclasses.")}getLogits(u,h){let g=u.dims.at(-1),_=u.data;if(h===-1)_=_.slice(-g);else{let P=h*g;_=_.slice(P,P+g)}return _}randomSelect(u){let h=0;for(let _=0;_1)return new c(u);if(u.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${u.num_return_sequences}.`);return new a(u)}}class a extends o{async sample(u){const h=(0,n.max)(u.data)[1];return[[BigInt(h),0]]}}class l extends o{async sample(u){let h=u.dims.at(-1);this.generation_config.top_k>0&&(h=Math.min(this.generation_config.top_k,h));const[g,_]=await(0,i.topk)(u,h),P=(0,n.softmax)(g.data);return Array.from({length:this.generation_config.num_beams},()=>{const A=this.randomSelect(P);return[_.data[A],Math.log(P[A])]})}}class c extends o{async sample(u){let h=u.dims.at(-1);this.generation_config.top_k>0&&(h=Math.min(this.generation_config.top_k,h));const[g,_]=await(0,i.topk)(u,h),P=(0,n.softmax)(g.data);return Array.from({length:this.generation_config.num_beams},(A,v)=>[_.data[v],Math.log(P[v])])}}},"./src/generation/stopping_criteria.js":(e,r,t)=>{t.r(r),t.d(r,{EosTokenCriteria:()=>a,InterruptableStoppingCriteria:()=>l,MaxLengthCriteria:()=>o,StoppingCriteria:()=>i,StoppingCriteriaList:()=>n});var s=t("./src/utils/generic.js");class i extends s.Callable{_call(p,u){throw Error("StoppingCriteria needs to be subclassed")}}class n extends s.Callable{constructor(){super(),this.criteria=[]}push(p){this.criteria.push(p)}extend(p){p instanceof n?p=p.criteria:p instanceof i&&(p=[p]),this.criteria.push(...p)}_call(p,u){const h=new Array(p.length).fill(!1);for(const g of this.criteria){const _=g(p,u);for(let P=0;Pu.length>=this.max_length)}}class a extends i{constructor(p){super(),Array.isArray(p)||(p=[p]),this.eos_token_id=p}_call(p,u){return p.map(h=>{const g=h.at(-1);return this.eos_token_id.some(_=>g==_)})}}class l extends i{constructor(){super(),this.interrupted=!1}interrupt(){this.interrupted=!0}reset(){this.interrupted=!1}_call(p,u){return new Array(p.length).fill(this.interrupted)}}},"./src/generation/streamers.js":(e,r,t)=>{t.r(r),t.d(r,{BaseStreamer:()=>o,TextStreamer:()=>l,WhisperTextStreamer:()=>c});var s=t("./src/utils/core.js"),i=t("./src/tokenizers.js"),n=t("./src/env.js");class o{put(u){throw Error("Not implemented")}end(){throw Error("Not implemented")}}const a=n.apis.IS_PROCESS_AVAILABLE?p=>process.stdout.write(p):p=>console.log(p);class l extends o{constructor(u,{skip_prompt:h=!1,callback_function:g=null,token_callback_function:_=null,skip_special_tokens:P=!0,decode_kwargs:A={},...v}={}){super(),this.tokenizer=u,this.skip_prompt=h,this.callback_function=g??a,this.token_callback_function=_,this.decode_kwargs={skip_special_tokens:P,...A,...v},this.token_cache=[],this.print_len=0,this.next_tokens_are_prompt=!0}put(u){var A;if(u.length>1)throw Error("TextStreamer only supports batch size of 1");const h=this.next_tokens_are_prompt;if(h&&(this.next_tokens_are_prompt=!1,this.skip_prompt))return;const g=u[0];(A=this.token_callback_function)==null||A.call(this,g),this.token_cache=(0,s.mergeArrays)(this.token_cache,g);const _=this.tokenizer.decode(this.token_cache,this.decode_kwargs);let P;h||_.endsWith(` +`)?(P=_.slice(this.print_len),this.token_cache=[],this.print_len=0):_.length>0&&(0,i.is_chinese_char)(_.charCodeAt(_.length-1))?(P=_.slice(this.print_len),this.print_len+=P.length):(P=_.slice(this.print_len,_.lastIndexOf(" ")+1),this.print_len+=P.length),this.on_finalized_text(P,!1)}end(){let u;this.token_cache.length>0?(u=this.tokenizer.decode(this.token_cache,this.decode_kwargs).slice(this.print_len),this.token_cache=[],this.print_len=0):u="",this.next_tokens_are_prompt=!0,this.on_finalized_text(u,!0)}on_finalized_text(u,h){var g,_;u.length>0&&((g=this.callback_function)==null||g.call(this,u)),h&&this.callback_function===a&&n.apis.IS_PROCESS_AVAILABLE&&((_=this.callback_function)==null||_.call(this,` +`))}}class c extends l{constructor(u,{skip_prompt:h=!1,callback_function:g=null,token_callback_function:_=null,on_chunk_start:P=null,on_chunk_end:A=null,on_finalize:v=null,time_precision:y=.02,skip_special_tokens:k=!0,decode_kwargs:E={}}={}){super(u,{skip_prompt:h,skip_special_tokens:k,callback_function:g,token_callback_function:_,decode_kwargs:E}),this.timestamp_begin=u.timestamp_begin,this.on_chunk_start=P,this.on_chunk_end=A,this.on_finalize=v,this.time_precision=y,this.waiting_for_timestamp=!1}put(u){var g,_;if(u.length>1)throw Error("WhisperTextStreamer only supports batch size of 1");const h=u[0];if(h.length===1){const P=Number(h[0])-this.timestamp_begin;if(P>=0){const A=P*this.time_precision;this.waiting_for_timestamp?(g=this.on_chunk_end)==null||g.call(this,A):(_=this.on_chunk_start)==null||_.call(this,A),this.waiting_for_timestamp=!this.waiting_for_timestamp,u=[[]]}}return super.put(u)}end(){var u;super.end(),(u=this.on_finalize)==null||u.call(this)}}},"./src/models.js":(e,r,t)=>{t.r(r),t.d(r,{ASTForAudioClassification:()=>Ua,ASTModel:()=>Va,ASTPreTrainedModel:()=>Ki,AlbertForMaskedLM:()=>V,AlbertForQuestionAnswering:()=>F,AlbertForSequenceClassification:()=>pe,AlbertModel:()=>Cn,AlbertPreTrainedModel:()=>Ss,AutoModel:()=>Pu,AutoModelForAudioClassification:()=>db,AutoModelForAudioFrameClassification:()=>ub,AutoModelForAudioTextToText:()=>Mb,AutoModelForCTC:()=>lb,AutoModelForCausalLM:()=>J0,AutoModelForDepthEstimation:()=>fb,AutoModelForDocumentQuestionAnswering:()=>pb,AutoModelForImageClassification:()=>tb,AutoModelForImageFeatureExtraction:()=>wb,AutoModelForImageMatting:()=>hb,AutoModelForImageSegmentation:()=>rb,AutoModelForImageTextToText:()=>yb,AutoModelForImageToImage:()=>mb,AutoModelForMaskGeneration:()=>ab,AutoModelForMaskedLM:()=>Y0,AutoModelForNormalEstimation:()=>_b,AutoModelForObjectDetection:()=>ib,AutoModelForPoseEstimation:()=>gb,AutoModelForQuestionAnswering:()=>Z0,AutoModelForSemanticSegmentation:()=>sb,AutoModelForSeq2SeqLM:()=>H0,AutoModelForSequenceClassification:()=>G0,AutoModelForSpeechSeq2Seq:()=>q0,AutoModelForTextToSpectrogram:()=>Q0,AutoModelForTextToWaveform:()=>X0,AutoModelForTokenClassification:()=>K0,AutoModelForUniversalSegmentation:()=>nb,AutoModelForVision2Seq:()=>eb,AutoModelForXVector:()=>cb,AutoModelForZeroShotObjectDetection:()=>ob,BartForConditionalGeneration:()=>Wt,BartForSequenceClassification:()=>Ot,BartModel:()=>kt,BartPretrainedModel:()=>Ct,BaseModelOutput:()=>Pe,BeitForImageClassification:()=>Il,BeitModel:()=>kl,BeitPreTrainedModel:()=>ia,BertForMaskedLM:()=>Ie,BertForQuestionAnswering:()=>We,BertForSequenceClassification:()=>Le,BertForTokenClassification:()=>Ne,BertModel:()=>Ae,BertPreTrainedModel:()=>xe,BlenderbotForConditionalGeneration:()=>Zt,BlenderbotModel:()=>Gt,BlenderbotPreTrainedModel:()=>gs,BlenderbotSmallForConditionalGeneration:()=>ws,BlenderbotSmallModel:()=>Zr,BlenderbotSmallPreTrainedModel:()=>gr,BloomForCausalLM:()=>jo,BloomModel:()=>No,BloomPreTrainedModel:()=>wi,CLIPModel:()=>eo,CLIPPreTrainedModel:()=>Vs,CLIPSegForImageSegmentation:()=>to,CLIPSegModel:()=>on,CLIPSegPreTrainedModel:()=>nn,CLIPTextModel:()=>Yc,CLIPTextModelWithProjection:()=>Ya,CLIPVisionModel:()=>Zc,CLIPVisionModelWithProjection:()=>Qn,CamembertForMaskedLM:()=>Ts,CamembertForQuestionAnswering:()=>Ls,CamembertForSequenceClassification:()=>xs,CamembertForTokenClassification:()=>Es,CamembertModel:()=>us,CamembertPreTrainedModel:()=>Vr,CausalLMOutput:()=>Fn,CausalLMOutputWithPast:()=>DT,ChineseCLIPModel:()=>sl,ChineseCLIPPreTrainedModel:()=>rl,ClapAudioModelWithProjection:()=>CM,ClapModel:()=>EM,ClapPreTrainedModel:()=>Wl,ClapTextModelWithProjection:()=>PM,CodeGenForCausalLM:()=>Ur,CodeGenModel:()=>In,CodeGenPreTrainedModel:()=>ti,CohereForCausalLM:()=>To,CohereModel:()=>vo,CoherePreTrainedModel:()=>ci,ConvBertForMaskedLM:()=>jt,ConvBertForQuestionAnswering:()=>Os,ConvBertForSequenceClassification:()=>dr,ConvBertForTokenClassification:()=>ds,ConvBertModel:()=>nr,ConvBertPreTrainedModel:()=>wt,ConvNextForImageClassification:()=>by,ConvNextModel:()=>My,ConvNextPreTrainedModel:()=>nu,ConvNextV2ForImageClassification:()=>Ty,ConvNextV2Model:()=>vy,ConvNextV2PreTrainedModel:()=>iu,DPTForDepthEstimation:()=>ry,DPTModel:()=>ty,DPTPreTrainedModel:()=>tu,DacDecoderModel:()=>f0,DacDecoderOutput:()=>p0,DacEncoderModel:()=>m0,DacEncoderOutput:()=>u0,DacModel:()=>h0,DacPreTrainedModel:()=>Jl,DebertaForMaskedLM:()=>et,DebertaForQuestionAnswering:()=>zt,DebertaForSequenceClassification:()=>it,DebertaForTokenClassification:()=>rr,DebertaModel:()=>Be,DebertaPreTrainedModel:()=>mr,DebertaV2ForMaskedLM:()=>hs,DebertaV2ForQuestionAnswering:()=>fs,DebertaV2ForSequenceClassification:()=>Er,DebertaV2ForTokenClassification:()=>ms,DebertaV2Model:()=>ps,DebertaV2PreTrainedModel:()=>kr,DecisionTransformerModel:()=>qM,DecisionTransformerPreTrainedModel:()=>HM,DeiTForImageClassification:()=>Ee,DeiTModel:()=>ye,DeiTPreTrainedModel:()=>ne,DepthAnythingForDepthEstimation:()=>ny,DepthAnythingPreTrainedModel:()=>sy,DepthProForDepthEstimation:()=>dy,DepthProPreTrainedModel:()=>ly,DetrForObjectDetection:()=>Fl,DetrForSegmentation:()=>oa,DetrModel:()=>Al,DetrObjectDetectionOutput:()=>aa,DetrPreTrainedModel:()=>Ti,DetrSegmentationOutput:()=>Ol,Dinov2ForImageClassification:()=>Ey,Dinov2Model:()=>xy,Dinov2PreTrainedModel:()=>ou,Dinov2WithRegistersForImageClassification:()=>Cy,Dinov2WithRegistersModel:()=>Py,Dinov2WithRegistersPreTrainedModel:()=>au,DistilBertForMaskedLM:()=>Ys,DistilBertForQuestionAnswering:()=>Js,DistilBertForSequenceClassification:()=>Qs,DistilBertForTokenClassification:()=>Xs,DistilBertModel:()=>Ps,DistilBertPreTrainedModel:()=>Qr,DonutSwinModel:()=>yy,DonutSwinPreTrainedModel:()=>wy,EfficientNetForImageClassification:()=>OM,EfficientNetModel:()=>FM,EfficientNetPreTrainedModel:()=>gu,ElectraForMaskedLM:()=>Ds,ElectraForQuestionAnswering:()=>qr,ElectraForSequenceClassification:()=>jr,ElectraForTokenClassification:()=>dt,ElectraModel:()=>cs,ElectraPreTrainedModel:()=>Dr,EsmForMaskedLM:()=>en,EsmForSequenceClassification:()=>tn,EsmForTokenClassification:()=>Lr,EsmModel:()=>Zs,EsmPreTrainedModel:()=>_s,ExaoneForCausalLM:()=>mt,ExaoneModel:()=>fo,ExaonePreTrainedModel:()=>Us,FalconForCausalLM:()=>xM,FalconModel:()=>TM,FalconPreTrainedModel:()=>mu,FastViTForImageClassification:()=>yl,FastViTModel:()=>wl,FastViTPreTrainedModel:()=>ea,Florence2ForConditionalGeneration:()=>Xi,Florence2PreTrainedModel:()=>Xa,GLPNForDepthEstimation:()=>gy,GLPNModel:()=>_y,GLPNPreTrainedModel:()=>su,GPT2LMHeadModel:()=>Yn,GPT2Model:()=>al,GPT2PreTrainedModel:()=>ro,GPTBigCodeForCausalLM:()=>uo,GPTBigCodeModel:()=>dl,GPTBigCodePreTrainedModel:()=>Oe,GPTJForCausalLM:()=>kn,GPTJModel:()=>co,GPTJPreTrainedModel:()=>lo,GPTNeoForCausalLM:()=>oo,GPTNeoModel:()=>io,GPTNeoPreTrainedModel:()=>Zn,GPTNeoXForCausalLM:()=>ao,GPTNeoXModel:()=>ll,GPTNeoXPreTrainedModel:()=>ei,Gemma2ForCausalLM:()=>Co,Gemma2Model:()=>Po,Gemma2PreTrainedModel:()=>pi,Gemma3ForCausalLM:()=>$o,Gemma3Model:()=>So,Gemma3PreTrainedModel:()=>hi,GemmaForCausalLM:()=>Eo,GemmaModel:()=>xo,GemmaPreTrainedModel:()=>ui,GlmForCausalLM:()=>gt,GlmModel:()=>mo,GlmPreTrainedModel:()=>ii,GraniteForCausalLM:()=>bo,GraniteModel:()=>Mo,GranitePreTrainedModel:()=>di,GroundingDinoForObjectDetection:()=>$y,GroundingDinoPreTrainedModel:()=>Sy,GroupViTModel:()=>gl,GroupViTPreTrainedModel:()=>_l,HeliumForCausalLM:()=>ni,HeliumModel:()=>ho,HeliumPreTrainedModel:()=>si,HieraForImageClassification:()=>ot,HieraModel:()=>Ye,HieraPreTrainedModel:()=>ze,HubertForCTC:()=>iM,HubertForSequenceClassification:()=>oM,HubertModel:()=>nM,HubertPreTrainedModel:()=>bT,IJepaForImageClassification:()=>Qo,IJepaModel:()=>qo,IJepaPreTrainedModel:()=>vi,Idefics3ForConditionalGeneration:()=>Hn,Idefics3PreTrainedModel:()=>Ja,ImageMattingOutput:()=>vb,JAISLMHeadModel:()=>no,JAISModel:()=>so,JAISPreTrainedModel:()=>$n,JinaCLIPModel:()=>nl,JinaCLIPPreTrainedModel:()=>Jn,JinaCLIPTextModel:()=>il,JinaCLIPVisionModel:()=>ol,LiteWhisperForConditionalGeneration:()=>Ga,LlamaForCausalLM:()=>po,LlamaModel:()=>ri,LlamaPreTrainedModel:()=>an,LlavaForConditionalGeneration:()=>Kn,LlavaOnevisionForConditionalGeneration:()=>qa,LlavaPreTrainedModel:()=>Ha,LongT5ForConditionalGeneration:()=>Qe,LongT5Model:()=>Ue,LongT5PreTrainedModel:()=>Ce,M2M100ForConditionalGeneration:()=>Ry,M2M100Model:()=>By,M2M100PreTrainedModel:()=>cu,MBartForCausalLM:()=>Tr,MBartForConditionalGeneration:()=>_r,MBartForSequenceClassification:()=>Yr,MBartModel:()=>vr,MBartPreTrainedModel:()=>Vt,MPNetForMaskedLM:()=>zr,MPNetForQuestionAnswering:()=>Ar,MPNetForSequenceClassification:()=>En,MPNetForTokenClassification:()=>Rs,MPNetModel:()=>xn,MPNetPreTrainedModel:()=>Xr,MT5ForConditionalGeneration:()=>ht,MT5Model:()=>Ze,MT5PreTrainedModel:()=>Ke,MarianMTModel:()=>zy,MarianModel:()=>Ly,MarianPreTrainedModel:()=>du,MaskFormerForInstanceSegmentation:()=>fy,MaskFormerModel:()=>my,MaskFormerPreTrainedModel:()=>ru,MaskedLMOutput:()=>wr,Metric3DForDepthEstimation:()=>uy,Metric3DPreTrainedModel:()=>cy,Metric3Dv2ForDepthEstimation:()=>hy,Metric3Dv2PreTrainedModel:()=>py,MgpstrForSceneTextRecognition:()=>ZM,MgpstrModelOutput:()=>JM,MgpstrPreTrainedModel:()=>YM,MimiDecoderModel:()=>c0,MimiDecoderOutput:()=>a0,MimiEncoderModel:()=>d0,MimiEncoderOutput:()=>o0,MimiModel:()=>l0,MimiPreTrainedModel:()=>Xl,MistralForCausalLM:()=>MM,MistralModel:()=>yM,MistralPreTrainedModel:()=>pu,MobileBertForMaskedLM:()=>zs,MobileBertForQuestionAnswering:()=>Ir,MobileBertForSequenceClassification:()=>Bs,MobileBertModel:()=>br,MobileBertPreTrainedModel:()=>Cs,MobileLLMForCausalLM:()=>_o,MobileLLMModel:()=>ft,MobileLLMPreTrainedModel:()=>An,MobileNetV1ForImageClassification:()=>LM,MobileNetV1ForSemanticSegmentation:()=>zM,MobileNetV1Model:()=>DM,MobileNetV1PreTrainedModel:()=>Kl,MobileNetV2ForImageClassification:()=>RM,MobileNetV2ForSemanticSegmentation:()=>NM,MobileNetV2Model:()=>BM,MobileNetV2PreTrainedModel:()=>Hl,MobileNetV3ForImageClassification:()=>VM,MobileNetV3ForSemanticSegmentation:()=>UM,MobileNetV3Model:()=>jM,MobileNetV3PreTrainedModel:()=>ql,MobileNetV4ForImageClassification:()=>GM,MobileNetV4ForSemanticSegmentation:()=>KM,MobileNetV4Model:()=>WM,MobileNetV4PreTrainedModel:()=>Ql,MobileViTForImageClassification:()=>Tl,MobileViTModel:()=>vl,MobileViTPreTrainedModel:()=>ta,MobileViTV2ForImageClassification:()=>El,MobileViTV2Model:()=>xl,MobileViTV2PreTrainedModel:()=>ra,ModelOutput:()=>me,ModernBertForMaskedLM:()=>B,ModernBertForSequenceClassification:()=>te,ModernBertForTokenClassification:()=>de,ModernBertModel:()=>ee,ModernBertPreTrainedModel:()=>D,Moondream1ForConditionalGeneration:()=>Qa,MoonshineForConditionalGeneration:()=>Ka,MoonshineModel:()=>Jc,MoonshinePreTrainedModel:()=>qi,MptForCausalLM:()=>Uo,MptModel:()=>Vo,MptPreTrainedModel:()=>yi,MultiModalityCausalLM:()=>XM,MultiModalityPreTrainedModel:()=>QM,MusicgenForCausalLM:()=>ET,MusicgenForConditionalGeneration:()=>yu,MusicgenModel:()=>xT,MusicgenPreTrainedModel:()=>wu,NomicBertModel:()=>ve,NomicBertPreTrainedModel:()=>be,OPTForCausalLM:()=>Go,OPTModel:()=>Wo,OPTPreTrainedModel:()=>Mi,Olmo2ForCausalLM:()=>li,Olmo2Model:()=>yo,Olmo2PreTrainedModel:()=>ai,OlmoForCausalLM:()=>wo,OlmoModel:()=>go,OlmoPreTrainedModel:()=>oi,OpenELMForCausalLM:()=>Io,OpenELMModel:()=>ko,OpenELMPreTrainedModel:()=>mi,OwlViTForObjectDetection:()=>Cl,OwlViTModel:()=>Pl,OwlViTPreTrainedModel:()=>sa,Owlv2ForObjectDetection:()=>$l,Owlv2Model:()=>Sl,Owlv2PreTrainedModel:()=>na,PaliGemmaForConditionalGeneration:()=>Yi,PaliGemmaPreTrainedModel:()=>Ji,PatchTSMixerForPrediction:()=>s0,PatchTSMixerModel:()=>r0,PatchTSMixerPreTrainedModel:()=>bu,PatchTSTForPrediction:()=>t0,PatchTSTModel:()=>e0,PatchTSTPreTrainedModel:()=>Mu,Phi3ForCausalLM:()=>Ro,Phi3Model:()=>Bo,Phi3PreTrainedModel:()=>gi,Phi3VForCausalLM:()=>js,Phi3VPreTrainedModel:()=>Zi,PhiForCausalLM:()=>zo,PhiModel:()=>Lo,PhiPreTrainedModel:()=>_i,PreTrainedModel:()=>j,PretrainedMixin:()=>It,PvtForImageClassification:()=>ul,PvtModel:()=>cl,PvtPreTrainedModel:()=>Yo,PyAnnoteForAudioFrameClassification:()=>Gy,PyAnnoteModel:()=>Wy,PyAnnotePreTrainedModel:()=>uu,QuestionAnsweringModelOutput:()=>Pr,Qwen2ForCausalLM:()=>Fo,Qwen2Model:()=>Ao,Qwen2PreTrainedModel:()=>fi,Qwen2VLForConditionalGeneration:()=>Do,Qwen2VLPreTrainedModel:()=>Oo,RFDetrForObjectDetection:()=>d,RFDetrModel:()=>ua,RFDetrObjectDetectionOutput:()=>m,RFDetrPreTrainedModel:()=>ca,RTDetrForObjectDetection:()=>Ll,RTDetrModel:()=>Dl,RTDetrObjectDetectionOutput:()=>xi,RTDetrPreTrainedModel:()=>la,RTDetrV2ForObjectDetection:()=>Bl,RTDetrV2Model:()=>zl,RTDetrV2ObjectDetectionOutput:()=>Rl,RTDetrV2PreTrainedModel:()=>da,ResNetForImageClassification:()=>Fr,ResNetModel:()=>Bt,ResNetPreTrainedModel:()=>_t,RoFormerForMaskedLM:()=>je,RoFormerForQuestionAnswering:()=>ut,RoFormerForSequenceClassification:()=>qe,RoFormerForTokenClassification:()=>Xe,RoFormerModel:()=>Fe,RoFormerPreTrainedModel:()=>Re,RobertaForMaskedLM:()=>Rt,RobertaForQuestionAnswering:()=>er,RobertaForSequenceClassification:()=>Jt,RobertaForTokenClassification:()=>qt,RobertaModel:()=>ur,RobertaPreTrainedModel:()=>Ht,SamImageSegmentationOutput:()=>Dy,SamModel:()=>Oy,SamPreTrainedModel:()=>Fy,SapiensForDepthEstimation:()=>oy,SapiensForNormalEstimation:()=>ay,SapiensForSemanticSegmentation:()=>iy,SapiensPreTrainedModel:()=>Nl,SegformerForImageClassification:()=>$M,SegformerForSemanticSegmentation:()=>kM,SegformerModel:()=>TT,SegformerPreTrainedModel:()=>Gl,Seq2SeqLMOutput:()=>OT,SequenceClassifierOutput:()=>bt,SiglipModel:()=>Za,SiglipPreTrainedModel:()=>Xn,SiglipTextModel:()=>el,SiglipVisionModel:()=>tl,SmolVLMForConditionalGeneration:()=>qn,SnacDecoderModel:()=>w0,SnacEncoderModel:()=>g0,SnacModel:()=>_0,SnacPreTrainedModel:()=>Yl,SpeechT5ForSpeechToText:()=>mM,SpeechT5ForTextToSpeech:()=>fM,SpeechT5HifiGan:()=>_M,SpeechT5Model:()=>vT,SpeechT5PreTrainedModel:()=>Ul,SqueezeBertForMaskedLM:()=>fr,SqueezeBertForQuestionAnswering:()=>Pn,SqueezeBertForSequenceClassification:()=>Ns,SqueezeBertModel:()=>cr,SqueezeBertPreTrainedModel:()=>Jr,StableLmForCausalLM:()=>AM,StableLmModel:()=>IM,StableLmPreTrainedModel:()=>_u,Starcoder2ForCausalLM:()=>vM,Starcoder2Model:()=>bM,Starcoder2PreTrainedModel:()=>hu,StyleTextToSpeech2Model:()=>hM,StyleTextToSpeech2PreTrainedModel:()=>pM,Swin2SRForImageSuperResolution:()=>ey,Swin2SRModel:()=>Zw,Swin2SRPreTrainedModel:()=>eu,SwinForImageClassification:()=>Jw,SwinForSemanticSegmentation:()=>Yw,SwinModel:()=>Xw,SwinPreTrainedModel:()=>$s,T5ForConditionalGeneration:()=>ue,T5Model:()=>le,T5PreTrainedModel:()=>Y,TableTransformerForObjectDetection:()=>I,TableTransformerModel:()=>C,TableTransformerObjectDetectionOutput:()=>W,TableTransformerPreTrainedModel:()=>T,TokenClassifierOutput:()=>pr,TrOCRForCausalLM:()=>wM,TrOCRPreTrainedModel:()=>gM,UltravoxModel:()=>i0,UltravoxPreTrainedModel:()=>n0,UniSpeechForCTC:()=>Qy,UniSpeechForSequenceClassification:()=>Xy,UniSpeechModel:()=>qy,UniSpeechPreTrainedModel:()=>jl,UniSpeechSatForAudioFrameClassification:()=>eM,UniSpeechSatForCTC:()=>Yy,UniSpeechSatForSequenceClassification:()=>Zy,UniSpeechSatModel:()=>Jy,UniSpeechSatPreTrainedModel:()=>pa,ViTForImageClassification:()=>Ho,ViTMAEModel:()=>hl,ViTMAEPreTrainedModel:()=>pl,ViTMSNForImageClassification:()=>fl,ViTMSNModel:()=>ml,ViTMSNPreTrainedModel:()=>Zo,ViTModel:()=>Ko,ViTPreTrainedModel:()=>bi,VisionEncoderDecoderModel:()=>Qi,VitMatteForImageMatting:()=>bl,VitMattePreTrainedModel:()=>Ml,VitPoseForPoseEstimation:()=>Jo,VitPosePreTrainedModel:()=>Xo,VitsModel:()=>fu,VitsModelOutput:()=>Tb,VitsPreTrainedModel:()=>SM,Wav2Vec2BertForCTC:()=>rM,Wav2Vec2BertForSequenceClassification:()=>sM,Wav2Vec2BertModel:()=>tM,Wav2Vec2BertPreTrainedModel:()=>Vl,Wav2Vec2ForAudioFrameClassification:()=>Uy,Wav2Vec2ForCTC:()=>jy,Wav2Vec2ForSequenceClassification:()=>Vy,Wav2Vec2Model:()=>Ny,Wav2Vec2PreTrainedModel:()=>ln,WavLMForAudioFrameClassification:()=>uM,WavLMForCTC:()=>lM,WavLMForSequenceClassification:()=>dM,WavLMForXVector:()=>cM,WavLMModel:()=>aM,WavLMPreTrainedModel:()=>Ei,WeSpeakerResNetModel:()=>Hy,WeSpeakerResNetPreTrainedModel:()=>Ky,WhisperForConditionalGeneration:()=>Hi,WhisperModel:()=>Wa,WhisperPreTrainedModel:()=>Gn,XLMForQuestionAnswering:()=>Ba,XLMForSequenceClassification:()=>za,XLMForTokenClassification:()=>Wi,XLMModel:()=>rn,XLMPreTrainedModel:()=>ir,XLMRobertaForMaskedLM:()=>Na,XLMRobertaForQuestionAnswering:()=>Gi,XLMRobertaForSequenceClassification:()=>Sn,XLMRobertaForTokenClassification:()=>ja,XLMRobertaModel:()=>Ra,XLMRobertaPreTrainedModel:()=>ys,XLMWithLMHeadModel:()=>sn,XVectorOutput:()=>bb,YolosForObjectDetection:()=>Iy,YolosModel:()=>ky,YolosObjectDetectionOutput:()=>Ay,YolosPreTrainedModel:()=>lu});var s=t("./src/configs.js"),i=t("./src/backends/onnx.js"),n=t("./src/utils/dtypes.js"),o=t("./src/utils/generic.js"),a=t("./src/utils/core.js"),l=t("./src/utils/hub.js"),c=t("./src/utils/constants.js"),p=t("./src/generation/logits_process.js"),u=t("./src/generation/configuration_utils.js"),h=t("./src/utils/tensor.js"),g=t("./src/utils/image.js"),_=t("./src/utils/maths.js"),P=t("./src/generation/stopping_criteria.js"),A=t("./src/generation/logits_sampler.js"),v=t("./src/env.js"),y=t("./src/models/whisper/generation_whisper.js"),k=t("./src/models/whisper/common_whisper.js");const E={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5,ImageTextToText:6,Musicgen:7,MultiModality:8,Phi3V:9,AudioTextToText:10,AutoEncoder:11},M=new Map,w=new Map,x=new Map;async function $(b,S,L){var yr;const oe=((yr=L.config)==null?void 0:yr["transformers.js_config"])??{};let ge=L.device??oe.device;ge&&typeof ge!="string"&&(ge.hasOwnProperty(S)?ge=ge[S]:(console.warn(`device not specified for "${S}". Using the default device.`),ge=null));const fe=ge??(v.apis.IS_NODE_ENV?"cpu":"wasm"),Se=(0,i.deviceToExecutionProviders)(fe);let De=L.dtype??oe.dtype;if(typeof De!="string"&&(De&&De.hasOwnProperty(S)?De=De[S]:(De=n.DEFAULT_DEVICE_DTYPE_MAPPING[fe]??n.DATA_TYPES.fp32,console.warn(`dtype not specified for "${S}". Using the default dtype (${De}) for this device (${fe}).`))),De===n.DATA_TYPES.auto){let Pt=oe.dtype;typeof Pt!="string"&&(Pt=Pt[S]),Pt&&Pt!==n.DATA_TYPES.auto&&n.DATA_TYPES.hasOwnProperty(Pt)?De=Pt:De=n.DEFAULT_DEVICE_DTYPE_MAPPING[fe]??n.DATA_TYPES.fp32}const Ge=De;if(n.DEFAULT_DTYPE_SUFFIX_MAPPING.hasOwnProperty(Ge)){if(Ge===n.DATA_TYPES.fp16&&fe==="webgpu"&&!await(0,n.isWebGpuFp16Supported)())throw new Error(`The device (${fe}) does not support fp16.`)}else throw new Error(`Invalid dtype: ${Ge}. Should be one of: ${Object.keys(n.DATA_TYPES).join(", ")}`);const Je=oe.kv_cache_dtype?typeof oe.kv_cache_dtype=="string"?oe.kv_cache_dtype:oe.kv_cache_dtype[Ge]??"float32":void 0;if(Je&&!["float32","float16"].includes(Je))throw new Error(`Invalid kv_cache_dtype: ${Je}. Should be one of: float32, float16`);const lt={dtype:Ge,kv_cache_dtype:Je},yt=n.DEFAULT_DTYPE_SUFFIX_MAPPING[Ge],st=`${S}${yt}.onnx`,Et=`${L.subfolder??""}/${st}`,at={...L.session_options};at.executionProviders??(at.executionProviders=Se);const vt=oe.free_dimension_overrides;vt?at.freeDimensionOverrides??(at.freeDimensionOverrides=vt):fe.startsWith("webnn")&&!at.freeDimensionOverrides&&console.warn('WebNN does not currently support dynamic shapes and requires `free_dimension_overrides` to be set in config.json as a field within "transformers.js_config". When `free_dimension_overrides` is not set, you may experience significant performance degradation.');const ct=(0,l.getModelFile)(b,Et,!0,L,v.apis.IS_NODE_ENV),xt=L.use_external_data_format??oe.use_external_data_format;let Lt=[];if(xt){let Pt;typeof xt=="object"?xt.hasOwnProperty(st)?Pt=xt[st]:xt.hasOwnProperty(S)?Pt=xt[S]:Pt=!1:Pt=xt;const Nt=+Pt;if(Nt>l.MAX_EXTERNAL_DATA_CHUNKS)throw new Error(`The number of external data chunks (${Nt}) exceeds the maximum allowed value (${l.MAX_EXTERNAL_DATA_CHUNKS}).`);for(let tr=0;tr{const Cr=await(0,l.getModelFile)(b,Wr,!0,L,v.apis.IS_NODE_ENV);dn(Cr instanceof Uint8Array?{path:sr,data:Cr}:sr)}))}}else at.externalData!==void 0&&(Lt=at.externalData.map(async Pt=>{if(typeof Pt.data=="string"){const Nt=await(0,l.getModelFile)(b,Pt.data,!0,L);return{...Pt,data:Nt}}return Pt}));if(Lt.length>0){const Pt=await Promise.all(Lt);v.apis.IS_NODE_ENV||(at.externalData=Pt)}if(fe==="webgpu"){const Pt=(0,s.getKeyValueShapes)(L.config,{prefix:"present"});if(Object.keys(Pt).length>0&&!(0,i.isONNXProxy)()){const Nt={};for(const tr in Pt)Nt[tr]="gpu-buffer";at.preferredOutputLocation=Nt}}return{buffer_or_path:await ct,session_options:at,session_config:lt}}async function z(b,S,L){return Object.fromEntries(await Promise.all(Object.keys(S).map(async oe=>{const{buffer_or_path:ge,session_options:fe,session_config:Se}=await $(b,S[oe],L),De=await(0,i.createInferenceSession)(ge,fe,Se);return[oe,De]})))}async function R(b,S,L){return Object.fromEntries(await Promise.all(Object.keys(S).map(async oe=>{const ge=await(0,l.getModelJSON)(b,S[oe],!1,L);return[oe,ge]})))}function Q(b,S){const L=Object.create(null),oe=[];for(const Se of b.inputNames){const De=S[Se];if(!(De instanceof h.Tensor)){oe.push(Se);continue}L[Se]=(0,i.isONNXProxy)()?De.clone():De}if(oe.length>0)throw new Error(`An error occurred during model execution: "Missing the following inputs: ${oe.join(", ")}.`);const ge=Object.keys(S).length,fe=b.inputNames.length;if(ge>fe){let Se=Object.keys(S).filter(De=>!b.inputNames.includes(De));console.warn(`WARNING: Too many inputs were provided (${ge} > ${fe}). The following inputs will be ignored: "${Se.join(", ")}".`)}return L}async function q(b,S){const L=Q(b,S);try{const oe=Object.fromEntries(Object.entries(L).map(([fe,Se])=>[fe,Se.ort_tensor]));let ge=await b.run(oe);return ge=U(ge),ge}catch(oe){const ge=Object.fromEntries(Object.entries(L).map(([fe,{type:Se,dims:De,data:Ge}])=>[fe,{type:Se,dims:De,data:Ge}]));throw console.error(`An error occurred during model execution: "${oe}".`),console.error("Inputs given to model:",ge),oe}}function U(b){for(let S in b)(0,i.isONNXTensor)(b[S])?b[S]=new h.Tensor(b[S]):typeof b[S]=="object"&&U(b[S]);return b}function Z(b){if(b instanceof h.Tensor)return b;if(b.length===0)throw Error("items must be non-empty");if(Array.isArray(b[0])){if(b.some(S=>S.length!==b[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 h.Tensor("int64",BigInt64Array.from(b.flat().map(S=>BigInt(S))),[b.length,b[0].length])}else return new h.Tensor("int64",BigInt64Array.from(b.map(S=>BigInt(S))),[1,b.length])}function H(b){return new h.Tensor("bool",[b],[1])}async function J(b,S){let{encoder_outputs:L,input_ids:oe,decoder_input_ids:ge,...fe}=S;if(!L){const De=(0,a.pick)(S,b.sessions.model.inputNames);L=(await ie(b,De)).last_hidden_state}return fe.input_ids=ge,fe.encoder_hidden_states=L,b.sessions.decoder_model_merged.inputNames.includes("encoder_attention_mask")&&(fe.encoder_attention_mask=S.attention_mask),await ce(b,fe,!0)}async function ie(b,S){const L=b.sessions.model,oe=(0,a.pick)(S,L.inputNames);if(L.inputNames.includes("inputs_embeds")&&!oe.inputs_embeds){if(!S.input_ids)throw new Error("Both `input_ids` and `inputs_embeds` are missing in the model inputs.");oe.inputs_embeds=await b.encode_text({input_ids:S.input_ids})}if(L.inputNames.includes("token_type_ids")&&!oe.token_type_ids){if(!oe.input_ids)throw new Error("Both `input_ids` and `token_type_ids` are missing in the model inputs.");oe.token_type_ids=(0,h.zeros_like)(oe.input_ids)}if(L.inputNames.includes("pixel_mask")&&!oe.pixel_mask){if(!oe.pixel_values)throw new Error("Both `pixel_values` and `pixel_mask` are missing in the model inputs.");const ge=oe.pixel_values.dims;oe.pixel_mask=(0,h.ones)([ge[0],ge[2],ge[3]])}return await q(L,oe)}async function ae(b,S){const L=await b.encode(S);return await b.decode(L)}async function ce(b,S,L=!1){const oe=b.sessions[L?"decoder_model_merged":"model"],{past_key_values:ge,...fe}=S;if(oe.inputNames.includes("use_cache_branch")&&(fe.use_cache_branch=H(!!ge)),oe.inputNames.includes("position_ids")&&fe.attention_mask&&!fe.position_ids){const De=["paligemma","gemma3_text","gemma3"].includes(b.config.model_type)?1:0;fe.position_ids=_e(fe,ge,De)}b.addPastKeyValues(fe,ge);const Se=(0,a.pick)(fe,oe.inputNames);return await q(oe,Se)}function he({modality_token_id:b,inputs_embeds:S,modality_features:L,input_ids:oe,attention_mask:ge}){const fe=oe.tolist().map(Je=>Je.reduce((lt,yt,st)=>(yt==b&<.push(st),lt),[])),Se=fe.reduce((Je,lt)=>Je+lt.length,0),De=L.dims[0];if(Se!==De)throw new Error(`Number of tokens and features do not match: tokens: ${Se}, features ${De}`);let Ge=0;for(let Je=0;Jefe.dims[1])){if(geDe==b.config.image_token_index)){const De=b.config.num_image_tokens;if(!De)throw new Error("`num_image_tokens` is missing in the model configuration.");const Ge=fe.dims[1]-(ge-De);L.input_ids=fe.slice(null,[-Ge,null]),L.attention_mask=(0,h.ones)([1,ge+Ge])}}}return L}function He(b,S,L,oe){return L.past_key_values&&(S=S.map(ge=>[ge.at(-1)])),{...L,decoder_input_ids:Z(S)}}function Me(b,...S){return b.config.is_encoder_decoder?He(b,...S):ke(b,...S)}function K(b,S,L,oe){const ge=!!L.past_key_values;return oe.guidance_scale!==null&&oe.guidance_scale>1&&(ge?L.input_ids=(0,h.cat)([L.input_ids,L.input_ids],0):(L.input_ids=(0,h.cat)([L.input_ids,(0,h.full_like)(L.input_ids,BigInt(oe.pad_token_id))],0),L.attention_mask=(0,h.cat)([L.attention_mask,(0,h.full_like)(L.attention_mask,0n)],0))),(ge||!L.pixel_values)&&(L.pixel_values=(0,h.full)([0,0,3,384,384],1)),ge&&(L.images_seq_mask=new h.Tensor("bool",new Array(1).fill(!0).fill(!1,0,1),[1,1]),L.images_emb_mask=new h.Tensor("bool",new Array(0).fill(!1),[1,1,0])),L}class j extends o.Callable{constructor(L,oe,ge){super();re(this,"main_input_name","input_ids");re(this,"forward_params",["input_ids","attention_mask"]);this.config=L,this.sessions=oe,this.configs=ge;const fe=x.get(this.constructor),Se=M.get(fe);switch(this.can_generate=!1,this._forward=null,this._prepare_inputs_for_generation=null,Se){case E.DecoderOnly:this.can_generate=!0,this._forward=ce,this._prepare_inputs_for_generation=ke;break;case E.Seq2Seq:case E.Vision2Seq:case E.Musicgen:this.can_generate=!0,this._forward=J,this._prepare_inputs_for_generation=He;break;case E.EncoderDecoder:this._forward=J;break;case E.ImageTextToText:this.can_generate=!0,this._forward=X,this._prepare_inputs_for_generation=Me;break;case E.AudioTextToText:this.can_generate=!0,this._forward=se,this._prepare_inputs_for_generation=Me;break;case E.Phi3V:this.can_generate=!0,this._prepare_inputs_for_generation=Me;break;case E.MultiModality:this.can_generate=!0,this._prepare_inputs_for_generation=K;break;case E.AutoEncoder:this._forward=ae;break;default:this._forward=ie;break}this.can_generate&&this.forward_params.push("past_key_values"),this.custom_config=this.config["transformers.js_config"]??{}}async dispose(){var oe;const L=[];for(const ge of Object.values(this.sessions))(oe=ge==null?void 0:ge.handler)!=null&&oe.dispose&&L.push(ge.handler.dispose());return await Promise.all(L)}static async from_pretrained(L,{progress_callback:oe=null,config:ge=null,cache_dir:fe=null,local_files_only:Se=!1,revision:De="main",model_file_name:Ge=null,subfolder:Je="onnx",device:lt=null,dtype:yt=null,use_external_data_format:st=null,session_options:Et={}}={}){let at={progress_callback:oe,config:ge,cache_dir:fe,local_files_only:Se,revision:De,model_file_name:Ge,subfolder:Je,device:lt,dtype:yt,use_external_data_format:st,session_options:Et};const vt=x.get(this),ct=M.get(vt);ge=at.config=await s.AutoConfig.from_pretrained(L,at);let xt;if(ct===E.DecoderOnly)xt=await Promise.all([z(L,{model:at.model_file_name??"model"},at),R(L,{generation_config:"generation_config.json"},at)]);else if(ct===E.Seq2Seq||ct===E.Vision2Seq)xt=await Promise.all([z(L,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},at),R(L,{generation_config:"generation_config.json"},at)]);else if(ct===E.MaskGeneration)xt=await Promise.all([z(L,{model:"vision_encoder",prompt_encoder_mask_decoder:"prompt_encoder_mask_decoder"},at)]);else if(ct===E.EncoderDecoder)xt=await Promise.all([z(L,{model:"encoder_model",decoder_model_merged:"decoder_model_merged"},at)]);else if(ct===E.ImageTextToText){const Lt={embed_tokens:"embed_tokens",vision_encoder:"vision_encoder",decoder_model_merged:"decoder_model_merged"};ge.is_encoder_decoder&&(Lt.model="encoder_model"),xt=await Promise.all([z(L,Lt,at),R(L,{generation_config:"generation_config.json"},at)])}else if(ct===E.AudioTextToText){const Lt={embed_tokens:"embed_tokens",audio_encoder:"audio_encoder",decoder_model_merged:"decoder_model_merged"};xt=await Promise.all([z(L,Lt,at),R(L,{generation_config:"generation_config.json"},at)])}else if(ct===E.Musicgen)xt=await Promise.all([z(L,{model:"text_encoder",decoder_model_merged:"decoder_model_merged",encodec_decode:"encodec_decode"},at),R(L,{generation_config:"generation_config.json"},at)]);else if(ct===E.MultiModality)xt=await Promise.all([z(L,{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"},at),R(L,{generation_config:"generation_config.json"},at)]);else if(ct===E.Phi3V)xt=await Promise.all([z(L,{prepare_inputs_embeds:"prepare_inputs_embeds",model:"model",vision_encoder:"vision_encoder"},at),R(L,{generation_config:"generation_config.json"},at)]);else if(ct===E.AutoEncoder)xt=await Promise.all([z(L,{encoder_model:"encoder_model",decoder_model:"decoder_model"},at)]);else{if(ct!==E.EncoderOnly){const Lt=vt??(ge==null?void 0:ge.model_type);Lt!=="custom"&&console.warn(`Model type for '${Lt}' not found, assuming encoder-only architecture. Please report this at ${c.GITHUB_ISSUE_URL}.`)}xt=await Promise.all([z(L,{model:at.model_file_name??"model"},at)])}return new this(ge,...xt)}async _call(L){return await this.forward(L)}async forward(L){return await this._forward(this,L)}get generation_config(){var L;return((L=this.configs)==null?void 0:L.generation_config)??null}_get_logits_warper(L){const oe=new p.LogitsProcessorList;return L.temperature!==null&&L.temperature!==1&&oe.push(new p.TemperatureLogitsWarper(L.temperature)),L.top_k!==null&&L.top_k!==0&&oe.push(new p.TopKLogitsWarper(L.top_k)),L.top_p!==null&&L.top_p<1&&oe.push(new p.TopPLogitsWarper(L.top_p)),oe}_get_logits_processor(L,oe,ge=null){const fe=new p.LogitsProcessorList;if(L.repetition_penalty!==null&&L.repetition_penalty!==1&&fe.push(new p.RepetitionPenaltyLogitsProcessor(L.repetition_penalty)),L.no_repeat_ngram_size!==null&&L.no_repeat_ngram_size>0&&fe.push(new p.NoRepeatNGramLogitsProcessor(L.no_repeat_ngram_size)),L.bad_words_ids!==null&&fe.push(new p.NoBadWordsLogitsProcessor(L.bad_words_ids,L.eos_token_id)),L.min_length!==null&&L.eos_token_id!==null&&L.min_length>0&&fe.push(new p.MinLengthLogitsProcessor(L.min_length,L.eos_token_id)),L.min_new_tokens!==null&&L.eos_token_id!==null&&L.min_new_tokens>0&&fe.push(new p.MinNewTokensLengthLogitsProcessor(oe,L.min_new_tokens,L.eos_token_id)),L.forced_bos_token_id!==null&&fe.push(new p.ForcedBOSTokenLogitsProcessor(L.forced_bos_token_id)),L.forced_eos_token_id!==null&&fe.push(new p.ForcedEOSTokenLogitsProcessor(L.max_length,L.forced_eos_token_id)),L.begin_suppress_tokens!==null){const Se=oe>1||L.forced_bos_token_id===null?oe:oe+1;fe.push(new p.SuppressTokensAtBeginLogitsProcessor(L.begin_suppress_tokens,Se))}return L.guidance_scale!==null&&L.guidance_scale>1&&fe.push(new p.ClassifierFreeGuidanceLogitsProcessor(L.guidance_scale)),ge!==null&&fe.extend(ge),fe}_prepare_generation_config(L,oe,ge=u.GenerationConfig){const fe={...this.config};for(const De of["decoder","generator","text_config"])De in fe&&Object.assign(fe,fe[De]);const Se=new ge(fe);return Object.assign(Se,this.generation_config??{}),L&&Object.assign(Se,L),oe&&Object.assign(Se,(0,a.pick)(oe,Object.getOwnPropertyNames(Se))),Se}_get_stopping_criteria(L,oe=null){const ge=new P.StoppingCriteriaList;return L.max_length!==null&&ge.push(new P.MaxLengthCriteria(L.max_length,this.config.max_position_embeddings??null)),L.eos_token_id!==null&&ge.push(new P.EosTokenCriteria(L.eos_token_id)),oe&&ge.extend(oe),ge}_validate_model_class(){if(!this.can_generate){const L=[xu,Eu,Tu,vu],oe=x.get(this.constructor),ge=new Set,fe=this.config.model_type;for(const De of L){const Ge=De.get(fe);Ge&&ge.add(Ge[0])}let Se=`The current model class (${oe}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;throw ge.size>0&&(Se+=` Please use the following class instead: ${[...ge].join(", ")}`),Error(Se)}}prepare_inputs_for_generation(...L){return this._prepare_inputs_for_generation(this,...L)}_update_model_kwargs_for_generation({generated_input_ids:L,outputs:oe,model_inputs:ge,is_encoder_decoder:fe}){return ge.past_key_values=this.getPastKeyValues(oe,ge.past_key_values),ge.input_ids=new h.Tensor("int64",L.flat(),[L.length,1]),fe||(ge.attention_mask=(0,h.cat)([ge.attention_mask,(0,h.ones)([ge.attention_mask.dims[0],1])],1)),ge.position_ids=null,ge}_prepare_model_inputs({inputs:L,bos_token_id:oe,model_kwargs:ge}){const fe=(0,a.pick)(ge,this.forward_params),Se=this.main_input_name;if(Se in fe){if(L)throw new Error("`inputs`: {inputs}` were passed alongside {input_name} which is not allowed. Make sure to either pass {inputs} or {input_name}=...")}else fe[Se]=L;return{inputs_tensor:fe[Se],model_inputs:fe,model_input_name:Se}}async _prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:L,model_inputs:oe,model_input_name:ge,generation_config:fe}){if(this.sessions.model.inputNames.includes("inputs_embeds")&&!oe.inputs_embeds&&"_prepare_inputs_embeds"in this){const{input_ids:De,pixel_values:Ge,attention_mask:Je,...lt}=oe,yt=await this._prepare_inputs_embeds(oe);oe={...lt,...(0,a.pick)(yt,["inputs_embeds","attention_mask"])}}let{last_hidden_state:Se}=await ie(this,oe);if(fe.guidance_scale!==null&&fe.guidance_scale>1)Se=(0,h.cat)([Se,(0,h.full_like)(Se,0)],0),"attention_mask"in oe&&(oe.attention_mask=(0,h.cat)([oe.attention_mask,(0,h.zeros_like)(oe.attention_mask)],0));else if(oe.decoder_input_ids){const De=Z(oe.decoder_input_ids).dims[0];if(De!==Se.dims[0]){if(Se.dims[0]!==1)throw new Error(`The encoder outputs have a different batch size (${Se.dims[0]}) than the decoder inputs (${De}).`);Se=(0,h.cat)(Array.from({length:De},()=>Se),0)}}return oe.encoder_outputs=Se,oe}_prepare_decoder_input_ids_for_generation({batch_size:L,model_input_name:oe,model_kwargs:ge,decoder_start_token_id:fe,bos_token_id:Se,generation_config:De}){let{decoder_input_ids:Ge,...Je}=ge;if(!(Ge instanceof h.Tensor)){if(Ge)Array.isArray(Ge[0])||(Ge=Array.from({length:L},()=>Ge));else if(fe??(fe=Se),this.config.model_type==="musicgen")Ge=Array.from({length:L*this.config.decoder.num_codebooks},()=>[fe]);else if(Array.isArray(fe)){if(fe.length!==L)throw new Error(`\`decoder_start_token_id\` expcted to have length ${L} but got ${fe.length}`);Ge=fe}else Ge=Array.from({length:L},()=>[fe]);Ge=Z(Ge)}return ge.decoder_attention_mask=(0,h.ones_like)(Ge),{input_ids:Ge,model_inputs:Je}}async generate({inputs:L=null,generation_config:oe=null,logits_processor:ge=null,stopping_criteria:fe=null,streamer:Se=null,...De}){this._validate_model_class(),oe=this._prepare_generation_config(oe,De);let{inputs_tensor:Ge,model_inputs:Je,model_input_name:lt}=this._prepare_model_inputs({inputs:L,model_kwargs:De});const yt=this.config.is_encoder_decoder;yt&&("encoder_outputs"in Je||(Je=await this._prepare_encoder_decoder_kwargs_for_generation({inputs_tensor:Ge,model_inputs:Je,model_input_name:lt,generation_config:oe})));let st;yt?{input_ids:st,model_inputs:Je}=this._prepare_decoder_input_ids_for_generation({batch_size:Je[lt].dims.at(0),model_input_name:lt,model_kwargs:Je,decoder_start_token_id:oe.decoder_start_token_id,bos_token_id:oe.bos_token_id,generation_config:oe}):st=Je[lt];let Et=st.dims.at(-1);oe.max_new_tokens!==null&&(oe.max_length=Et+oe.max_new_tokens);const at=this._get_logits_processor(oe,Et,ge),vt=this._get_stopping_criteria(oe,fe),ct=Je[lt].dims.at(0),xt=A.LogitsSampler.getSampler(oe),Lt=new Array(ct).fill(0),Qt=st.tolist();Se&&Se.put(Qt);let yr,Pt={};for(;;){if(Je=this.prepare_inputs_for_generation(Qt,Je,oe),yr=await this.forward(Je),oe.output_attentions&&oe.return_dict_in_generate){const Cr=this.getAttentions(yr);for(const ks in Cr)ks in Pt||(Pt[ks]=[]),Pt[ks].push(Cr[ks])}const sr=yr.logits.slice(null,-1,null),Wr=at(Qt,sr),dn=[];for(let Cr=0;CrCr))break;Je=this._update_model_kwargs_for_generation({generated_input_ids:dn,outputs:yr,model_inputs:Je,is_encoder_decoder:yt})}Se&&Se.end();const Nt=this.getPastKeyValues(yr,Je.past_key_values,!0),tr=new h.Tensor("int64",Qt.flat(),[Qt.length,Qt[0].length]);if(oe.return_dict_in_generate)return{sequences:tr,past_key_values:Nt,...Pt};for(const sr of Object.values(yr))sr.location==="gpu-buffer"&&sr.dispose();return tr}getPastKeyValues(L,oe,ge=!1){const fe=Object.create(null);for(const Se in L)if(Se.startsWith("present")){const De=Se.replace("present","past_key_values"),Ge=Se.includes("encoder");if(Ge&&oe?fe[De]=oe[De]:fe[De]=L[Se],oe&&(!Ge||ge)){const Je=oe[De];Je.location==="gpu-buffer"&&Je.dispose()}}return fe}getAttentions(L){const oe={};for(const ge of["cross_attentions","encoder_attentions","decoder_attentions"])for(const fe in L)fe.startsWith(ge)&&(ge in oe||(oe[ge]=[]),oe[ge].push(L[fe]));return oe}addPastKeyValues(L,oe){var ge,fe,Se;if(oe)Object.assign(L,oe);else{const De=this.sessions.decoder_model_merged??this.sessions.model,Ge=((ge=De==null?void 0:De.config)==null?void 0:ge.kv_cache_dtype)??"float32",Je=Ge==="float16"?new h.DataTypeMap.float16:[],lt=((Se=(fe=L[this.main_input_name]??L.attention_mask)==null?void 0:fe.dims)==null?void 0:Se[0])??1,yt=(0,s.getKeyValueShapes)(this.config,{batch_size:lt});for(const st in yt)L[st]=new h.Tensor(Ge,Je,yt[st])}}async encode_image({pixel_values:L}){const oe=(await q(this.sessions.vision_encoder,{pixel_values:L})).image_features;return this.config.num_image_tokens||(console.warn(`The number of image tokens was not set in the model configuration. Setting it to the number of features detected by the vision encoder (${oe.dims[1]}).`),this.config.num_image_tokens=oe.dims[1]),oe}async encode_text({input_ids:L}){return(await q(this.sessions.embed_tokens,{input_ids:L})).inputs_embeds}async encode_audio({audio_values:L}){return(await q(this.sessions.audio_encoder,{audio_values:L})).audio_features}}class me{}class Pe extends me{constructor({last_hidden_state:S,hidden_states:L=null,attentions:oe=null}){super(),this.last_hidden_state=S,this.hidden_states=L,this.attentions=oe}}class xe extends j{}class Ae extends xe{}class Ie extends xe{async _call(S){return new wr(await super._call(S))}}class Le extends xe{async _call(S){return new bt(await super._call(S))}}class Ne extends xe{async _call(S){return new pr(await super._call(S))}}class We extends xe{async _call(S){return new Pr(await super._call(S))}}class D extends j{}class ee extends D{}class B extends D{async _call(S){return new wr(await super._call(S))}}class te extends D{async _call(S){return new bt(await super._call(S))}}class de extends D{async _call(S){return new pr(await super._call(S))}}class be extends j{}class ve extends be{}class Re extends j{}class Fe extends Re{}class je extends Re{async _call(S){return new wr(await super._call(S))}}class qe extends Re{async _call(S){return new bt(await super._call(S))}}class Xe extends Re{async _call(S){return new pr(await super._call(S))}}class ut extends Re{async _call(S){return new Pr(await super._call(S))}}class wt extends j{}class nr extends wt{}class jt extends wt{async _call(S){return new wr(await super._call(S))}}class dr extends wt{async _call(S){return new bt(await super._call(S))}}class ds extends wt{async _call(S){return new pr(await super._call(S))}}class Os extends wt{async _call(S){return new Pr(await super._call(S))}}class Dr extends j{}class cs extends Dr{}class Ds extends Dr{async _call(S){return new wr(await super._call(S))}}class jr extends Dr{async _call(S){return new bt(await super._call(S))}}class dt extends Dr{async _call(S){return new pr(await super._call(S))}}class qr extends Dr{async _call(S){return new Pr(await super._call(S))}}class Vr extends j{}class us extends Vr{}class Ts extends Vr{async _call(S){return new wr(await super._call(S))}}class xs extends Vr{async _call(S){return new bt(await super._call(S))}}class Es extends Vr{async _call(S){return new pr(await super._call(S))}}class Ls extends Vr{async _call(S){return new Pr(await super._call(S))}}class mr extends j{}class Be extends mr{}class et extends mr{async _call(S){return new wr(await super._call(S))}}class it extends mr{async _call(S){return new bt(await super._call(S))}}class rr extends mr{async _call(S){return new pr(await super._call(S))}}class zt extends mr{async _call(S){return new Pr(await super._call(S))}}class kr extends j{}class ps extends kr{}class hs extends kr{async _call(S){return new wr(await super._call(S))}}class Er extends kr{async _call(S){return new bt(await super._call(S))}}class ms extends kr{async _call(S){return new pr(await super._call(S))}}class fs extends kr{async _call(S){return new Pr(await super._call(S))}}class Qr extends j{}class Ps extends Qr{}class Qs extends Qr{async _call(S){return new bt(await super._call(S))}}class Xs extends Qr{async _call(S){return new pr(await super._call(S))}}class Js extends Qr{async _call(S){return new Pr(await super._call(S))}}class Ys extends Qr{async _call(S){return new wr(await super._call(S))}}class _s extends j{}class Zs extends _s{}class en extends _s{async _call(S){return new wr(await super._call(S))}}class tn extends _s{async _call(S){return new bt(await super._call(S))}}class Lr extends _s{async _call(S){return new pr(await super._call(S))}}class Cs extends j{}class br extends Cs{}class zs extends Cs{async _call(S){return new wr(await super._call(S))}}class Bs extends Cs{async _call(S){return new bt(await super._call(S))}}class Ir extends Cs{async _call(S){return new Pr(await super._call(S))}}class Xr extends j{}class xn extends Xr{}class zr extends Xr{async _call(S){return new wr(await super._call(S))}}class En extends Xr{async _call(S){return new bt(await super._call(S))}}class Rs extends Xr{async _call(S){return new pr(await super._call(S))}}class Ar extends Xr{async _call(S){return new Pr(await super._call(S))}}class Jr extends j{}class cr extends Jr{}class fr extends Jr{async _call(S){return new wr(await super._call(S))}}class Ns extends Jr{async _call(S){return new bt(await super._call(S))}}class Pn extends Jr{async _call(S){return new Pr(await super._call(S))}}class Ss extends j{}class Cn extends Ss{}class pe extends Ss{async _call(S){return new bt(await super._call(S))}}class F extends Ss{async _call(S){return new Pr(await super._call(S))}}class V extends Ss{async _call(S){return new wr(await super._call(S))}}class Y extends j{constructor(){super(...arguments);re(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class le extends Y{}class ue extends Y{}class Ce extends j{}class Ue extends Ce{}class Qe extends Ce{}class Ke extends j{}class Ze extends Ke{}class ht extends Ke{}class Ct extends j{}class kt extends Ct{}class Wt extends Ct{}class Ot extends Ct{async _call(S){return new bt(await super._call(S))}}class Vt extends j{}class vr extends Vt{}class _r extends Vt{}class Yr extends Vt{async _call(S){return new bt(await super._call(S))}}class Tr extends Vt{}class gs extends j{}class Gt extends gs{}class Zt extends gs{}class gr extends j{}class Zr extends gr{}class ws extends gr{}class Ht extends j{}class ur extends Ht{}class Rt extends Ht{async _call(S){return new wr(await super._call(S))}}class Jt extends Ht{async _call(S){return new bt(await super._call(S))}}class qt extends Ht{async _call(S){return new pr(await super._call(S))}}class er extends Ht{async _call(S){return new Pr(await super._call(S))}}class ir extends j{}class rn extends ir{}class sn extends ir{async _call(S){return new wr(await super._call(S))}}class za extends ir{async _call(S){return new bt(await super._call(S))}}class Wi extends ir{async _call(S){return new pr(await super._call(S))}}class Ba extends ir{async _call(S){return new Pr(await super._call(S))}}class ys extends j{}class Ra extends ys{}class Na extends ys{async _call(S){return new wr(await super._call(S))}}class Sn extends ys{async _call(S){return new bt(await super._call(S))}}class ja extends ys{async _call(S){return new pr(await super._call(S))}}class Gi extends ys{async _call(S){return new Pr(await super._call(S))}}class Ki extends j{}class Va extends Ki{}class Ua extends Ki{}class Gn extends j{constructor(){super(...arguments);re(this,"requires_attention_mask",!1);re(this,"main_input_name","input_features");re(this,"forward_params",["input_features","attention_mask","decoder_input_ids","decoder_attention_mask","past_key_values"])}}class Wa extends Gn{}class Hi extends Gn{_prepare_generation_config(S,L){return super._prepare_generation_config(S,L,y.WhisperGenerationConfig)}_retrieve_init_tokens(S){const L=[S.decoder_start_token_id];let oe=S.language;const ge=S.task;if(S.is_multilingual){oe||(console.warn("No language specified - defaulting to English (en)."),oe="en");const Se=`<|${(0,k.whisper_language_to_code)(oe)}|>`;L.push(S.lang_to_id[Se]),L.push(S.task_to_id[ge??"transcribe"])}else if(oe||ge)throw new 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!S.return_timestamps&&S.no_timestamps_token_id&&L.at(-1)!==S.no_timestamps_token_id?L.push(S.no_timestamps_token_id):S.return_timestamps&&L.at(-1)===S.no_timestamps_token_id&&(console.warn("<|notimestamps|> prompt token is removed from generation_config since `return_timestamps` is set to `true`."),L.pop()),L.filter(fe=>fe!=null)}async generate({inputs:S=null,generation_config:L=null,logits_processor:oe=null,stopping_criteria:ge=null,...fe}){L=this._prepare_generation_config(L,fe);const Se=fe.decoder_input_ids??this._retrieve_init_tokens(L);if(L.return_timestamps&&(oe??(oe=new p.LogitsProcessorList),oe.push(new p.WhisperTimeStampLogitsProcessor(L,Se))),L.begin_suppress_tokens&&(oe??(oe=new p.LogitsProcessorList),oe.push(new p.SuppressTokensAtBeginLogitsProcessor(L.begin_suppress_tokens,Se.length))),L.return_token_timestamps){if(!L.alignment_heads)throw new 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.");L.task==="translate"&&console.warn("Token-level timestamps may not be reliable for task 'translate'."),L.output_attentions=!0,L.return_dict_in_generate=!0}const De=await super.generate({inputs:S,generation_config:L,logits_processor:oe,decoder_input_ids:Se,...fe});return L.return_token_timestamps&&(De.token_timestamps=this._extract_token_timestamps(De,L.alignment_heads,L.num_frames)),De}_extract_token_timestamps(S,L,oe=null,ge=.02){if(!S.cross_attentions)throw new Error("Model outputs must contain cross attentions to extract timestamps. This is most likely because the model was not exported with `output_attentions=True`.");oe==null&&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 fe=this.config.median_filter_width;fe===void 0&&(console.warn("Model config has no `median_filter_width`, using default value of 7."),fe=7);const Se=S.cross_attentions,De=Array.from({length:this.config.decoder_layers},(vt,ct)=>(0,h.cat)(Se.map(xt=>xt[ct]),2)),Ge=(0,h.stack)(L.map(([vt,ct])=>{if(vt>=De.length)throw new Error(`Layer index ${vt} is out of bounds for cross attentions (length ${De.length}).`);return oe?De[vt].slice(null,ct,null,[0,oe]):De[vt].slice(null,ct)})).transpose(1,0,2,3),[Je,lt]=(0,h.std_mean)(Ge,-2,0,!0),yt=Ge.clone();for(let vt=0;vtxt[tr+1]-xt[tr]),yr=(0,a.mergeArrays)([1],Qt).map(Nt=>!!Nt),Pt=[];for(let Nt=0;Ntst.findIndex(Et=>Et==fe)),Ge=De.every(st=>st===-1),Je=De.every(st=>st!==-1);if(!Ge&&!Je)throw new Error("Every input should contain either 0 or 1 image token.");if(Ge)return{inputs_embeds:S,attention_mask:ge};const lt=[],yt=[];for(let st=0;stArray.from({length:S.dims[0]},Qt=>Array.from({length:S.dims[1]},yr=>1))),at=L?L.tolist():[],vt=oe?oe.tolist():[];let ct=0,xt=0;for(let Lt=0;Ltst[Lt][or]==1),Pt=Qt.reduce((Kt,or,cn)=>(or==Ge&&Kt.push(cn),Kt),[]).map(Kt=>Qt[Kt+1]),Nt=Pt.filter(Kt=>Kt==Se).length,tr=Pt.filter(Kt=>Kt==De).length;let sr=[],Wr=0,dn=Nt,Zl=tr;for(let Kt=0;KtMs>Wr&&Dn==Se),cn=Qt.findIndex((Dn,Ms)=>Ms>Wr&&Dn==De),On=dn>0&&or!==-1?or:Qt.length+1,Ci=Zl>0&&cn!==-1?cn:Qt.length+1;let sd,Su,$u,ku;On0?(0,_.max)(sr.at(-1))[0]+1:0;sr.push(Array.from({length:3*Au},(Dn,Ms)=>xb+Ms%Au));const Fu=Au+xb,id=LT*Iu*nd,zT=Array.from({length:id},(Dn,Ms)=>Fu+Math.floor(Ms/(Iu*nd))),BT=Array.from({length:id},(Dn,Ms)=>Fu+Math.floor(Ms/nd)%Iu),RT=Array.from({length:id},(Dn,Ms)=>Fu+Ms%nd);sr.push([zT,BT,RT].flat()),Wr=sd+id}if(Wr0?(0,_.max)(sr.at(-1))[0]+1:0,or=Qt.length-Wr;sr.push(Array.from({length:3*or},(cn,On)=>Kt+On%or))}const Cr=sr.reduce((Kt,or)=>Kt+or.length,0),ks=new Array(Cr);let Cu=0;for(let Kt=0;Kt<3;++Kt)for(let or=0;oryt[ct%yt.length]),at=Array.from({length:st[0]},(vt,ct)=>(0,_.max)(yt.subarray(st[1]*ct,st[1]*(ct+1)))[0]+1n+BigInt(st[1]));return[new h.Tensor("int64",Et,[3,...st]),new h.Tensor("int64",at,[at.length,1])]}else{const[yt,st]=S.dims,Et=BigInt64Array.from({length:3*yt*st},(at,vt)=>BigInt(Math.floor(vt%st/yt)));return[new h.Tensor("int64",Et,[3,...S.dims]),(0,h.zeros)([yt,1])]}}async encode_image({pixel_values:S,image_grid_thw:L}){return(await q(this.sessions.vision_encoder,{pixel_values:S,grid_thw:L})).image_features}_merge_input_ids_with_image_features(S){return N({image_token_id:this.config.image_token_id,...S})}prepare_inputs_for_generation(S,L,oe){if(L.attention_mask&&!L.position_ids)if(!L.past_key_values)[L.position_ids,L.rope_deltas]=this.get_rope_index(L.input_ids,L.image_grid_thw,L.video_grid_thw,L.attention_mask);else{L.pixel_values=null;const ge=BigInt(Object.values(L.past_key_values)[0].dims.at(-2)),fe=L.rope_deltas.map(Se=>ge+Se);L.position_ids=(0,h.stack)([fe,fe,fe],0)}return L}}class _i extends j{}class Lo extends _i{}class zo extends _i{}class gi extends j{}class Bo extends gi{}class Ro extends gi{}class wi extends j{}class No extends wi{}class jo extends wi{}class yi extends j{}class Vo extends yi{}class Uo extends yi{}class Mi extends j{}class Wo extends Mi{}class Go extends Mi{}class bi extends j{}class Ko extends bi{}class Ho extends bi{async _call(S){return new bt(await super._call(S))}}class vi extends j{}class qo extends vi{}class Qo extends vi{async _call(S){return new bt(await super._call(S))}}class Xo extends j{}class Jo extends Xo{}class Yo extends j{}class cl extends Yo{}class ul extends Yo{async _call(S){return new bt(await super._call(S))}}class pl extends j{}class hl extends pl{}class Zo extends j{}class ml extends Zo{}class fl extends Zo{async _call(S){return new bt(await super._call(S))}}class _l extends j{}class gl extends _l{}class ea extends j{}class wl extends ea{}class yl extends ea{async _call(S){return new bt(await super._call(S))}}class Ml extends j{}class bl extends Ml{async _call(S){return new vb(await super._call(S))}}class ta extends j{}class vl extends ta{}class Tl extends ta{async _call(S){return new bt(await super._call(S))}}class ra extends j{}class xl extends ra{}class El extends ra{async _call(S){return new bt(await super._call(S))}}class sa extends j{}class Pl extends sa{}class Cl extends sa{}class na extends j{}class Sl extends na{}class $l extends na{}class ia extends j{}class kl extends ia{}class Il extends ia{async _call(S){return new bt(await super._call(S))}}class Ti extends j{}class Al extends Ti{}class Fl extends Ti{async _call(S){return new aa(await super._call(S))}}class oa extends Ti{async _call(S){return new Ol(await super._call(S))}}class aa extends me{constructor({logits:S,pred_boxes:L}){super(),this.logits=S,this.pred_boxes=L}}class Ol extends me{constructor({logits:S,pred_boxes:L,pred_masks:oe}){super(),this.logits=S,this.pred_boxes=L,this.pred_masks=oe}}class la extends j{}class Dl extends la{}class Ll extends la{async _call(S){return new xi(await super._call(S))}}class xi extends me{constructor({logits:S,pred_boxes:L}){super(),this.logits=S,this.pred_boxes=L}}class da extends j{}class zl extends da{}class Bl extends da{async _call(S){return new Rl(await super._call(S))}}class Rl extends xi{}class ca extends j{}class ua extends ca{}class d extends ca{async _call(S){return new m(await super._call(S))}}class m extends xi{}class T extends j{}class C extends T{}class I extends T{async _call(S){return new W(await super._call(S))}}class W extends aa{}class ne extends j{}class ye extends ne{}class Ee extends ne{async _call(S){return new bt(await super._call(S))}}class ze extends j{}class Ye extends ze{}class ot extends ze{async _call(S){return new bt(await super._call(S))}}class _t extends j{}class Bt extends _t{}class Fr extends _t{async _call(S){return new bt(await super._call(S))}}class $s extends j{}class Xw extends $s{}class Jw extends $s{async _call(S){return new bt(await super._call(S))}}class Yw extends $s{}class eu extends j{}class Zw extends eu{}class ey extends eu{}class tu extends j{}class ty extends tu{}class ry extends tu{}class sy extends j{}class ny extends sy{}class Nl extends j{}class iy extends Nl{}class oy extends Nl{}class ay extends Nl{}class ly extends j{}class dy extends ly{}class cy extends j{}class uy extends cy{}class py extends j{}class hy extends py{}class ru extends j{}class my extends ru{}class fy extends ru{}class su extends j{}class _y extends su{}class gy extends su{}class wy extends j{}class yy extends wy{}class nu extends j{}class My extends nu{}class by extends nu{async _call(S){return new bt(await super._call(S))}}class iu extends j{}class vy extends iu{}class Ty extends iu{async _call(S){return new bt(await super._call(S))}}class ou extends j{}class xy extends ou{}class Ey extends ou{async _call(S){return new bt(await super._call(S))}}class au extends j{}class Py extends au{}class Cy extends au{async _call(S){return new bt(await super._call(S))}}class Sy extends j{}class $y extends Sy{}class lu extends j{}class ky extends lu{}class Iy extends lu{async _call(S){return new Ay(await super._call(S))}}class Ay extends me{constructor({logits:S,pred_boxes:L}){super(),this.logits=S,this.pred_boxes=L}}class Fy extends j{}class Oy extends Fy{async get_image_embeddings({pixel_values:S}){return await ie(this,{pixel_values:S})}async forward(S){if((!S.image_embeddings||!S.image_positional_embeddings)&&(S={...S,...await this.get_image_embeddings(S)}),!S.input_labels&&S.input_points){const oe=S.input_points.dims.slice(0,-1),ge=oe.reduce((fe,Se)=>fe*Se,1);S.input_labels=new h.Tensor("int64",new BigInt64Array(ge).fill(1n),oe)}const L={image_embeddings:S.image_embeddings,image_positional_embeddings:S.image_positional_embeddings};return S.input_points&&(L.input_points=S.input_points),S.input_labels&&(L.input_labels=S.input_labels),S.input_boxes&&(L.input_boxes=S.input_boxes),await q(this.sessions.prompt_encoder_mask_decoder,L)}async _call(S){return new Dy(await super._call(S))}}class Dy extends me{constructor({iou_scores:S,pred_masks:L}){super(),this.iou_scores=S,this.pred_masks=L}}class du extends j{}class Ly extends du{}class zy extends du{}class cu extends j{}class By extends cu{}class Ry extends cu{}class ln extends j{}class Ny extends ln{}class jy extends ln{async _call(S){return new Fn(await super._call(S))}}class Vy extends ln{async _call(S){return new bt(await super._call(S))}}class Uy extends ln{async _call(S){return new pr(await super._call(S))}}class uu extends j{}class Wy extends uu{}class Gy extends uu{async _call(S){return new pr(await super._call(S))}}class Ky extends j{}class Hy extends Ky{}class jl extends j{}class qy extends jl{}class Qy extends jl{async _call(S){return new Fn(await super._call(S))}}class Xy extends jl{async _call(S){return new bt(await super._call(S))}}class pa extends j{}class Jy extends pa{}class Yy extends pa{async _call(S){return new Fn(await super._call(S))}}class Zy extends pa{async _call(S){return new bt(await super._call(S))}}class eM extends pa{async _call(S){return new pr(await super._call(S))}}class Vl extends j{}class tM extends Vl{}class rM extends Vl{async _call(S){return new Fn(await super._call(S))}}class sM extends Vl{async _call(S){return new bt(await super._call(S))}}class bT extends j{}class nM extends ln{}class iM extends ln{async _call(S){return new Fn(await super._call(S))}}class oM extends ln{async _call(S){return new bt(await super._call(S))}}class Ei extends j{}class aM extends Ei{}class lM extends Ei{async _call(S){return new Fn(await super._call(S))}}class dM extends Ei{async _call(S){return new bt(await super._call(S))}}class cM extends Ei{async _call(S){return new bb(await super._call(S))}}class uM extends Ei{async _call(S){return new pr(await super._call(S))}}class pM extends j{}class hM extends pM{}class Ul extends j{}class vT extends Ul{}class mM extends Ul{}class fM extends Ul{async generate_speech(S,L,{threshold:oe=.5,minlenratio:ge=0,maxlenratio:fe=20,vocoder:Se=null}={}){const De={input_ids:S},{encoder_outputs:Ge,encoder_attention_mask:Je}=await ie(this,De),lt=Ge.dims[1]/this.config.reduction_factor,yt=Math.floor(lt*fe),st=Math.floor(lt*ge),Et=this.config.num_mel_bins;let at=[],vt=null,ct=null,xt=0;for(;;){++xt;const yr=H(!!ct);let Pt;ct?Pt=ct.output_sequence_out:Pt=new h.Tensor("float32",new Float32Array(Et),[1,1,Et]);let Nt={use_cache_branch:yr,output_sequence:Pt,encoder_attention_mask:Je,speaker_embeddings:L,encoder_hidden_states:Ge};this.addPastKeyValues(Nt,vt),ct=await q(this.sessions.decoder_model_merged,Nt),vt=this.getPastKeyValues(ct,vt);const{prob:tr,spectrum:sr}=ct;if(at.push(sr),xt>=st&&(Array.from(tr.data).filter(Wr=>Wr>=oe).length>0||xt>=yt))break}const Lt=(0,h.cat)(at),{waveform:Qt}=await q(Se.sessions.model,{spectrogram:Lt});return{spectrogram:Lt,waveform:Qt}}}class _M extends j{constructor(){super(...arguments);re(this,"main_input_name","spectrogram")}}class gM extends j{}class wM extends gM{}class pu extends j{}class yM extends pu{}class MM extends pu{}class hu extends j{}class bM extends hu{}class vM extends hu{}class mu extends j{}class TM extends mu{}class xM extends mu{}class Wl extends j{}class EM extends Wl{}class PM extends Wl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"text_model"})}}class CM extends Wl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"audio_model"})}}class SM extends j{}class fu extends SM{async _call(S){return new Tb(await super._call(S))}}class Gl extends j{}class TT extends Gl{}class $M extends Gl{}class kM extends Gl{}class _u extends j{}class IM extends _u{}class AM extends _u{}class gu extends j{}class FM extends gu{}class OM extends gu{async _call(S){return new bt(await super._call(S))}}class wu extends j{}class xT extends wu{}class ET extends wu{}class yu extends j{constructor(){super(...arguments);re(this,"forward_params",["input_ids","attention_mask","encoder_outputs","decoder_input_ids","decoder_attention_mask","past_key_values"])}_apply_and_filter_by_delay_pattern_mask(L){const[oe,ge]=L.dims,fe=this.config.decoder.num_codebooks,Se=ge-fe;let De=0;for(let lt=0;lt0&&Et<=Se&&(L.data[De++]=L.data[lt])}const Ge=Math.floor(oe/fe),Je=De/(Ge*fe);return new h.Tensor(L.type,L.data.slice(0,De),[Ge,fe,Je])}prepare_inputs_for_generation(L,oe,ge){let fe=structuredClone(L);for(let De=0;De=Ge&&(fe[De][Ge]=BigInt(this.config.decoder.pad_token_id));return ge.guidance_scale!==null&&ge.guidance_scale>1&&(fe=fe.concat(fe)),super.prepare_inputs_for_generation(fe,oe,ge)}async generate(L){const oe=await super.generate(L),ge=this._apply_and_filter_by_delay_pattern_mask(oe).unsqueeze_(0),{audio_values:fe}=await q(this.sessions.encodec_decode,{audio_codes:ge});return fe}}class Kl extends j{}class DM extends Kl{}class LM extends Kl{async _call(S){return new bt(await super._call(S))}}class zM extends Kl{}class Hl extends j{}class BM extends Hl{}class RM extends Hl{async _call(S){return new bt(await super._call(S))}}class NM extends Hl{}class ql extends j{}class jM extends ql{}class VM extends ql{async _call(S){return new bt(await super._call(S))}}class UM extends ql{}class Ql extends j{}class WM extends Ql{}class GM extends Ql{async _call(S){return new bt(await super._call(S))}}class KM extends Ql{}class HM extends j{}class qM extends HM{}class QM extends j{}class XM extends QM{constructor(...L){super(...L);re(this,"forward_params",["input_ids","pixel_values","images_seq_mask","images_emb_mask","attention_mask","position_ids","past_key_values"]);this._generation_mode="text"}async forward(L){const oe=this._generation_mode??"text";let ge;if(oe==="text"||!L.past_key_values){const Je=this.sessions.prepare_inputs_embeds,lt=(0,a.pick)(L,Je.inputNames);ge=await q(Je,lt)}else{const Je=this.sessions.gen_img_embeds,lt=(0,a.pick)({image_ids:L.input_ids},Je.inputNames);ge=await q(Je,lt)}const fe={...L,...ge},Se=await ce(this,fe),De=this.sessions[oe==="text"?"lm_head":"gen_head"];if(!De)throw new Error(`Unable to find "${De}" generation head`);const Ge=await q(De,(0,a.pick)(Se,De.inputNames));return{...ge,...Se,...Ge}}async generate(L){return this._generation_mode="text",super.generate(L)}async generate_images(L){this._generation_mode="image";const oe=(L.inputs??L[this.main_input_name]).dims[1],fe=(await super.generate(L)).slice(null,[oe,null]),Se=this.sessions.image_decode,{decoded_image:De}=await q(Se,{generated_tokens:fe}),Ge=De.add_(1).mul_(255/2).clamp_(0,255).to("uint8"),Je=[];for(const lt of Ge){const yt=g.RawImage.fromTensor(lt);Je.push(yt)}return Je}}class JM extends me{constructor({char_logits:S,bpe_logits:L,wp_logits:oe}){super(),this.char_logits=S,this.bpe_logits=L,this.wp_logits=oe}get logits(){return[this.char_logits,this.bpe_logits,this.wp_logits]}}class YM extends j{}class ZM extends YM{async _call(S){return new JM(await super._call(S))}}class Mu extends j{}class e0 extends Mu{}class t0 extends Mu{}class bu extends j{}class r0 extends bu{}class s0 extends bu{}class n0 extends j{constructor(){super(...arguments);re(this,"forward_params",["input_ids","attention_mask","position_ids","audio_values","past_key_values"])}}class i0 extends n0{_merge_input_ids_with_audio_features(S){const L=S.audio_features.dims.at(-1),oe=S.audio_features.view(-1,L);return O({audio_token_id:this.config.ignore_index,...S,audio_features:oe})}}class Xl extends j{constructor(){super(...arguments);re(this,"main_input_name","input_values");re(this,"forward_params",["input_values"])}}class o0 extends me{constructor({audio_codes:S}){super(),this.audio_codes=S}}class a0 extends me{constructor({audio_values:S}){super(),this.audio_values=S}}class l0 extends Xl{async encode(S){return new o0(await q(this.sessions.encoder_model,S))}async decode(S){return new a0(await q(this.sessions.decoder_model,S))}}class d0 extends Xl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"encoder_model"})}}class c0 extends Xl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"decoder_model"})}}class Jl extends j{constructor(){super(...arguments);re(this,"main_input_name","input_values");re(this,"forward_params",["input_values"])}}class u0 extends me{constructor({audio_codes:S}){super(),this.audio_codes=S}}class p0 extends me{constructor({audio_values:S}){super(),this.audio_values=S}}class h0 extends Jl{async encode(S){return new u0(await q(this.sessions.encoder_model,S))}async decode(S){return new p0(await q(this.sessions.decoder_model,S))}}class m0 extends Jl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"encoder_model"})}}class f0 extends Jl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"decoder_model"})}}class Yl extends j{constructor(){super(...arguments);re(this,"main_input_name","input_values");re(this,"forward_params",["input_values"])}}class _0 extends Yl{async encode(S){return await q(this.sessions.encoder_model,S)}async decode(S){return await q(this.sessions.decoder_model,S)}}class g0 extends Yl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"encoder_model"})}}class w0 extends Yl{static async from_pretrained(S,L={}){return super.from_pretrained(S,{...L,model_file_name:L.model_file_name??"decoder_model"})}}class It{static async from_pretrained(S,{progress_callback:L=null,config:oe=null,cache_dir:ge=null,local_files_only:fe=!1,revision:Se="main",model_file_name:De=null,subfolder:Ge="onnx",device:Je=null,dtype:lt=null,use_external_data_format:yt=null,session_options:st={}}={}){const Et={progress_callback:L,config:oe,cache_dir:ge,local_files_only:fe,revision:Se,model_file_name:De,subfolder:Ge,device:Je,dtype:lt,use_external_data_format:yt,session_options:st};if(Et.config=await s.AutoConfig.from_pretrained(S,Et),!this.MODEL_CLASS_MAPPINGS)throw new Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);const at=Et.config.model_type;for(const vt of this.MODEL_CLASS_MAPPINGS){let ct=vt.get(at);if(!ct){for(const xt of vt.values())if(xt[0]===at){ct=xt;break}if(!ct)continue}return await ct[1].from_pretrained(S,Et)}if(this.BASE_IF_FAIL)return W0.has(at)||console.warn(`Unknown model class "${at}", attempting to construct from base class.`),await j.from_pretrained(S,Et);throw Error(`Unsupported model type: ${at}`)}}re(It,"MODEL_CLASS_MAPPINGS",null),re(It,"BASE_IF_FAIL",!1);const PT=new Map([["bert",["BertModel",Ae]],["modernbert",["ModernBertModel",ee]],["nomic_bert",["NomicBertModel",ve]],["roformer",["RoFormerModel",Fe]],["electra",["ElectraModel",cs]],["esm",["EsmModel",Zs]],["convbert",["ConvBertModel",nr]],["camembert",["CamembertModel",us]],["deberta",["DebertaModel",Be]],["deberta-v2",["DebertaV2Model",ps]],["mpnet",["MPNetModel",xn]],["albert",["AlbertModel",Cn]],["distilbert",["DistilBertModel",Ps]],["roberta",["RobertaModel",ur]],["xlm",["XLMModel",rn]],["xlm-roberta",["XLMRobertaModel",Ra]],["clap",["ClapModel",EM]],["clip",["CLIPModel",eo]],["clipseg",["CLIPSegModel",on]],["chinese_clip",["ChineseCLIPModel",sl]],["siglip",["SiglipModel",Za]],["jina_clip",["JinaCLIPModel",nl]],["mobilebert",["MobileBertModel",br]],["squeezebert",["SqueezeBertModel",cr]],["wav2vec2",["Wav2Vec2Model",Ny]],["wav2vec2-bert",["Wav2Vec2BertModel",tM]],["unispeech",["UniSpeechModel",qy]],["unispeech-sat",["UniSpeechSatModel",Jy]],["hubert",["HubertModel",nM]],["wavlm",["WavLMModel",aM]],["audio-spectrogram-transformer",["ASTModel",Va]],["vits",["VitsModel",fu]],["pyannote",["PyAnnoteModel",Wy]],["wespeaker-resnet",["WeSpeakerResNetModel",Hy]],["detr",["DetrModel",Al]],["rt_detr",["RTDetrModel",Dl]],["rt_detr_v2",["RTDetrV2Model",zl]],["rf_detr",["RFDetrModel",ua]],["table-transformer",["TableTransformerModel",C]],["vit",["ViTModel",Ko]],["ijepa",["IJepaModel",qo]],["pvt",["PvtModel",cl]],["vit_msn",["ViTMSNModel",ml]],["vit_mae",["ViTMAEModel",hl]],["groupvit",["GroupViTModel",gl]],["fastvit",["FastViTModel",wl]],["mobilevit",["MobileViTModel",vl]],["mobilevitv2",["MobileViTV2Model",xl]],["owlvit",["OwlViTModel",Pl]],["owlv2",["Owlv2Model",Sl]],["beit",["BeitModel",kl]],["deit",["DeiTModel",ye]],["hiera",["HieraModel",Ye]],["convnext",["ConvNextModel",My]],["convnextv2",["ConvNextV2Model",vy]],["dinov2",["Dinov2Model",xy]],["dinov2_with_registers",["Dinov2WithRegistersModel",Py]],["resnet",["ResNetModel",Bt]],["swin",["SwinModel",Xw]],["swin2sr",["Swin2SRModel",Zw]],["donut-swin",["DonutSwinModel",yy]],["yolos",["YolosModel",ky]],["dpt",["DPTModel",ty]],["glpn",["GLPNModel",_y]],["hifigan",["SpeechT5HifiGan",_M]],["efficientnet",["EfficientNetModel",FM]],["decision_transformer",["DecisionTransformerModel",qM]],["patchtst",["PatchTSTForPrediction",e0]],["patchtsmixer",["PatchTSMixerForPrediction",r0]],["mobilenet_v1",["MobileNetV1Model",DM]],["mobilenet_v2",["MobileNetV2Model",BM]],["mobilenet_v3",["MobileNetV3Model",jM]],["mobilenet_v4",["MobileNetV4Model",WM]],["maskformer",["MaskFormerModel",my]],["mgp-str",["MgpstrForSceneTextRecognition",ZM]],["style_text_to_speech_2",["StyleTextToSpeech2Model",hM]]]),CT=new Map([["t5",["T5Model",le]],["longt5",["LongT5Model",Ue]],["mt5",["MT5Model",Ze]],["bart",["BartModel",kt]],["mbart",["MBartModel",vr]],["marian",["MarianModel",Ly]],["whisper",["WhisperModel",Wa]],["m2m_100",["M2M100Model",By]],["blenderbot",["BlenderbotModel",Gt]],["blenderbot-small",["BlenderbotSmallModel",Zr]]]),ST=new Map([["mimi",["MimiModel",l0]],["dac",["DacModel",h0]],["snac",["SnacModel",_0]]]),$T=new Map([["bloom",["BloomModel",No]],["jais",["JAISModel",so]],["gpt2",["GPT2Model",al]],["gptj",["GPTJModel",co]],["gpt_bigcode",["GPTBigCodeModel",dl]],["gpt_neo",["GPTNeoModel",io]],["gpt_neox",["GPTNeoXModel",ll]],["codegen",["CodeGenModel",In]],["llama",["LlamaModel",ri]],["exaone",["ExaoneModel",fo]],["olmo",["OlmoModel",go]],["olmo2",["Olmo2Model",yo]],["mobilellm",["MobileLLMModel",ft]],["granite",["GraniteModel",Mo]],["cohere",["CohereModel",vo]],["gemma",["GemmaModel",xo]],["gemma2",["Gemma2Model",Po]],["gemma3_text",["Gemma3Model",So]],["helium",["HeliumModel",ho]],["glm",["GlmModel",mo]],["openelm",["OpenELMModel",ko]],["qwen2",["Qwen2Model",Ao]],["phi",["PhiModel",Lo]],["phi3",["Phi3Model",Bo]],["mpt",["MptModel",Vo]],["opt",["OPTModel",Wo]],["mistral",["MistralModel",yM]],["starcoder2",["Starcoder2Model",bM]],["falcon",["FalconModel",TM]],["stablelm",["StableLmModel",IM]]]),vu=new Map([["speecht5",["SpeechT5ForSpeechToText",mM]],["whisper",["WhisperForConditionalGeneration",Hi]],["lite-whisper",["LiteWhisperForConditionalGeneration",Ga]],["moonshine",["MoonshineForConditionalGeneration",Ka]]]),y0=new Map([["speecht5",["SpeechT5ForTextToSpeech",fM]]]),M0=new Map([["vits",["VitsModel",fu]],["musicgen",["MusicgenForConditionalGeneration",yu]]]),b0=new Map([["bert",["BertForSequenceClassification",Le]],["modernbert",["ModernBertForSequenceClassification",te]],["roformer",["RoFormerForSequenceClassification",qe]],["electra",["ElectraForSequenceClassification",jr]],["esm",["EsmForSequenceClassification",tn]],["convbert",["ConvBertForSequenceClassification",dr]],["camembert",["CamembertForSequenceClassification",xs]],["deberta",["DebertaForSequenceClassification",it]],["deberta-v2",["DebertaV2ForSequenceClassification",Er]],["mpnet",["MPNetForSequenceClassification",En]],["albert",["AlbertForSequenceClassification",pe]],["distilbert",["DistilBertForSequenceClassification",Qs]],["roberta",["RobertaForSequenceClassification",Jt]],["xlm",["XLMForSequenceClassification",za]],["xlm-roberta",["XLMRobertaForSequenceClassification",Sn]],["bart",["BartForSequenceClassification",Ot]],["mbart",["MBartForSequenceClassification",Yr]],["mobilebert",["MobileBertForSequenceClassification",Bs]],["squeezebert",["SqueezeBertForSequenceClassification",Ns]]]),v0=new Map([["bert",["BertForTokenClassification",Ne]],["modernbert",["ModernBertForTokenClassification",de]],["roformer",["RoFormerForTokenClassification",Xe]],["electra",["ElectraForTokenClassification",dt]],["esm",["EsmForTokenClassification",Lr]],["convbert",["ConvBertForTokenClassification",ds]],["camembert",["CamembertForTokenClassification",Es]],["deberta",["DebertaForTokenClassification",rr]],["deberta-v2",["DebertaV2ForTokenClassification",ms]],["mpnet",["MPNetForTokenClassification",Rs]],["distilbert",["DistilBertForTokenClassification",Xs]],["roberta",["RobertaForTokenClassification",qt]],["xlm",["XLMForTokenClassification",Wi]],["xlm-roberta",["XLMRobertaForTokenClassification",ja]]]),Tu=new Map([["t5",["T5ForConditionalGeneration",ue]],["longt5",["LongT5ForConditionalGeneration",Qe]],["mt5",["MT5ForConditionalGeneration",ht]],["bart",["BartForConditionalGeneration",Wt]],["mbart",["MBartForConditionalGeneration",_r]],["marian",["MarianMTModel",zy]],["m2m_100",["M2M100ForConditionalGeneration",Ry]],["blenderbot",["BlenderbotForConditionalGeneration",Zt]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",ws]]]),xu=new Map([["bloom",["BloomForCausalLM",jo]],["gpt2",["GPT2LMHeadModel",Yn]],["jais",["JAISLMHeadModel",no]],["gptj",["GPTJForCausalLM",kn]],["gpt_bigcode",["GPTBigCodeForCausalLM",uo]],["gpt_neo",["GPTNeoForCausalLM",oo]],["gpt_neox",["GPTNeoXForCausalLM",ao]],["codegen",["CodeGenForCausalLM",Ur]],["llama",["LlamaForCausalLM",po]],["exaone",["ExaoneForCausalLM",mt]],["olmo",["OlmoForCausalLM",wo]],["olmo2",["Olmo2ForCausalLM",li]],["mobilellm",["MobileLLMForCausalLM",_o]],["granite",["GraniteForCausalLM",bo]],["cohere",["CohereForCausalLM",To]],["gemma",["GemmaForCausalLM",Eo]],["gemma2",["Gemma2ForCausalLM",Co]],["gemma3_text",["Gemma3ForCausalLM",$o]],["helium",["HeliumForCausalLM",ni]],["glm",["GlmForCausalLM",gt]],["openelm",["OpenELMForCausalLM",Io]],["qwen2",["Qwen2ForCausalLM",Fo]],["phi",["PhiForCausalLM",zo]],["phi3",["Phi3ForCausalLM",Ro]],["mpt",["MptForCausalLM",Uo]],["opt",["OPTForCausalLM",Go]],["mbart",["MBartForCausalLM",Tr]],["mistral",["MistralForCausalLM",MM]],["starcoder2",["Starcoder2ForCausalLM",vM]],["falcon",["FalconForCausalLM",xM]],["trocr",["TrOCRForCausalLM",wM]],["stablelm",["StableLmForCausalLM",AM]],["phi3_v",["Phi3VForCausalLM",js]]]),kT=new Map([["multi_modality",["MultiModalityCausalLM",XM]]]),T0=new Map([["bert",["BertForMaskedLM",Ie]],["modernbert",["ModernBertForMaskedLM",B]],["roformer",["RoFormerForMaskedLM",je]],["electra",["ElectraForMaskedLM",Ds]],["esm",["EsmForMaskedLM",en]],["convbert",["ConvBertForMaskedLM",jt]],["camembert",["CamembertForMaskedLM",Ts]],["deberta",["DebertaForMaskedLM",et]],["deberta-v2",["DebertaV2ForMaskedLM",hs]],["mpnet",["MPNetForMaskedLM",zr]],["albert",["AlbertForMaskedLM",V]],["distilbert",["DistilBertForMaskedLM",Ys]],["roberta",["RobertaForMaskedLM",Rt]],["xlm",["XLMWithLMHeadModel",sn]],["xlm-roberta",["XLMRobertaForMaskedLM",Na]],["mobilebert",["MobileBertForMaskedLM",zs]],["squeezebert",["SqueezeBertForMaskedLM",fr]]]),x0=new Map([["bert",["BertForQuestionAnswering",We]],["roformer",["RoFormerForQuestionAnswering",ut]],["electra",["ElectraForQuestionAnswering",qr]],["convbert",["ConvBertForQuestionAnswering",Os]],["camembert",["CamembertForQuestionAnswering",Ls]],["deberta",["DebertaForQuestionAnswering",zt]],["deberta-v2",["DebertaV2ForQuestionAnswering",fs]],["mpnet",["MPNetForQuestionAnswering",Ar]],["albert",["AlbertForQuestionAnswering",F]],["distilbert",["DistilBertForQuestionAnswering",Js]],["roberta",["RobertaForQuestionAnswering",er]],["xlm",["XLMForQuestionAnswering",Ba]],["xlm-roberta",["XLMRobertaForQuestionAnswering",Gi]],["mobilebert",["MobileBertForQuestionAnswering",Ir]],["squeezebert",["SqueezeBertForQuestionAnswering",Pn]]]),Eu=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",Qi]],["idefics3",["Idefics3ForConditionalGeneration",Hn]],["smolvlm",["SmolVLMForConditionalGeneration",qn]]]),E0=new Map([["llava",["LlavaForConditionalGeneration",Kn]],["llava_onevision",["LlavaOnevisionForConditionalGeneration",qa]],["moondream1",["Moondream1ForConditionalGeneration",Qa]],["florence2",["Florence2ForConditionalGeneration",Xi]],["qwen2-vl",["Qwen2VLForConditionalGeneration",Do]],["idefics3",["Idefics3ForConditionalGeneration",Hn]],["smolvlm",["SmolVLMForConditionalGeneration",qn]],["paligemma",["PaliGemmaForConditionalGeneration",Yi]]]),P0=new Map([["ultravox",["UltravoxModel",i0]]]),IT=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",Qi]]]),C0=new Map([["vit",["ViTForImageClassification",Ho]],["ijepa",["IJepaForImageClassification",Qo]],["pvt",["PvtForImageClassification",ul]],["vit_msn",["ViTMSNForImageClassification",fl]],["fastvit",["FastViTForImageClassification",yl]],["mobilevit",["MobileViTForImageClassification",Tl]],["mobilevitv2",["MobileViTV2ForImageClassification",El]],["beit",["BeitForImageClassification",Il]],["deit",["DeiTForImageClassification",Ee]],["hiera",["HieraForImageClassification",ot]],["convnext",["ConvNextForImageClassification",by]],["convnextv2",["ConvNextV2ForImageClassification",Ty]],["dinov2",["Dinov2ForImageClassification",Ey]],["dinov2_with_registers",["Dinov2WithRegistersForImageClassification",Cy]],["resnet",["ResNetForImageClassification",Fr]],["swin",["SwinForImageClassification",Jw]],["segformer",["SegformerForImageClassification",$M]],["efficientnet",["EfficientNetForImageClassification",OM]],["mobilenet_v1",["MobileNetV1ForImageClassification",LM]],["mobilenet_v2",["MobileNetV2ForImageClassification",RM]],["mobilenet_v3",["MobileNetV3ForImageClassification",VM]],["mobilenet_v4",["MobileNetV4ForImageClassification",GM]]]),S0=new Map([["detr",["DetrForObjectDetection",Fl]],["rt_detr",["RTDetrForObjectDetection",Ll]],["rt_detr_v2",["RTDetrV2ForObjectDetection",Bl]],["rf_detr",["RFDetrForObjectDetection",d]],["table-transformer",["TableTransformerForObjectDetection",I]],["yolos",["YolosForObjectDetection",Iy]]]),$0=new Map([["owlvit",["OwlViTForObjectDetection",Cl]],["owlv2",["Owlv2ForObjectDetection",$l]],["grounding-dino",["GroundingDinoForObjectDetection",$y]]]),Pi=new Map([["detr",["DetrForSegmentation",oa]],["clipseg",["CLIPSegForImageSegmentation",to]]]),k0=new Map([["segformer",["SegformerForSemanticSegmentation",kM]],["sapiens",["SapiensForSemanticSegmentation",iy]],["swin",["SwinForSemanticSegmentation",Yw]],["mobilenet_v1",["MobileNetV1ForSemanticSegmentation",zM]],["mobilenet_v2",["MobileNetV2ForSemanticSegmentation",NM]],["mobilenet_v3",["MobileNetV3ForSemanticSegmentation",UM]],["mobilenet_v4",["MobileNetV4ForSemanticSegmentation",KM]]]),I0=new Map([["detr",["DetrForSegmentation",oa]],["maskformer",["MaskFormerForInstanceSegmentation",fy]]]),A0=new Map([["sam",["SamModel",Oy]]]),F0=new Map([["wav2vec2",["Wav2Vec2ForCTC",jy]],["wav2vec2-bert",["Wav2Vec2BertForCTC",rM]],["unispeech",["UniSpeechForCTC",Qy]],["unispeech-sat",["UniSpeechSatForCTC",Yy]],["wavlm",["WavLMForCTC",lM]],["hubert",["HubertForCTC",iM]]]),O0=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",Vy]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",sM]],["unispeech",["UniSpeechForSequenceClassification",Xy]],["unispeech-sat",["UniSpeechSatForSequenceClassification",Zy]],["wavlm",["WavLMForSequenceClassification",dM]],["hubert",["HubertForSequenceClassification",oM]],["audio-spectrogram-transformer",["ASTForAudioClassification",Ua]]]),D0=new Map([["wavlm",["WavLMForXVector",cM]]]),L0=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",eM]],["wavlm",["WavLMForAudioFrameClassification",uM]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",Uy]],["pyannote",["PyAnnoteForAudioFrameClassification",Gy]]]),z0=new Map([["vitmatte",["VitMatteForImageMatting",bl]]]),AT=new Map([["patchtst",["PatchTSTForPrediction",t0]],["patchtsmixer",["PatchTSMixerForPrediction",s0]]]),B0=new Map([["swin2sr",["Swin2SRForImageSuperResolution",ey]]]),R0=new Map([["dpt",["DPTForDepthEstimation",ry]],["depth_anything",["DepthAnythingForDepthEstimation",ny]],["glpn",["GLPNForDepthEstimation",gy]],["sapiens",["SapiensForDepthEstimation",oy]],["depth_pro",["DepthProForDepthEstimation",dy]],["metric3d",["Metric3DForDepthEstimation",uy]],["metric3dv2",["Metric3Dv2ForDepthEstimation",hy]]]),N0=new Map([["sapiens",["SapiensForNormalEstimation",ay]]]),j0=new Map([["vitpose",["VitPoseForPoseEstimation",Jo]]]),V0=new Map([["clip",["CLIPVisionModelWithProjection",Qn]],["siglip",["SiglipVisionModel",tl]],["jina_clip",["JinaCLIPVisionModel",ol]]]),U0=[[PT,E.EncoderOnly],[CT,E.EncoderDecoder],[$T,E.DecoderOnly],[ST,E.AutoEncoder],[b0,E.EncoderOnly],[v0,E.EncoderOnly],[Tu,E.Seq2Seq],[vu,E.Seq2Seq],[xu,E.DecoderOnly],[kT,E.MultiModality],[T0,E.EncoderOnly],[x0,E.EncoderOnly],[Eu,E.Vision2Seq],[E0,E.ImageTextToText],[P0,E.AudioTextToText],[C0,E.EncoderOnly],[Pi,E.EncoderOnly],[I0,E.EncoderOnly],[k0,E.EncoderOnly],[z0,E.EncoderOnly],[AT,E.EncoderOnly],[B0,E.EncoderOnly],[R0,E.EncoderOnly],[N0,E.EncoderOnly],[j0,E.EncoderOnly],[S0,E.EncoderOnly],[$0,E.EncoderOnly],[A0,E.MaskGeneration],[F0,E.EncoderOnly],[O0,E.EncoderOnly],[y0,E.Seq2Seq],[M0,E.EncoderOnly],[D0,E.EncoderOnly],[L0,E.EncoderOnly],[V0,E.EncoderOnly]];for(const[b,S]of U0)for(const[L,oe]of b.values())M.set(L,S),x.set(oe,L),w.set(L,oe);const FT=[["MusicgenForConditionalGeneration",yu,E.Musicgen],["Phi3VForCausalLM",js,E.Phi3V],["CLIPTextModelWithProjection",Ya,E.EncoderOnly],["SiglipTextModel",el,E.EncoderOnly],["JinaCLIPTextModel",il,E.EncoderOnly],["ClapTextModelWithProjection",PM,E.EncoderOnly],["ClapAudioModelWithProjection",CM,E.EncoderOnly],["DacEncoderModel",m0,E.EncoderOnly],["DacDecoderModel",f0,E.EncoderOnly],["MimiEncoderModel",d0,E.EncoderOnly],["MimiDecoderModel",c0,E.EncoderOnly],["SnacEncoderModel",g0,E.EncoderOnly],["SnacDecoderModel",w0,E.EncoderOnly]];for(const[b,S,L]of FT)M.set(b,L),x.set(S,b),w.set(b,S);const W0=new Map([["modnet",Pi],["birefnet",Pi],["isnet",Pi],["ben",Pi]]);for(const[b,S]of W0.entries())S.set(b,["PreTrainedModel",j]),M.set(b,E.EncoderOnly),x.set(j,b),w.set(b,j);class Pu extends It{}re(Pu,"MODEL_CLASS_MAPPINGS",U0.map(S=>S[0])),re(Pu,"BASE_IF_FAIL",!0);class G0 extends It{}re(G0,"MODEL_CLASS_MAPPINGS",[b0]);class K0 extends It{}re(K0,"MODEL_CLASS_MAPPINGS",[v0]);class H0 extends It{}re(H0,"MODEL_CLASS_MAPPINGS",[Tu]);class q0 extends It{}re(q0,"MODEL_CLASS_MAPPINGS",[vu]);class Q0 extends It{}re(Q0,"MODEL_CLASS_MAPPINGS",[y0]);class X0 extends It{}re(X0,"MODEL_CLASS_MAPPINGS",[M0]);class J0 extends It{}re(J0,"MODEL_CLASS_MAPPINGS",[xu]);class Y0 extends It{}re(Y0,"MODEL_CLASS_MAPPINGS",[T0]);class Z0 extends It{}re(Z0,"MODEL_CLASS_MAPPINGS",[x0]);class eb extends It{}re(eb,"MODEL_CLASS_MAPPINGS",[Eu]);class tb extends It{}re(tb,"MODEL_CLASS_MAPPINGS",[C0]);class rb extends It{}re(rb,"MODEL_CLASS_MAPPINGS",[Pi]);class sb extends It{}re(sb,"MODEL_CLASS_MAPPINGS",[k0]);class nb extends It{}re(nb,"MODEL_CLASS_MAPPINGS",[I0]);class ib extends It{}re(ib,"MODEL_CLASS_MAPPINGS",[S0]);class ob extends It{}re(ob,"MODEL_CLASS_MAPPINGS",[$0]);class ab extends It{}re(ab,"MODEL_CLASS_MAPPINGS",[A0]);class lb extends It{}re(lb,"MODEL_CLASS_MAPPINGS",[F0]);class db extends It{}re(db,"MODEL_CLASS_MAPPINGS",[O0]);class cb extends It{}re(cb,"MODEL_CLASS_MAPPINGS",[D0]);class ub extends It{}re(ub,"MODEL_CLASS_MAPPINGS",[L0]);class pb extends It{}re(pb,"MODEL_CLASS_MAPPINGS",[IT]);class hb extends It{}re(hb,"MODEL_CLASS_MAPPINGS",[z0]);class mb extends It{}re(mb,"MODEL_CLASS_MAPPINGS",[B0]);class fb extends It{}re(fb,"MODEL_CLASS_MAPPINGS",[R0]);class _b extends It{}re(_b,"MODEL_CLASS_MAPPINGS",[N0]);class gb extends It{}re(gb,"MODEL_CLASS_MAPPINGS",[j0]);class wb extends It{}re(wb,"MODEL_CLASS_MAPPINGS",[V0]);class yb extends It{}re(yb,"MODEL_CLASS_MAPPINGS",[E0]);class Mb extends It{}re(Mb,"MODEL_CLASS_MAPPINGS",[P0]);class OT extends me{constructor({logits:S,past_key_values:L,encoder_outputs:oe,decoder_attentions:ge=null,cross_attentions:fe=null}){super(),this.logits=S,this.past_key_values=L,this.encoder_outputs=oe,this.decoder_attentions=ge,this.cross_attentions=fe}}class bt extends me{constructor({logits:S,...L}){super(),this.logits=S;const oe=Object.values(L);oe.length>0&&(this.attentions=oe)}}class bb extends me{constructor({logits:S,embeddings:L}){super(),this.logits=S,this.embeddings=L}}class pr extends me{constructor({logits:S}){super(),this.logits=S}}class wr extends me{constructor({logits:S}){super(),this.logits=S}}class Pr extends me{constructor({start_logits:S,end_logits:L}){super(),this.start_logits=S,this.end_logits=L}}class Fn extends me{constructor({logits:S}){super(),this.logits=S}}class DT extends me{constructor({logits:S,past_key_values:L}){super(),this.logits=S,this.past_key_values=L}}class vb extends me{constructor({alphas:S}){super(),this.alphas=S}}class Tb extends me{constructor({waveform:S,spectrogram:L}){super(),this.waveform=S,this.spectrogram=L}}},"./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js":(e,r,t)=>{t.r(r),t.d(r,{ASTFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var i=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a);const l=this.config.sampling_rate,c=(0,i.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(l/2),l,null,"kaldi",!0);for(let p=0;p{t.r(r),t.d(r,{AutoFeatureExtractor:()=>o});var s=t("./src/utils/constants.js"),i=t("./src/utils/hub.js");t("./src/base/feature_extraction_utils.js");var n=t("./src/models/feature_extractors.js");class o{static async from_pretrained(l,c={}){const p=await(0,i.getModelJSON)(l,s.FEATURE_EXTRACTOR_NAME,!0,c),u=p.feature_extractor_type,h=n[u];if(!h)throw new Error(`Unknown feature_extractor_type: '${u}'. Please report this at ${s.GITHUB_ISSUE_URL}.`);return new h(p)}}},"./src/models/auto/image_processing_auto.js":(e,r,t)=>{t.r(r),t.d(r,{AutoImageProcessor:()=>a});var s=t("./src/utils/constants.js"),i=t("./src/utils/hub.js"),n=t("./src/base/image_processors_utils.js"),o=t("./src/models/image_processors.js");class a{static async from_pretrained(c,p={}){const u=await(0,i.getModelJSON)(c,s.IMAGE_PROCESSOR_NAME,!0,p),h=u.image_processor_type??u.feature_extractor_type;let g=o[h];return g||(h!==void 0&&console.warn(`Image processor type '${h}' not found, assuming base ImageProcessor. Please report this at ${s.GITHUB_ISSUE_URL}.`),g=n.ImageProcessor),new g(u)}}},"./src/models/auto/processing_auto.js":(e,r,t)=>{t.r(r),t.d(r,{AutoProcessor:()=>c});var s=t("./src/utils/constants.js"),i=t("./src/utils/hub.js"),n=t("./src/base/processing_utils.js"),o=t("./src/models/processors.js"),a=t("./src/models/image_processors.js"),l=t("./src/models/feature_extractors.js");class c{static async from_pretrained(u,h={}){const g=await(0,i.getModelJSON)(u,s.IMAGE_PROCESSOR_NAME,!0,h),{image_processor_type:_,feature_extractor_type:P,processor_class:A}=g;if(A&&o[A])return o[A].from_pretrained(u,h);if(!_&&!P)throw new Error("No `image_processor_type` or `feature_extractor_type` found in the config.");const v={};if(_){const k=a[_];if(!k)throw new Error(`Unknown image_processor_type: '${_}'.`);v.image_processor=new k(g)}if(P){const k=a[P];if(k)v.image_processor=new k(g);else{const E=l[P];if(!E)throw new Error(`Unknown feature_extractor_type: '${P}'.`);v.feature_extractor=new E(g)}}const y={};return new n.Processor(y,v)}}},"./src/models/beit/image_processing_beit.js":(e,r,t)=>{t.r(r),t.d(r,{BeitFeatureExtractor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/bit/image_processing_bit.js":(e,r,t)=>{t.r(r),t.d(r,{BitImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/chinese_clip/image_processing_chinese_clip.js":(e,r,t)=>{t.r(r),t.d(r,{ChineseCLIPFeatureExtractor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/clap/feature_extraction_clap.js":(e,r,t)=>{t.r(r),t.d(r,{ClapFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var i=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a),this.mel_filters=(0,i.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,null,"htk"),this.mel_filters_slaney=(0,i.mel_filter_bank)(this.config.nb_frequency_bins,this.config.feature_size,this.config.frequency_min,this.config.frequency_max,this.config.sampling_rate,"slaney","slaney"),this.window=(0,i.window_function)(this.config.fft_window_size,"hann")}async _get_input_mel(a,l,c,p){let u;const h=a.length-l;if(h>0)if(c==="rand_trunc"){const g=Math.floor(Math.random()*(h+1));a=a.subarray(g,g+l),u=await this._extract_fbank_features(a,this.mel_filters_slaney,this.config.nb_max_samples)}else throw new Error(`Truncation strategy "${c}" not implemented`);else{if(h<0){let g=new Float64Array(l);if(g.set(a),p==="repeat")for(let _=a.length;_{t.r(r),t.d(r,{CLIPFeatureExtractor:()=>n,CLIPImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/convnext/image_processing_convnext.js":(e,r,t)=>{t.r(r),t.d(r,{ConvNextFeatureExtractor:()=>n,ConvNextImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{constructor(a){super(a),this.crop_pct=this.config.crop_pct??224/256}async resize(a){var c;const l=(c=this.size)==null?void 0:c.shortest_edge;if(l===void 0)throw new Error("Size dictionary must contain 'shortest_edge' key.");if(l<384){const p=Math.floor(l/this.crop_pct),[u,h]=this.get_resize_output_image_size(a,{shortest_edge:p});a=await a.resize(u,h,{resample:this.resample}),a=await a.center_crop(l,l)}else a=await a.resize(l,l,{resample:this.resample});return a}}class n extends i{}},"./src/models/dac/feature_extraction_dac.js":(e,r,t)=>{t.r(r),t.d(r,{DacFeatureExtractor:()=>i});var s=t("./src/models/encodec/feature_extraction_encodec.js");class i extends s.EncodecFeatureExtractor{}},"./src/models/deit/image_processing_deit.js":(e,r,t)=>{t.r(r),t.d(r,{DeiTFeatureExtractor:()=>n,DeiTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/detr/image_processing_detr.js":(e,r,t)=>{t.r(r),t.d(r,{DetrFeatureExtractor:()=>o,DetrImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(l){const c=await super._call(l),p=[c.pixel_values.dims[0],64,64],u=(0,i.full)(p,1n);return{...c,pixel_mask:u}}post_process_object_detection(...l){return(0,s.post_process_object_detection)(...l)}post_process_panoptic_segmentation(...l){return(0,s.post_process_panoptic_segmentation)(...l)}post_process_instance_segmentation(...l){return(0,s.post_process_instance_segmentation)(...l)}}class o extends n{}},"./src/models/donut/image_processing_donut.js":(e,r,t)=>{t.r(r),t.d(r,{DonutFeatureExtractor:()=>n,DonutImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{pad_image(a,l,c,p={}){const[u,h,g]=l;let _=this.image_mean;Array.isArray(this.image_mean)||(_=new Array(g).fill(_));let P=this.image_std;Array.isArray(P)||(P=new Array(g).fill(_));const A=_.map((v,y)=>-v/P[y]);return super.pad_image(a,l,c,{center:!0,constant_values:A,...p})}}class n extends i{}},"./src/models/dpt/image_processing_dpt.js":(e,r,t)=>{t.r(r),t.d(r,{DPTFeatureExtractor:()=>n,DPTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/efficientnet/image_processing_efficientnet.js":(e,r,t)=>{t.r(r),t.d(r,{EfficientNetImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{constructor(o){super(o),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(a=>a*a))}}},"./src/models/encodec/feature_extraction_encodec.js":(e,r,t)=>{t.r(r),t.d(r,{EncodecFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{async _call(a){(0,s.validate_audio_inputs)(a,"EncodecFeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));const l=this.config.feature_size;if(a.length%l!==0)throw new Error(`The length of the audio data must be a multiple of the number of channels (${l}).`);const c=[1,l,a.length/l];return{input_values:new i.Tensor("float32",a,c)}}}},"./src/models/feature_extractors.js":(e,r,t)=>{t.r(r),t.d(r,{ASTFeatureExtractor:()=>s.ASTFeatureExtractor,ClapFeatureExtractor:()=>n.ClapFeatureExtractor,DacFeatureExtractor:()=>o.DacFeatureExtractor,EncodecFeatureExtractor:()=>i.EncodecFeatureExtractor,ImageFeatureExtractor:()=>P.ImageProcessor,MoonshineFeatureExtractor:()=>a.MoonshineFeatureExtractor,PyAnnoteFeatureExtractor:()=>l.PyAnnoteFeatureExtractor,SeamlessM4TFeatureExtractor:()=>c.SeamlessM4TFeatureExtractor,SnacFeatureExtractor:()=>p.SnacFeatureExtractor,SpeechT5FeatureExtractor:()=>u.SpeechT5FeatureExtractor,Wav2Vec2FeatureExtractor:()=>h.Wav2Vec2FeatureExtractor,WeSpeakerFeatureExtractor:()=>g.WeSpeakerFeatureExtractor,WhisperFeatureExtractor:()=>_.WhisperFeatureExtractor});var s=t("./src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js"),i=t("./src/models/encodec/feature_extraction_encodec.js"),n=t("./src/models/clap/feature_extraction_clap.js"),o=t("./src/models/dac/feature_extraction_dac.js"),a=t("./src/models/moonshine/feature_extraction_moonshine.js"),l=t("./src/models/pyannote/feature_extraction_pyannote.js"),c=t("./src/models/seamless_m4t/feature_extraction_seamless_m4t.js"),p=t("./src/models/snac/feature_extraction_snac.js"),u=t("./src/models/speecht5/feature_extraction_speecht5.js"),h=t("./src/models/wav2vec2/feature_extraction_wav2vec2.js"),g=t("./src/models/wespeaker/feature_extraction_wespeaker.js"),_=t("./src/models/whisper/feature_extraction_whisper.js"),P=t("./src/base/image_processors_utils.js")},"./src/models/florence2/processing_florence2.js":(e,r,t)=>{t.r(r),t.d(r,{Florence2Processor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class o extends s.Processor{constructor(l,c){super(l,c);const{tasks_answer_post_processing_type:p,task_prompts_without_inputs:u,task_prompts_with_input:h}=this.image_processor.config;this.tasks_answer_post_processing_type=new Map(Object.entries(p??{})),this.task_prompts_without_inputs=new Map(Object.entries(u??{})),this.task_prompts_with_input=new Map(Object.entries(h??{})),this.regexes={quad_boxes:/(.+?)/gm,bboxes:/([^<]+)?/gm},this.size_per_bin=1e3}construct_prompts(l){typeof l=="string"&&(l=[l]);const c=[];for(const p of l)if(this.task_prompts_without_inputs.has(p))c.push(this.task_prompts_without_inputs.get(p));else{for(const[u,h]of this.task_prompts_with_input)if(p.includes(u)){c.push(h.replaceAll("{input}",p).replaceAll(u,""));break}c.length!==l.length&&c.push(p)}return c}post_process_generation(l,c,p){const u=this.tasks_answer_post_processing_type.get(c)??"pure_text";l=l.replaceAll("","").replaceAll("","");let h;switch(u){case"pure_text":h=l;break;case"description_with_bboxes":case"bboxes":case"phrase_grounding":case"ocr":const g=u==="ocr"?"quad_boxes":"bboxes",_=l.matchAll(this.regexes[g]),P=[],A=[];for(const[v,y,...k]of _)P.push(y?y.trim():P.at(-1)??""),A.push(k.map((E,M)=>(Number(E)+.5)/this.size_per_bin*p[M%2]));h={labels:P,[g]:A};break;default:throw new Error(`Task "${c}" (of type "${u}") not yet implemented.`)}return{[c]:h}}async _call(l,c=null,p={}){if(!l&&!c)throw new Error("Either text or images must be provided");const u=await this.image_processor(l,p),h=c?this.tokenizer(c,p):{};return{...u,...h}}}re(o,"tokenizer_class",n.AutoTokenizer),re(o,"image_processor_class",i.AutoImageProcessor)},"./src/models/glpn/image_processing_glpn.js":(e,r,t)=>{t.r(r),t.d(r,{GLPNFeatureExtractor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/grounding_dino/image_processing_grounding_dino.js":(e,r,t)=>{t.r(r),t.d(r,{GroundingDinoImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a){const l=await super._call(a),c=l.pixel_values.dims,p=(0,i.ones)([c[0],c[2],c[3]]);return{...l,pixel_mask:p}}}},"./src/models/grounding_dino/processing_grounding_dino.js":(e,r,t)=>{t.r(r),t.d(r,{GroundingDinoProcessor:()=>l});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),o=t("./src/base/image_processors_utils.js");function a(c,p){const h=c.dims.at(-1)-1,g=c.tolist();g.fill(!1,0,1),g.fill(!1,h);const _=p.tolist();return g.map((P,A)=>P?A:null).filter(P=>P!==null).map(P=>_[P])}class l extends s.Processor{async _call(p,u,h={}){const g=p?await this.image_processor(p,h):{};return{...u?this.tokenizer(u,h):{},...g}}post_process_grounded_object_detection(p,u,{box_threshold:h=.25,text_threshold:g=.25,target_sizes:_=null}={}){const{logits:P,pred_boxes:A}=p,v=P.dims[0];if(_!==null&&_.length!==v)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const y=P.dims.at(1),k=P.sigmoid(),E=k.max(-1).tolist(),M=A.tolist().map(x=>x.map($=>(0,o.center_to_corners_format)($))),w=[];for(let x=0;xU.map((Z,H)=>Z*$[(H+1)%2])));const z=E[x],R=[],Q=[],q=[];for(let U=0;U{t.r(r),t.d(r,{Idefics3ImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{constructor(a){super(a),this.do_image_splitting=a.do_image_splitting??!0,this.max_image_size=a.max_image_size}get_resize_for_vision_encoder(a,l){let[c,p]=a.dims.slice(-2);const u=p/c;return p>=c?(p=Math.ceil(p/l)*l,c=Math.floor(p/u),c=Math.ceil(c/l)*l):(c=Math.ceil(c/l)*l,p=Math.floor(c*u),p=Math.ceil(p/l)*l),{height:c,width:p}}async _call(a,{do_image_splitting:l=null,return_row_col_info:c=!1}={}){let p;if(!Array.isArray(a))p=[[a]];else{if(a.length===0||!a[0])throw new Error("No images provided.");Array.isArray(a[0])?p=a:p=[a]}let u=[],h=[],g=[];const _=[],P=[];for(const x of p){let $=await Promise.all(x.map(Q=>this.preprocess(Q)));_.push(...$.map(Q=>Q.original_size)),P.push(...$.map(Q=>Q.reshaped_input_size)),$.forEach(Q=>Q.pixel_values.unsqueeze_(0));const{longest_edge:z}=this.max_image_size;let R;if(l??this.do_image_splitting){let Q=new Array($.length),q=new Array($.length);R=await Promise.all($.map(async(U,Z)=>{const H=this.get_resize_for_vision_encoder(U.pixel_values,z),J=await(0,i.interpolate_4d)(U.pixel_values,{size:[H.height,H.width]}),{frames:ie,num_splits_h:ae,num_splits_w:ce}=await this.split_image(J,this.max_image_size);return Q[Z]=ae,q[Z]=ce,(0,i.cat)(ie,0)})),h.push(Q),g.push(q)}else{const Q=[z,z];R=await Promise.all($.map(q=>(0,i.interpolate_4d)(q.pixel_values,{size:Q}))),h.push(new Array($.length).fill(0)),g.push(new Array($.length).fill(0))}u.push((0,i.cat)(R,0))}const A=u.length,[v,y,k,E]=u[0].dims;let M,w;if(A===1)M=u[0].unsqueeze_(0),w=(0,i.full)([A,v,k,E],!0);else{const x=Math.max(...u.map(R=>R.dims.at(0)));w=(0,i.full)([A,x,k,E],!0);const $=w.data,z=x*k*E;for(let R=0;Rc||g>p){_=Math.ceil(h/c),P=Math.ceil(g/p);const A=Math.ceil(h/_),v=Math.ceil(g/P);for(let E=0;E<_;++E)for(let M=0;M{t.r(r),t.d(r,{Idefics3Processor:()=>p});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");var o=t("./src/utils/core.js");function a(u,h,g,_,P,A){let v="";for(let y=0;y`+P.repeat(u);v+=` +`}return v+=` +${_}${A}`+P.repeat(u)+`${_}`,v}function l(u,h,g,_){return`${h}${_}`+g.repeat(u)+`${h}`}function c(u,h,g,_,P,A){return u===0&&h===0?l(g,_,P,A):a(g,u,h,_,P,A)}class p extends s.Processor{constructor(){super(...arguments);re(this,"fake_image_token","");re(this,"image_token","");re(this,"global_img_token","")}async _call(g,_=null,P={}){P.return_row_col_info??(P.return_row_col_info=!0);let A;_&&(A=await this.image_processor(_,P)),Array.isArray(g)||(g=[g]);const v=A.rows??[new Array(g.length).fill(0)],y=A.cols??[new Array(g.length).fill(0)],k=this.config.image_seq_len,E=[],M=[];for(let x=0;xc(Z,R[H],k,this.fake_image_token,this.image_token,this.global_img_token)),q=$.split(this.image_token);if(q.length===0)throw new Error("The image token should be present in the text.");let U=q[0];for(let Z=0;Z{t.r(r),t.d(r,{BeitFeatureExtractor:()=>s.BeitFeatureExtractor,BitImageProcessor:()=>i.BitImageProcessor,CLIPFeatureExtractor:()=>o.CLIPFeatureExtractor,CLIPImageProcessor:()=>o.CLIPImageProcessor,ChineseCLIPFeatureExtractor:()=>n.ChineseCLIPFeatureExtractor,ConvNextFeatureExtractor:()=>a.ConvNextFeatureExtractor,ConvNextImageProcessor:()=>a.ConvNextImageProcessor,DPTFeatureExtractor:()=>u.DPTFeatureExtractor,DPTImageProcessor:()=>u.DPTImageProcessor,DeiTFeatureExtractor:()=>l.DeiTFeatureExtractor,DeiTImageProcessor:()=>l.DeiTImageProcessor,DetrFeatureExtractor:()=>c.DetrFeatureExtractor,DetrImageProcessor:()=>c.DetrImageProcessor,DonutFeatureExtractor:()=>p.DonutFeatureExtractor,DonutImageProcessor:()=>p.DonutImageProcessor,EfficientNetImageProcessor:()=>h.EfficientNetImageProcessor,GLPNFeatureExtractor:()=>g.GLPNFeatureExtractor,GroundingDinoImageProcessor:()=>_.GroundingDinoImageProcessor,Idefics3ImageProcessor:()=>P.Idefics3ImageProcessor,JinaCLIPImageProcessor:()=>v.JinaCLIPImageProcessor,LlavaOnevisionImageProcessor:()=>y.LlavaOnevisionImageProcessor,Mask2FormerImageProcessor:()=>k.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>E.MaskFormerFeatureExtractor,MaskFormerImageProcessor:()=>E.MaskFormerImageProcessor,MobileNetV1FeatureExtractor:()=>M.MobileNetV1FeatureExtractor,MobileNetV1ImageProcessor:()=>M.MobileNetV1ImageProcessor,MobileNetV2FeatureExtractor:()=>w.MobileNetV2FeatureExtractor,MobileNetV2ImageProcessor:()=>w.MobileNetV2ImageProcessor,MobileNetV3FeatureExtractor:()=>x.MobileNetV3FeatureExtractor,MobileNetV3ImageProcessor:()=>x.MobileNetV3ImageProcessor,MobileNetV4FeatureExtractor:()=>$.MobileNetV4FeatureExtractor,MobileNetV4ImageProcessor:()=>$.MobileNetV4ImageProcessor,MobileViTFeatureExtractor:()=>z.MobileViTFeatureExtractor,MobileViTImageProcessor:()=>z.MobileViTImageProcessor,NougatImageProcessor:()=>R.NougatImageProcessor,OwlViTFeatureExtractor:()=>q.OwlViTFeatureExtractor,OwlViTImageProcessor:()=>q.OwlViTImageProcessor,Owlv2ImageProcessor:()=>Q.Owlv2ImageProcessor,Phi3VImageProcessor:()=>U.Phi3VImageProcessor,PvtImageProcessor:()=>Z.PvtImageProcessor,Qwen2VLImageProcessor:()=>H.Qwen2VLImageProcessor,RTDetrImageProcessor:()=>J.RTDetrImageProcessor,SamImageProcessor:()=>ie.SamImageProcessor,SegformerFeatureExtractor:()=>ae.SegformerFeatureExtractor,SegformerImageProcessor:()=>ae.SegformerImageProcessor,SiglipImageProcessor:()=>ce.SiglipImageProcessor,SmolVLMImageProcessor:()=>he.SmolVLMImageProcessor,Swin2SRImageProcessor:()=>N.Swin2SRImageProcessor,VLMImageProcessor:()=>A.VLMImageProcessor,ViTFeatureExtractor:()=>O.ViTFeatureExtractor,ViTImageProcessor:()=>O.ViTImageProcessor,VitMatteImageProcessor:()=>G.VitMatteImageProcessor,VitPoseImageProcessor:()=>se.VitPoseImageProcessor,YolosFeatureExtractor:()=>X.YolosFeatureExtractor,YolosImageProcessor:()=>X.YolosImageProcessor});var s=t("./src/models/beit/image_processing_beit.js"),i=t("./src/models/bit/image_processing_bit.js"),n=t("./src/models/chinese_clip/image_processing_chinese_clip.js"),o=t("./src/models/clip/image_processing_clip.js"),a=t("./src/models/convnext/image_processing_convnext.js"),l=t("./src/models/deit/image_processing_deit.js"),c=t("./src/models/detr/image_processing_detr.js"),p=t("./src/models/donut/image_processing_donut.js"),u=t("./src/models/dpt/image_processing_dpt.js"),h=t("./src/models/efficientnet/image_processing_efficientnet.js"),g=t("./src/models/glpn/image_processing_glpn.js"),_=t("./src/models/grounding_dino/image_processing_grounding_dino.js"),P=t("./src/models/idefics3/image_processing_idefics3.js"),A=t("./src/models/janus/image_processing_janus.js"),v=t("./src/models/jina_clip/image_processing_jina_clip.js"),y=t("./src/models/llava_onevision/image_processing_llava_onevision.js"),k=t("./src/models/mask2former/image_processing_mask2former.js"),E=t("./src/models/maskformer/image_processing_maskformer.js"),M=t("./src/models/mobilenet_v1/image_processing_mobilenet_v1.js"),w=t("./src/models/mobilenet_v2/image_processing_mobilenet_v2.js"),x=t("./src/models/mobilenet_v3/image_processing_mobilenet_v3.js"),$=t("./src/models/mobilenet_v4/image_processing_mobilenet_v4.js"),z=t("./src/models/mobilevit/image_processing_mobilevit.js"),R=t("./src/models/nougat/image_processing_nougat.js"),Q=t("./src/models/owlv2/image_processing_owlv2.js"),q=t("./src/models/owlvit/image_processing_owlvit.js"),U=t("./src/models/phi3_v/image_processing_phi3_v.js"),Z=t("./src/models/pvt/image_processing_pvt.js"),H=t("./src/models/qwen2_vl/image_processing_qwen2_vl.js"),J=t("./src/models/rt_detr/image_processing_rt_detr.js"),ie=t("./src/models/sam/image_processing_sam.js"),ae=t("./src/models/segformer/image_processing_segformer.js"),ce=t("./src/models/siglip/image_processing_siglip.js"),he=t("./src/models/smolvlm/image_processing_smolvlm.js"),N=t("./src/models/swin2sr/image_processing_swin2sr.js"),O=t("./src/models/vit/image_processing_vit.js"),G=t("./src/models/vitmatte/image_processing_vitmatte.js"),se=t("./src/models/vitpose/image_processing_vitpose.js"),X=t("./src/models/yolos/image_processing_yolos.js")},"./src/models/janus/image_processing_janus.js":(e,r,t)=>{t.r(r),t.d(r,{VLMImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{constructor(o){super({do_pad:!0,pad_size:{width:o.image_size,height:o.image_size},...o}),this.constant_values=this.config.background_color.map(a=>a*this.rescale_factor)}pad_image(o,a,l,c){return super.pad_image(o,a,l,{constant_values:this.constant_values,center:!0,...c})}}},"./src/models/janus/processing_janus.js":(e,r,t)=>{t.r(r),t.d(r,{VLChatProcessor:()=>c});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),o=t("./src/utils/core.js"),a=t("./src/utils/tensor.js"),l=t("./src/utils/image.js");class c extends s.Processor{constructor(u,h){super(u,h),this.image_tag=this.config.image_tag,this.image_start_tag=this.config.image_start_tag,this.image_end_tag=this.config.image_end_tag,this.num_image_tokens=this.config.num_image_tokens}async _call(u,{images:h=null,chat_template:g="default"}={}){h?Array.isArray(h)||(h=[h]):h=await Promise.all(u.filter(R=>R.images).flatMap(R=>R.images).map(R=>l.RawImage.read(R)));const _=this.tokenizer,P=_.apply_chat_template(u,{tokenize:!1,add_generation_prompt:!0,chat_template:g}),A=R=>_.encode(R,{add_special_tokens:!1}),v=P.split(this.image_tag),y=v.length-1;if(h.length!==y)throw new Error(`Number of images provided (${h.length}) does not match number of "${this.image_tag}" image tags (${y})`);const[k,E,M]=_.model.convert_tokens_to_ids([this.image_tag,this.image_start_tag,this.image_end_tag]);let w=A(v[0]),x=new Array(w.length).fill(!1);for(let R=1;R0){const R=await this.image_processor(h);return R.pixel_values.unsqueeze_(0),{...z,...R}}return z}}re(c,"image_processor_class",i.AutoImageProcessor),re(c,"tokenizer_class",n.AutoTokenizer),re(c,"uses_processor_config",!0)},"./src/models/jina_clip/image_processing_jina_clip.js":(e,r,t)=>{t.r(r),t.d(r,{JinaCLIPImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{constructor(o){const{resize_mode:a,fill_color:l,interpolation:c,size:p,...u}=o,h=a==="squash"?{width:p,height:p}:a==="shortest"?{shortest_edge:p}:{longest_edge:p},g=c==="bicubic"?3:2;super({...u,size:h,resample:g,do_center_crop:!0,crop_size:p,do_normalize:!0})}}},"./src/models/jina_clip/processing_jina_clip.js":(e,r,t)=>{t.r(r),t.d(r,{JinaCLIPProcessor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class o extends s.Processor{async _call(l=null,c=null,p={}){if(!l&&!c)throw new Error("Either text or images must be provided");const u=l?this.tokenizer(l,p):{},h=c?await this.image_processor(c,p):{};return{...u,...h}}}re(o,"tokenizer_class",n.AutoTokenizer),re(o,"image_processor_class",i.AutoImageProcessor)},"./src/models/llava_onevision/image_processing_llava_onevision.js":(e,r,t)=>{t.r(r),t.d(r,{LlavaOnevisionImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/mask2former/image_processing_mask2former.js":(e,r,t)=>{t.r(r),t.d(r,{Mask2FormerImageProcessor:()=>i});var s=t("./src/models/maskformer/image_processing_maskformer.js");class i extends s.MaskFormerImageProcessor{}},"./src/models/maskformer/image_processing_maskformer.js":(e,r,t)=>{t.r(r),t.d(r,{MaskFormerFeatureExtractor:()=>n,MaskFormerImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_panoptic_segmentation(...a){return(0,s.post_process_panoptic_segmentation)(...a)}post_process_instance_segmentation(...a){return(0,s.post_process_instance_segmentation)(...a)}}class n extends i{}},"./src/models/mgp_str/processing_mgp_str.js":(e,r,t)=>{t.r(r),t.d(r,{MgpstrProcessor:()=>l});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js"),o=t("./src/utils/maths.js");const a={char:["char_decode",1],bpe:["bpe_decode",2],wp:["wp_decode",102]};class l extends s.Processor{get char_tokenizer(){return this.components.char_tokenizer}get bpe_tokenizer(){return this.components.bpe_tokenizer}get wp_tokenizer(){return this.components.wp_tokenizer}_decode_helper(p,u){if(!a.hasOwnProperty(u))throw new Error(`Format ${u} is not supported.`);const[h,g]=a[u],_=this[h].bind(this),[P,A]=p.dims,v=[],y=[],k=p.tolist();for(let M=0;M0?$.reduce((R,Q)=>R*Q,1):0;y.push(x),v.push(z)}return[_(y),v]}char_decode(p){return this.char_tokenizer.batch_decode(p).map(u=>u.replaceAll(" ",""))}bpe_decode(p){return this.bpe_tokenizer.batch_decode(p)}wp_decode(p){return this.wp_tokenizer.batch_decode(p).map(u=>u.replaceAll(" ",""))}batch_decode([p,u,h]){const[g,_]=this._decode_helper(p,"char"),[P,A]=this._decode_helper(u,"bpe"),[v,y]=this._decode_helper(h,"wp"),k=[],E=[];for(let M=0;M{t.r(r),t.d(r,{MobileNetV1FeatureExtractor:()=>n,MobileNetV1ImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/mobilenet_v2/image_processing_mobilenet_v2.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV2FeatureExtractor:()=>n,MobileNetV2ImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/mobilenet_v3/image_processing_mobilenet_v3.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV3FeatureExtractor:()=>n,MobileNetV3ImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/mobilenet_v4/image_processing_mobilenet_v4.js":(e,r,t)=>{t.r(r),t.d(r,{MobileNetV4FeatureExtractor:()=>n,MobileNetV4ImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/mobilevit/image_processing_mobilevit.js":(e,r,t)=>{t.r(r),t.d(r,{MobileViTFeatureExtractor:()=>n,MobileViTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/moonshine/feature_extraction_moonshine.js":(e,r,t)=>{t.r(r),t.d(r,{MoonshineFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{async _call(a){(0,s.validate_audio_inputs)(a,"MoonshineFeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));const l=[1,a.length];return{input_values:new i.Tensor("float32",a,l)}}}},"./src/models/moonshine/processing_moonshine.js":(e,r,t)=>{t.r(r),t.d(r,{MoonshineProcessor:()=>o});var s=t("./src/models/auto/feature_extraction_auto.js"),i=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",i.AutoTokenizer),re(o,"feature_extractor_class",s.AutoFeatureExtractor)},"./src/models/nougat/image_processing_nougat.js":(e,r,t)=>{t.r(r),t.d(r,{NougatImageProcessor:()=>i});var s=t("./src/models/donut/image_processing_donut.js");class i extends s.DonutImageProcessor{}},"./src/models/owlv2/image_processing_owlv2.js":(e,r,t)=>{t.r(r),t.d(r,{Owlv2ImageProcessor:()=>i});var s=t("./src/models/owlvit/image_processing_owlvit.js");class i extends s.OwlViTImageProcessor{}},"./src/models/owlvit/image_processing_owlvit.js":(e,r,t)=>{t.r(r),t.d(r,{OwlViTFeatureExtractor:()=>n,OwlViTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_object_detection(...a){return(0,s.post_process_object_detection)(...a)}}class n extends i{}},"./src/models/owlvit/processing_owlvit.js":(e,r,t)=>{t.r(r),t.d(r,{OwlViTProcessor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");class o extends s.Processor{}re(o,"tokenizer_class",n.AutoTokenizer),re(o,"image_processor_class",i.AutoImageProcessor)},"./src/models/paligemma/processing_paligemma.js":(e,r,t)=>{t.r(r),t.d(r,{PaliGemmaProcessor:()=>l});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");const o="";function a(c,p,u,h,g){return`${h.repeat(u*g)}${p}${c} +`}class l extends s.Processor{async _call(p,u=null,h={}){u||(console.warn("You are using PaliGemma without a text prefix. It will perform as a picture-captioning model."),u=""),Array.isArray(p)||(p=[p]),Array.isArray(u)||(u=[u]);const g=this.tokenizer.bos_token,_=this.image_processor.config.image_seq_length;let P;u.some(y=>y.includes(o))?P=u.map(y=>{const k=y.replaceAll(o,o.repeat(_)),E=k.lastIndexOf(o),M=E===-1?0:E+o.length;return k.slice(0,M)+g+k.slice(M)+` +`}):(console.warn("You are passing both `text` and `images` to `PaliGemmaProcessor`. The processor expects special image tokens in the text, as many tokens as there are images per each text. It is recommended to add `` tokens in the very beginning of your text. For this call, we will infer how many images each text has and add special tokens."),P=u.map(y=>a(y,g,_,o,p.length)));const A=this.tokenizer(P,h);return{...await this.image_processor(p,h),...A}}}re(l,"tokenizer_class",n.AutoTokenizer),re(l,"image_processor_class",i.AutoImageProcessor),re(l,"uses_processor_config",!1)},"./src/models/phi3_v/image_processing_phi3_v.js":(e,r,t)=>{t.r(r),t.d(r,{Phi3VImageProcessor:()=>p});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");const n=336,o=[2,3],{ceil:a,floor:l,sqrt:c}=Math;class p extends s.ImageProcessor{constructor(h){super({...h,do_normalize:!0,do_pad:!0,pad_size:"custom",do_convert_rgb:!0,do_resize:!0}),this._num_crops=h.num_crops}calc_num_image_tokens_from_image_size(h,g){const{num_img_tokens:_}=this.config;return l((l(g/n)*l(h/n)+1)*_+1+(l(g/n)+1)*c(_))}get_resize_output_image_size(h,g){const _=this._num_crops,[P,A]=h.size;let v=P/A,y=1;for(;y*Math.ceil(y/v)<=_;)y+=1;y-=1;const k=Math.floor(y*336),E=Math.floor(k/v);return[k,E]}pad_image(h,g,_,P={}){const[A,v]=g,y=n*a(A/n),k=n*a(v/n),E=[1,1,1].map((M,w)=>(M-this.image_mean[w])/this.image_std[w]);return super.pad_image(h,g,{width:k,height:y},{center:!0,constant_values:E,...P})}async _call(h,{num_crops:g=null}={}){if(this._num_crops=g??(g=this.config.num_crops),g<4||c(g)%1!==0)throw new Error("num_crops must be a square number >= 4");Array.isArray(h)||(h=[h]);const _=h.length,P=await Promise.all(h.map(x=>this.preprocess(x))),A=P.map(x=>x.original_size),v=P.map(x=>x.reshaped_input_size),y=[];for(const{pixel_values:x}of P){x.unsqueeze_(0);const[$,z]=x.dims.slice(-2),R=await(0,i.interpolate_4d)(x,{size:[n,n],mode:"bicubic"});if(g>0){const Q=[],q=c(g),U=l(z/q),Z=l($/q);for(let J=0;Jx.map($=>n*a($/n))),M=new i.Tensor("int64",E.flat(),[_,2]),w=E.map(([x,$])=>this.calc_num_image_tokens_from_image_size($,x));return{pixel_values:k,original_sizes:A,reshaped_input_sizes:v,image_sizes:M,num_img_tokens:w}}}},"./src/models/phi3_v/processing_phi3_v.js":(e,r,t)=>{t.r(r),t.d(r,{Phi3VProcessor:()=>l});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");const o="<|image|>",a=/<\|image_\d+\|>/g;class l extends s.Processor{async _call(p,u=null,{padding:h=!0,truncation:g=!0,num_crops:_=null}={}){Array.isArray(p)||(p=[p]);let P,A;if(u){A=await this.image_processor(u,{num_crops:_});const{num_img_tokens:v}=A,y=p.map((E,M)=>E.split(a).join(o.repeat(v[M])));P=this.tokenizer(y,{padding:h,truncation:g});const k=this.tokenizer.model.convert_tokens_to_ids([o])[0];P.input_ids.map_(E=>E==k?-E:E)}else P=this.tokenizer(p);return{...P,...A}}}re(l,"image_processor_class",i.AutoImageProcessor),re(l,"tokenizer_class",n.AutoTokenizer)},"./src/models/processors.js":(e,r,t)=>{t.r(r),t.d(r,{Florence2Processor:()=>s.Florence2Processor,GroundingDinoProcessor:()=>i.GroundingDinoProcessor,Idefics3Processor:()=>n.Idefics3Processor,JinaCLIPProcessor:()=>a.JinaCLIPProcessor,MgpstrProcessor:()=>l.MgpstrProcessor,MoonshineProcessor:()=>c.MoonshineProcessor,OwlViTProcessor:()=>p.OwlViTProcessor,PaliGemmaProcessor:()=>h.PaliGemmaProcessor,Phi3VProcessor:()=>u.Phi3VProcessor,PyAnnoteProcessor:()=>g.PyAnnoteProcessor,Qwen2VLProcessor:()=>_.Qwen2VLProcessor,SamProcessor:()=>P.SamProcessor,SmolVLMProcessor:()=>A.SmolVLMProcessor,SpeechT5Processor:()=>v.SpeechT5Processor,UltravoxProcessor:()=>y.UltravoxProcessor,VLChatProcessor:()=>o.VLChatProcessor,Wav2Vec2Processor:()=>k.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>E.Wav2Vec2ProcessorWithLM,WhisperProcessor:()=>M.WhisperProcessor});var s=t("./src/models/florence2/processing_florence2.js"),i=t("./src/models/grounding_dino/processing_grounding_dino.js"),n=t("./src/models/idefics3/processing_idefics3.js"),o=t("./src/models/janus/processing_janus.js"),a=t("./src/models/jina_clip/processing_jina_clip.js"),l=t("./src/models/mgp_str/processing_mgp_str.js"),c=t("./src/models/moonshine/processing_moonshine.js"),p=t("./src/models/owlvit/processing_owlvit.js"),u=t("./src/models/phi3_v/processing_phi3_v.js"),h=t("./src/models/paligemma/processing_paligemma.js"),g=t("./src/models/pyannote/processing_pyannote.js"),_=t("./src/models/qwen2_vl/processing_qwen2_vl.js"),P=t("./src/models/sam/processing_sam.js"),A=t("./src/models/smolvlm/processing_smolvlm.js"),v=t("./src/models/speecht5/processing_speecht5.js"),y=t("./src/models/ultravox/processing_ultravox.js"),k=t("./src/models/wav2vec2/processing_wav2vec2.js"),E=t("./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js"),M=t("./src/models/whisper/processing_whisper.js")},"./src/models/pvt/image_processing_pvt.js":(e,r,t)=>{t.r(r),t.d(r,{PvtImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/pyannote/feature_extraction_pyannote.js":(e,r,t)=>{t.r(r),t.d(r,{PyAnnoteFeatureExtractor:()=>o});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js"),n=t("./src/utils/maths.js");class o extends s.FeatureExtractor{async _call(l){(0,s.validate_audio_inputs)(l,"PyAnnoteFeatureExtractor"),l instanceof Float64Array&&(l=new Float32Array(l));const c=[1,1,l.length];return{input_values:new i.Tensor("float32",l,c)}}samples_to_frames(l){return(l-this.config.offset)/this.config.step}post_process_speaker_diarization(l,c){const p=c/this.samples_to_frames(c)/this.config.sampling_rate,u=[];for(const h of l.tolist()){const g=[];let _=-1;for(let P=0;P({id:P,start:A*p,end:v*p,confidence:y/(v-A)})))}return u}}},"./src/models/pyannote/processing_pyannote.js":(e,r,t)=>{t.r(r),t.d(r,{PyAnnoteProcessor:()=>n});var s=t("./src/base/processing_utils.js"),i=t("./src/models/pyannote/feature_extraction_pyannote.js");class n extends s.Processor{async _call(a){return await this.feature_extractor(a)}post_process_speaker_diarization(...a){return this.feature_extractor.post_process_speaker_diarization(...a)}get sampling_rate(){return this.feature_extractor.config.sampling_rate}}re(n,"feature_extractor_class",i.PyAnnoteFeatureExtractor)},"./src/models/qwen2_vl/image_processing_qwen2_vl.js":(e,r,t)=>{t.r(r),t.d(r,{Qwen2VLImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a,...l){const{pixel_values:c,original_sizes:p,reshaped_input_sizes:u}=await super._call(a,...l);let h=c;const{temporal_patch_size:g,merge_size:_,patch_size:P}=this.config;h.dims[0]===1&&(h=(0,i.cat)(Array.from({length:g},()=>h),0));const A=h.dims[0]/g,v=h.dims[1],y=Math.floor(h.dims[2]/P),k=Math.floor(h.dims[3]/P),E=h.view(A,g,v,Math.floor(y/_),_,P,Math.floor(k/_),_,P).permute(0,3,6,4,7,2,1,5,8).view(A*y*k,v*g*P*P),M=new i.Tensor("int64",[A,y,k],[1,3]);return{pixel_values:E,image_grid_thw:M,original_sizes:p,reshaped_input_sizes:u}}}},"./src/models/qwen2_vl/processing_qwen2_vl.js":(e,r,t)=>{t.r(r),t.d(r,{Qwen2VLProcessor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js"),n=t("./src/tokenizers.js");t("./src/utils/image.js");class o extends s.Processor{async _call(l,c=null,...p){Array.isArray(l)||(l=[l]);let u,h;if(c&&(u=await this.image_processor(c),h=u.image_grid_thw),h){let _=this.image_processor.config.merge_size**2,P=0;const A=h.tolist();l=l.map(v=>{for(;v.includes("<|image_pad|>");){const y=Number(A[P++].reduce((k,E)=>k*E,1n));v=v.replace("<|image_pad|>","<|placeholder|>".repeat(Math.floor(y/_)))}return v.replaceAll("<|placeholder|>","<|image_pad|>")})}return{...this.tokenizer(l),...u}}}re(o,"image_processor_class",i.AutoImageProcessor),re(o,"tokenizer_class",n.AutoTokenizer)},"./src/models/rt_detr/image_processing_rt_detr.js":(e,r,t)=>{t.r(r),t.d(r,{RTDetrImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_object_detection(...o){return(0,s.post_process_object_detection)(...o)}}},"./src/models/sam/image_processing_sam.js":(e,r,t)=>{t.r(r),t.d(r,{SamImageProcessor:()=>o});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/core.js"),n=t("./src/utils/tensor.js");class o extends s.ImageProcessor{reshape_input_points(l,c,p,u=!1){l=structuredClone(l);let h=(0,i.calculateDimensions)(l);if(h.length===3)u||(h=[1,...h]),l=[l];else if(h.length!==4)throw Error("The input_points must be a 4D tensor of shape `batch_size`, `point_batch_size`, `nb_points_per_image`, `2`.");for(let g=0;gu!==c.dims[h]))throw Error(`The first ${p.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new n.Tensor("int64",l.flat(1/0).map(BigInt),p)}async _call(l,{input_points:c=null,input_labels:p=null,input_boxes:u=null}={}){const h=await super._call(l);if(c&&(h.input_points=this.reshape_input_points(c,h.original_sizes,h.reshaped_input_sizes)),p){if(!h.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");h.input_labels=this.add_input_labels(p,h.input_points)}return u&&(h.input_boxes=this.reshape_input_points(u,h.original_sizes,h.reshaped_input_sizes,!0)),h}async post_process_masks(l,c,p,{mask_threshold:u=0,binarize:h=!0,pad_size:g=null}={}){const _=[];g=g??this.pad_size;const P=[g.height,g.width];for(let A=0;Au&&(M[w]=1);k=new n.Tensor("bool",M,k.dims)}_.push(k)}return _}generate_crop_boxes(l,c,{crop_n_layers:p=0,overlap_ratio:u=512/1500,points_per_crop:h=32,crop_n_points_downscale_factor:g=1}={}){}}},"./src/models/sam/processing_sam.js":(e,r,t)=>{t.r(r),t.d(r,{SamProcessor:()=>n});var s=t("./src/base/processing_utils.js"),i=t("./src/models/auto/image_processing_auto.js");class n extends s.Processor{async _call(...a){return await this.image_processor(...a)}post_process_masks(...a){return this.image_processor.post_process_masks(...a)}reshape_input_points(...a){return this.image_processor.reshape_input_points(...a)}}re(n,"image_processor_class",i.AutoImageProcessor)},"./src/models/seamless_m4t/feature_extraction_seamless_m4t.js":(e,r,t)=>{t.r(r),t.d(r,{SeamlessM4TFeatureExtractor:()=>o});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js"),n=t("./src/utils/audio.js");class o extends s.FeatureExtractor{constructor(l){super(l);const c=this.config.sampling_rate,p=(0,n.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(c/2),c,null,"kaldi",!0);for(let u=0;up*32768),(0,n.spectrogram)(l,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:c,transpose:!0})}async _call(l,{padding:c=!0,pad_to_multiple_of:p=2,do_normalize_per_mel_bins:u=!0,return_attention_mask:h=!0}={}){(0,s.validate_audio_inputs)(l,"SeamlessM4TFeatureExtractor");let g=await this._extract_fbank_features(l,this.config.max_length);if(u){const[M,w]=g.dims,x=g.data;for(let $=0;$0){const z=new Float32Array(w*(M+$));z.set(x),z.fill(this.config.padding_value,x.length);const R=M+$;g=new i.Tensor(g.type,z,[R,w]),h&&(_=new i.Tensor("int64",new BigInt64Array(R),[1,R]),_.data.fill(1n,0,M))}}const[P,A]=g.dims,v=this.config.stride;if(P%v!==0)throw new Error(`The number of frames (${P}) must be a multiple of the stride (${v}).`);const k=g.view(1,Math.floor(P/v),A*v),E={input_features:k};if(h){const M=k.dims[1],w=new BigInt64Array(M);if(_){const x=_.data;for(let $=1,z=0;${t.r(r),t.d(r,{SegformerFeatureExtractor:()=>n,SegformerImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_semantic_segmentation(...a){return(0,s.post_process_semantic_segmentation)(...a)}}class n extends i{}},"./src/models/siglip/image_processing_siglip.js":(e,r,t)=>{t.r(r),t.d(r,{SiglipImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}},"./src/models/smolvlm/image_processing_smolvlm.js":(e,r,t)=>{t.r(r),t.d(r,{SmolVLMImageProcessor:()=>s.Idefics3ImageProcessor});var s=t("./src/models/idefics3/image_processing_idefics3.js")},"./src/models/smolvlm/processing_smolvlm.js":(e,r,t)=>{t.r(r),t.d(r,{SmolVLMProcessor:()=>s.Idefics3Processor});var s=t("./src/models/idefics3/processing_idefics3.js")},"./src/models/snac/feature_extraction_snac.js":(e,r,t)=>{t.r(r),t.d(r,{SnacFeatureExtractor:()=>i});var s=t("./src/models/dac/feature_extraction_dac.js");class i extends s.DacFeatureExtractor{}},"./src/models/speecht5/feature_extraction_speecht5.js":(e,r,t)=>{t.r(r),t.d(r,{SpeechT5FeatureExtractor:()=>i});var s=t("./src/base/feature_extraction_utils.js");class i extends s.FeatureExtractor{}},"./src/models/speecht5/processing_speecht5.js":(e,r,t)=>{t.r(r),t.d(r,{SpeechT5Processor:()=>o});var s=t("./src/base/processing_utils.js"),i=t("./src/tokenizers.js"),n=t("./src/models/auto/feature_extraction_auto.js");class o extends s.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",i.AutoTokenizer),re(o,"feature_extractor_class",n.AutoFeatureExtractor)},"./src/models/swin2sr/image_processing_swin2sr.js":(e,r,t)=>{t.r(r),t.d(r,{Swin2SRImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{pad_image(o,a,l,c={}){const[p,u,h]=a;return super.pad_image(o,a,{width:u+(l-u%l)%l,height:p+(l-p%l)%l},{mode:"symmetric",center:!1,constant_values:-1,...c})}}},"./src/models/ultravox/processing_ultravox.js":(e,r,t)=>{t.r(r),t.d(r,{UltravoxProcessor:()=>o});var s=t("./src/models/auto/feature_extraction_auto.js"),i=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l,c=null,p={}){if(Array.isArray(l))throw new Error("Batched inputs are not supported yet.");let u={};if(c){const g=c.length,{input_features:_}=await this.feature_extractor(c,{...p,max_length:g}),P=Math.round(g/this.config.encoder_ds_factor+1e-4),A=1+Math.ceil(P/this.config.stack_factor);u.audio_token_len=[A],u.audio_values=_;const v=this.config.audio_placeholder;if(!l.includes(v))throw new Error(`The input text does not contain the image token ${v}.`);l=l.replaceAll(v,v.repeat(A))}return{...this.tokenizer(l,{add_special_tokens:!1,...p}),...u}}}re(o,"tokenizer_class",i.AutoTokenizer),re(o,"feature_extractor_class",s.AutoFeatureExtractor),re(o,"uses_processor_config",!0)},"./src/models/vit/image_processing_vit.js":(e,r,t)=>{t.r(r),t.d(r,{ViTFeatureExtractor:()=>n,ViTImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{}class n extends i{}},"./src/models/vitmatte/image_processing_vitmatte.js":(e,r,t)=>{t.r(r),t.d(r,{VitMatteImageProcessor:()=>n});var s=t("./src/base/image_processors_utils.js"),i=t("./src/utils/tensor.js");class n extends s.ImageProcessor{async _call(a,l){Array.isArray(a)||(a=[a]),Array.isArray(l)||(l=[l]);const c=await Promise.all(a.map(h=>this.preprocess(h))),p=await Promise.all(l.map(h=>this.preprocess(h,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:(0,i.stack)(c.map((h,g)=>(0,i.cat)([h.pixel_values,p[g].pixel_values],0)),0),original_sizes:c.map(h=>h.original_size),reshaped_input_sizes:c.map(h=>h.reshaped_input_size)}}}},"./src/models/vitpose/image_processing_vitpose.js":(e,r,t)=>{t.r(r),t.d(r,{VitPoseImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_pose_estimation(o,a,{threshold:l=null}={}){const c=o.tolist(),[p,u,h,g]=o.dims,_=[];for(let P=0;P{t.r(r),t.d(r,{Wav2Vec2FeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js"),i=t("./src/utils/tensor.js");class n extends s.FeatureExtractor{_zero_mean_unit_var_norm(a){const c=a.reduce((u,h)=>u+h,0)/a.length,p=a.reduce((u,h)=>u+(h-c)**2,0)/a.length;return a.map(u=>(u-c)/Math.sqrt(p+1e-7))}async _call(a){(0,s.validate_audio_inputs)(a,"Wav2Vec2FeatureExtractor"),a instanceof Float64Array&&(a=new Float32Array(a));let l=a;this.config.do_normalize&&(l=this._zero_mean_unit_var_norm(l));const c=[1,l.length];return{input_values:new i.Tensor("float32",l,c),attention_mask:new i.Tensor("int64",new BigInt64Array(l.length).fill(1n),c)}}}},"./src/models/wav2vec2/processing_wav2vec2.js":(e,r,t)=>{t.r(r),t.d(r,{Wav2Vec2Processor:()=>o});var s=t("./src/tokenizers.js"),i=t("./src/models/auto/feature_extraction_auto.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",s.AutoTokenizer),re(o,"feature_extractor_class",i.AutoFeatureExtractor)},"./src/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.js":(e,r,t)=>{t.r(r),t.d(r,{Wav2Vec2ProcessorWithLM:()=>o});var s=t("./src/tokenizers.js"),i=t("./src/models/auto/feature_extraction_auto.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",s.AutoTokenizer),re(o,"feature_extractor_class",i.AutoFeatureExtractor)},"./src/models/wespeaker/feature_extraction_wespeaker.js":(e,r,t)=>{t.r(r),t.d(r,{WeSpeakerFeatureExtractor:()=>n});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var i=t("./src/utils/audio.js");class n extends s.FeatureExtractor{constructor(a){super(a);const l=this.config.sampling_rate,c=(0,i.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(l/2),l,null,"kaldi",!0);for(let p=0;pl*32768),(0,i.spectrogram)(a,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,transpose:!0,min_num_frames:this.min_num_frames})}async _call(a){(0,s.validate_audio_inputs)(a,"WeSpeakerFeatureExtractor");const l=(await this._extract_fbank_features(a)).unsqueeze_(0);if(this.config.fbank_centering_span===null){const c=l.mean(1).data,p=l.data,[u,h,g]=l.dims;for(let _=0;_{t.r(r),t.d(r,{WHISPER_LANGUAGE_MAPPING:()=>i,WHISPER_TO_LANGUAGE_CODE_MAPPING:()=>n,whisper_language_to_code:()=>o});const s=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],i=new Map(s),n=new Map([...s.map(([a,l])=>[l,a]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);function o(a){a=a.toLowerCase();let l=n.get(a);if(l===void 0){const c=a.match(/^<\|([a-z]{2})\|>$/);if(c&&(a=c[1]),i.has(a))l=a;else{const u=a.length===2?i.keys():i.values();throw new Error(`Language "${a}" is not supported. Must be one of: ${JSON.stringify(Array.from(u))}`)}}return l}},"./src/models/whisper/feature_extraction_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperFeatureExtractor:()=>o});var s=t("./src/base/feature_extraction_utils.js");t("./src/utils/tensor.js");var i=t("./src/utils/audio.js"),n=t("./src/utils/maths.js");class o extends s.FeatureExtractor{constructor(l){var c;super(l),(c=this.config).mel_filters??(c.mel_filters=(0,i.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney")),this.window=(0,i.window_function)(this.config.n_fft,"hann")}async _extract_fbank_features(l){const c=await(0,i.spectrogram)(l,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:Math.min(Math.floor(l.length/this.config.hop_length),this.config.nb_max_frames)}),p=c.data,u=(0,n.max)(p)[0];for(let h=0;hu?(l.length>this.config.n_samples&&console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),p=l.slice(0,u)):(p=new Float32Array(u),p.set(l)),{input_features:(await this._extract_fbank_features(p)).unsqueeze_(0)}}}},"./src/models/whisper/generation_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperGenerationConfig:()=>i});var s=t("./src/generation/configuration_utils.js");class i extends s.GenerationConfig{constructor(){super(...arguments);re(this,"return_timestamps",null);re(this,"return_token_timestamps",null);re(this,"num_frames",null);re(this,"alignment_heads",null);re(this,"task",null);re(this,"language",null);re(this,"no_timestamps_token_id",null);re(this,"prompt_ids",null);re(this,"is_multilingual",null);re(this,"lang_to_id",null);re(this,"task_to_id",null);re(this,"max_initial_timestamp_index",1)}}},"./src/models/whisper/processing_whisper.js":(e,r,t)=>{t.r(r),t.d(r,{WhisperProcessor:()=>o});var s=t("./src/models/auto/feature_extraction_auto.js"),i=t("./src/tokenizers.js"),n=t("./src/base/processing_utils.js");class o extends n.Processor{async _call(l){return await this.feature_extractor(l)}}re(o,"tokenizer_class",i.AutoTokenizer),re(o,"feature_extractor_class",s.AutoFeatureExtractor)},"./src/models/yolos/image_processing_yolos.js":(e,r,t)=>{t.r(r),t.d(r,{YolosFeatureExtractor:()=>n,YolosImageProcessor:()=>i});var s=t("./src/base/image_processors_utils.js");class i extends s.ImageProcessor{post_process_object_detection(...a){return(0,s.post_process_object_detection)(...a)}}class n extends i{}},"./src/ops/registry.js":(e,r,t)=>{t.r(r),t.d(r,{TensorOpRegistry:()=>l});var s=t("./src/backends/onnx.js"),i=t("./src/utils/tensor.js"),n=t("./src/env.js");const o=n.apis.IS_BROWSER_ENV||n.apis.IS_WEBWORKER_ENV,a=async(c,p,u)=>{const h=await(0,s.createInferenceSession)(new Uint8Array(c),p);let g=Promise.resolve();return async _=>{const P=(0,s.isONNXProxy)(),A=Object.fromEntries(Object.entries(_).map(([y,k])=>[y,(P?k.clone():k).ort_tensor])),v=await(g=o?g.then(()=>h.run(A)):h.run(A));return Array.isArray(u)?u.map(y=>new i.Tensor(v[y])):new i.Tensor(v[u])}};class l{static get nearest_interpolate_4d(){return this._nearest_interpolate_4d||(this._nearest_interpolate_4d=a([8,10,18,0,58,129,1,10,41,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,18,10,4,109,111,100,101,34,7,110,101,97,114,101,115,116,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,21],this.session_options,"y")),this._nearest_interpolate_4d}static get bilinear_interpolate_4d(){return this._bilinear_interpolate_4d||(this._bilinear_interpolate_4d=a([8,9,18,0,58,128,1,10,40,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,17,10,4,109,111,100,101,34,6,108,105,110,101,97,114,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bilinear_interpolate_4d}static get bicubic_interpolate_4d(){return this._bicubic_interpolate_4d||(this._bicubic_interpolate_4d=a([8,9,18,0,58,127,10,39,10,1,120,10,0,10,0,10,1,115,18,1,121,34,6,82,101,115,105,122,101,42,16,10,4,109,111,100,101,34,5,99,117,98,105,99,160,1,3,18,1,114,90,31,10,1,120,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,90,15,10,1,115,18,10,10,8,8,7,18,4,10,2,8,4,98,31,10,1,121,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,99,10,3,18,1,104,10,3,18,1,119,66,2,16,20],this.session_options,"y")),this._bicubic_interpolate_4d}static get matmul(){return this._matmul||(this._matmul=a([8,9,18,0,58,55,10,17,10,1,97,10,1,98,18,1,99,34,6,77,97,116,77,117,108,18,1,114,90,9,10,1,97,18,4,10,2,8,1,90,9,10,1,98,18,4,10,2,8,1,98,9,10,1,99,18,4,10,2,8,1,66,2,16,20],this.session_options,"c")),this._matmul}static get stft(){return this._stft||(this._stft=a([8,7,18,0,58,148,1,10,38,10,1,115,10,1,106,10,1,119,10,1,108,18,1,111,34,4,83,84,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,115,90,26,10,1,115,18,21,10,19,8,1,18,15,10,3,18,1,98,10,3,18,1,115,10,3,18,1,99,90,11,10,1,106,18,6,10,4,8,7,18,0,90,16,10,1,119,18,11,10,9,8,1,18,5,10,3,18,1,119,90,11,10,1,108,18,6,10,4,8,7,18,0,98,31,10,1,111,18,26,10,24,8,1,18,20,10,3,18,1,98,10,3,18,1,102,10,3,18,1,100,10,3,18,1,99,66,2,16,17],this.session_options,"o")),this._stft}static get rfft(){return this._rfft||(this._rfft=a([8,9,18,0,58,97,10,33,10,1,120,10,0,10,1,97,18,1,121,34,3,68,70,84,42,15,10,8,111,110,101,115,105,100,101,100,24,1,160,1,2,18,1,100,90,21,10,1,120,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,90,11,10,1,97,18,6,10,4,8,7,18,0,98,21,10,1,121,18,16,10,14,8,1,18,10,10,3,18,1,115,10,3,18,1,99,66,2,16,20],this.session_options,"y")),this._rfft}static get top_k(){return this._top_k||(this._top_k=a([8,10,18,0,58,73,10,18,10,1,120,10,1,107,18,1,118,18,1,105,34,4,84,111,112,75,18,1,116,90,9,10,1,120,18,4,10,2,8,1,90,15,10,1,107,18,10,10,8,8,7,18,4,10,2,8,1,98,9,10,1,118,18,4,10,2,8,1,98,9,10,1,105,18,4,10,2,8,7,66,2,16,21],this.session_options,["v","i"])),this._top_k}static get slice(){return this._slice||(this._slice=a([8,7,18,0,58,96,10,25,10,1,120,10,1,115,10,1,101,10,1,97,10,1,116,18,1,121,34,5,83,108,105,99,101,18,1,114,90,9,10,1,120,18,4,10,2,8,1,90,9,10,1,115,18,4,10,2,8,7,90,9,10,1,101,18,4,10,2,8,7,90,9,10,1,97,18,4,10,2,8,7,90,9,10,1,116,18,4,10,2,8,7,98,9,10,1,121,18,4,10,2,8,1,66,2,16,13],this.session_options,"y")),this._slice}}re(l,"session_options",{})},"./src/pipelines.js":(e,r,t)=>{t.r(r),t.d(r,{AudioClassificationPipeline:()=>q,AutomaticSpeechRecognitionPipeline:()=>Z,BackgroundRemovalPipeline:()=>ae,DepthEstimationPipeline:()=>X,DocumentQuestionAnsweringPipeline:()=>O,FeatureExtractionPipeline:()=>R,FillMaskPipeline:()=>k,ImageClassificationPipeline:()=>J,ImageFeatureExtractionPipeline:()=>Q,ImageSegmentationPipeline:()=>ie,ImageToImagePipeline:()=>se,ImageToTextPipeline:()=>H,ObjectDetectionPipeline:()=>he,Pipeline:()=>P,QuestionAnsweringPipeline:()=>y,SummarizationPipeline:()=>M,Text2TextGenerationPipeline:()=>E,TextClassificationPipeline:()=>A,TextGenerationPipeline:()=>$,TextToAudioPipeline:()=>G,TokenClassificationPipeline:()=>v,TranslationPipeline:()=>w,ZeroShotAudioClassificationPipeline:()=>U,ZeroShotClassificationPipeline:()=>z,ZeroShotImageClassificationPipeline:()=>ce,ZeroShotObjectDetectionPipeline:()=>N,pipeline:()=>ke});var s=t("./src/tokenizers.js"),i=t("./src/models.js"),n=t("./src/models/auto/processing_auto.js");t("./src/base/processing_utils.js");var o=t("./src/utils/generic.js"),a=t("./src/utils/core.js"),l=t("./src/utils/maths.js"),c=t("./src/utils/audio.js"),p=t("./src/utils/tensor.js"),u=t("./src/utils/image.js");async function h(Me){return Array.isArray(Me)||(Me=[Me]),await Promise.all(Me.map(K=>u.RawImage.read(K)))}async function g(Me,K){return Array.isArray(Me)||(Me=[Me]),await Promise.all(Me.map(j=>typeof j=="string"||j instanceof URL?(0,c.read_audio)(j,K):j instanceof Float64Array?new Float32Array(j):j))}function _(Me,K){K&&(Me=Me.map(Ae=>Ae|0));const[j,me,Pe,xe]=Me;return{xmin:j,ymin:me,xmax:Pe,ymax:xe}}class P extends o.Callable{constructor({task:K,model:j,tokenizer:me=null,processor:Pe=null}){super(),this.task=K,this.model=j,this.tokenizer=me,this.processor=Pe}async dispose(){await this.model.dispose()}}class A extends P{constructor(K){super(K)}async _call(K,{top_k:j=1}={}){const me=this.tokenizer(K,{padding:!0,truncation:!0}),Pe=await this.model(me),xe=this.model.config.problem_type==="multi_label_classification"?Le=>Le.sigmoid():Le=>new p.Tensor("float32",(0,l.softmax)(Le.data),Le.dims),Ae=this.model.config.id2label,Ie=[];for(const Le of Pe.logits){const Ne=xe(Le),We=await(0,p.topk)(Ne,j),D=We[0].tolist(),B=We[1].tolist().map((te,de)=>({label:Ae?Ae[te]:`LABEL_${te}`,score:D[de]}));j===1?Ie.push(...B):Ie.push(B)}return Array.isArray(K)||j===1?Ie:Ie[0]}}class v extends P{constructor(K){super(K)}async _call(K,{ignore_labels:j=["O"]}={}){const me=Array.isArray(K),Pe=this.tokenizer(me?K:[K],{padding:!0,truncation:!0}),Ae=(await this.model(Pe)).logits,Ie=this.model.config.id2label,Le=[];for(let Ne=0;NeFe==this.tokenizer.sep_token_id);Le[D].map((Fe,je)=>Fe==1&&(je===0||je>B&&Ne.findIndex(qe=>qe==ee[je])===-1));const te=xe[D].tolist(),de=Ae[D].tolist();for(let Fe=1;Feje==ee[Fe])!==-1)&&(te[Fe]=-1/0,de[Fe]=-1/0);const be=(0,l.softmax)(te).map((Fe,je)=>[Fe,je]),ve=(0,l.softmax)(de).map((Fe,je)=>[Fe,je]);be[0][0]=0,ve[0][0]=0;const Re=(0,a.product)(be,ve).filter(Fe=>Fe[0][1]<=Fe[1][1]).map(Fe=>[Fe[0][1],Fe[1][1],Fe[0][0]*Fe[1][0]]).sort((Fe,je)=>je[2]-Fe[2]);for(let Fe=0;Fete==this.tokenizer.mask_token_id);if(Ne===-1)throw Error(`Mask token (${this.tokenizer.mask_token}) not found in text.`);const We=Pe[Ie][Ne],D=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(We.data),We.dims),j),ee=D[0].tolist(),B=D[1].tolist();xe.push(B.map((te,de)=>{const be=Le.slice();return be[Ne]=te,{score:ee[de],token:Number(te),token_str:this.tokenizer.decode([te]),sequence:this.tokenizer.decode(be,{skip_special_tokens:!0})}}))}return Array.isArray(K)?xe:xe[0]}}class E extends P{constructor(j){super(j);re(this,"_key","generated_text")}async _call(j,me={}){Array.isArray(j)||(j=[j]),this.model.config.prefix&&(j=j.map(Ne=>this.model.config.prefix+Ne));const Pe=this.model.config.task_specific_params;Pe&&Pe[this.task]&&Pe[this.task].prefix&&(j=j.map(Ne=>Pe[this.task].prefix+Ne));const xe=this.tokenizer,Ae={padding:!0,truncation:!0};let Ie;this instanceof w&&"_build_translation_inputs"in xe?Ie=xe._build_translation_inputs(j,Ae,me):Ie=xe(j,Ae);const Le=await this.model.generate({...Ie,...me});return xe.batch_decode(Le,{skip_special_tokens:!0}).map(Ne=>({[this._key]:Ne}))}}class M extends E{constructor(j){super(j);re(this,"_key","summary_text")}}class w extends E{constructor(j){super(j);re(this,"_key","translation_text")}}function x(Me){return Array.isArray(Me)&&Me.every(K=>"role"in K&&"content"in K)}class $ extends P{constructor(K){super(K)}async _call(K,j={}){let me=!1,Pe=!1,xe;if(typeof K=="string")xe=K=[K];else if(Array.isArray(K)&&K.every(B=>typeof B=="string"))me=!0,xe=K;else{if(x(K))K=[K];else if(Array.isArray(K)&&K.every(x))me=!0;else throw new Error("Input must be a string, an array of strings, a Chat, or an array of Chats");Pe=!0,xe=K.map(B=>this.tokenizer.apply_chat_template(B,{tokenize:!1,add_generation_prompt:!0}))}const Ae=j.add_special_tokens??!1,Ie=Pe?!1:j.return_full_text??!0;this.tokenizer.padding_side="left";const Le=this.tokenizer(xe,{add_special_tokens:Ae,padding:!0,truncation:!0}),Ne=await this.model.generate({...Le,...j}),We=this.tokenizer.batch_decode(Ne,{skip_special_tokens:!0});let D;!Ie&&Le.input_ids.dims.at(-1)>0&&(D=this.tokenizer.batch_decode(Le.input_ids,{skip_special_tokens:!0}).map(B=>B.length));const ee=Array.from({length:K.length},B=>[]);for(let B=0;B[j.toLowerCase(),me])),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(K,j,{hypothesis_template:me="This example is {}.",multi_label:Pe=!1}={}){const xe=Array.isArray(K);xe||(K=[K]),Array.isArray(j)||(j=[j]);const Ae=j.map(Ne=>me.replace("{}",Ne)),Ie=Pe||j.length===1,Le=[];for(const Ne of K){const We=[];for(const B of Ae){const te=this.tokenizer(Ne,{text_pair:B,padding:!0,truncation:!0}),de=await this.model(te);Ie?We.push([de.logits.data[this.contradiction_id],de.logits.data[this.entailment_id]]):We.push(de.logits.data[this.entailment_id])}const ee=(Ie?We.map(B=>(0,l.softmax)(B)[1]):(0,l.softmax)(We)).map((B,te)=>[B,te]).sort((B,te)=>te[0]-B[0]);Le.push({sequence:Ne,labels:ee.map(B=>j[B[1]]),scores:ee.map(B=>B[0])})}return xe?Le:Le[0]}}class R extends P{constructor(K){super(K)}async _call(K,{pooling:j="none",normalize:me=!1,quantize:Pe=!1,precision:xe="binary"}={}){const Ae=this.tokenizer(K,{padding:!0,truncation:!0}),Ie=await this.model(Ae);let Le=Ie.last_hidden_state??Ie.logits??Ie.token_embeddings;if(j!=="none")if(j==="mean")Le=(0,p.mean_pooling)(Le,Ae.attention_mask);else if(j==="cls")Le=Le.slice(null,0);else throw Error(`Pooling method '${j}' not supported.`);return me&&(Le=Le.normalize(2,-1)),Pe&&(Le=(0,p.quantize_embeddings)(Le,xe)),Le}}class Q extends P{constructor(K){super(K)}async _call(K,{pool:j=null}={}){const me=await h(K),{pixel_values:Pe}=await this.processor(me),xe=await this.model({pixel_values:Pe});let Ae;if(j){if(!("pooler_output"in xe))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");Ae=xe.pooler_output}else Ae=xe.last_hidden_state??xe.logits??xe.image_embeds;return Ae}}class q extends P{constructor(K){super(K)}async _call(K,{top_k:j=5}={}){const me=this.processor.feature_extractor.config.sampling_rate,Pe=await g(K,me),xe=this.model.config.id2label,Ae=[];for(const Ie of Pe){const Le=await this.processor(Ie),We=(await this.model(Le)).logits[0],D=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(We.data),We.dims),j),ee=D[0].tolist(),te=D[1].tolist().map((de,be)=>({label:xe?xe[de]:`LABEL_${de}`,score:ee[be]}));Ae.push(te)}return Array.isArray(K)?Ae:Ae[0]}}class U extends P{constructor(K){super(K)}async _call(K,j,{hypothesis_template:me="This is a sound of {}."}={}){const Pe=!Array.isArray(K);Pe&&(K=[K]);const xe=j.map(We=>me.replace("{}",We)),Ae=this.tokenizer(xe,{padding:!0,truncation:!0}),Ie=this.processor.feature_extractor.config.sampling_rate,Le=await g(K,Ie),Ne=[];for(const We of Le){const D=await this.processor(We),ee=await this.model({...Ae,...D}),B=(0,l.softmax)(ee.logits_per_audio.data);Ne.push([...B].map((te,de)=>({score:te,label:j[de]})))}return Pe?Ne[0]:Ne}}class Z extends P{constructor(K){super(K)}async _call(K,j={}){switch(this.model.config.model_type){case"whisper":case"lite-whisper":return this._call_whisper(K,j);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(K,j);case"moonshine":return this._call_moonshine(K,j);default:throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(K,j){j.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),j.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');const me=!Array.isArray(K);me&&(K=[K]);const Pe=this.processor.feature_extractor.config.sampling_rate,xe=await g(K,Pe),Ae=[];for(const Ie of xe){const Le=await this.processor(Ie),We=(await this.model(Le)).logits[0],D=[];for(const B of We)D.push((0,l.max)(B.data)[1]);const ee=this.tokenizer.decode(D);Ae.push({text:ee})}return me?Ae[0]:Ae}async _call_whisper(K,j){const me=j.return_timestamps??!1,Pe=j.chunk_length_s??0,xe=j.force_full_sequences??!1;let Ae=j.stride_length_s??null;const Ie={...j};me==="word"&&(Ie.return_token_timestamps=!0,Ie.return_timestamps=!1);const Le=!Array.isArray(K);Le&&(K=[K]);const Ne=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,We=this.processor.feature_extractor.config.hop_length,D=this.processor.feature_extractor.config.sampling_rate,ee=await g(K,D),B=[];for(const te of ee){let de=[];if(Pe>0){if(Ae===null)Ae=Pe/6;else if(Pe<=Ae)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const Re=D*Pe,Fe=D*Ae,je=Re-2*Fe;let qe=0;for(;;){const Xe=qe+Re,ut=te.subarray(qe,Xe),wt=await this.processor(ut),nr=qe===0,jt=Xe>=te.length;if(de.push({stride:[ut.length,nr?0:Fe,jt?0:Fe],input_features:wt.input_features,is_last:jt}),jt)break;qe+=je}}else de=[{stride:[te.length,0,0],input_features:(await this.processor(te)).input_features,is_last:!0}];for(const Re of de){Ie.num_frames=Math.floor(Re.stride[0]/We);const Fe=await this.model.generate({inputs:Re.input_features,...Ie});me==="word"?(Re.tokens=Fe.sequences.tolist()[0],Re.token_timestamps=Fe.token_timestamps.tolist()[0].map(je=>(0,l.round)(je,2))):Re.tokens=Fe[0].tolist(),Re.stride=Re.stride.map(je=>je/D)}const[be,ve]=this.tokenizer._decode_asr(de,{time_precision:Ne,return_timestamps:me,force_full_sequences:xe});B.push({text:be,...ve})}return Le?B[0]:B}async _call_moonshine(K,j){const me=!Array.isArray(K);me&&(K=[K]);const Pe=this.processor.feature_extractor.config.sampling_rate,xe=await g(K,Pe),Ae=[];for(const Ie of xe){const Le=await this.processor(Ie),Ne=Math.floor(Ie.length/Pe)*6,We=await this.model.generate({max_new_tokens:Ne,...j,...Le}),D=this.processor.batch_decode(We,{skip_special_tokens:!0})[0];Ae.push({text:D})}return me?Ae[0]:Ae}}class H extends P{constructor(K){super(K)}async _call(K,j={}){const me=Array.isArray(K),Pe=await h(K),{pixel_values:xe}=await this.processor(Pe),Ae=[];for(const Ie of xe){Ie.dims=[1,...Ie.dims];const Le=await this.model.generate({inputs:Ie,...j}),Ne=this.tokenizer.batch_decode(Le,{skip_special_tokens:!0}).map(We=>({generated_text:We.trim()}));Ae.push(Ne)}return me?Ae:Ae[0]}}class J extends P{constructor(K){super(K)}async _call(K,{top_k:j=5}={}){const me=await h(K),{pixel_values:Pe}=await this.processor(me),xe=await this.model({pixel_values:Pe}),Ae=this.model.config.id2label,Ie=[];for(const Le of xe.logits){const Ne=await(0,p.topk)(new p.Tensor("float32",(0,l.softmax)(Le.data),Le.dims),j),We=Ne[0].tolist(),ee=Ne[1].tolist().map((B,te)=>({label:Ae?Ae[B]:`LABEL_${B}`,score:We[te]}));Ie.push(ee)}return Array.isArray(K)?Ie:Ie[0]}}class ie extends P{constructor(K){super(K),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(K,{threshold:j=.5,mask_threshold:me=.5,overlap_mask_area_threshold:Pe=.8,label_ids_to_fuse:xe=null,target_sizes:Ae=null,subtask:Ie=null}={}){if(Array.isArray(K)&&K.length!==1)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");const Ne=await h(K),We=Ne.map(Re=>[Re.height,Re.width]),D=await this.processor(Ne),{inputNames:ee,outputNames:B}=this.model.sessions.model;if(!ee.includes("pixel_values")){if(ee.length!==1)throw Error(`Expected a single input name, but got ${ee.length} inputs: ${ee}.`);const Re=ee[0];if(Re in D)throw Error(`Input name ${Re} already exists in the inputs.`);D[Re]=D.pixel_values}const te=await this.model(D);let de=null;if(Ie!==null)de=this.subtasks_mapping[Ie];else if(this.processor.image_processor){for(const[Re,Fe]of Object.entries(this.subtasks_mapping))if(Fe in this.processor.image_processor){de=this.processor.image_processor[Fe].bind(this.processor.image_processor),Ie=Re;break}}const be=this.model.config.id2label,ve=[];if(Ie)if(Ie==="panoptic"||Ie==="instance"){const Re=de(te,j,me,Pe,xe,Ae??We)[0],Fe=Re.segmentation;for(const je of Re.segments_info){const qe=new Uint8ClampedArray(Fe.data.length);for(let ut=0;utwt<-1e-5||wt>1+1e-5)&&Xe.sigmoid_();const ut=await u.RawImage.fromTensor(Xe.mul_(255).to("uint8")).resize(qe[1],qe[0]);ve.push({label:null,score:null,mask:ut})}}return ve}}class ae extends ie{constructor(K){super(K)}async _call(K,j={}){if(Array.isArray(K)&&K.length!==1)throw Error("Background removal pipeline currently only supports a batch size of 1.");const Pe=await h(K),xe=await super._call(K,j);return Pe.map((Ie,Le)=>{const Ne=Ie.clone();return Ne.putAlpha(xe[Le].mask),Ne})}}class ce extends P{constructor(K){super(K)}async _call(K,j,{hypothesis_template:me="This is a photo of {}"}={}){const Pe=Array.isArray(K),xe=await h(K),Ae=j.map(ee=>me.replace("{}",ee)),Ie=this.tokenizer(Ae,{padding:this.model.config.model_type==="siglip"?"max_length":!0,truncation:!0}),{pixel_values:Le}=await this.processor(xe),Ne=await this.model({...Ie,pixel_values:Le}),We=this.model.config.model_type==="siglip"?ee=>ee.sigmoid().data:ee=>(0,l.softmax)(ee.data),D=[];for(const ee of Ne.logits_per_image){const te=[...We(ee)].map((de,be)=>({score:de,label:j[be]}));te.sort((de,be)=>be.score-de.score),D.push(te)}return Pe?D:D[0]}}class he extends P{constructor(K){super(K)}async _call(K,{threshold:j=.9,percentage:me=!1}={}){const Pe=Array.isArray(K);if(Pe&&K.length!==1)throw Error("Object detection pipeline currently only supports a batch size of 1.");const xe=await h(K),Ae=me?null:xe.map(B=>[B.height,B.width]),{pixel_values:Ie,pixel_mask:Le}=await this.processor(xe),Ne=await this.model({pixel_values:Ie,pixel_mask:Le}),We=this.processor.image_processor.post_process_object_detection(Ne,j,Ae),D=this.model.config.id2label,ee=We.map(B=>B.boxes.map((te,de)=>({score:B.scores[de],label:D[B.classes[de]],box:_(te,!me)})));return Pe?ee:ee[0]}}class N extends P{constructor(K){super(K)}async _call(K,j,{threshold:me=.1,top_k:Pe=null,percentage:xe=!1}={}){const Ae=Array.isArray(K),Ie=await h(K),Le=this.tokenizer(j,{padding:!0,truncation:!0}),Ne=await this.processor(Ie),We=[];for(let D=0;D({score:ve.scores[Fe],label:ve.labels[Fe],box:_(Re,!xe)}))}else{const ve=this.processor.image_processor.post_process_object_detection(de,me,B,!0)[0];be=ve.boxes.map((Re,Fe)=>({score:ve.scores[Fe],label:j[ve.classes[Fe]],box:_(Re,!xe)}))}be.sort((ve,Re)=>Re.score-ve.score),Pe!==null&&(be=be.slice(0,Pe)),We.push(be)}return Ae?We:We[0]}}class O extends P{constructor(K){super(K)}async _call(K,j,me={}){const Pe=(await h(K))[0],{pixel_values:xe}=await this.processor(Pe),Ae=`${j}`,Ie=this.tokenizer(Ae,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,Le=await this.model.generate({inputs:xe,max_length:this.model.config.decoder.max_position_embeddings,decoder_input_ids:Ie,...me}),We=this.tokenizer.batch_decode(Le)[0].match(/(.*?)<\/s_answer>/);let D=null;return We&&We.length>=2&&(D=We[1].trim()),[{answer:D}]}}class G extends P{constructor(j){super(j);re(this,"DEFAULT_VOCODER_ID","Xenova/speecht5_hifigan");this.vocoder=j.vocoder??null}async _call(j,{speaker_embeddings:me=null}={}){return this.processor?this._call_text_to_spectrogram(j,{speaker_embeddings:me}):this._call_text_to_waveform(j)}async _call_text_to_waveform(j){const me=this.tokenizer(j,{padding:!0,truncation:!0}),{waveform:Pe}=await this.model(me),xe=this.model.config.sampling_rate;return new c.RawAudio(Pe.data,xe)}async _call_text_to_spectrogram(j,{speaker_embeddings:me}){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 me=="string"||me instanceof URL)&&(me=new Float32Array(await(await fetch(me)).arrayBuffer())),me instanceof Float32Array)me=new p.Tensor("float32",me,[1,me.length]);else if(!(me instanceof p.Tensor))throw new Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");const{input_ids:Pe}=this.tokenizer(j,{padding:!0,truncation:!0}),{waveform:xe}=await this.model.generate_speech(Pe,me,{vocoder:this.vocoder}),Ae=this.processor.feature_extractor.config.sampling_rate;return new c.RawAudio(xe.data,Ae)}}class se extends P{constructor(K){super(K)}async _call(K){const j=await h(K),me=await this.processor(j),Pe=await this.model(me),xe=[];for(const Ae of Pe.reconstruction){const Ie=Ae.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");xe.push(u.RawImage.fromTensor(Ie))}return xe.length>1?xe:xe[0]}}class X extends P{constructor(K){super(K)}async _call(K){const j=await h(K),me=await this.processor(j),{predicted_depth:Pe}=await this.model(me),xe=[];for(let Ae=0;Ae1?xe:xe[0]}}const we=Object.freeze({"text-classification":{tokenizer:s.AutoTokenizer,pipeline:A,model:i.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:s.AutoTokenizer,pipeline:v,model:i.AutoModelForTokenClassification,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:s.AutoTokenizer,pipeline:y,model:i.AutoModelForQuestionAnswering,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:s.AutoTokenizer,pipeline:k,model:i.AutoModelForMaskedLM,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:s.AutoTokenizer,pipeline:M,model:i.AutoModelForSeq2SeqLM,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:s.AutoTokenizer,pipeline:w,model:i.AutoModelForSeq2SeqLM,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:s.AutoTokenizer,pipeline:E,model:i.AutoModelForSeq2SeqLM,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:s.AutoTokenizer,pipeline:$,model:i.AutoModelForCausalLM,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:s.AutoTokenizer,pipeline:z,model:i.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:q,model:i.AutoModelForAudioClassification,processor:n.AutoProcessor,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:s.AutoTokenizer,pipeline:U,model:i.AutoModel,processor:n.AutoProcessor,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:s.AutoTokenizer,pipeline:Z,model:[i.AutoModelForSpeechSeq2Seq,i.AutoModelForCTC],processor:n.AutoProcessor,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:s.AutoTokenizer,pipeline:G,model:[i.AutoModelForTextToWaveform,i.AutoModelForTextToSpectrogram],processor:[n.AutoProcessor,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:s.AutoTokenizer,pipeline:H,model:i.AutoModelForVision2Seq,processor:n.AutoProcessor,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:J,model:i.AutoModelForImageClassification,processor:n.AutoProcessor,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:ie,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:n.AutoProcessor,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"background-removal":{pipeline:ae,model:[i.AutoModelForImageSegmentation,i.AutoModelForSemanticSegmentation,i.AutoModelForUniversalSegmentation],processor:n.AutoProcessor,default:{model:"Xenova/modnet"},type:"image"},"zero-shot-image-classification":{tokenizer:s.AutoTokenizer,pipeline:ce,model:i.AutoModel,processor:n.AutoProcessor,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:he,model:i.AutoModelForObjectDetection,processor:n.AutoProcessor,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:s.AutoTokenizer,pipeline:N,model:i.AutoModelForZeroShotObjectDetection,processor:n.AutoProcessor,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:s.AutoTokenizer,pipeline:O,model:i.AutoModelForDocumentQuestionAnswering,processor:n.AutoProcessor,default:{model:"Xenova/donut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:se,model:i.AutoModelForImageToImage,processor:n.AutoProcessor,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:X,model:i.AutoModelForDepthEstimation,processor:n.AutoProcessor,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:s.AutoTokenizer,pipeline:R,model:i.AutoModel,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:n.AutoProcessor,pipeline:Q,model:[i.AutoModelForImageFeatureExtraction,i.AutoModel],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),_e=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function ke(Me,K=null,{progress_callback:j=null,config:me=null,cache_dir:Pe=null,local_files_only:xe=!1,revision:Ae="main",device:Ie=null,dtype:Le=null,subfolder:Ne="onnx",use_external_data_format:We=null,model_file_name:D=null,session_options:ee={}}={}){Me=_e[Me]??Me;const B=we[Me.split("_",1)[0]];if(!B)throw Error(`Unsupported pipeline: ${Me}. Must be one of [${Object.keys(we)}]`);K||(K=B.default.model,console.log(`No model specified. Using default model: "${K}".`));const te={progress_callback:j,config:me,cache_dir:Pe,local_files_only:xe,revision:Ae,device:Ie,dtype:Le,subfolder:Ne,use_external_data_format:We,model_file_name:D,session_options:ee},de=new Map([["tokenizer",B.tokenizer],["model",B.model],["processor",B.processor]]),be=await He(de,K,te);be.task=Me,(0,a.dispatchCallback)(j,{status:"ready",task:Me,model:K});const ve=B.pipeline;return new ve(be)}async function He(Me,K,j){const me=Object.create(null),Pe=[];for(const[xe,Ae]of Me.entries()){if(!Ae)continue;let Ie;Array.isArray(Ae)?Ie=new Promise(async(Le,Ne)=>{var D,ee;let We;for(const B of Ae){if(B===null){Le(null);return}try{Le(await B.from_pretrained(K,j));return}catch(te){if((D=te.message)!=null&&D.includes("Unsupported model type"))We=te;else if((ee=te.message)!=null&&ee.includes("Could not locate file"))We=te;else{Ne(te);return}}}Ne(We)}):Ie=Ae.from_pretrained(K,j),me[xe]=Ie,Pe.push(Ie)}await Promise.all(Pe);for(const[xe,Ae]of Object.entries(me))me[xe]=await Ae;return me}},"./src/tokenizers.js":(e,r,t)=>{t.r(r),t.d(r,{AlbertTokenizer:()=>Vr,AutoTokenizer:()=>Cn,BartTokenizer:()=>hs,BertTokenizer:()=>qr,BlenderbotSmallTokenizer:()=>Jr,BlenderbotTokenizer:()=>Ar,BloomTokenizer:()=>Qr,CLIPTokenizer:()=>xn,CamembertTokenizer:()=>it,CodeGenTokenizer:()=>Xr,CodeLlamaTokenizer:()=>Xs,CohereTokenizer:()=>Pn,ConvBertTokenizer:()=>mr,DebertaTokenizer:()=>xs,DebertaV2Tokenizer:()=>Es,DistilBertTokenizer:()=>et,ElectraTokenizer:()=>zt,EsmTokenizer:()=>en,FalconTokenizer:()=>_s,GPT2Tokenizer:()=>ps,GPTNeoXTokenizer:()=>Zs,GemmaTokenizer:()=>Lr,Grok1Tokenizer:()=>Cs,HerbertTokenizer:()=>Ls,LlamaTokenizer:()=>Qs,M2M100Tokenizer:()=>Bs,MBart50Tokenizer:()=>ms,MBartTokenizer:()=>Er,MPNetTokenizer:()=>Ys,MarianTokenizer:()=>En,MgpstrTokenizer:()=>Ss,MobileBertTokenizer:()=>us,NllbTokenizer:()=>zs,NougatTokenizer:()=>fr,PreTrainedTokenizer:()=>dt,Qwen2Tokenizer:()=>tn,RoFormerTokenizer:()=>Be,RobertaTokenizer:()=>fs,SiglipTokenizer:()=>zr,SpeechT5Tokenizer:()=>cr,SqueezeBertTokenizer:()=>Ts,T5Tokenizer:()=>kr,TokenizerModel:()=>Q,VitsTokenizer:()=>Ns,Wav2Vec2CTCTokenizer:()=>Rs,WhisperTokenizer:()=>Ir,XLMRobertaTokenizer:()=>Js,XLMTokenizer:()=>rr,is_chinese_char:()=>k});var s=t("./src/utils/generic.js"),i=t("./src/utils/core.js"),n=t("./src/utils/hub.js"),o=t("./src/utils/maths.js"),a=t("./src/utils/tensor.js"),l=t("./src/utils/data-structures.js"),c=t("./node_modules/@huggingface/jinja/dist/index.js"),p=t("./src/models/whisper/common_whisper.js");async function u(pe,F){const V=await Promise.all([(0,n.getModelJSON)(pe,"tokenizer.json",!0,F),(0,n.getModelJSON)(pe,"tokenizer_config.json",!0,F)]);return F.legacy!==null&&(V[1].legacy=F.legacy),V}function h(pe,F){const V=[];let Y=0;for(const le of pe.matchAll(F)){const ue=le[0];Y0&&V.push(ue),Y=le.index+ue.length}return Y=19968&&pe<=40959||pe>=13312&&pe<=19903||pe>=131072&&pe<=173791||pe>=173824&&pe<=177983||pe>=177984&&pe<=178207||pe>=178208&&pe<=183983||pe>=63744&&pe<=64255||pe>=194560&&pe<=195103}function E(pe,F,V){const Y=[];let le=0;for(;lethis.tokens_to_ids.get(V)??this.unk_token_id)}convert_ids_to_tokens(F){return F.map(V=>this.vocab[V]??this.unk_token)}}class q extends Q{constructor(F){super(F),this.tokens_to_ids=_(F.vocab),this.unk_token_id=this.tokens_to_ids.get(F.unk_token),this.unk_token=F.unk_token,this.max_input_chars_per_word=F.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(const[V,Y]of this.tokens_to_ids)this.vocab[Y]=V}encode(F){const V=[];for(const Y of F){const le=[...Y];if(le.length>this.max_input_chars_per_word){V.push(this.unk_token);continue}let ue=!1,Ce=0;const Ue=[];for(;Ce0&&(Ze=this.config.continuing_subword_prefix+Ze),this.tokens_to_ids.has(Ze)){Ke=Ze;break}--Qe}if(Ke===null){ue=!0;break}Ue.push(Ke),Ce=Qe}ue?V.push(this.unk_token):V.push(...Ue)}return V}}class U extends Q{constructor(F,V){super(F);const Y=F.vocab.length;this.vocab=new Array(Y),this.scores=new Array(Y);for(let le=0;le[le,ue])),this.bos_token=" ",this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=V.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 l.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(F){const V=F.chars,Y=1;let le=0;for(;le{const pe=[...Array.from({length:94},(le,ue)=>ue+33),...Array.from({length:12},(le,ue)=>ue+161),...Array.from({length:82},(le,ue)=>ue+174)],F=pe.slice();let V=0;for(let le=0;le<256;++le)pe.includes(le)||(pe.push(le),F.push(256+V),V+=1);const Y=F.map(le=>String.fromCharCode(le));return Object.fromEntries(pe.map((le,ue)=>[le,Y[ue]]))})(),H=(0,i.reverseDictionary)(Z);class J extends Q{constructor(F){super(F),this.tokens_to_ids=_(F.vocab),this.unk_token_id=this.tokens_to_ids.get(F.unk_token),this.unk_token=F.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(const[Y,le]of this.tokens_to_ids)this.vocab[le]=Y;const V=Array.isArray(F.merges[0]);this.merges=V?F.merges:F.merges.map(Y=>Y.split(" ",2)),this.bpe_ranks=new Map(this.merges.map((Y,le)=>[JSON.stringify(Y),le])),this.end_of_word_suffix=F.end_of_word_suffix,this.continuing_subword_suffix=F.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.cache=new Map}bpe(F){if(F.length===0)return[];const V=this.cache.get(F);if(V!==void 0)return V;const Y=Array.from(F);this.end_of_word_suffix&&(Y[Y.length-1]+=this.end_of_word_suffix);let le=[];if(Y.length>1){const ue=new l.PriorityQueue((Qe,Ke)=>Qe.score`<0x${Ue.toString(16).toUpperCase().padStart(2,"0")}>`);Ce.every(Ue=>this.tokens_to_ids.has(Ue))?V.push(...Ce):V.push(this.unk_token)}else V.push(this.unk_token)}return V}}class ie extends Q{constructor(F,V){super(F),this.tokens_to_ids=_(V.target_lang?F.vocab[V.target_lang]:F.vocab),this.bos_token=V.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=V.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=V.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=V.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(const[Y,le]of this.tokens_to_ids)this.vocab[le]=Y}encode(F){return F}}class ae extends s.Callable{constructor(F){super(),this.config=F}static fromConfig(F){if(F===null)return null;switch(F.type){case"BertNormalizer":return new Me(F);case"Precompiled":return new jt(F);case"Sequence":return new He(F);case"Replace":return new ce(F);case"NFC":return new N(F);case"NFD":return new O(F);case"NFKC":return new G(F);case"NFKD":return new se(F);case"Strip":return new X(F);case"StripAccents":return new we(F);case"Lowercase":return new _e(F);case"Prepend":return new ke(F);default:throw new Error(`Unknown Normalizer type: ${F.type}`)}}normalize(F){throw Error("normalize should be implemented in subclass.")}_call(F){return this.normalize(F)}}class ce extends ae{normalize(F){const V=g(this.config.pattern);return V===null?F:F.replaceAll(V,this.config.content)}}class he extends ae{constructor(){super(...arguments);re(this,"form")}normalize(V){return V=V.normalize(this.form),V}}class N extends he{constructor(){super(...arguments);re(this,"form","NFC")}}class O extends he{constructor(){super(...arguments);re(this,"form","NFD")}}class G extends he{constructor(){super(...arguments);re(this,"form","NFKC")}}class se extends he{constructor(){super(...arguments);re(this,"form","NFKD")}}class X extends ae{normalize(F){return this.config.strip_left&&this.config.strip_right?F=F.trim():(this.config.strip_left&&(F=F.trimStart()),this.config.strip_right&&(F=F.trimEnd())),F}}class we extends ae{normalize(F){return F=v(F),F}}class _e extends ae{normalize(F){return F=F.toLowerCase(),F}}class ke extends ae{normalize(F){return F=this.config.prepend+F,F}}class He extends ae{constructor(F){super(F),this.normalizers=F.normalizers.map(V=>ae.fromConfig(V))}normalize(F){return this.normalizers.reduce((V,Y)=>Y.normalize(V),F)}}class Me extends ae{_tokenize_chinese_chars(F){const V=[];for(let Y=0;Ythis.pre_tokenize_text(Y,V)):this.pre_tokenize_text(F,V)).flat()}_call(F,V){return this.pre_tokenize(F,V)}}class j extends K{constructor(F){super(),this.pattern=new RegExp(`[^\\s${w}]+|[${w}]`,"gu")}pre_tokenize_text(F,V){return F.trim().match(this.pattern)||[]}}class me extends K{constructor(F){super(),this.config=F,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=new RegExp("'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+","gu"),this.byte_encoder=Z,this.text_encoder=new TextEncoder}pre_tokenize_text(F,V){return this.add_prefix_space&&!F.startsWith(" ")&&(F=" "+F),(this.use_regex?F.match(this.pattern)||[]:[F]).map(le=>Array.from(this.text_encoder.encode(le),ue=>this.byte_encoder[ue]).join(""))}}class Pe extends K{constructor(F){super(),this.config=F,this.pattern=g(this.config.pattern,this.config.invert)}pre_tokenize_text(F,V){var Y;return this.pattern===null?[]:this.config.invert?F.match(this.pattern)||[]:((Y=this.config.behavior)==null?void 0:Y.toLowerCase())==="removed"?F.split(this.pattern).filter(le=>le):h(F,this.pattern)}}class xe extends K{constructor(F){super(),this.config=F,this.pattern=new RegExp(`[^${w}]+|[${w}]+`,"gu")}pre_tokenize_text(F,V){return F.match(this.pattern)||[]}}class Ae extends K{constructor(F){super(),this.config=F;const V=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=new RegExp(V,"gu")}pre_tokenize_text(F,V){return F.match(this.pattern)||[]}}class Ie extends s.Callable{constructor(F){super(),this.config=F}static fromConfig(F){if(F===null)return null;switch(F.type){case"TemplateProcessing":return new We(F);case"ByteLevel":return new D(F);case"RobertaProcessing":return new Ne(F);case"BertProcessing":return new Le(F);case"Sequence":return new ee(F);default:throw new Error(`Unknown PostProcessor type: ${F.type}`)}}post_process(F,...V){throw Error("post_process should be implemented in subclass.")}_call(F,...V){return this.post_process(F,...V)}}class Le extends Ie{constructor(F){super(F),this.cls=F.cls[0],this.sep=F.sep[0]}post_process(F,V=null,{add_special_tokens:Y=!0}={}){Y&&(F=(0,i.mergeArrays)([this.cls],F,[this.sep]));let le=new Array(F.length).fill(0);if(V!==null){const ue=Y&&this instanceof Ne?[this.sep]:[],Ce=Y?[this.sep]:[];F=(0,i.mergeArrays)(F,ue,V,Ce),le=(0,i.mergeArrays)(le,new Array(V.length+ue.length+Ce.length).fill(1))}return{tokens:F,token_type_ids:le}}}class Ne extends Le{}class We extends Ie{constructor(F){super(F),this.single=F.single,this.pair=F.pair}post_process(F,V=null,{add_special_tokens:Y=!0}={}){const le=V===null?this.single:this.pair;let ue=[],Ce=[];for(const Ue of le)"SpecialToken"in Ue?Y&&(ue.push(Ue.SpecialToken.id),Ce.push(Ue.SpecialToken.type_id)):"Sequence"in Ue&&(Ue.Sequence.id==="A"?(ue=(0,i.mergeArrays)(ue,F),Ce=(0,i.mergeArrays)(Ce,new Array(F.length).fill(Ue.Sequence.type_id))):Ue.Sequence.id==="B"&&(ue=(0,i.mergeArrays)(ue,V),Ce=(0,i.mergeArrays)(Ce,new Array(V.length).fill(Ue.Sequence.type_id))));return{tokens:ue,token_type_ids:Ce}}}class D extends Ie{post_process(F,V=null){return V&&(F=(0,i.mergeArrays)(F,V)),{tokens:F}}}class ee extends Ie{constructor(F){super(F),this.processors=F.processors.map(V=>Ie.fromConfig(V))}post_process(F,V=null,Y={}){let le;for(const ue of this.processors)if(ue instanceof D)F=ue.post_process(F).tokens,V&&(V=ue.post_process(V).tokens);else{const Ce=ue.post_process(F,V,Y);F=Ce.tokens,le=Ce.token_type_ids}return{tokens:F,token_type_ids:le}}}class B extends s.Callable{constructor(F){super(),this.config=F,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=F.trim_offsets}static fromConfig(F){if(F===null)return null;switch(F.type){case"WordPiece":return new Re(F);case"Metaspace":return new nr(F);case"ByteLevel":return new Fe(F);case"Replace":return new te(F);case"ByteFallback":return new de(F);case"Fuse":return new be(F);case"Strip":return new ve(F);case"Sequence":return new qe(F);case"CTC":return new je(F);case"BPEDecoder":return new Xe(F);default:throw new Error(`Unknown Decoder type: ${F.type}`)}}_call(F){return this.decode(F)}decode(F){return this.decode_chain(F).join("")}decode_chain(F){throw Error("`decode_chain` should be implemented in subclass.")}}class te extends B{decode_chain(F){const V=g(this.config.pattern);return V===null?F:F.map(Y=>Y.replaceAll(V,this.config.content))}}class de extends B{constructor(F){super(F),this.text_decoder=new TextDecoder}decode_chain(F){const V=[];let Y=[];for(const le of F){let ue=null;if(le.length===6&&le.startsWith("<0x")&&le.endsWith(">")){const Ce=parseInt(le.slice(3,5),16);isNaN(Ce)||(ue=Ce)}if(ue!==null)Y.push(ue);else{if(Y.length>0){const Ce=this.text_decoder.decode(Uint8Array.from(Y));V.push(Ce),Y=[]}V.push(le)}}if(Y.length>0){const le=this.text_decoder.decode(Uint8Array.from(Y));V.push(le),Y=[]}return V}}class be extends B{decode_chain(F){return[F.join("")]}}class ve extends B{constructor(F){super(F),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(F){return F.map(V=>{let Y=0;for(let ue=0;ue(Y!==0&&(V.startsWith(this.config.prefix)?V=V.replace(this.config.prefix,""):V=" "+V),this.cleanup&&(V=A(V)),V))}}class Fe extends B{constructor(F){super(F),this.byte_decoder=H,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(F){const V=F.join(""),Y=new Uint8Array([...V].map(ue=>this.byte_decoder[ue]));return this.text_decoder.decode(Y)}decode_chain(F){const V=[];let Y=[];for(const le of F)this.added_tokens.find(ue=>ue.content===le)!==void 0?(Y.length>0&&(V.push(this.convert_tokens_to_string(Y)),Y=[]),V.push(le)):Y.push(le);return Y.length>0&&V.push(this.convert_tokens_to_string(Y)),V}}class je extends B{constructor(F){super(F),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(F){if(F.length===0)return"";const V=[F[0]];for(let ue=1;ueue!==this.pad_token).join("");return this.cleanup&&(le=A(le).replaceAll(this.word_delimiter_token," ").trim()),le}decode_chain(F){return[this.convert_tokens_to_string(F)]}}class qe extends B{constructor(F){super(F),this.decoders=F.decoders.map(V=>B.fromConfig(V))}decode_chain(F){return this.decoders.reduce((V,Y)=>Y.decode_chain(V),F)}}class Xe extends B{constructor(F){super(F),this.suffix=this.config.suffix}decode_chain(F){return F.map((V,Y)=>V.replaceAll(this.suffix,Y===F.length-1?"":" "))}}class ut extends B{decode_chain(F){let V="";for(let Y=1;YY.normalize("NFKC")).join("~"):F=F.normalize("NFKC"),F}}class dr extends K{constructor(F){super(),this.tokenizers=F.pretokenizers.map(V=>K.fromConfig(V))}pre_tokenize_text(F,V){return this.tokenizers.reduce((Y,le)=>le.pre_tokenize(Y,V),[F])}}class ds extends K{constructor(F){super()}pre_tokenize_text(F,V){return F.match(/\w+|[^\w\s]+/g)||[]}}class Os extends K{constructor(F){super()}pre_tokenize_text(F,V){return M(F)}}class Dr extends K{constructor(F){super(),this.config=F,this.pattern=g(this.config.pattern),this.content=this.config.content}pre_tokenize_text(F,V){return this.pattern===null?[F]:[F.replaceAll(this.pattern,this.config.content)]}}const cs=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function Ds(pe,F,V,Y){for(const le of Object.keys(pe)){const ue=F-pe[le].length,Ce=V(le),Ue=new Array(ue).fill(Ce);pe[le]=Y==="right"?(0,i.mergeArrays)(pe[le],Ue):(0,i.mergeArrays)(Ue,pe[le])}}function jr(pe,F){for(const V of Object.keys(pe))pe[V].length=F}class dt extends s.Callable{constructor(V,Y){super();re(this,"return_token_type_ids",!1);re(this,"padding_side","right");this._tokenizer_config=Y,this.normalizer=ae.fromConfig(V.normalizer),this.pre_tokenizer=K.fromConfig(V.pre_tokenizer),this.model=Q.fromConfig(V.model,Y),this.post_processor=Ie.fromConfig(V.post_processor),this.decoder=B.fromConfig(V.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(const le of V.added_tokens){const ue=new R(le);this.added_tokens.push(ue),this.model.tokens_to_ids.set(ue.content,ue.id),this.model.vocab[ue.id]=ue.content,ue.special&&(this.special_tokens.push(ue.content),this.all_special_ids.push(ue.id))}if(this.additional_special_tokens=Y.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 l.DictionarySplitter(this.added_tokens.map(le=>le.content)),this.added_tokens_map=new Map(this.added_tokens.map(le=>[le.content,le])),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=Y.model_max_length,this.remove_space=Y.remove_space,this.clean_up_tokenization_spaces=Y.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=Y.do_lowercase_and_remove_accent??!1,Y.padding_side&&(this.padding_side=Y.padding_side),this.legacy=!1,this.chat_template=Y.chat_template??null,Array.isArray(this.chat_template)){const le=Object.create(null);for(const{name:ue,template:Ce}of this.chat_template){if(typeof ue!="string"||typeof Ce!="string")throw new Error('Chat template must be a list of objects with "name" and "template" properties');le[ue]=Ce}this.chat_template=le}this._compiled_template_cache=new Map}getToken(...V){for(const Y of V){const le=this._tokenizer_config[Y];if(le)if(typeof le=="object"){if(le.__type==="AddedToken")return le.content;throw Error(`Unknown token: ${le}`)}else return le}return null}static async from_pretrained(V,{progress_callback:Y=null,config:le=null,cache_dir:ue=null,local_files_only:Ce=!1,revision:Ue="main",legacy:Qe=null}={}){const Ke=await u(V,{progress_callback:Y,config:le,cache_dir:ue,local_files_only:Ce,revision:Ue,legacy:Qe});return new this(...Ke)}_call(V,{text_pair:Y=null,add_special_tokens:le=!0,padding:ue=!1,truncation:Ce=null,max_length:Ue=null,return_tensor:Qe=!0,return_token_type_ids:Ke=null}={}){const Ze=Array.isArray(V);let ht;if(Ze){if(V.length===0)throw Error("text array must be non-empty");if(Y!==null){if(Array.isArray(Y)){if(V.length!==Y.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");ht=V.map((kt,Wt)=>this._encode_plus(kt,{text_pair:Y[Wt],add_special_tokens:le,return_token_type_ids:Ke}))}else ht=V.map(kt=>this._encode_plus(kt,{add_special_tokens:le,return_token_type_ids:Ke}))}else{if(V==null)throw Error("text may not be null or undefined");if(Array.isArray(Y))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");ht=[this._encode_plus(V,{text_pair:Y,add_special_tokens:le,return_token_type_ids:Ke})]}if(Ue===null?ue==="max_length"?Ue=this.model_max_length:Ue=(0,o.max)(ht.map(kt=>kt.input_ids.length))[0]:Ce||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."),Ue=Math.min(Ue,this.model_max_length??1/0),ue||Ce)for(let kt=0;ktUe?Ce&&jr(ht[kt],Ue):ue&&Ds(ht[kt],Ue,Wt=>Wt==="input_ids"?this.pad_token_id:0,this.padding_side));const Ct={};if(Qe){if(!(ue&&Ce)&&ht.some(Wt=>{var Ot;for(const Vt of Object.keys(Wt))if(Wt[Vt].length!==((Ot=ht[0][Vt])==null?void 0:Ot.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.");const kt=[ht.length,ht[0].input_ids.length];for(const Wt of Object.keys(ht[0]))Ct[Wt]=new a.Tensor("int64",BigInt64Array.from(ht.flatMap(Ot=>Ot[Wt]).map(BigInt)),kt)}else{for(const kt of Object.keys(ht[0]))Ct[kt]=ht.map(Wt=>Wt[kt]);if(!Ze)for(const kt of Object.keys(Ct))Ct[kt]=Ct[kt][0]}return Ct}_encode_text(V){if(V===null)return null;const Y=this.added_tokens_splitter.split(V);for(let ue=0;ue0&&(Y[ue-1]=Y[ue-1].trimEnd()),Ce.rstrip&&ue{if(ue.length===0)return[];if(this.added_tokens_map.has(ue))return[ue];if(this.remove_space===!0&&(ue=ue.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(ue=y(ue)),this.normalizer!==null&&(ue=this.normalizer(ue)),ue.length===0)return[];const Ue=this.pre_tokenizer!==null?this.pre_tokenizer(ue,{section_index:Ce}):[ue];return this.model(Ue)})}_encode_plus(V,{text_pair:Y=null,add_special_tokens:le=!0,return_token_type_ids:ue=null}={}){const{tokens:Ce,token_type_ids:Ue}=this._tokenize_helper(V,{pair:Y,add_special_tokens:le}),Qe=this.model.convert_tokens_to_ids(Ce),Ke={input_ids:Qe,attention_mask:new Array(Qe.length).fill(1)};return(ue??this.return_token_type_ids)&&Ue&&(Ke.token_type_ids=Ue),Ke}_tokenize_helper(V,{pair:Y=null,add_special_tokens:le=!1}={}){const ue=this._encode_text(V),Ce=this._encode_text(Y);return this.post_processor?this.post_processor(ue,Ce,{add_special_tokens:le}):{tokens:(0,i.mergeArrays)(ue??[],Ce??[])}}tokenize(V,{pair:Y=null,add_special_tokens:le=!1}={}){return this._tokenize_helper(V,{pair:Y,add_special_tokens:le}).tokens}encode(V,{text_pair:Y=null,add_special_tokens:le=!0,return_token_type_ids:ue=null}={}){return this._encode_plus(V,{text_pair:Y,add_special_tokens:le,return_token_type_ids:ue}).input_ids}batch_decode(V,Y={}){return V instanceof a.Tensor&&(V=V.tolist()),V.map(le=>this.decode(le,Y))}decode(V,Y={}){if(V instanceof a.Tensor&&(V=P(V)),!Array.isArray(V)||V.length===0||!(0,i.isIntegralNumber)(V[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(V,Y)}decode_single(V,{skip_special_tokens:Y=!1,clean_up_tokenization_spaces:le=null}){let ue=this.model.convert_ids_to_tokens(V);Y&&(ue=ue.filter(Ue=>!this.special_tokens.includes(Ue)));let Ce=this.decoder?this.decoder(ue):ue.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(Ce=Ce.replaceAll(this.decoder.end_of_word_suffix," "),Y&&(Ce=Ce.trim())),(le??this.clean_up_tokenization_spaces)&&(Ce=A(Ce)),Ce}get_chat_template({chat_template:V=null,tools:Y=null}={}){if(this.chat_template&&typeof this.chat_template=="object"){const le=this.chat_template;if(V!==null&&Object.hasOwn(le,V))V=le[V];else if(V===null)if(Y!==null&&"tool_use"in le)V=le.tool_use;else if("default"in le)V=le.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(le).sort()}.`)}else if(V===null)if(this.chat_template)V=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 V}apply_chat_template(V,{tools:Y=null,documents:le=null,chat_template:ue=null,add_generation_prompt:Ce=!1,tokenize:Ue=!0,padding:Qe=!1,truncation:Ke=!1,max_length:Ze=null,return_tensor:ht=!0,return_dict:Ct=!1,tokenizer_kwargs:kt={},...Wt}={}){if(ue=this.get_chat_template({chat_template:ue,tools:Y}),typeof ue!="string")throw Error(`chat_template must be a string, but got ${typeof ue}`);let Ot=this._compiled_template_cache.get(ue);Ot===void 0&&(Ot=new c.Template(ue),this._compiled_template_cache.set(ue,Ot));const Vt=Object.create(null);for(const _r of cs){const Yr=this.getToken(_r);Yr&&(Vt[_r]=Yr)}const vr=Ot.render({messages:V,add_generation_prompt:Ce,tools:Y,documents:le,...Vt,...Wt});if(Ue){const _r=this._call(vr,{add_special_tokens:!1,padding:Qe,truncation:Ke,max_length:Ze,return_tensor:ht,...kt});return Ct?_r:_r.input_ids}return vr}}class qr extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Vr extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class us extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Ts extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class xs extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Es extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Ls extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class mr extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class Be extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class et extends dt{}class it extends dt{}class rr extends dt{constructor(V,Y){super(V,Y);re(this,"return_token_type_ids",!0);console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class zt extends dt{constructor(){super(...arguments);re(this,"return_token_type_ids",!0)}}class kr extends dt{}class ps extends dt{}class hs extends dt{}class Er extends dt{constructor(F,V){super(F,V),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(Y=>this.languageRegex.test(Y)),this.lang_to_token=Y=>Y}_build_translation_inputs(F,V,Y){return br(this,F,V,Y)}}class ms extends Er{}class fs extends dt{}class Qr extends dt{}const Ps="▁";class Qs extends dt{constructor(V,Y){super(V,Y);re(this,"padding_side","left");this.legacy=Y.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new wt({replacement:Ps,add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(V){if(V===null)return null;if(this.legacy||V.length===0)return super._encode_text(V);let Y=super._encode_text(Ps+V.replaceAll(Ps," "));return Y.length>1&&Y[0]===Ps&&this.special_tokens.includes(Y[1])&&(Y=Y.slice(1)),Y}}class Xs extends dt{}class Js extends dt{}class Ys extends dt{}class _s extends dt{}class Zs extends dt{}class en extends dt{}class tn extends dt{}class Lr extends dt{}class Cs extends dt{}function br(pe,F,V,Y){if(!("language_codes"in pe)||!Array.isArray(pe.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in pe)||!(pe.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in pe)||typeof pe.lang_to_token!="function")throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");const le=Y.src_lang,ue=Y.tgt_lang;if(!pe.language_codes.includes(ue))throw new Error(`Target language code "${ue}" is not valid. Must be one of: {${pe.language_codes.join(", ")}}`);if(le!==void 0){if(!pe.language_codes.includes(le))throw new Error(`Source language code "${le}" is not valid. Must be one of: {${pe.language_codes.join(", ")}}`);for(const Ce of pe.post_processor.config.single)if("SpecialToken"in Ce&&pe.languageRegex.test(Ce.SpecialToken.id)){Ce.SpecialToken.id=pe.lang_to_token(le);break}}return Y.forced_bos_token_id=pe.model.convert_tokens_to_ids([pe.lang_to_token(ue)])[0],pe._call(F,V)}class zs extends dt{constructor(F,V){super(F,V),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(Y=>this.languageRegex.test(Y)),this.lang_to_token=Y=>Y}_build_translation_inputs(F,V,Y){return br(this,F,V,Y)}}class Bs extends dt{constructor(F,V){super(F,V),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(Y=>this.languageRegex.test(Y)).map(Y=>Y.slice(2,-2)),this.lang_to_token=Y=>`__${Y}__`}_build_translation_inputs(F,V,Y){return br(this,F,V,Y)}}class Ir extends dt{get timestamp_begin(){return this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1}_decode_asr(F,{return_timestamps:V=!1,return_language:Y=!1,time_precision:le=null,force_full_sequences:ue=!0}={}){if(le===null)throw Error("Must specify time_precision");let Ce=null;const Ue=V==="word";function Qe(){return{language:Ce,timestamp:[null,null],text:""}}const Ke=[];let Ze=Qe(),ht=0;const Ct=this.timestamp_begin,Wt=Ct+1500;let Ot=[],Vt=[],vr=!1,_r=null;const Yr=new Set(this.all_special_ids);for(const Gt of F){const Zt=Gt.tokens,gr=Ue?Gt.token_timestamps:null;let Zr=null,ws=Ct;if("stride"in Gt){const[Rt,Jt,qt]=Gt.stride;if(ht-=Jt,_r=Rt-qt,Jt&&(ws=Jt/le+Ct),qt)for(let er=Zt.length-1;er>=0;--er){const ir=Number(Zt[er]);if(ir>=Ct){if(Zr!==null&&(ir-Ct)*le<_r)break;Zr=ir}}}let Ht=[],ur=[];for(let Rt=0;Rt=Ct&&Jt<=Wt){const qt=(Jt-Ct)*le+ht,er=(0,o.round)(qt,2);if(Zr!==null&&Jt>=Zr)vr=!0;else if(vr||Ot.length>0&&Jt0?(Ot.push(Ht),Ue&&Vt.push(ur)):Ot.every(Rt=>Rt.length===0)&&(Ze=Qe(),Ot=[],Ht=[],Vt=[],ur=[])}if(Ot.length>0){if(ue&&V)throw new 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.");const[Gt,Zt]=this.findLongestCommonSequence(Ot,Vt),gr=this.decode(Gt);Ze.text=gr,Ue&&(Ze.words=this.collateWordTimestamps(Gt,Zt,Ce)),Ke.push(Ze)}let Tr=Object.create(null);const gs=Ke.map(Gt=>Gt.text).join("");if(V||Y){for(let Gt=0;Gt0;let Ue=Ce?[]:null,Qe=Ce?V[0]:null;for(let Ke=1;KeJt===ws[qt]&&Qe[gs+qt]<=V[Ke][gr+qt]).length:Ht=Zt.filter((Jt,qt)=>Jt===ws[qt]).length;const ur=Tr/1e4,Rt=Ht/Tr+ur;Ht>1&&Rt>ht&&(ht=Rt,Ct=[gs,Gt,gr,Zr])}const[Wt,Ot,Vt,vr]=Ct,_r=Math.floor((Ot+Wt)/2),Yr=Math.floor((vr+Vt)/2);ue.push(...Y.slice(0,_r)),Y=Ze.slice(Yr),le=Y.length,Ce&&(Ue.push(...Qe.slice(0,_r)),Qe=V[Ke].slice(Yr))}return ue.push(...Y),Ce?(Ue.push(...Qe),[ue,Ue]):[ue,[]]}collateWordTimestamps(F,V,Y){const[le,ue,Ce]=this.combineTokensIntoWords(F,Y),Ue=[];for(let Qe=0;Qe=le){const Ue=((Ce-le)*Y).toFixed(2);ue.push(`<|${Ue}|>`),ue.push([])}else ue[ue.length-1].push(Ce);return ue=ue.map(Ce=>typeof Ce=="string"?Ce:super.decode(Ce,V)),ue.join("")}splitTokensOnUnicode(F){const V=this.decode(F,{decode_with_timestamps:!0}),Y="�",le=[],ue=[],Ce=[];let Ue=[],Qe=[],Ke=0;for(let Ze=0;Ze=this.model.tokens_to_ids.get("<|endoftext|>"),Wt=Ze.startsWith(" "),Ot=Ze.trim(),Vt=Qe.test(Ot);if(kt||Wt||Vt||ue.length===0)ue.push(Ze),Ce.push(ht),Ue.push(Ct);else{const vr=ue.length-1;ue[vr]+=Ze,Ce[vr].push(...ht),Ue[vr].push(...Ct)}}return[ue,Ce,Ue]}mergePunctuations(F,V,Y,le,ue){const Ce=structuredClone(F),Ue=structuredClone(V),Qe=structuredClone(Y);let Ke=Ce.length-2,Ze=Ce.length-1;for(;Ke>=0;)Ce[Ke].startsWith(" ")&&le.includes(Ce[Ke].trim())?(Ce[Ze]=Ce[Ke]+Ce[Ze],Ue[Ze]=(0,i.mergeArrays)(Ue[Ke],Ue[Ze]),Qe[Ze]=(0,i.mergeArrays)(Qe[Ke],Qe[Ze]),Ce[Ke]="",Ue[Ke]=[],Qe[Ke]=[]):Ze=Ke,--Ke;for(Ke=0,Ze=1;Zeht),Ue.filter(ht=>ht.length>0),Qe.filter(ht=>ht.length>0)]}}class Xr extends dt{}class xn extends dt{}class zr extends dt{}class En extends dt{constructor(F,V){super(F,V),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(Y=>this.languageRegex.test(Y)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(F){if(F===null)return null;const[V,...Y]=F.trim().split(this.languageRegex);if(Y.length===0)return super._encode_text(V);if(Y.length===2){const[le,ue]=Y;return this.supported_language_codes.includes(le)||console.warn(`Unsupported language code "${le}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,i.mergeArrays)([le],super._encode_text(ue))}}}class Rs extends dt{}class Ar extends dt{}class Jr extends dt{}class cr extends dt{}class fr extends dt{}class Ns extends dt{constructor(F,V){super(F,V),this.decoder=new ut({})}}class Pn extends dt{}class Ss extends dt{}class Cn{static async from_pretrained(F,{progress_callback:V=null,config:Y=null,cache_dir:le=null,local_files_only:ue=!1,revision:Ce="main",legacy:Ue=null}={}){var Ct;const[Qe,Ke]=await u(F,{progress_callback:V,config:Y,cache_dir:le,local_files_only:ue,revision:Ce,legacy:Ue}),Ze=((Ct=Ke.tokenizer_class)==null?void 0:Ct.replace(/Fast$/,""))??"PreTrainedTokenizer";let ht=this.TOKENIZER_CLASS_MAPPING[Ze];return ht||(console.warn(`Unknown tokenizer class "${Ze}", attempting to construct from base class.`),ht=dt),new ht(Qe,Ke)}}re(Cn,"TOKENIZER_CLASS_MAPPING",{T5Tokenizer:kr,DistilBertTokenizer:et,CamembertTokenizer:it,DebertaTokenizer:xs,DebertaV2Tokenizer:Es,BertTokenizer:qr,HerbertTokenizer:Ls,ConvBertTokenizer:mr,RoFormerTokenizer:Be,XLMTokenizer:rr,ElectraTokenizer:zt,MobileBertTokenizer:us,SqueezeBertTokenizer:Ts,AlbertTokenizer:Vr,GPT2Tokenizer:ps,BartTokenizer:hs,MBartTokenizer:Er,MBart50Tokenizer:ms,RobertaTokenizer:fs,WhisperTokenizer:Ir,CodeGenTokenizer:Xr,CLIPTokenizer:xn,SiglipTokenizer:zr,MarianTokenizer:En,BloomTokenizer:Qr,NllbTokenizer:zs,M2M100Tokenizer:Bs,LlamaTokenizer:Qs,CodeLlamaTokenizer:Xs,XLMRobertaTokenizer:Js,MPNetTokenizer:Ys,FalconTokenizer:_s,GPTNeoXTokenizer:Zs,EsmTokenizer:en,Wav2Vec2CTCTokenizer:Rs,BlenderbotTokenizer:Ar,BlenderbotSmallTokenizer:Jr,SpeechT5Tokenizer:cr,NougatTokenizer:fr,VitsTokenizer:Ns,Qwen2Tokenizer:tn,GemmaTokenizer:Lr,Grok1Tokenizer:Cs,CohereTokenizer:Pn,MgpstrTokenizer:Ss,PreTrainedTokenizer:dt})},"./src/utils/audio.js":(e,r,t)=>{t.r(r),t.d(r,{RawAudio:()=>q,hamming:()=>h,hanning:()=>u,mel_filter_bank:()=>k,read_audio:()=>c,spectrogram:()=>$,window_function:()=>z});var s=t("./src/utils/hub.js"),i=t("./src/utils/maths.js"),n=t("./src/utils/core.js"),o=t("./src/env.js"),a=t("?7a2c"),l=t("./src/utils/tensor.js");async function c(U,Z){if(typeof AudioContext>"u")throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");const H=await(await(0,s.getFile)(U)).arrayBuffer(),J=new AudioContext({sampleRate:Z});typeof Z>"u"&&console.warn(`No sampling rate provided, using default of ${J.sampleRate}Hz.`);const ie=await J.decodeAudioData(H);let ae;if(ie.numberOfChannels===2){const ce=Math.sqrt(2),he=ie.getChannelData(0),N=ie.getChannelData(1);ae=new Float32Array(he.length);for(let O=0;O2595*Math.log10(1+U/700),kaldi:U=>1127*Math.log(1+U/700),slaney:(U,Z=1e3,H=15,J=27/Math.log(6.4))=>U>=Z?H+Math.log(U/Z)*J:3*U/200};function _(U,Z="htk"){const H=g[Z];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof U=="number"?H(U):U.map(J=>H(J))}const P={htk:U=>700*(10**(U/2595)-1),kaldi:U=>700*(Math.exp(U/1127)-1),slaney:(U,Z=1e3,H=15,J=Math.log(6.4)/27)=>U>=H?Z*Math.exp(J*(U-H)):200*U/3};function A(U,Z="htk"){const H=P[Z];if(!H)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof U=="number"?H(U):U.map(J=>H(J))}function v(U,Z){const H=Float64Array.from({length:Z.length-1},(ce,he)=>Z[he+1]-Z[he]),J=Array.from({length:U.length},()=>new Array(Z.length));for(let ce=0;cenew Array(U.length));for(let ce=0;ceU+J*ae)}function k(U,Z,H,J,ie,ae=null,ce="htk",he=!1){if(ae!==null&&ae!=="slaney")throw new Error('norm must be one of null or "slaney"');const N=_(H,ce),O=_(J,ce),G=y(N,O,Z+2);let se=A(G,ce),X;if(he){const _e=ie/(U*2);X=_(Float64Array.from({length:U},(ke,He)=>He*_e),ce),se=G}else X=y(0,Math.floor(ie/2),U);const we=v(X,se);if(ae!==null&&ae==="slaney")for(let _e=0;_eie)throw Error(`frame_length (${H}) may not be larger than fft_length (${ie})`);if(Pe!==H)throw new Error(`Length of the window (${Pe}) must equal frame_length (${H})`);if(J<=0)throw new Error("hop_length must be greater than zero");if(ae===null&&G!==null)throw new Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(ce){if(he!=="reflect")throw new Error(`pad_mode="${he}" not implemented yet.`);const be=Math.floor((ie-1)/2)+1;U=E(U,be,be)}let xe=Math.floor(1+Math.floor((U.length-H)/J));Me!==null&&xexe?j&&(Le=K):Le=Ie=K);const Ne=new i.FFT(ie),We=new Float64Array(ie),D=new Float64Array(Ne.outputBufferSize),ee=new Float32Array(Ae*Le);for(let be=0;be=1;--Fe)We[Fe]-=O*We[Fe-1];We[0]*=1-O}for(let Fe=0;FeMath.pow(he,.85));break;default:throw new Error(`Unknown window type ${Z}.`)}if(H&&(ce=ce.subarray(0,U)),J===null)return ce;if(U>J)throw new Error(`Length of the window (${U}) may not be larger than frame_length (${J})`);return ce}function R(U,Z){let H=44;const J=new ArrayBuffer(H+U.length*4),ie=new DataView(J);Q(ie,0,"RIFF"),ie.setUint32(4,36+U.length*4,!0),Q(ie,8,"WAVE"),Q(ie,12,"fmt "),ie.setUint32(16,16,!0),ie.setUint16(20,3,!0),ie.setUint16(22,1,!0),ie.setUint32(24,Z,!0),ie.setUint32(28,Z*4,!0),ie.setUint16(32,4,!0),ie.setUint16(34,32,!0),Q(ie,36,"data"),ie.setUint32(40,U.length*4,!0);for(let ae=0;ae{let ae=await ie.arrayBuffer();a.writeFileSync(J,Buffer.from(ae))};else throw new Error("Unable to save because filesystem is disabled in this environment.");await H(Z,this.toBlob())}}},"./src/utils/constants.js":(e,r,t)=>{t.r(r),t.d(r,{CHAT_TEMPLATE_NAME:()=>l,CONFIG_NAME:()=>i,FEATURE_EXTRACTOR_NAME:()=>n,GENERATION_CONFIG_NAME:()=>c,GITHUB_ISSUE_URL:()=>s,IMAGE_PROCESSOR_NAME:()=>o,PROCESSOR_NAME:()=>a});const s="https://github.com/huggingface/transformers.js/issues/new/choose",i="config.json",n="preprocessor_config.json",o=n,a="processor_config.json",l="chat_template.json",c="generation_config.json"},"./src/utils/core.js":(e,r,t)=>{t.r(r),t.d(r,{calculateDimensions:()=>c,calculateReflectOffset:()=>g,count:()=>v,dispatchCallback:()=>s,escapeRegExp:()=>n,isIntegralNumber:()=>a,isNullishDimension:()=>l,isTypedArray:()=>o,len:()=>A,mergeArrays:()=>u,pick:()=>P,pop:()=>p,product:()=>h,reverseDictionary:()=>i,saveBlob:()=>_});function s(y,k){y&&y(k)}function i(y){return Object.fromEntries(Object.entries(y).map(([k,E])=>[E,k]))}function n(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(y){var k,E,M;return((M=(E=(k=y==null?void 0:y.prototype)==null?void 0:k.__proto__)==null?void 0:E.constructor)==null?void 0:M.name)==="TypedArray"}function a(y){return Number.isInteger(y)||typeof y=="bigint"}function l(y){return y==null||y===-1}function c(y){const k=[];let E=y;for(;Array.isArray(E);)k.push(E.length),E=E[0];return k}function p(y,k,E=void 0){const M=y[k];if(M!==void 0)return delete y[k],M;if(E===void 0)throw Error(`Key ${k} does not exist in object.`);return E}function u(...y){return Array.prototype.concat.apply([],y)}function h(...y){return y.reduce((k,E)=>k.flatMap(M=>E.map(w=>[M,w])))}function g(y,k){return Math.abs((y+k)%(2*k)-k)}function _(y,k){const E=URL.createObjectURL(k),M=document.createElement("a");M.href=E,M.download=y,M.click(),M.remove(),URL.revokeObjectURL(E)}function P(y,k){return Object.assign({},...k.map(E=>{if(y[E]!==void 0)return{[E]:y[E]}}))}function A(y){let k=0;for(const E of y)++k;return k}function v(y,k){let E=0;for(const M of y)M===k&&++E;return E}},"./src/utils/data-structures.js":(e,r,t)=>{t.r(r),t.d(r,{CharTrie:()=>i,DictionarySplitter:()=>l,PriorityQueue:()=>s,TokenLattice:()=>o});class s{constructor(p=(h,g)=>h>g,u=1/0){this._heap=[],this._comparator=p,this._maxSize=u}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...p){return this.extend(p)}extend(p){for(const u of p)if(this.size0&&this._swap(0,u),this._heap.pop(),this._siftDown(),p}replace(p){const u=this.peek();return this._heap[0]=p,this._siftDown(),u}_parent(p){return(p+1>>>1)-1}_left(p){return(p<<1)+1}_right(p){return p+1<<1}_greater(p,u){return this._comparator(this._heap[p],this._heap[u])}_swap(p,u){const h=this._heap[p];this._heap[p]=this._heap[u],this._heap[u]=h}_siftUp(){this._siftUpFrom(this.size-1)}_siftUpFrom(p){for(;p>0&&this._greater(p,this._parent(p));)this._swap(p,this._parent(p)),p=this._parent(p)}_siftDown(){let p=0;for(;this._left(p)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);const g=new a(this.bosTokenId,0,0,0,0),_=new a(this.eosTokenId,1,this.len,0,0);this.nodes.push(g.clone()),this.nodes.push(_.clone()),this.beginNodes[this.len].push(_),this.endNodes[0].push(g)}insert(p,u,h,g){const _=this.nodes.length,P=new a(g,_,p,u,h);this.beginNodes[p].push(P),this.endNodes[p+u].push(P),this.nodes.push(P)}viterbi(){const p=this.len;let u=0;for(;u<=p;){if(this.beginNodes[u].length==0)return[];for(let A of this.beginNodes[u]){A.prev=null;let v=0,y=null;for(let k of this.endNodes[u]){const E=k.backtraceScore+A.score;(y===null||E>v)&&(y=k.clone(),v=E)}if(y!==null)A.prev=y,A.backtraceScore=v;else return[]}++u}const h=[],_=this.beginNodes[p][0].prev;if(_===null)return[];let P=_.clone();for(;P.prev!==null;)h.push(P.clone()),P=P.clone().prev.clone();return h.reverse(),h}piece(p){return this.chars.slice(p.pos,p.pos+p.length).join("")}tokens(){return this.viterbi().map(u=>this.piece(u))}tokenIds(){return this.viterbi().map(u=>u.tokenId)}}class a{constructor(p,u,h,g,_){this.tokenId=p,this.nodeId=u,this.pos=h,this.length=g,this.score=_,this.prev=null,this.backtraceScore=0}clone(){const p=new a(this.tokenId,this.nodeId,this.pos,this.length,this.score);return p.prev=this.prev,p.backtraceScore=this.backtraceScore,p}}class l{constructor(p){this.trie=this._buildTrie(p)}_buildTrie(p){var h;const u=Object.create(null);for(const g of p){let _=u;for(let P=0;Pg&&u.push(p.slice(g,_)),u.push(A),_+=A.length,g=_):++_}return g{t.r(r),t.d(r,{DEVICE_TYPES:()=>s});const s=Object.freeze({auto:"auto",gpu:"gpu",cpu:"cpu",wasm:"wasm",webgpu:"webgpu",cuda:"cuda",dml:"dml",webnn:"webnn","webnn-npu":"webnn-npu","webnn-gpu":"webnn-gpu","webnn-cpu":"webnn-cpu"})},"./src/utils/dtypes.js":(e,r,t)=>{t.r(r),t.d(r,{DATA_TYPES:()=>o,DEFAULT_DEVICE_DTYPE_MAPPING:()=>a,DEFAULT_DTYPE_SUFFIX_MAPPING:()=>l,isWebGpuFp16Supported:()=>n});var s=t("./src/env.js"),i=t("./src/utils/devices.js");const n=function(){let c;return async function(){if(c===void 0)if(!s.apis.IS_WEBGPU_AVAILABLE)c=!1;else try{c=(await navigator.gpu.requestAdapter()).features.has("shader-f16")}catch{c=!1}return c}}(),o=Object.freeze({auto:"auto",fp32:"fp32",fp16:"fp16",q8:"q8",int8:"int8",uint8:"uint8",q4:"q4",bnb4:"bnb4",q4f16:"q4f16"}),a=Object.freeze({[i.DEVICE_TYPES.wasm]:o.q8}),l=Object.freeze({[o.fp32]:"",[o.fp16]:"_fp16",[o.int8]:"_int8",[o.uint8]:"_uint8",[o.q8]:"_quantized",[o.q4]:"_q4",[o.q4f16]:"_q4f16",[o.bnb4]:"_bnb4"})},"./src/utils/generic.js":(e,r,t)=>{t.r(r),t.d(r,{Callable:()=>s});const s=class{constructor(){let i=function(...n){return i._call(...n)};return Object.setPrototypeOf(i,new.target.prototype)}_call(...i){throw Error("Must implement _call method in subclass")}}},"./src/utils/hub.js":(e,r,t)=>{t.r(r),t.d(r,{MAX_EXTERNAL_DATA_CHUNKS:()=>a,getFile:()=>g,getModelFile:()=>y,getModelJSON:()=>k});var s=t("?7a2c"),i=t("?a42a"),n=t("./src/env.js"),o=t("./src/utils/core.js");const a=100,l={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};class c{constructor(x){if(this.filePath=x,this.headers=new Headers,this.exists=s.existsSync(x),this.exists){this.status=200,this.statusText="OK";let $=s.statSync(x);this.headers.set("content-length",$.size.toString()),this.updateContentType();const z=s.createReadStream(x);this.body=new ReadableStream({start(R){z.on("data",Q=>R.enqueue(Q)),z.on("end",()=>R.close()),z.on("error",Q=>R.error(Q))},cancel(){z.destroy()}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const x=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",l[x]??"application/octet-stream")}clone(){let x=new c(this.filePath);return x.exists=this.exists,x.status=this.status,x.statusText=this.statusText,x.headers=new Headers(this.headers),x}async arrayBuffer(){return(await s.promises.readFile(this.filePath)).buffer}async blob(){const x=await s.promises.readFile(this.filePath);return new Blob([x],{type:this.headers.get("content-type")})}async text(){return await s.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function p(w,x=null,$=null){let z;try{z=new URL(w)}catch{return!1}return!(x&&!x.includes(z.protocol)||$&&!$.includes(z.hostname))}const u=/^(\b[\w\-.]+\b\/)?\b[\w\-.]{1,96}\b$/;function h(w){return!(!u.test(w)||w.includes("..")||w.includes("--")||w.endsWith(".git")||w.endsWith(".ipynb"))}async function g(w){var x;if(n.env.useFS&&!p(w,["http:","https:","blob:"]))return new c(w.toString());if(typeof process<"u"&&((x=process==null?void 0:process.release)==null?void 0:x.name)==="node"){const $=!!(Fs!=null&&Fs.TESTING_REMOTELY),z=n.env.version,R=new Headers;if(R.set("User-Agent",`transformers.js/${z}; is_ci/${$};`),p(w,["http:","https:"],["huggingface.co","hf.co"])){const q=(Fs==null?void 0:Fs.HF_TOKEN)??(Fs==null?void 0:Fs.HF_ACCESS_TOKEN);q&&R.set("Authorization",`Bearer ${q}`)}return fetch(w,{headers:R})}else return fetch(w)}const _={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};function P(w,x,$){if(!$)return null;const z=_[w]??`Error (${w}) occurred while trying to load file`;throw Error(`${z}: "${x}".`)}class A{constructor(x){this.path=x}async match(x){let $=i.join(this.path,x),z=new c($);if(z.exists)return z}async put(x,$,z=void 0){let R=i.join(this.path,x);try{const Q=$.headers.get("Content-Length"),q=parseInt(Q??"0");let U=0;await s.promises.mkdir(i.dirname(R),{recursive:!0});const Z=s.createWriteStream(R),H=$.body.getReader();for(;;){const{done:J,value:ie}=await H.read();if(J)break;await new Promise((ce,he)=>{Z.write(ie,N=>{if(N){he(N);return}ce()})}),U+=ie.length;const ae=q?U/q*100:0;z==null||z({progress:ae,loaded:U,total:q})}Z.close()}catch(Q){try{await s.promises.unlink(R)}catch{}throw Q}}}async function v(w,...x){for(let $ of x)try{let z=await w.match($);if(z)return z}catch{continue}}async function y(w,x,$=!0,z={},R=!1){if(!n.env.allowLocalModels){if(z.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!n.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}(0,o.dispatchCallback)(z.progress_callback,{status:"initiate",name:w,file:x});let Q;if(!Q&&n.env.useBrowserCache){if(typeof caches>"u")throw Error("Browser cache is not available in this environment.");try{Q=await caches.open("transformers-cache")}catch(se){console.warn("An error occurred while opening the browser cache:",se)}}if(!Q&&n.env.useFSCache&&(Q=new A(z.cache_dir??n.env.cacheDir)),!Q&&n.env.useCustomCache){if(!n.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!n.env.customCache.match||!n.env.customCache.put)throw new Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");Q=n.env.customCache}const q=z.revision??"main",U=M(w,x),Z=h(w),H=Z?M(n.env.localModelPath,U):U,J=M(n.env.remoteHost,n.env.remotePathTemplate.replaceAll("{model}",w).replaceAll("{revision}",encodeURIComponent(q)),x);let ie;const ae=Q instanceof A?q==="main"?U:M(w,q,x):J;let ce=!1,he;Q&&(he=await v(Q,H,ae));const N=he!==void 0;if(he===void 0){if(n.env.allowLocalModels)if(p(U,["http:","https:"])){if(z.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${U}.`);if(!n.env.allowRemoteModels)throw new Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${U}.`)}else try{he=await g(H),ie=H}catch(X){console.warn(`Unable to load from local path "${H}": "${X}"`)}if(he===void 0||he.status===404){if(z.local_files_only||!n.env.allowRemoteModels){if($)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${H}".`);return null}if(!Z)throw Error(`Local file missing at "${H}" and download aborted due to invalid model ID "${w}".`);if(he=await g(J),he.status!==200)return P(he.status,J,$);ie=ae}ce=Q&&typeof Response<"u"&&he instanceof Response&&he.status===200}(0,o.dispatchCallback)(z.progress_callback,{status:"download",name:w,file:x});let O;if(!(n.apis.IS_NODE_ENV&&R)){let se;z.progress_callback?N&&typeof navigator<"u"&&/firefox/i.test(navigator.userAgent)?(se=new Uint8Array(await he.arrayBuffer()),(0,o.dispatchCallback)(z.progress_callback,{status:"progress",name:w,file:x,progress:100,loaded:se.length,total:se.length})):se=await E(he,X=>{(0,o.dispatchCallback)(z.progress_callback,{status:"progress",name:w,file:x,...X})}):se=new Uint8Array(await he.arrayBuffer()),O=se}if(ce&&ie&&await Q.match(ie)===void 0&&(O?await Q.put(ie,new Response(O,{headers:he.headers})).catch(se=>{console.warn(`Unable to add response to browser cache: ${se}.`)}):await Q.put(ie,he,z.progress_callback)),(0,o.dispatchCallback)(z.progress_callback,{status:"done",name:w,file:x}),O){if(R)throw new Error("Cannot return path in a browser environment.");return O}if(he instanceof c)return he.filePath;const G=await Q.match(ie);if(G instanceof c)return G.filePath;throw new Error("Unable to return path for response.")}async function k(w,x,$=!0,z={}){const R=await y(w,x,$,z,!1);if(R===null)return{};const q=new TextDecoder("utf-8").decode(R);return JSON.parse(q)}async function E(w,x){const $=w.headers.get("Content-Length");$===null&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let z=parseInt($??"0"),R=new Uint8Array(z),Q=0;const q=w.body.getReader();async function U(){const{done:Z,value:H}=await q.read();if(Z)return;const J=Q+H.length;if(J>z){z=J;const ae=new Uint8Array(z);ae.set(R),R=ae}R.set(H,Q),Q=J;const ie=Q/z*100;return x({progress:ie,loaded:Q,total:z}),U()}return await U(),R}function M(...w){return w=w.map((x,$)=>($&&(x=x.replace(new RegExp("^/"),"")),$!==w.length-1&&(x=x.replace(new RegExp("/$"),"")),x)),w.join("/")}},"./src/utils/image.js":(e,r,t)=>{t.r(r),t.d(r,{RawImage:()=>_,load_image:()=>P});var s=t("./src/utils/core.js"),i=t("./src/utils/hub.js"),n=t("./src/env.js"),o=t("./src/utils/tensor.js"),a=t("?2b25");let l,c,p;const u=n.apis.IS_BROWSER_ENV||n.apis.IS_WEBWORKER_ENV;if(u)l=(A,v)=>{if(!self.OffscreenCanvas)throw new Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas(A,v)},p=self.createImageBitmap,c=self.ImageData;else if(a)p=async A=>{const y=(await A.metadata()).channels,{data:k,info:E}=await A.rotate().raw().toBuffer({resolveWithObject:!0}),M=new _(new Uint8ClampedArray(k),E.width,E.height,E.channels);return y!==void 0&&y!==E.channels&&M.convert(y),M};else throw new Error("Unable to load image processing library.");const h={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},g=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class _{constructor(v,y,k,E){this.data=v,this.width=y,this.height=k,this.channels=E}get size(){return[this.width,this.height]}static async read(v){if(v instanceof _)return v;if(typeof v=="string"||v instanceof URL)return await this.fromURL(v);if(v instanceof Blob)return await this.fromBlob(v);if(typeof HTMLCanvasElement<"u"&&v instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&v instanceof OffscreenCanvas)return this.fromCanvas(v);throw new Error(`Unsupported input type: ${typeof v}`)}static fromCanvas(v){if(!u)throw new Error("fromCanvas() is only supported in browser environments.");const k=v.getContext("2d").getImageData(0,0,v.width,v.height).data;return new _(k,v.width,v.height,4)}static async fromURL(v){const y=await(0,i.getFile)(v);if(y.status!==200)throw new Error(`Unable to read image from "${v}" (${y.status} ${y.statusText})`);const k=await y.blob();return this.fromBlob(k)}static async fromBlob(v){if(u){const y=await p(v),k=l(y.width,y.height).getContext("2d");return k.drawImage(y,0,0),new this(k.getImageData(0,0,y.width,y.height).data,y.width,y.height,4)}else{const y=a(await v.arrayBuffer());return await p(y)}}static fromTensor(v,y="CHW"){if(v.dims.length!==3)throw new Error(`Tensor should have 3 dimensions, but has ${v.dims.length} dimensions.`);if(y==="CHW")v=v.transpose(1,2,0);else if(y!=="HWC")throw new Error(`Unsupported channel format: ${y}`);if(!(v.data instanceof Uint8ClampedArray||v.data instanceof Uint8Array))throw new Error(`Unsupported tensor type: ${v.type}`);switch(v.dims[2]){case 1:case 2:case 3:case 4:return new _(v.data,v.dims[1],v.dims[0],v.dims[2]);default:throw new Error(`Unsupported number of channels: ${v.dims[2]}`)}}grayscale(){if(this.channels===1)return this;const v=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let y=0,k=0;y=0?$=k:R=-k,E>=0?z=E:Q=-E,x.drawImage(w,$,z,v,y,R,Q,v,y),new _(x.getImageData(0,0,v,y).data,v,y,4).convert(M)}else{let M=this.toSharp();if(k>=0&&E>=0)M=M.extract({left:Math.floor(k),top:Math.floor(E),width:v,height:y});else if(k<=0&&E<=0){const w=Math.floor(-E),x=Math.floor(-k);M=M.extend({top:w,left:x,right:v-this.width-x,bottom:y-this.height-w})}else{let w=[0,0],x=0;E<0?(w[0]=Math.floor(-E),w[1]=y-this.height-w[0]):x=Math.floor(E);let $=[0,0],z=0;k<0?($[0]=Math.floor(-k),$[1]=v-this.width-$[0]):z=Math.floor(k),M=M.extend({top:w[0],bottom:w[1],left:$[0],right:$[1]}).extract({left:z,top:x,width:v,height:y})}return await p(M)}}async toBlob(v="image/png",y=1){if(!u)throw new Error("toBlob() is only supported in browser environments.");return await this.toCanvas().convertToBlob({type:v,quality:y})}toTensor(v="CHW"){let y=new o.Tensor("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if(v!=="HWC")if(v==="CHW")y=y.permute(2,0,1);else throw new Error(`Unsupported channel format: ${v}`);return y}toCanvas(){if(!u)throw new Error("toCanvas() is only supported in browser environments.");const v=this.clone().rgba(),y=l(v.width,v.height),k=new c(v.data,v.width,v.height);return y.getContext("2d").putImageData(k,0,0),y}split(){const{data:v,width:y,height:k,channels:E}=this,M=v.constructor,w=v.length/E,x=Array.from({length:E},()=>new M(w));for(let $=0;$new _($,y,k,1))}_update(v,y,k,E=null){return this.data=v,this.width=y,this.height=k,E!==null&&(this.channels=E),this}clone(){return new _(this.data.slice(),this.width,this.height,this.channels)}convert(v){if(this.channels===v)return this;switch(v){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(v){if(u){if(n.apis.IS_WEBWORKER_ENV)throw new Error("Unable to save an image from a Web Worker.");const y=v.split(".").pop().toLowerCase(),k=g.get(y)??"image/png",E=await this.toBlob(k);(0,s.saveBlob)(v,E)}else{if(n.apis.IS_FS_AVAILABLE)return await this.toSharp().toFile(v);throw new Error("Unable to save the image because filesystem is disabled in this environment.")}}toSharp(){if(u)throw new Error("toSharp() is only supported in server-side environments.");return a(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}const P=_.read.bind(_)},"./src/utils/maths.js":(e,r,t)=>{t.r(r),t.d(r,{FFT:()=>P,bankers_round:()=>y,cos_sim:()=>l,dot:()=>a,dynamic_time_warping:()=>k,interpolate_data:()=>s,log_softmax:()=>o,magnitude:()=>c,max:()=>u,medianFilter:()=>A,min:()=>p,permute_data:()=>i,round:()=>v,softmax:()=>n});function s(E,[M,w,x],[$,z],R="bilinear",Q=!1){const q=z/x,U=$/w,Z=new E.constructor($*z*M),H=w*x,J=$*z;for(let ie=0;ie<$;++ie)for(let ae=0;ae=0;--Q)$[Q]=q,x[Q]=M[w[Q]],q*=x[Q];const z=w.map((Q,q)=>$[w.indexOf(q)]),R=new E.constructor(E.length);for(let Q=0;Q=0;--U)q+=Z%M[U]*z[U],Z=Math.floor(Z/M[U]);R[q]=E[Q]}return[R,x]}function n(E){const M=u(E)[0],w=E.map(z=>Math.exp(z-M)),x=w.reduce((z,R)=>z+R,0);return w.map(z=>z/x)}function o(E){const M=u(E)[0];let w=0;for(let z=0;zz-M-x)}function a(E,M){let w=0;for(let x=0;xM+w*w,0))}function p(E){if(E.length===0)throw Error("Array must not be empty");let M=E[0],w=0;for(let x=1;xM&&(M=E[x],w=x);return[M,w]}function h(E){return E>0&&(E&E-1)===0}class g{constructor(M){if(this.size=M|0,this.size<=1||!h(this.size))throw new Error("FFT size must be a power of two larger than 1");this._csize=M<<1,this.table=new Float64Array(this.size*2);for(let x=0;xx;x<<=1)++w;this._width=w%2===0?w-1:w,this._bitrev=new Int32Array(1<>>$&3)<>>1);for(let $=0;$>>1]=M[$];return x}toComplexArray(M,w){const x=w||this.createComplexArray();for(let $=0;$>>1],x[$+1]=0;return x}transform(M,w){if(M===w)throw new Error("Input and output buffers must be different");this._transform4(M,w,1)}realTransform(M,w){if(M===w)throw new Error("Input and output buffers must be different");this._realTransform4(M,w,1)}inverseTransform(M,w){if(M===w)throw new Error("Input and output buffers must be different");this._transform4(M,w,-1);for(let x=0;x>=2;R>=2;R>>=2){Q=$/R<<1;const J=Q>>>2;for(q=0;q<$;q+=Q){const ie=q+J-1;for(let ae=q,ce=0;ae>>1,R>>>1)}else for(q=0,U=0;q<$;q+=Q,++U){const ie=Z[U];this._singleRealTransform4(w,M,q,ie>>>1,R>>>1,x)}const H=this.table;for(R>>=2;R>=2;R>>=2){Q=$/R<<1;const ie=Q>>>1,ae=ie>>>1,ce=ae>>>1;for(q=0;q<$;q+=Q)for(let he=0,N=0;he<=ce;he+=2,N+=R){const O=q+he,G=O+ae,se=G+ae,X=se+ae,we=M[O],_e=M[O+1],ke=M[G],He=M[G+1],Me=M[se],K=M[se+1],j=M[X],me=M[X+1],Pe=we,xe=_e,Ae=H[N],Ie=x*H[N+1],Le=ke*Ae-He*Ie,Ne=ke*Ie+He*Ae,We=H[2*N],D=x*H[2*N+1],ee=Me*We-K*D,B=Me*D+K*We,te=H[3*N],de=x*H[3*N+1],be=j*te-me*de,ve=j*de+me*te,Re=Pe+ee,Fe=xe+B,je=Pe-ee,qe=xe-B,Xe=Le+be,ut=Ne+ve,wt=x*(Le-be),nr=x*(Ne-ve);if(M[O]=Re+Xe,M[O+1]=Fe+ut,M[G]=je+nr,M[G+1]=qe-wt,he===0){M[se]=Re-Xe,M[se+1]=Fe-ut;continue}if(he===ce)continue;const jt=q+ae-he,dr=q+ie-he;M[jt]=je-x*nr,M[jt+1]=-qe-x*wt,M[dr]=Re-x*Xe,M[dr+1]=-Fe+x*ut}}const J=$>>>1;for(let ie=2;ie>1;++Z){const H=(Z+1-M)**2/2,J=Math.sqrt(q**2+U**2)**H,ie=H*Math.atan2(U,q),ae=2*Z;z[ae]=J*Math.cos(ie),z[ae+1]=J*Math.sin(ie),R[ae]=z[ae],R[ae+1]=-z[ae+1]}this._slicedChirpBuffer=z.subarray(w,x),this._f=new g($>>1),this._f.transform(this._chirpBuffer,R)}_transform(M,w,x){const $=this._buffer1,z=this._buffer2,R=this._outBuffer1,Q=this._outBuffer2,q=this._chirpBuffer,U=this._slicedChirpBuffer,Z=this._a;if(x)for(let H=0;H>1,ae=w[ie];$[H]=ae*U[H],$[J]=ae*U[J]}else for(let H=0;H=E.length&&(q=2*(E.length-1)-q),x[R++]=E[q]}x.sort(),w[z]=x[$]}return w}function v(E,M){const w=Math.pow(10,M);return Math.round(E*w)/w}function y(E){const M=Math.round(E);return Math.abs(E)%1===.5?M%2===0?M:M-1:M}function k(E){const M=E.length,w=E[0].length,x=[M+1,w+1],$=Array.from({length:x[0]},()=>Array(x[1]).fill(1/0));$[0][0]=0;const z=Array.from({length:x[0]},()=>Array(x[1]).fill(-1));for(let Z=1;Z0||Q>0;)switch(q.push(R-1),U.push(Q-1),z[R][Q]){case 0:--R,--Q;break;case 1:--R;break;case 2:--Q;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${R}, ${Q}]. Please file a bug report.`)}return q.reverse(),U.reverse(),[q,U]}},"./src/utils/tensor.js":(e,r,t)=>{t.r(r),t.d(r,{DataTypeMap:()=>o,Tensor:()=>a,cat:()=>w,full:()=>U,full_like:()=>Z,interpolate:()=>p,interpolate_4d:()=>u,layer_norm:()=>y,matmul:()=>h,mean:()=>R,mean_pooling:()=>v,ones:()=>H,ones_like:()=>J,permute:()=>c,quantize_embeddings:()=>he,rand:()=>ce,rfft:()=>g,slice:()=>A,stack:()=>x,std_mean:()=>z,topk:()=>_,zeros:()=>ie,zeros_like:()=>ae});var s=t("./src/utils/maths.js"),i=t("./src/backends/onnx.js"),n=t("./src/ops/registry.js");const o=Object.freeze({float32:Float32Array,float16:typeof Float16Array<"u"?Float16Array:Uint16Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array,uint4:Uint8Array,int4:Int8Array});class a{constructor(...O){re(this,"ort_tensor");return(0,i.isONNXTensor)(O[0])?this.ort_tensor=O[0]:this.ort_tensor=new i.Tensor(O[0],O[1],O[2]),new Proxy(this,{get:(G,se)=>{if(typeof se=="string"){let X=Number(se);if(Number.isInteger(X))return G._getitem(X)}return G[se]},set:(G,se,X)=>G[se]=X})}get dims(){return this.ort_tensor.dims}set dims(O){this.ort_tensor.dims=O}get type(){return this.ort_tensor.type}get data(){return this.ort_tensor.data}get size(){return this.ort_tensor.size}get location(){return this.ort_tensor.location}dispose(){this.ort_tensor.dispose()}*[Symbol.iterator](){const[O,...G]=this.dims;if(G.length>0){const se=G.reduce((X,we)=>X*we);for(let X=0;X0){const X=se.reduce((we,_e)=>we*_e);return this._subarray(O,X,se)}else return new a(this.type,[this.data[O]],se)}indexOf(O){const G=this.data;for(let se=0;seme)throw new Error(`Invalid slice: ${K}`);const Pe=[Math.max(j,0),Math.min(me,this.dims[Me])];se.push(Pe),G.push(Pe[1]-Pe[0])}else throw new Error(`Invalid slice: ${K}`)}const X=se.map(([Me,K])=>K-Me),we=X.reduce((Me,K)=>Me*K),_e=this.data,ke=new _e.constructor(we),He=this.stride();for(let Me=0;Me=0;--j){const Pe=X[j];K+=(me%Pe+se[j][0])*He[j],me=Math.floor(me/Pe)}ke[Me]=_e[K]}return new a(this.type,ke,G)}permute(...O){return c(this,O)}transpose(...O){return this.permute(...O)}sum(O=null,G=!1){return this.norm(1,O,G)}norm(O="fro",G=null,se=!1){if(O==="fro")O=2;else if(typeof O=="string")throw Error(`Unsupported norm: ${O}`);const X=this.data,we=(Me,K)=>Me+K**O;if(G===null){const Me=X.reduce(we,0)**(1/O);return new a(this.type,[Me],[])}const[_e,ke,He]=$(we,this,G,se);if(O!==1)for(let Me=0;Me=0;--He){const j=this.dims[He];if(He!==G){const me=Me%j;ke+=me*K,K*=this.dims[He]}Me=Math.floor(Me/j)}X[_e]/=we[ke]}return this}normalize(O=2,G=1){return this.clone().normalize_(O,G)}stride(){return Q(this.dims)}squeeze(O=null){return new a(this.type,this.data,k(this.dims,O))}squeeze_(O=null){return this.dims=k(this.dims,O),this}unsqueeze(O=null){return new a(this.type,this.data,E(this.dims,O))}unsqueeze_(O=null){return this.dims=E(this.dims,O),this}flatten_(O=0,G=-1){G=(G+this.dims.length)%this.dims.length;let se=this.dims.slice(0,O),X=this.dims.slice(O,G+1),we=this.dims.slice(G+1);return this.dims=[...se,X.reduce((_e,ke)=>_e*ke,1),...we],this}flatten(O=0,G=-1){return this.clone().flatten_(O,G)}view(...O){let G=-1;for(let X=0;Xke!==G?we*_e:we,1);O[G]=se.length/X}return new a(this.type,se,O)}neg_(){const O=this.data;for(let G=0;GO?1:0;return new a("bool",G,this.dims)}lt(O){const G=new Uint8Array(this.data.length),se=this.data;for(let X=0;XMath.min(_e,ke),this,O,G,1/0);return new a(se,X,we)}max(O=null,G=!1){if(O===null){const _e=(0,s.max)(this.data)[0];return new a(this.type,[_e],[])}const[se,X,we]=$((_e,ke)=>Math.max(_e,ke),this,O,G,-1/0);return new a(se,X,we)}argmin(O=null,G=!1){if(O!==null)throw new Error("`dim !== null` not yet implemented.");const se=(0,s.min)(this.data)[1];return new a("int64",[BigInt(se)],[])}argmax(O=null,G=!1){if(O!==null)throw new Error("`dim !== null` not yet implemented.");const se=(0,s.max)(this.data)[1];return new a("int64",[BigInt(se)],[])}to(O){if(this.type===O)return this;if(!o.hasOwnProperty(O))throw new Error(`Unsupported type: ${O}`);let G;const se=["int64","uint64"].includes(this.type),X=["int64","uint64"].includes(O);return se&&!X?G=Number:!se&&X&&(G=BigInt),new a(O,o[O].from(this.data,G),this.dims)}}function l(N,O){const G=N.length,se=O.reduce((we,_e)=>we*_e);if(G!==se)throw Error(`cannot reshape array of size ${G} into shape (${O})`);let X=N;for(let we=O.length-1;we>=0;we--)X=X.reduce((_e,ke)=>{let He=_e[_e.length-1];return He.lengthnew a("int64",N,[N.length]);async function A(N,O,G,se,X){return await(await n.TensorOpRegistry.slice)({x:N,s:P(O),e:P(G),a:P(se),t:P(X??new Array(se.length).fill(1))})}function v(N,O){const G=N.data,se=O.data,X=[N.dims[0],N.dims[2]],we=new G.constructor(X[0]*X[1]),[_e,ke,He]=N.dims;let Me=0;for(let K=0;K<_e;++K){const j=K*He*ke;for(let me=0;meG!==1):typeof O=="number"?N[O]===1&&N.splice(O,1):Array.isArray(O)&&(N=N.filter((G,se)=>G!==1||!O.includes(se))),N}function E(N,O){return O=M(O,N.length+1),N=N.slice(),N.splice(O,0,1),N}function M(N,O,G=null,se=!0){if(N<-O||N>=O){if(se)throw new Error(`IndexError: index ${N} is out of bounds for dimension${G===null?"":" "+G} with size ${O}`);return N<-O?0:O}return N<0&&(N=(N%O+O)%O),N}function w(N,O=0){O=M(O,N[0].dims.length);const G=N[0].dims.slice();G[O]=N.reduce((_e,ke)=>_e+ke.dims[O],0);const se=G.reduce((_e,ke)=>_e*ke,1),X=new N[0].data.constructor(se),we=N[0].type;if(O===0){let _e=0;for(const ke of N){const He=ke.data;X.set(He,_e),_e+=He.length}}else{let _e=0;for(let ke=0;ke=0;--me){const Ae=Me[me];let Ie=Pe%Ae;me===O&&(Ie+=_e),j+=Ie*xe,xe*=G[me],Pe=Math.floor(Pe/Ae)}X[j]=He[K]}_e+=Me[O]}}return new a(we,X,G)}function x(N,O=0){return w(N.map(G=>G.unsqueeze(O)),O)}function $(N,O,G=null,se=!1,X=null){const we=O.data,_e=O.dims;G=M(G,_e.length);const ke=_e.slice();ke[G]=1;const He=new we.constructor(we.length/_e[G]);X!==null&&He.fill(X);for(let Me=0;Me=0;--j){const xe=_e[j];if(j!==G){const Ae=me%xe;K+=Ae*Pe,Pe*=ke[j]}me=Math.floor(me/xe)}He[K]=N(He[K],we[Me],Me,K)}return se||ke.splice(G,1),[O.type,He,ke]}function z(N,O=null,G=1,se=!1){const X=N.data,we=N.dims;if(O===null){const Pe=X.reduce((Le,Ne)=>Le+Ne,0)/X.length,xe=Math.sqrt(X.reduce((Le,Ne)=>Le+(Ne-Pe)**2,0)/(X.length-G)),Ae=new a(N.type,[Pe],[]);return[new a(N.type,[xe],[]),Ae]}O=M(O,we.length);const _e=R(N,O,se),ke=_e.data,[He,Me,K]=$((me,Pe,xe,Ae)=>me+(Pe-ke[Ae])**2,N,O,se);for(let me=0;meMe+K,0);return new a(N.type,[He/X.length],[])}O=M(O,se.length);const[we,_e,ke]=$((He,Me)=>He+Me,N,O,G);if(se[O]!==1)for(let He=0;He<_e.length;++He)_e[He]/=se[O];return new a(we,_e,ke)}function Q(N){const O=new Array(N.length);for(let G=N.length-1,se=1;G>=0;--G)O[G]=se,se*=N[G];return O}function q(N,O,G,se){const X=N.reduce((we,_e)=>we*_e,1);return new a(G,new se(X).fill(O),N)}function U(N,O){let G,se;if(typeof O=="number")G="float32",se=Float32Array;else if(typeof O=="bigint")G="int64",se=BigInt64Array;else if(typeof O=="boolean")G="bool",se=Uint8Array;else throw new Error(`Unsupported data type: ${typeof O}`);return q(N,O,G,se)}function Z(N,O){return U(N.dims,O)}function H(N){return q(N,1n,"int64",BigInt64Array)}function J(N){return H(N.dims)}function ie(N){return q(N,0n,"int64",BigInt64Array)}function ae(N){return ie(N.dims)}function ce(N){const O=N.reduce((G,se)=>G*se,1);return new a("float32",Float32Array.from({length:O},()=>Math.random()),N)}function he(N,O){if(N.dims.length!==2)throw new Error("The tensor must have 2 dimensions");if(N.dims.at(-1)%8!==0)throw new Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes(O))throw new Error("The precision must be either 'binary' or 'ubinary'");const G=O==="binary",se=G?"int8":"uint8",X=G?Int8Array:Uint8Array,we=N.data,_e=new X(we.length/8);for(let ke=0;ke0?1:0,Me=Math.floor(ke/8),K=ke%8;_e[Me]|=He<<7-K,G&&K===0&&(_e[Me]-=128)}return new a(se,_e,[N.dims[0],N.dims[1]/8])}},"./src/utils/video.js":(e,r,t)=>{t.r(r),t.d(r,{RawVideo:()=>o,RawVideoFrame:()=>n,load_video:()=>a});var s=t("./src/utils/image.js"),i=t("./src/env.js");class n{constructor(c,p){this.image=c,this.timestamp=p}}class o{constructor(c,p){c.length>0&&c[0]instanceof s.RawImage&&(c=c.map((u,h)=>new n(u,(h+1)/(c.length+1)*p))),this.frames=c,this.duration=p}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 a(l,{num_frames:c=null,fps:p=null}={}){if(!i.apis.IS_BROWSER_ENV)throw new Error("`load_video` is currently only supported in browser environments.");if(c==null&&p==null)throw new Error("Either num_frames or fps must be provided.");const u=[],h=document.createElement("video");if(h.crossOrigin="anonymous",h.muted=!0,typeof l=="string")h.src=l;else if(l instanceof Blob)h.src=URL.createObjectURL(l);else if(l instanceof HTMLVideoElement)h.src=l.src;else throw new Error("Invalid URL or video element provided.");if(await new Promise(k=>h.onloadedmetadata=k),h.seekable.start(0)===h.seekable.end(0)){const E=await(await fetch(h.src)).blob();h.src=URL.createObjectURL(E),await new Promise(M=>h.onloadedmetadata=M)}const g=h.duration;let _,P;c!=null?(_=c,P=c===1?0:g/(c-1)):(P=1/p,_=Math.floor(g/P));let A=[];for(let k=0;k<_;++k)A.push(c===1?g/2:k*P);const v=document.createElement("canvas");v.width=h.videoWidth,v.height=h.videoHeight;const y=v.getContext("2d",{willReadFrequently:!0});for(const k of A){h.currentTime=k,await new Promise(x=>{h.onseeked=x}),y.drawImage(h,0,0,v.width,v.height);const E=y.getImageData(0,0,v.width,v.height),M=new s.RawImage(E.data,v.width,v.height,4),w=new n(M,k);u.push(w)}return h.remove(),new o(u,g)}}},Qw={};function Ft(e){var r=Qw[e];if(r!==void 0)return r.exports;var t=Qw[e]={exports:{}};return uT[e](t,t.exports,Ft),t.exports}(()=>{var e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,r;Ft.t=function(t,s){if(s&1&&(t=this(t)),s&8||typeof t=="object"&&t&&(s&4&&t.__esModule||s&16&&typeof t.then=="function"))return t;var i=Object.create(null);Ft.r(i);var n={};r=r||[null,e({}),e([]),e(e)];for(var o=s&2&&t;typeof o=="object"&&!~r.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(a=>n[a]=()=>t[a]);return n.default=()=>t,Ft.d(i,n),i}})(),Ft.d=(e,r)=>{for(var t in r)Ft.o(r,t)&&!Ft.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},Ft.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),Ft.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var f={};(()=>{/*!*****************************!*\ + !*** ./src/transformers.js ***! + \*****************************/Ft.r(f),Ft.d(f,{ASTFeatureExtractor:()=>u.ASTFeatureExtractor,ASTForAudioClassification:()=>t.ASTForAudioClassification,ASTModel:()=>t.ASTModel,ASTPreTrainedModel:()=>t.ASTPreTrainedModel,AlbertForMaskedLM:()=>t.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>t.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>t.AlbertForSequenceClassification,AlbertModel:()=>t.AlbertModel,AlbertPreTrainedModel:()=>t.AlbertPreTrainedModel,AlbertTokenizer:()=>s.AlbertTokenizer,AudioClassificationPipeline:()=>r.AudioClassificationPipeline,AutoConfig:()=>i.AutoConfig,AutoFeatureExtractor:()=>h.AutoFeatureExtractor,AutoImageProcessor:()=>P.AutoImageProcessor,AutoModel:()=>t.AutoModel,AutoModelForAudioClassification:()=>t.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>t.AutoModelForAudioFrameClassification,AutoModelForAudioTextToText:()=>t.AutoModelForAudioTextToText,AutoModelForCTC:()=>t.AutoModelForCTC,AutoModelForCausalLM:()=>t.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>t.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>t.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>t.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>t.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>t.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>t.AutoModelForImageSegmentation,AutoModelForImageTextToText:()=>t.AutoModelForImageTextToText,AutoModelForImageToImage:()=>t.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>t.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>t.AutoModelForMaskedLM,AutoModelForNormalEstimation:()=>t.AutoModelForNormalEstimation,AutoModelForObjectDetection:()=>t.AutoModelForObjectDetection,AutoModelForPoseEstimation:()=>t.AutoModelForPoseEstimation,AutoModelForQuestionAnswering:()=>t.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>t.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>t.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>t.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>t.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>t.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>t.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>t.AutoModelForTokenClassification,AutoModelForUniversalSegmentation:()=>t.AutoModelForUniversalSegmentation,AutoModelForVision2Seq:()=>t.AutoModelForVision2Seq,AutoModelForXVector:()=>t.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>t.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>y.AutoProcessor,AutoTokenizer:()=>s.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>r.AutomaticSpeechRecognitionPipeline,BackgroundRemovalPipeline:()=>r.BackgroundRemovalPipeline,BartForConditionalGeneration:()=>t.BartForConditionalGeneration,BartForSequenceClassification:()=>t.BartForSequenceClassification,BartModel:()=>t.BartModel,BartPretrainedModel:()=>t.BartPretrainedModel,BartTokenizer:()=>s.BartTokenizer,BaseModelOutput:()=>t.BaseModelOutput,BaseStreamer:()=>k.BaseStreamer,BeitFeatureExtractor:()=>_.BeitFeatureExtractor,BeitForImageClassification:()=>t.BeitForImageClassification,BeitModel:()=>t.BeitModel,BeitPreTrainedModel:()=>t.BeitPreTrainedModel,BertForMaskedLM:()=>t.BertForMaskedLM,BertForQuestionAnswering:()=>t.BertForQuestionAnswering,BertForSequenceClassification:()=>t.BertForSequenceClassification,BertForTokenClassification:()=>t.BertForTokenClassification,BertModel:()=>t.BertModel,BertPreTrainedModel:()=>t.BertPreTrainedModel,BertTokenizer:()=>s.BertTokenizer,BitImageProcessor:()=>_.BitImageProcessor,BlenderbotForConditionalGeneration:()=>t.BlenderbotForConditionalGeneration,BlenderbotModel:()=>t.BlenderbotModel,BlenderbotPreTrainedModel:()=>t.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>t.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>t.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>t.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>s.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>s.BlenderbotTokenizer,BloomForCausalLM:()=>t.BloomForCausalLM,BloomModel:()=>t.BloomModel,BloomPreTrainedModel:()=>t.BloomPreTrainedModel,BloomTokenizer:()=>s.BloomTokenizer,CLIPFeatureExtractor:()=>_.CLIPFeatureExtractor,CLIPImageProcessor:()=>_.CLIPImageProcessor,CLIPModel:()=>t.CLIPModel,CLIPPreTrainedModel:()=>t.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>t.CLIPSegForImageSegmentation,CLIPSegModel:()=>t.CLIPSegModel,CLIPSegPreTrainedModel:()=>t.CLIPSegPreTrainedModel,CLIPTextModel:()=>t.CLIPTextModel,CLIPTextModelWithProjection:()=>t.CLIPTextModelWithProjection,CLIPTokenizer:()=>s.CLIPTokenizer,CLIPVisionModel:()=>t.CLIPVisionModel,CLIPVisionModelWithProjection:()=>t.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>t.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>t.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>t.CamembertForSequenceClassification,CamembertForTokenClassification:()=>t.CamembertForTokenClassification,CamembertModel:()=>t.CamembertModel,CamembertPreTrainedModel:()=>t.CamembertPreTrainedModel,CamembertTokenizer:()=>s.CamembertTokenizer,CausalLMOutput:()=>t.CausalLMOutput,CausalLMOutputWithPast:()=>t.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>_.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>t.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>t.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>t.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>u.ClapFeatureExtractor,ClapModel:()=>t.ClapModel,ClapPreTrainedModel:()=>t.ClapPreTrainedModel,ClapTextModelWithProjection:()=>t.ClapTextModelWithProjection,ClassifierFreeGuidanceLogitsProcessor:()=>M.ClassifierFreeGuidanceLogitsProcessor,CodeGenForCausalLM:()=>t.CodeGenForCausalLM,CodeGenModel:()=>t.CodeGenModel,CodeGenPreTrainedModel:()=>t.CodeGenPreTrainedModel,CodeGenTokenizer:()=>s.CodeGenTokenizer,CodeLlamaTokenizer:()=>s.CodeLlamaTokenizer,CohereForCausalLM:()=>t.CohereForCausalLM,CohereModel:()=>t.CohereModel,CoherePreTrainedModel:()=>t.CoherePreTrainedModel,CohereTokenizer:()=>s.CohereTokenizer,ConvBertForMaskedLM:()=>t.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>t.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>t.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>t.ConvBertForTokenClassification,ConvBertModel:()=>t.ConvBertModel,ConvBertPreTrainedModel:()=>t.ConvBertPreTrainedModel,ConvBertTokenizer:()=>s.ConvBertTokenizer,ConvNextFeatureExtractor:()=>_.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>t.ConvNextForImageClassification,ConvNextImageProcessor:()=>_.ConvNextImageProcessor,ConvNextModel:()=>t.ConvNextModel,ConvNextPreTrainedModel:()=>t.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>t.ConvNextV2ForImageClassification,ConvNextV2Model:()=>t.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>t.ConvNextV2PreTrainedModel,DPTFeatureExtractor:()=>_.DPTFeatureExtractor,DPTForDepthEstimation:()=>t.DPTForDepthEstimation,DPTImageProcessor:()=>_.DPTImageProcessor,DPTModel:()=>t.DPTModel,DPTPreTrainedModel:()=>t.DPTPreTrainedModel,DacDecoderModel:()=>t.DacDecoderModel,DacDecoderOutput:()=>t.DacDecoderOutput,DacEncoderModel:()=>t.DacEncoderModel,DacEncoderOutput:()=>t.DacEncoderOutput,DacFeatureExtractor:()=>u.DacFeatureExtractor,DacModel:()=>t.DacModel,DacPreTrainedModel:()=>t.DacPreTrainedModel,DataTypeMap:()=>l.DataTypeMap,DebertaForMaskedLM:()=>t.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>t.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>t.DebertaForSequenceClassification,DebertaForTokenClassification:()=>t.DebertaForTokenClassification,DebertaModel:()=>t.DebertaModel,DebertaPreTrainedModel:()=>t.DebertaPreTrainedModel,DebertaTokenizer:()=>s.DebertaTokenizer,DebertaV2ForMaskedLM:()=>t.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>t.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>t.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>t.DebertaV2ForTokenClassification,DebertaV2Model:()=>t.DebertaV2Model,DebertaV2PreTrainedModel:()=>t.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>s.DebertaV2Tokenizer,DecisionTransformerModel:()=>t.DecisionTransformerModel,DecisionTransformerPreTrainedModel:()=>t.DecisionTransformerPreTrainedModel,DeiTFeatureExtractor:()=>_.DeiTFeatureExtractor,DeiTForImageClassification:()=>t.DeiTForImageClassification,DeiTImageProcessor:()=>_.DeiTImageProcessor,DeiTModel:()=>t.DeiTModel,DeiTPreTrainedModel:()=>t.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>t.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>t.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>r.DepthEstimationPipeline,DepthProForDepthEstimation:()=>t.DepthProForDepthEstimation,DepthProPreTrainedModel:()=>t.DepthProPreTrainedModel,DetrFeatureExtractor:()=>_.DetrFeatureExtractor,DetrForObjectDetection:()=>t.DetrForObjectDetection,DetrForSegmentation:()=>t.DetrForSegmentation,DetrImageProcessor:()=>_.DetrImageProcessor,DetrModel:()=>t.DetrModel,DetrObjectDetectionOutput:()=>t.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>t.DetrPreTrainedModel,DetrSegmentationOutput:()=>t.DetrSegmentationOutput,Dinov2ForImageClassification:()=>t.Dinov2ForImageClassification,Dinov2Model:()=>t.Dinov2Model,Dinov2PreTrainedModel:()=>t.Dinov2PreTrainedModel,Dinov2WithRegistersForImageClassification:()=>t.Dinov2WithRegistersForImageClassification,Dinov2WithRegistersModel:()=>t.Dinov2WithRegistersModel,Dinov2WithRegistersPreTrainedModel:()=>t.Dinov2WithRegistersPreTrainedModel,DistilBertForMaskedLM:()=>t.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>t.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>t.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>t.DistilBertForTokenClassification,DistilBertModel:()=>t.DistilBertModel,DistilBertPreTrainedModel:()=>t.DistilBertPreTrainedModel,DistilBertTokenizer:()=>s.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>r.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>_.DonutFeatureExtractor,DonutImageProcessor:()=>_.DonutImageProcessor,DonutSwinModel:()=>t.DonutSwinModel,DonutSwinPreTrainedModel:()=>t.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>t.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>_.EfficientNetImageProcessor,EfficientNetModel:()=>t.EfficientNetModel,EfficientNetPreTrainedModel:()=>t.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>t.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>t.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>t.ElectraForSequenceClassification,ElectraForTokenClassification:()=>t.ElectraForTokenClassification,ElectraModel:()=>t.ElectraModel,ElectraPreTrainedModel:()=>t.ElectraPreTrainedModel,ElectraTokenizer:()=>s.ElectraTokenizer,EncodecFeatureExtractor:()=>u.EncodecFeatureExtractor,EosTokenCriteria:()=>E.EosTokenCriteria,EsmForMaskedLM:()=>t.EsmForMaskedLM,EsmForSequenceClassification:()=>t.EsmForSequenceClassification,EsmForTokenClassification:()=>t.EsmForTokenClassification,EsmModel:()=>t.EsmModel,EsmPreTrainedModel:()=>t.EsmPreTrainedModel,EsmTokenizer:()=>s.EsmTokenizer,ExaoneForCausalLM:()=>t.ExaoneForCausalLM,ExaoneModel:()=>t.ExaoneModel,ExaonePreTrainedModel:()=>t.ExaonePreTrainedModel,FFT:()=>c.FFT,FalconForCausalLM:()=>t.FalconForCausalLM,FalconModel:()=>t.FalconModel,FalconPreTrainedModel:()=>t.FalconPreTrainedModel,FalconTokenizer:()=>s.FalconTokenizer,FastViTForImageClassification:()=>t.FastViTForImageClassification,FastViTModel:()=>t.FastViTModel,FastViTPreTrainedModel:()=>t.FastViTPreTrainedModel,FeatureExtractionPipeline:()=>r.FeatureExtractionPipeline,FeatureExtractor:()=>p.FeatureExtractor,FillMaskPipeline:()=>r.FillMaskPipeline,Florence2ForConditionalGeneration:()=>t.Florence2ForConditionalGeneration,Florence2PreTrainedModel:()=>t.Florence2PreTrainedModel,Florence2Processor:()=>v.Florence2Processor,ForcedBOSTokenLogitsProcessor:()=>M.ForcedBOSTokenLogitsProcessor,ForcedEOSTokenLogitsProcessor:()=>M.ForcedEOSTokenLogitsProcessor,GLPNFeatureExtractor:()=>_.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>t.GLPNForDepthEstimation,GLPNModel:()=>t.GLPNModel,GLPNPreTrainedModel:()=>t.GLPNPreTrainedModel,GPT2LMHeadModel:()=>t.GPT2LMHeadModel,GPT2Model:()=>t.GPT2Model,GPT2PreTrainedModel:()=>t.GPT2PreTrainedModel,GPT2Tokenizer:()=>s.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>t.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>t.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>t.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>t.GPTJForCausalLM,GPTJModel:()=>t.GPTJModel,GPTJPreTrainedModel:()=>t.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>t.GPTNeoForCausalLM,GPTNeoModel:()=>t.GPTNeoModel,GPTNeoPreTrainedModel:()=>t.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>t.GPTNeoXForCausalLM,GPTNeoXModel:()=>t.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>t.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>s.GPTNeoXTokenizer,Gemma2ForCausalLM:()=>t.Gemma2ForCausalLM,Gemma2Model:()=>t.Gemma2Model,Gemma2PreTrainedModel:()=>t.Gemma2PreTrainedModel,Gemma3ForCausalLM:()=>t.Gemma3ForCausalLM,Gemma3Model:()=>t.Gemma3Model,Gemma3PreTrainedModel:()=>t.Gemma3PreTrainedModel,GemmaForCausalLM:()=>t.GemmaForCausalLM,GemmaModel:()=>t.GemmaModel,GemmaPreTrainedModel:()=>t.GemmaPreTrainedModel,GemmaTokenizer:()=>s.GemmaTokenizer,GlmForCausalLM:()=>t.GlmForCausalLM,GlmModel:()=>t.GlmModel,GlmPreTrainedModel:()=>t.GlmPreTrainedModel,GraniteForCausalLM:()=>t.GraniteForCausalLM,GraniteModel:()=>t.GraniteModel,GranitePreTrainedModel:()=>t.GranitePreTrainedModel,Grok1Tokenizer:()=>s.Grok1Tokenizer,GroundingDinoForObjectDetection:()=>t.GroundingDinoForObjectDetection,GroundingDinoImageProcessor:()=>_.GroundingDinoImageProcessor,GroundingDinoPreTrainedModel:()=>t.GroundingDinoPreTrainedModel,GroundingDinoProcessor:()=>v.GroundingDinoProcessor,GroupViTModel:()=>t.GroupViTModel,GroupViTPreTrainedModel:()=>t.GroupViTPreTrainedModel,HeliumForCausalLM:()=>t.HeliumForCausalLM,HeliumModel:()=>t.HeliumModel,HeliumPreTrainedModel:()=>t.HeliumPreTrainedModel,HerbertTokenizer:()=>s.HerbertTokenizer,HieraForImageClassification:()=>t.HieraForImageClassification,HieraModel:()=>t.HieraModel,HieraPreTrainedModel:()=>t.HieraPreTrainedModel,HubertForCTC:()=>t.HubertForCTC,HubertForSequenceClassification:()=>t.HubertForSequenceClassification,HubertModel:()=>t.HubertModel,HubertPreTrainedModel:()=>t.HubertPreTrainedModel,IJepaForImageClassification:()=>t.IJepaForImageClassification,IJepaModel:()=>t.IJepaModel,IJepaPreTrainedModel:()=>t.IJepaPreTrainedModel,Idefics3ForConditionalGeneration:()=>t.Idefics3ForConditionalGeneration,Idefics3ImageProcessor:()=>_.Idefics3ImageProcessor,Idefics3PreTrainedModel:()=>t.Idefics3PreTrainedModel,Idefics3Processor:()=>v.Idefics3Processor,ImageClassificationPipeline:()=>r.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>r.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>u.ImageFeatureExtractor,ImageMattingOutput:()=>t.ImageMattingOutput,ImageProcessor:()=>g.ImageProcessor,ImageSegmentationPipeline:()=>r.ImageSegmentationPipeline,ImageToImagePipeline:()=>r.ImageToImagePipeline,ImageToTextPipeline:()=>r.ImageToTextPipeline,InterruptableStoppingCriteria:()=>E.InterruptableStoppingCriteria,JAISLMHeadModel:()=>t.JAISLMHeadModel,JAISModel:()=>t.JAISModel,JAISPreTrainedModel:()=>t.JAISPreTrainedModel,JinaCLIPImageProcessor:()=>_.JinaCLIPImageProcessor,JinaCLIPModel:()=>t.JinaCLIPModel,JinaCLIPPreTrainedModel:()=>t.JinaCLIPPreTrainedModel,JinaCLIPProcessor:()=>v.JinaCLIPProcessor,JinaCLIPTextModel:()=>t.JinaCLIPTextModel,JinaCLIPVisionModel:()=>t.JinaCLIPVisionModel,LiteWhisperForConditionalGeneration:()=>t.LiteWhisperForConditionalGeneration,LlamaForCausalLM:()=>t.LlamaForCausalLM,LlamaModel:()=>t.LlamaModel,LlamaPreTrainedModel:()=>t.LlamaPreTrainedModel,LlamaTokenizer:()=>s.LlamaTokenizer,LlavaForConditionalGeneration:()=>t.LlavaForConditionalGeneration,LlavaOnevisionForConditionalGeneration:()=>t.LlavaOnevisionForConditionalGeneration,LlavaOnevisionImageProcessor:()=>_.LlavaOnevisionImageProcessor,LlavaPreTrainedModel:()=>t.LlavaPreTrainedModel,LogitsProcessor:()=>M.LogitsProcessor,LogitsProcessorList:()=>M.LogitsProcessorList,LogitsWarper:()=>M.LogitsWarper,LongT5ForConditionalGeneration:()=>t.LongT5ForConditionalGeneration,LongT5Model:()=>t.LongT5Model,LongT5PreTrainedModel:()=>t.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>t.M2M100ForConditionalGeneration,M2M100Model:()=>t.M2M100Model,M2M100PreTrainedModel:()=>t.M2M100PreTrainedModel,M2M100Tokenizer:()=>s.M2M100Tokenizer,MBart50Tokenizer:()=>s.MBart50Tokenizer,MBartForCausalLM:()=>t.MBartForCausalLM,MBartForConditionalGeneration:()=>t.MBartForConditionalGeneration,MBartForSequenceClassification:()=>t.MBartForSequenceClassification,MBartModel:()=>t.MBartModel,MBartPreTrainedModel:()=>t.MBartPreTrainedModel,MBartTokenizer:()=>s.MBartTokenizer,MPNetForMaskedLM:()=>t.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>t.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>t.MPNetForSequenceClassification,MPNetForTokenClassification:()=>t.MPNetForTokenClassification,MPNetModel:()=>t.MPNetModel,MPNetPreTrainedModel:()=>t.MPNetPreTrainedModel,MPNetTokenizer:()=>s.MPNetTokenizer,MT5ForConditionalGeneration:()=>t.MT5ForConditionalGeneration,MT5Model:()=>t.MT5Model,MT5PreTrainedModel:()=>t.MT5PreTrainedModel,MarianMTModel:()=>t.MarianMTModel,MarianModel:()=>t.MarianModel,MarianPreTrainedModel:()=>t.MarianPreTrainedModel,MarianTokenizer:()=>s.MarianTokenizer,Mask2FormerImageProcessor:()=>_.Mask2FormerImageProcessor,MaskFormerFeatureExtractor:()=>_.MaskFormerFeatureExtractor,MaskFormerForInstanceSegmentation:()=>t.MaskFormerForInstanceSegmentation,MaskFormerImageProcessor:()=>_.MaskFormerImageProcessor,MaskFormerModel:()=>t.MaskFormerModel,MaskFormerPreTrainedModel:()=>t.MaskFormerPreTrainedModel,MaskedLMOutput:()=>t.MaskedLMOutput,MaxLengthCriteria:()=>E.MaxLengthCriteria,Metric3DForDepthEstimation:()=>t.Metric3DForDepthEstimation,Metric3DPreTrainedModel:()=>t.Metric3DPreTrainedModel,Metric3Dv2ForDepthEstimation:()=>t.Metric3Dv2ForDepthEstimation,Metric3Dv2PreTrainedModel:()=>t.Metric3Dv2PreTrainedModel,MgpstrForSceneTextRecognition:()=>t.MgpstrForSceneTextRecognition,MgpstrModelOutput:()=>t.MgpstrModelOutput,MgpstrPreTrainedModel:()=>t.MgpstrPreTrainedModel,MgpstrProcessor:()=>v.MgpstrProcessor,MgpstrTokenizer:()=>s.MgpstrTokenizer,MimiDecoderModel:()=>t.MimiDecoderModel,MimiDecoderOutput:()=>t.MimiDecoderOutput,MimiEncoderModel:()=>t.MimiEncoderModel,MimiEncoderOutput:()=>t.MimiEncoderOutput,MimiModel:()=>t.MimiModel,MimiPreTrainedModel:()=>t.MimiPreTrainedModel,MinLengthLogitsProcessor:()=>M.MinLengthLogitsProcessor,MinNewTokensLengthLogitsProcessor:()=>M.MinNewTokensLengthLogitsProcessor,MistralForCausalLM:()=>t.MistralForCausalLM,MistralModel:()=>t.MistralModel,MistralPreTrainedModel:()=>t.MistralPreTrainedModel,MobileBertForMaskedLM:()=>t.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>t.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>t.MobileBertForSequenceClassification,MobileBertModel:()=>t.MobileBertModel,MobileBertPreTrainedModel:()=>t.MobileBertPreTrainedModel,MobileBertTokenizer:()=>s.MobileBertTokenizer,MobileLLMForCausalLM:()=>t.MobileLLMForCausalLM,MobileLLMModel:()=>t.MobileLLMModel,MobileLLMPreTrainedModel:()=>t.MobileLLMPreTrainedModel,MobileNetV1FeatureExtractor:()=>_.MobileNetV1FeatureExtractor,MobileNetV1ForImageClassification:()=>t.MobileNetV1ForImageClassification,MobileNetV1ForSemanticSegmentation:()=>t.MobileNetV1ForSemanticSegmentation,MobileNetV1ImageProcessor:()=>_.MobileNetV1ImageProcessor,MobileNetV1Model:()=>t.MobileNetV1Model,MobileNetV1PreTrainedModel:()=>t.MobileNetV1PreTrainedModel,MobileNetV2FeatureExtractor:()=>_.MobileNetV2FeatureExtractor,MobileNetV2ForImageClassification:()=>t.MobileNetV2ForImageClassification,MobileNetV2ForSemanticSegmentation:()=>t.MobileNetV2ForSemanticSegmentation,MobileNetV2ImageProcessor:()=>_.MobileNetV2ImageProcessor,MobileNetV2Model:()=>t.MobileNetV2Model,MobileNetV2PreTrainedModel:()=>t.MobileNetV2PreTrainedModel,MobileNetV3FeatureExtractor:()=>_.MobileNetV3FeatureExtractor,MobileNetV3ForImageClassification:()=>t.MobileNetV3ForImageClassification,MobileNetV3ForSemanticSegmentation:()=>t.MobileNetV3ForSemanticSegmentation,MobileNetV3ImageProcessor:()=>_.MobileNetV3ImageProcessor,MobileNetV3Model:()=>t.MobileNetV3Model,MobileNetV3PreTrainedModel:()=>t.MobileNetV3PreTrainedModel,MobileNetV4FeatureExtractor:()=>_.MobileNetV4FeatureExtractor,MobileNetV4ForImageClassification:()=>t.MobileNetV4ForImageClassification,MobileNetV4ForSemanticSegmentation:()=>t.MobileNetV4ForSemanticSegmentation,MobileNetV4ImageProcessor:()=>_.MobileNetV4ImageProcessor,MobileNetV4Model:()=>t.MobileNetV4Model,MobileNetV4PreTrainedModel:()=>t.MobileNetV4PreTrainedModel,MobileViTFeatureExtractor:()=>_.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>t.MobileViTForImageClassification,MobileViTImageProcessor:()=>_.MobileViTImageProcessor,MobileViTModel:()=>t.MobileViTModel,MobileViTPreTrainedModel:()=>t.MobileViTPreTrainedModel,MobileViTV2ForImageClassification:()=>t.MobileViTV2ForImageClassification,MobileViTV2Model:()=>t.MobileViTV2Model,MobileViTV2PreTrainedModel:()=>t.MobileViTV2PreTrainedModel,ModelOutput:()=>t.ModelOutput,ModernBertForMaskedLM:()=>t.ModernBertForMaskedLM,ModernBertForSequenceClassification:()=>t.ModernBertForSequenceClassification,ModernBertForTokenClassification:()=>t.ModernBertForTokenClassification,ModernBertModel:()=>t.ModernBertModel,ModernBertPreTrainedModel:()=>t.ModernBertPreTrainedModel,Moondream1ForConditionalGeneration:()=>t.Moondream1ForConditionalGeneration,MoonshineFeatureExtractor:()=>u.MoonshineFeatureExtractor,MoonshineForConditionalGeneration:()=>t.MoonshineForConditionalGeneration,MoonshineModel:()=>t.MoonshineModel,MoonshinePreTrainedModel:()=>t.MoonshinePreTrainedModel,MoonshineProcessor:()=>v.MoonshineProcessor,MptForCausalLM:()=>t.MptForCausalLM,MptModel:()=>t.MptModel,MptPreTrainedModel:()=>t.MptPreTrainedModel,MultiModalityCausalLM:()=>t.MultiModalityCausalLM,MultiModalityPreTrainedModel:()=>t.MultiModalityPreTrainedModel,MusicgenForCausalLM:()=>t.MusicgenForCausalLM,MusicgenForConditionalGeneration:()=>t.MusicgenForConditionalGeneration,MusicgenModel:()=>t.MusicgenModel,MusicgenPreTrainedModel:()=>t.MusicgenPreTrainedModel,NllbTokenizer:()=>s.NllbTokenizer,NoBadWordsLogitsProcessor:()=>M.NoBadWordsLogitsProcessor,NoRepeatNGramLogitsProcessor:()=>M.NoRepeatNGramLogitsProcessor,NomicBertModel:()=>t.NomicBertModel,NomicBertPreTrainedModel:()=>t.NomicBertPreTrainedModel,NougatImageProcessor:()=>_.NougatImageProcessor,NougatTokenizer:()=>s.NougatTokenizer,OPTForCausalLM:()=>t.OPTForCausalLM,OPTModel:()=>t.OPTModel,OPTPreTrainedModel:()=>t.OPTPreTrainedModel,ObjectDetectionPipeline:()=>r.ObjectDetectionPipeline,Olmo2ForCausalLM:()=>t.Olmo2ForCausalLM,Olmo2Model:()=>t.Olmo2Model,Olmo2PreTrainedModel:()=>t.Olmo2PreTrainedModel,OlmoForCausalLM:()=>t.OlmoForCausalLM,OlmoModel:()=>t.OlmoModel,OlmoPreTrainedModel:()=>t.OlmoPreTrainedModel,OpenELMForCausalLM:()=>t.OpenELMForCausalLM,OpenELMModel:()=>t.OpenELMModel,OpenELMPreTrainedModel:()=>t.OpenELMPreTrainedModel,OwlViTFeatureExtractor:()=>_.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>t.OwlViTForObjectDetection,OwlViTImageProcessor:()=>_.OwlViTImageProcessor,OwlViTModel:()=>t.OwlViTModel,OwlViTPreTrainedModel:()=>t.OwlViTPreTrainedModel,OwlViTProcessor:()=>v.OwlViTProcessor,Owlv2ForObjectDetection:()=>t.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>_.Owlv2ImageProcessor,Owlv2Model:()=>t.Owlv2Model,Owlv2PreTrainedModel:()=>t.Owlv2PreTrainedModel,PaliGemmaForConditionalGeneration:()=>t.PaliGemmaForConditionalGeneration,PaliGemmaPreTrainedModel:()=>t.PaliGemmaPreTrainedModel,PaliGemmaProcessor:()=>v.PaliGemmaProcessor,PatchTSMixerForPrediction:()=>t.PatchTSMixerForPrediction,PatchTSMixerModel:()=>t.PatchTSMixerModel,PatchTSMixerPreTrainedModel:()=>t.PatchTSMixerPreTrainedModel,PatchTSTForPrediction:()=>t.PatchTSTForPrediction,PatchTSTModel:()=>t.PatchTSTModel,PatchTSTPreTrainedModel:()=>t.PatchTSTPreTrainedModel,Phi3ForCausalLM:()=>t.Phi3ForCausalLM,Phi3Model:()=>t.Phi3Model,Phi3PreTrainedModel:()=>t.Phi3PreTrainedModel,Phi3VForCausalLM:()=>t.Phi3VForCausalLM,Phi3VImageProcessor:()=>_.Phi3VImageProcessor,Phi3VPreTrainedModel:()=>t.Phi3VPreTrainedModel,Phi3VProcessor:()=>v.Phi3VProcessor,PhiForCausalLM:()=>t.PhiForCausalLM,PhiModel:()=>t.PhiModel,PhiPreTrainedModel:()=>t.PhiPreTrainedModel,Pipeline:()=>r.Pipeline,PreTrainedModel:()=>t.PreTrainedModel,PreTrainedTokenizer:()=>s.PreTrainedTokenizer,PretrainedConfig:()=>i.PretrainedConfig,PretrainedMixin:()=>t.PretrainedMixin,Processor:()=>A.Processor,PvtForImageClassification:()=>t.PvtForImageClassification,PvtImageProcessor:()=>_.PvtImageProcessor,PvtModel:()=>t.PvtModel,PvtPreTrainedModel:()=>t.PvtPreTrainedModel,PyAnnoteFeatureExtractor:()=>u.PyAnnoteFeatureExtractor,PyAnnoteForAudioFrameClassification:()=>t.PyAnnoteForAudioFrameClassification,PyAnnoteModel:()=>t.PyAnnoteModel,PyAnnotePreTrainedModel:()=>t.PyAnnotePreTrainedModel,PyAnnoteProcessor:()=>v.PyAnnoteProcessor,QuestionAnsweringModelOutput:()=>t.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>r.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>t.Qwen2ForCausalLM,Qwen2Model:()=>t.Qwen2Model,Qwen2PreTrainedModel:()=>t.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>s.Qwen2Tokenizer,Qwen2VLForConditionalGeneration:()=>t.Qwen2VLForConditionalGeneration,Qwen2VLImageProcessor:()=>_.Qwen2VLImageProcessor,Qwen2VLPreTrainedModel:()=>t.Qwen2VLPreTrainedModel,Qwen2VLProcessor:()=>v.Qwen2VLProcessor,RFDetrForObjectDetection:()=>t.RFDetrForObjectDetection,RFDetrModel:()=>t.RFDetrModel,RFDetrObjectDetectionOutput:()=>t.RFDetrObjectDetectionOutput,RFDetrPreTrainedModel:()=>t.RFDetrPreTrainedModel,RTDetrForObjectDetection:()=>t.RTDetrForObjectDetection,RTDetrImageProcessor:()=>_.RTDetrImageProcessor,RTDetrModel:()=>t.RTDetrModel,RTDetrObjectDetectionOutput:()=>t.RTDetrObjectDetectionOutput,RTDetrPreTrainedModel:()=>t.RTDetrPreTrainedModel,RTDetrV2ForObjectDetection:()=>t.RTDetrV2ForObjectDetection,RTDetrV2Model:()=>t.RTDetrV2Model,RTDetrV2ObjectDetectionOutput:()=>t.RTDetrV2ObjectDetectionOutput,RTDetrV2PreTrainedModel:()=>t.RTDetrV2PreTrainedModel,RawAudio:()=>n.RawAudio,RawImage:()=>o.RawImage,RawVideo:()=>a.RawVideo,RawVideoFrame:()=>a.RawVideoFrame,RepetitionPenaltyLogitsProcessor:()=>M.RepetitionPenaltyLogitsProcessor,ResNetForImageClassification:()=>t.ResNetForImageClassification,ResNetModel:()=>t.ResNetModel,ResNetPreTrainedModel:()=>t.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>t.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>t.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>t.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>t.RoFormerForTokenClassification,RoFormerModel:()=>t.RoFormerModel,RoFormerPreTrainedModel:()=>t.RoFormerPreTrainedModel,RoFormerTokenizer:()=>s.RoFormerTokenizer,RobertaForMaskedLM:()=>t.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>t.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>t.RobertaForSequenceClassification,RobertaForTokenClassification:()=>t.RobertaForTokenClassification,RobertaModel:()=>t.RobertaModel,RobertaPreTrainedModel:()=>t.RobertaPreTrainedModel,RobertaTokenizer:()=>s.RobertaTokenizer,SamImageProcessor:()=>_.SamImageProcessor,SamImageSegmentationOutput:()=>t.SamImageSegmentationOutput,SamModel:()=>t.SamModel,SamPreTrainedModel:()=>t.SamPreTrainedModel,SamProcessor:()=>v.SamProcessor,SapiensForDepthEstimation:()=>t.SapiensForDepthEstimation,SapiensForNormalEstimation:()=>t.SapiensForNormalEstimation,SapiensForSemanticSegmentation:()=>t.SapiensForSemanticSegmentation,SapiensPreTrainedModel:()=>t.SapiensPreTrainedModel,SeamlessM4TFeatureExtractor:()=>u.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>_.SegformerFeatureExtractor,SegformerForImageClassification:()=>t.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>t.SegformerForSemanticSegmentation,SegformerImageProcessor:()=>_.SegformerImageProcessor,SegformerModel:()=>t.SegformerModel,SegformerPreTrainedModel:()=>t.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>t.Seq2SeqLMOutput,SequenceClassifierOutput:()=>t.SequenceClassifierOutput,SiglipImageProcessor:()=>_.SiglipImageProcessor,SiglipModel:()=>t.SiglipModel,SiglipPreTrainedModel:()=>t.SiglipPreTrainedModel,SiglipTextModel:()=>t.SiglipTextModel,SiglipTokenizer:()=>s.SiglipTokenizer,SiglipVisionModel:()=>t.SiglipVisionModel,SmolVLMForConditionalGeneration:()=>t.SmolVLMForConditionalGeneration,SmolVLMImageProcessor:()=>_.SmolVLMImageProcessor,SmolVLMProcessor:()=>v.SmolVLMProcessor,SnacDecoderModel:()=>t.SnacDecoderModel,SnacEncoderModel:()=>t.SnacEncoderModel,SnacFeatureExtractor:()=>u.SnacFeatureExtractor,SnacModel:()=>t.SnacModel,SnacPreTrainedModel:()=>t.SnacPreTrainedModel,SpeechT5FeatureExtractor:()=>u.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>t.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>t.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>t.SpeechT5HifiGan,SpeechT5Model:()=>t.SpeechT5Model,SpeechT5PreTrainedModel:()=>t.SpeechT5PreTrainedModel,SpeechT5Processor:()=>v.SpeechT5Processor,SpeechT5Tokenizer:()=>s.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>t.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>t.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>t.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>t.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>t.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>s.SqueezeBertTokenizer,StableLmForCausalLM:()=>t.StableLmForCausalLM,StableLmModel:()=>t.StableLmModel,StableLmPreTrainedModel:()=>t.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>t.Starcoder2ForCausalLM,Starcoder2Model:()=>t.Starcoder2Model,Starcoder2PreTrainedModel:()=>t.Starcoder2PreTrainedModel,StoppingCriteria:()=>E.StoppingCriteria,StoppingCriteriaList:()=>E.StoppingCriteriaList,StyleTextToSpeech2Model:()=>t.StyleTextToSpeech2Model,StyleTextToSpeech2PreTrainedModel:()=>t.StyleTextToSpeech2PreTrainedModel,SummarizationPipeline:()=>r.SummarizationPipeline,SuppressTokensAtBeginLogitsProcessor:()=>M.SuppressTokensAtBeginLogitsProcessor,Swin2SRForImageSuperResolution:()=>t.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>_.Swin2SRImageProcessor,Swin2SRModel:()=>t.Swin2SRModel,Swin2SRPreTrainedModel:()=>t.Swin2SRPreTrainedModel,SwinForImageClassification:()=>t.SwinForImageClassification,SwinForSemanticSegmentation:()=>t.SwinForSemanticSegmentation,SwinModel:()=>t.SwinModel,SwinPreTrainedModel:()=>t.SwinPreTrainedModel,T5ForConditionalGeneration:()=>t.T5ForConditionalGeneration,T5Model:()=>t.T5Model,T5PreTrainedModel:()=>t.T5PreTrainedModel,T5Tokenizer:()=>s.T5Tokenizer,TableTransformerForObjectDetection:()=>t.TableTransformerForObjectDetection,TableTransformerModel:()=>t.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>t.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>t.TableTransformerPreTrainedModel,TemperatureLogitsWarper:()=>M.TemperatureLogitsWarper,Tensor:()=>l.Tensor,Text2TextGenerationPipeline:()=>r.Text2TextGenerationPipeline,TextClassificationPipeline:()=>r.TextClassificationPipeline,TextGenerationPipeline:()=>r.TextGenerationPipeline,TextStreamer:()=>k.TextStreamer,TextToAudioPipeline:()=>r.TextToAudioPipeline,TokenClassificationPipeline:()=>r.TokenClassificationPipeline,TokenClassifierOutput:()=>t.TokenClassifierOutput,TokenizerModel:()=>s.TokenizerModel,TopKLogitsWarper:()=>M.TopKLogitsWarper,TopPLogitsWarper:()=>M.TopPLogitsWarper,TrOCRForCausalLM:()=>t.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>t.TrOCRPreTrainedModel,TranslationPipeline:()=>r.TranslationPipeline,UltravoxModel:()=>t.UltravoxModel,UltravoxPreTrainedModel:()=>t.UltravoxPreTrainedModel,UltravoxProcessor:()=>v.UltravoxProcessor,UniSpeechForCTC:()=>t.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>t.UniSpeechForSequenceClassification,UniSpeechModel:()=>t.UniSpeechModel,UniSpeechPreTrainedModel:()=>t.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>t.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>t.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>t.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>t.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>t.UniSpeechSatPreTrainedModel,VLChatProcessor:()=>v.VLChatProcessor,VLMImageProcessor:()=>_.VLMImageProcessor,ViTFeatureExtractor:()=>_.ViTFeatureExtractor,ViTForImageClassification:()=>t.ViTForImageClassification,ViTImageProcessor:()=>_.ViTImageProcessor,ViTMAEModel:()=>t.ViTMAEModel,ViTMAEPreTrainedModel:()=>t.ViTMAEPreTrainedModel,ViTMSNForImageClassification:()=>t.ViTMSNForImageClassification,ViTMSNModel:()=>t.ViTMSNModel,ViTMSNPreTrainedModel:()=>t.ViTMSNPreTrainedModel,ViTModel:()=>t.ViTModel,ViTPreTrainedModel:()=>t.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>t.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>t.VitMatteForImageMatting,VitMatteImageProcessor:()=>_.VitMatteImageProcessor,VitMattePreTrainedModel:()=>t.VitMattePreTrainedModel,VitPoseForPoseEstimation:()=>t.VitPoseForPoseEstimation,VitPoseImageProcessor:()=>_.VitPoseImageProcessor,VitPosePreTrainedModel:()=>t.VitPosePreTrainedModel,VitsModel:()=>t.VitsModel,VitsModelOutput:()=>t.VitsModelOutput,VitsPreTrainedModel:()=>t.VitsPreTrainedModel,VitsTokenizer:()=>s.VitsTokenizer,Wav2Vec2BertForCTC:()=>t.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>t.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>t.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>t.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>s.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>u.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>t.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>t.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>t.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>t.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>t.Wav2Vec2PreTrainedModel,Wav2Vec2Processor:()=>v.Wav2Vec2Processor,Wav2Vec2ProcessorWithLM:()=>v.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>t.WavLMForAudioFrameClassification,WavLMForCTC:()=>t.WavLMForCTC,WavLMForSequenceClassification:()=>t.WavLMForSequenceClassification,WavLMForXVector:()=>t.WavLMForXVector,WavLMModel:()=>t.WavLMModel,WavLMPreTrainedModel:()=>t.WavLMPreTrainedModel,WeSpeakerFeatureExtractor:()=>u.WeSpeakerFeatureExtractor,WeSpeakerResNetModel:()=>t.WeSpeakerResNetModel,WeSpeakerResNetPreTrainedModel:()=>t.WeSpeakerResNetPreTrainedModel,WhisperFeatureExtractor:()=>u.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>t.WhisperForConditionalGeneration,WhisperModel:()=>t.WhisperModel,WhisperPreTrainedModel:()=>t.WhisperPreTrainedModel,WhisperProcessor:()=>v.WhisperProcessor,WhisperTextStreamer:()=>k.WhisperTextStreamer,WhisperTimeStampLogitsProcessor:()=>M.WhisperTimeStampLogitsProcessor,WhisperTokenizer:()=>s.WhisperTokenizer,XLMForQuestionAnswering:()=>t.XLMForQuestionAnswering,XLMForSequenceClassification:()=>t.XLMForSequenceClassification,XLMForTokenClassification:()=>t.XLMForTokenClassification,XLMModel:()=>t.XLMModel,XLMPreTrainedModel:()=>t.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>t.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>t.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>t.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>t.XLMRobertaForTokenClassification,XLMRobertaModel:()=>t.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>t.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>s.XLMRobertaTokenizer,XLMTokenizer:()=>s.XLMTokenizer,XLMWithLMHeadModel:()=>t.XLMWithLMHeadModel,XVectorOutput:()=>t.XVectorOutput,YolosFeatureExtractor:()=>_.YolosFeatureExtractor,YolosForObjectDetection:()=>t.YolosForObjectDetection,YolosImageProcessor:()=>_.YolosImageProcessor,YolosModel:()=>t.YolosModel,YolosObjectDetectionOutput:()=>t.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>t.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>r.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>r.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>r.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>r.ZeroShotObjectDetectionPipeline,bankers_round:()=>c.bankers_round,cat:()=>l.cat,cos_sim:()=>c.cos_sim,dot:()=>c.dot,dynamic_time_warping:()=>c.dynamic_time_warping,env:()=>e.env,full:()=>l.full,full_like:()=>l.full_like,getKeyValueShapes:()=>i.getKeyValueShapes,hamming:()=>n.hamming,hanning:()=>n.hanning,interpolate:()=>l.interpolate,interpolate_4d:()=>l.interpolate_4d,interpolate_data:()=>c.interpolate_data,is_chinese_char:()=>s.is_chinese_char,layer_norm:()=>l.layer_norm,load_image:()=>o.load_image,load_video:()=>a.load_video,log_softmax:()=>c.log_softmax,magnitude:()=>c.magnitude,matmul:()=>l.matmul,max:()=>c.max,mean:()=>l.mean,mean_pooling:()=>l.mean_pooling,medianFilter:()=>c.medianFilter,mel_filter_bank:()=>n.mel_filter_bank,min:()=>c.min,ones:()=>l.ones,ones_like:()=>l.ones_like,permute:()=>l.permute,permute_data:()=>c.permute_data,pipeline:()=>r.pipeline,quantize_embeddings:()=>l.quantize_embeddings,rand:()=>l.rand,read_audio:()=>n.read_audio,rfft:()=>l.rfft,round:()=>c.round,slice:()=>l.slice,softmax:()=>c.softmax,spectrogram:()=>n.spectrogram,stack:()=>l.stack,std_mean:()=>l.std_mean,topk:()=>l.topk,window_function:()=>n.window_function,zeros:()=>l.zeros,zeros_like:()=>l.zeros_like});var e=Ft("./src/env.js"),r=Ft("./src/pipelines.js"),t=Ft("./src/models.js"),s=Ft("./src/tokenizers.js"),i=Ft("./src/configs.js"),n=Ft("./src/utils/audio.js"),o=Ft("./src/utils/image.js"),a=Ft("./src/utils/video.js"),l=Ft("./src/utils/tensor.js"),c=Ft("./src/utils/maths.js"),p=Ft("./src/base/feature_extraction_utils.js"),u=Ft("./src/models/feature_extractors.js"),h=Ft("./src/models/auto/feature_extraction_auto.js"),g=Ft("./src/base/image_processors_utils.js"),_=Ft("./src/models/image_processors.js"),P=Ft("./src/models/auto/image_processing_auto.js"),A=Ft("./src/base/processing_utils.js"),v=Ft("./src/models/processors.js"),y=Ft("./src/models/auto/processing_auto.js"),k=Ft("./src/generation/streamers.js"),E=Ft("./src/generation/stopping_criteria.js"),M=Ft("./src/generation/logits_process.js")})(),f.ASTFeatureExtractor,f.ASTForAudioClassification,f.ASTModel,f.ASTPreTrainedModel,f.AlbertForMaskedLM,f.AlbertForQuestionAnswering,f.AlbertForSequenceClassification,f.AlbertModel,f.AlbertPreTrainedModel,f.AlbertTokenizer,f.AudioClassificationPipeline,f.AutoConfig,f.AutoFeatureExtractor,f.AutoImageProcessor,f.AutoModel,f.AutoModelForAudioClassification,f.AutoModelForAudioFrameClassification,f.AutoModelForAudioTextToText,f.AutoModelForCTC,f.AutoModelForCausalLM,f.AutoModelForDepthEstimation,f.AutoModelForDocumentQuestionAnswering,f.AutoModelForImageClassification,f.AutoModelForImageFeatureExtraction,f.AutoModelForImageMatting,f.AutoModelForImageSegmentation,f.AutoModelForImageTextToText,f.AutoModelForImageToImage,f.AutoModelForMaskGeneration,f.AutoModelForMaskedLM,f.AutoModelForNormalEstimation,f.AutoModelForObjectDetection,f.AutoModelForPoseEstimation,f.AutoModelForQuestionAnswering,f.AutoModelForSemanticSegmentation,f.AutoModelForSeq2SeqLM,f.AutoModelForSequenceClassification,f.AutoModelForSpeechSeq2Seq,f.AutoModelForTextToSpectrogram,f.AutoModelForTextToWaveform,f.AutoModelForTokenClassification,f.AutoModelForUniversalSegmentation,f.AutoModelForVision2Seq,f.AutoModelForXVector,f.AutoModelForZeroShotObjectDetection;var pT=f.AutoProcessor,hT=f.AutoTokenizer;f.AutomaticSpeechRecognitionPipeline,f.BackgroundRemovalPipeline,f.BartForConditionalGeneration,f.BartForSequenceClassification,f.BartModel,f.BartPretrainedModel,f.BartTokenizer,f.BaseModelOutput,f.BaseStreamer,f.BeitFeatureExtractor,f.BeitForImageClassification,f.BeitModel,f.BeitPreTrainedModel,f.BertForMaskedLM,f.BertForQuestionAnswering,f.BertForSequenceClassification,f.BertForTokenClassification,f.BertModel,f.BertPreTrainedModel,f.BertTokenizer,f.BitImageProcessor,f.BlenderbotForConditionalGeneration,f.BlenderbotModel,f.BlenderbotPreTrainedModel,f.BlenderbotSmallForConditionalGeneration,f.BlenderbotSmallModel,f.BlenderbotSmallPreTrainedModel,f.BlenderbotSmallTokenizer,f.BlenderbotTokenizer,f.BloomForCausalLM,f.BloomModel,f.BloomPreTrainedModel,f.BloomTokenizer,f.CLIPFeatureExtractor,f.CLIPImageProcessor,f.CLIPModel,f.CLIPPreTrainedModel,f.CLIPSegForImageSegmentation,f.CLIPSegModel,f.CLIPSegPreTrainedModel,f.CLIPTextModel,f.CLIPTextModelWithProjection,f.CLIPTokenizer,f.CLIPVisionModel,f.CLIPVisionModelWithProjection,f.CamembertForMaskedLM,f.CamembertForQuestionAnswering,f.CamembertForSequenceClassification,f.CamembertForTokenClassification,f.CamembertModel,f.CamembertPreTrainedModel,f.CamembertTokenizer,f.CausalLMOutput,f.CausalLMOutputWithPast,f.ChineseCLIPFeatureExtractor,f.ChineseCLIPModel,f.ChineseCLIPPreTrainedModel,f.ClapAudioModelWithProjection,f.ClapFeatureExtractor,f.ClapModel,f.ClapPreTrainedModel,f.ClapTextModelWithProjection,f.ClassifierFreeGuidanceLogitsProcessor,f.CodeGenForCausalLM,f.CodeGenModel,f.CodeGenPreTrainedModel,f.CodeGenTokenizer,f.CodeLlamaTokenizer,f.CohereForCausalLM,f.CohereModel,f.CoherePreTrainedModel,f.CohereTokenizer,f.ConvBertForMaskedLM,f.ConvBertForQuestionAnswering,f.ConvBertForSequenceClassification,f.ConvBertForTokenClassification,f.ConvBertModel,f.ConvBertPreTrainedModel,f.ConvBertTokenizer,f.ConvNextFeatureExtractor,f.ConvNextForImageClassification,f.ConvNextImageProcessor,f.ConvNextModel,f.ConvNextPreTrainedModel,f.ConvNextV2ForImageClassification,f.ConvNextV2Model,f.ConvNextV2PreTrainedModel,f.DPTFeatureExtractor,f.DPTForDepthEstimation,f.DPTImageProcessor,f.DPTModel,f.DPTPreTrainedModel,f.DacDecoderModel,f.DacDecoderOutput,f.DacEncoderModel,f.DacEncoderOutput,f.DacFeatureExtractor,f.DacModel,f.DacPreTrainedModel,f.DataTypeMap,f.DebertaForMaskedLM,f.DebertaForQuestionAnswering,f.DebertaForSequenceClassification,f.DebertaForTokenClassification,f.DebertaModel,f.DebertaPreTrainedModel,f.DebertaTokenizer,f.DebertaV2ForMaskedLM,f.DebertaV2ForQuestionAnswering,f.DebertaV2ForSequenceClassification,f.DebertaV2ForTokenClassification,f.DebertaV2Model,f.DebertaV2PreTrainedModel,f.DebertaV2Tokenizer,f.DecisionTransformerModel,f.DecisionTransformerPreTrainedModel,f.DeiTFeatureExtractor,f.DeiTForImageClassification,f.DeiTImageProcessor,f.DeiTModel,f.DeiTPreTrainedModel,f.DepthAnythingForDepthEstimation,f.DepthAnythingPreTrainedModel,f.DepthEstimationPipeline,f.DepthProForDepthEstimation,f.DepthProPreTrainedModel,f.DetrFeatureExtractor,f.DetrForObjectDetection,f.DetrForSegmentation,f.DetrImageProcessor,f.DetrModel,f.DetrObjectDetectionOutput,f.DetrPreTrainedModel,f.DetrSegmentationOutput,f.Dinov2ForImageClassification,f.Dinov2Model,f.Dinov2PreTrainedModel,f.Dinov2WithRegistersForImageClassification,f.Dinov2WithRegistersModel,f.Dinov2WithRegistersPreTrainedModel,f.DistilBertForMaskedLM,f.DistilBertForQuestionAnswering,f.DistilBertForSequenceClassification,f.DistilBertForTokenClassification,f.DistilBertModel,f.DistilBertPreTrainedModel,f.DistilBertTokenizer,f.DocumentQuestionAnsweringPipeline,f.DonutFeatureExtractor,f.DonutImageProcessor,f.DonutSwinModel,f.DonutSwinPreTrainedModel,f.EfficientNetForImageClassification,f.EfficientNetImageProcessor,f.EfficientNetModel,f.EfficientNetPreTrainedModel,f.ElectraForMaskedLM,f.ElectraForQuestionAnswering,f.ElectraForSequenceClassification,f.ElectraForTokenClassification,f.ElectraModel,f.ElectraPreTrainedModel,f.ElectraTokenizer,f.EncodecFeatureExtractor,f.EosTokenCriteria,f.EsmForMaskedLM,f.EsmForSequenceClassification,f.EsmForTokenClassification,f.EsmModel,f.EsmPreTrainedModel,f.EsmTokenizer,f.ExaoneForCausalLM,f.ExaoneModel,f.ExaonePreTrainedModel,f.FFT,f.FalconForCausalLM,f.FalconModel,f.FalconPreTrainedModel,f.FalconTokenizer,f.FastViTForImageClassification,f.FastViTModel,f.FastViTPreTrainedModel,f.FeatureExtractionPipeline,f.FeatureExtractor,f.FillMaskPipeline,f.Florence2ForConditionalGeneration,f.Florence2PreTrainedModel,f.Florence2Processor,f.ForcedBOSTokenLogitsProcessor,f.ForcedEOSTokenLogitsProcessor,f.GLPNFeatureExtractor,f.GLPNForDepthEstimation,f.GLPNModel,f.GLPNPreTrainedModel,f.GPT2LMHeadModel,f.GPT2Model,f.GPT2PreTrainedModel,f.GPT2Tokenizer,f.GPTBigCodeForCausalLM,f.GPTBigCodeModel,f.GPTBigCodePreTrainedModel,f.GPTJForCausalLM,f.GPTJModel,f.GPTJPreTrainedModel,f.GPTNeoForCausalLM,f.GPTNeoModel,f.GPTNeoPreTrainedModel,f.GPTNeoXForCausalLM,f.GPTNeoXModel,f.GPTNeoXPreTrainedModel,f.GPTNeoXTokenizer,f.Gemma2ForCausalLM,f.Gemma2Model,f.Gemma2PreTrainedModel,f.Gemma3ForCausalLM,f.Gemma3Model,f.Gemma3PreTrainedModel,f.GemmaForCausalLM,f.GemmaModel,f.GemmaPreTrainedModel,f.GemmaTokenizer,f.GlmForCausalLM,f.GlmModel,f.GlmPreTrainedModel,f.GraniteForCausalLM,f.GraniteModel,f.GranitePreTrainedModel,f.Grok1Tokenizer,f.GroundingDinoForObjectDetection,f.GroundingDinoImageProcessor,f.GroundingDinoPreTrainedModel,f.GroundingDinoProcessor,f.GroupViTModel,f.GroupViTPreTrainedModel,f.HeliumForCausalLM,f.HeliumModel,f.HeliumPreTrainedModel,f.HerbertTokenizer,f.HieraForImageClassification,f.HieraModel,f.HieraPreTrainedModel,f.HubertForCTC,f.HubertForSequenceClassification,f.HubertModel,f.HubertPreTrainedModel,f.IJepaForImageClassification,f.IJepaModel,f.IJepaPreTrainedModel,f.Idefics3ForConditionalGeneration,f.Idefics3ImageProcessor,f.Idefics3PreTrainedModel,f.Idefics3Processor,f.ImageClassificationPipeline,f.ImageFeatureExtractionPipeline,f.ImageFeatureExtractor,f.ImageMattingOutput,f.ImageProcessor,f.ImageSegmentationPipeline,f.ImageToImagePipeline,f.ImageToTextPipeline,f.InterruptableStoppingCriteria,f.JAISLMHeadModel,f.JAISModel,f.JAISPreTrainedModel,f.JinaCLIPImageProcessor,f.JinaCLIPModel,f.JinaCLIPPreTrainedModel,f.JinaCLIPProcessor,f.JinaCLIPTextModel,f.JinaCLIPVisionModel,f.LiteWhisperForConditionalGeneration,f.LlamaForCausalLM,f.LlamaModel,f.LlamaPreTrainedModel,f.LlamaTokenizer,f.LlavaForConditionalGeneration,f.LlavaOnevisionForConditionalGeneration,f.LlavaOnevisionImageProcessor,f.LlavaPreTrainedModel,f.LogitsProcessor,f.LogitsProcessorList,f.LogitsWarper,f.LongT5ForConditionalGeneration,f.LongT5Model,f.LongT5PreTrainedModel,f.M2M100ForConditionalGeneration,f.M2M100Model,f.M2M100PreTrainedModel,f.M2M100Tokenizer,f.MBart50Tokenizer,f.MBartForCausalLM,f.MBartForConditionalGeneration,f.MBartForSequenceClassification,f.MBartModel,f.MBartPreTrainedModel,f.MBartTokenizer,f.MPNetForMaskedLM,f.MPNetForQuestionAnswering,f.MPNetForSequenceClassification,f.MPNetForTokenClassification,f.MPNetModel,f.MPNetPreTrainedModel,f.MPNetTokenizer,f.MT5ForConditionalGeneration,f.MT5Model,f.MT5PreTrainedModel,f.MarianMTModel,f.MarianModel,f.MarianPreTrainedModel,f.MarianTokenizer,f.Mask2FormerImageProcessor,f.MaskFormerFeatureExtractor,f.MaskFormerForInstanceSegmentation,f.MaskFormerImageProcessor,f.MaskFormerModel,f.MaskFormerPreTrainedModel,f.MaskedLMOutput,f.MaxLengthCriteria,f.Metric3DForDepthEstimation,f.Metric3DPreTrainedModel,f.Metric3Dv2ForDepthEstimation,f.Metric3Dv2PreTrainedModel,f.MgpstrForSceneTextRecognition,f.MgpstrModelOutput,f.MgpstrPreTrainedModel,f.MgpstrProcessor,f.MgpstrTokenizer,f.MimiDecoderModel,f.MimiDecoderOutput,f.MimiEncoderModel,f.MimiEncoderOutput,f.MimiModel,f.MimiPreTrainedModel,f.MinLengthLogitsProcessor,f.MinNewTokensLengthLogitsProcessor,f.MistralForCausalLM,f.MistralModel,f.MistralPreTrainedModel,f.MobileBertForMaskedLM,f.MobileBertForQuestionAnswering,f.MobileBertForSequenceClassification,f.MobileBertModel,f.MobileBertPreTrainedModel,f.MobileBertTokenizer,f.MobileLLMForCausalLM,f.MobileLLMModel,f.MobileLLMPreTrainedModel,f.MobileNetV1FeatureExtractor,f.MobileNetV1ForImageClassification,f.MobileNetV1ForSemanticSegmentation,f.MobileNetV1ImageProcessor,f.MobileNetV1Model,f.MobileNetV1PreTrainedModel,f.MobileNetV2FeatureExtractor,f.MobileNetV2ForImageClassification,f.MobileNetV2ForSemanticSegmentation,f.MobileNetV2ImageProcessor,f.MobileNetV2Model,f.MobileNetV2PreTrainedModel,f.MobileNetV3FeatureExtractor,f.MobileNetV3ForImageClassification,f.MobileNetV3ForSemanticSegmentation,f.MobileNetV3ImageProcessor,f.MobileNetV3Model,f.MobileNetV3PreTrainedModel,f.MobileNetV4FeatureExtractor,f.MobileNetV4ForImageClassification,f.MobileNetV4ForSemanticSegmentation,f.MobileNetV4ImageProcessor,f.MobileNetV4Model,f.MobileNetV4PreTrainedModel,f.MobileViTFeatureExtractor,f.MobileViTForImageClassification,f.MobileViTImageProcessor,f.MobileViTModel,f.MobileViTPreTrainedModel,f.MobileViTV2ForImageClassification,f.MobileViTV2Model,f.MobileViTV2PreTrainedModel,f.ModelOutput,f.ModernBertForMaskedLM,f.ModernBertForSequenceClassification,f.ModernBertForTokenClassification,f.ModernBertModel,f.ModernBertPreTrainedModel,f.Moondream1ForConditionalGeneration,f.MoonshineFeatureExtractor,f.MoonshineForConditionalGeneration,f.MoonshineModel,f.MoonshinePreTrainedModel,f.MoonshineProcessor,f.MptForCausalLM,f.MptModel,f.MptPreTrainedModel,f.MultiModalityCausalLM,f.MultiModalityPreTrainedModel,f.MusicgenForCausalLM,f.MusicgenForConditionalGeneration,f.MusicgenModel,f.MusicgenPreTrainedModel,f.NllbTokenizer,f.NoBadWordsLogitsProcessor,f.NoRepeatNGramLogitsProcessor,f.NomicBertModel,f.NomicBertPreTrainedModel,f.NougatImageProcessor,f.NougatTokenizer,f.OPTForCausalLM,f.OPTModel,f.OPTPreTrainedModel,f.ObjectDetectionPipeline,f.Olmo2ForCausalLM,f.Olmo2Model,f.Olmo2PreTrainedModel,f.OlmoForCausalLM,f.OlmoModel,f.OlmoPreTrainedModel,f.OpenELMForCausalLM,f.OpenELMModel,f.OpenELMPreTrainedModel,f.OwlViTFeatureExtractor,f.OwlViTForObjectDetection,f.OwlViTImageProcessor,f.OwlViTModel,f.OwlViTPreTrainedModel,f.OwlViTProcessor,f.Owlv2ForObjectDetection,f.Owlv2ImageProcessor,f.Owlv2Model,f.Owlv2PreTrainedModel,f.PaliGemmaForConditionalGeneration,f.PaliGemmaPreTrainedModel,f.PaliGemmaProcessor,f.PatchTSMixerForPrediction,f.PatchTSMixerModel,f.PatchTSMixerPreTrainedModel,f.PatchTSTForPrediction,f.PatchTSTModel,f.PatchTSTPreTrainedModel,f.Phi3ForCausalLM,f.Phi3Model,f.Phi3PreTrainedModel,f.Phi3VForCausalLM,f.Phi3VImageProcessor,f.Phi3VPreTrainedModel,f.Phi3VProcessor,f.PhiForCausalLM,f.PhiModel,f.PhiPreTrainedModel,f.Pipeline,f.PreTrainedModel,f.PreTrainedTokenizer,f.PretrainedConfig,f.PretrainedMixin,f.Processor,f.PvtForImageClassification,f.PvtImageProcessor,f.PvtModel,f.PvtPreTrainedModel,f.PyAnnoteFeatureExtractor,f.PyAnnoteForAudioFrameClassification,f.PyAnnoteModel,f.PyAnnotePreTrainedModel,f.PyAnnoteProcessor,f.QuestionAnsweringModelOutput,f.QuestionAnsweringPipeline,f.Qwen2ForCausalLM,f.Qwen2Model,f.Qwen2PreTrainedModel,f.Qwen2Tokenizer,f.Qwen2VLForConditionalGeneration,f.Qwen2VLImageProcessor,f.Qwen2VLPreTrainedModel,f.Qwen2VLProcessor,f.RFDetrForObjectDetection,f.RFDetrModel,f.RFDetrObjectDetectionOutput,f.RFDetrPreTrainedModel,f.RTDetrForObjectDetection,f.RTDetrImageProcessor,f.RTDetrModel,f.RTDetrObjectDetectionOutput,f.RTDetrPreTrainedModel,f.RTDetrV2ForObjectDetection,f.RTDetrV2Model,f.RTDetrV2ObjectDetectionOutput,f.RTDetrV2PreTrainedModel,f.RawAudio,f.RawImage,f.RawVideo,f.RawVideoFrame,f.RepetitionPenaltyLogitsProcessor,f.ResNetForImageClassification,f.ResNetModel,f.ResNetPreTrainedModel,f.RoFormerForMaskedLM,f.RoFormerForQuestionAnswering,f.RoFormerForSequenceClassification,f.RoFormerForTokenClassification,f.RoFormerModel,f.RoFormerPreTrainedModel,f.RoFormerTokenizer,f.RobertaForMaskedLM,f.RobertaForQuestionAnswering,f.RobertaForSequenceClassification,f.RobertaForTokenClassification,f.RobertaModel,f.RobertaPreTrainedModel,f.RobertaTokenizer,f.SamImageProcessor,f.SamImageSegmentationOutput,f.SamModel,f.SamPreTrainedModel,f.SamProcessor,f.SapiensForDepthEstimation,f.SapiensForNormalEstimation,f.SapiensForSemanticSegmentation,f.SapiensPreTrainedModel,f.SeamlessM4TFeatureExtractor,f.SegformerFeatureExtractor,f.SegformerForImageClassification,f.SegformerForSemanticSegmentation,f.SegformerImageProcessor,f.SegformerModel,f.SegformerPreTrainedModel,f.Seq2SeqLMOutput,f.SequenceClassifierOutput,f.SiglipImageProcessor,f.SiglipModel,f.SiglipPreTrainedModel,f.SiglipTextModel,f.SiglipTokenizer,f.SiglipVisionModel,f.SmolVLMForConditionalGeneration,f.SmolVLMImageProcessor,f.SmolVLMProcessor,f.SnacDecoderModel,f.SnacEncoderModel,f.SnacFeatureExtractor,f.SnacModel,f.SnacPreTrainedModel,f.SpeechT5FeatureExtractor,f.SpeechT5ForSpeechToText,f.SpeechT5ForTextToSpeech,f.SpeechT5HifiGan,f.SpeechT5Model,f.SpeechT5PreTrainedModel,f.SpeechT5Processor,f.SpeechT5Tokenizer,f.SqueezeBertForMaskedLM,f.SqueezeBertForQuestionAnswering,f.SqueezeBertForSequenceClassification,f.SqueezeBertModel,f.SqueezeBertPreTrainedModel,f.SqueezeBertTokenizer,f.StableLmForCausalLM,f.StableLmModel,f.StableLmPreTrainedModel,f.Starcoder2ForCausalLM,f.Starcoder2Model,f.Starcoder2PreTrainedModel,f.StoppingCriteria,f.StoppingCriteriaList,f.StyleTextToSpeech2Model,f.StyleTextToSpeech2PreTrainedModel,f.SummarizationPipeline,f.SuppressTokensAtBeginLogitsProcessor,f.Swin2SRForImageSuperResolution,f.Swin2SRImageProcessor,f.Swin2SRModel,f.Swin2SRPreTrainedModel,f.SwinForImageClassification,f.SwinForSemanticSegmentation,f.SwinModel,f.SwinPreTrainedModel,f.T5ForConditionalGeneration,f.T5Model,f.T5PreTrainedModel,f.T5Tokenizer,f.TableTransformerForObjectDetection,f.TableTransformerModel,f.TableTransformerObjectDetectionOutput,f.TableTransformerPreTrainedModel,f.TemperatureLogitsWarper,f.Tensor,f.Text2TextGenerationPipeline,f.TextClassificationPipeline,f.TextGenerationPipeline;var mT=f.TextStreamer;f.TextToAudioPipeline,f.TokenClassificationPipeline,f.TokenClassifierOutput,f.TokenizerModel,f.TopKLogitsWarper,f.TopPLogitsWarper,f.TrOCRForCausalLM,f.TrOCRPreTrainedModel,f.TranslationPipeline,f.UltravoxModel,f.UltravoxPreTrainedModel,f.UltravoxProcessor,f.UniSpeechForCTC,f.UniSpeechForSequenceClassification,f.UniSpeechModel,f.UniSpeechPreTrainedModel,f.UniSpeechSatForAudioFrameClassification,f.UniSpeechSatForCTC,f.UniSpeechSatForSequenceClassification,f.UniSpeechSatModel,f.UniSpeechSatPreTrainedModel,f.VLChatProcessor,f.VLMImageProcessor,f.ViTFeatureExtractor,f.ViTForImageClassification,f.ViTImageProcessor,f.ViTMAEModel,f.ViTMAEPreTrainedModel,f.ViTMSNForImageClassification,f.ViTMSNModel,f.ViTMSNPreTrainedModel,f.ViTModel,f.ViTPreTrainedModel,f.VisionEncoderDecoderModel,f.VitMatteForImageMatting,f.VitMatteImageProcessor,f.VitMattePreTrainedModel,f.VitPoseForPoseEstimation,f.VitPoseImageProcessor,f.VitPosePreTrainedModel,f.VitsModel,f.VitsModelOutput,f.VitsPreTrainedModel,f.VitsTokenizer,f.Wav2Vec2BertForCTC,f.Wav2Vec2BertForSequenceClassification,f.Wav2Vec2BertModel,f.Wav2Vec2BertPreTrainedModel,f.Wav2Vec2CTCTokenizer,f.Wav2Vec2FeatureExtractor,f.Wav2Vec2ForAudioFrameClassification,f.Wav2Vec2ForCTC,f.Wav2Vec2ForSequenceClassification,f.Wav2Vec2Model,f.Wav2Vec2PreTrainedModel,f.Wav2Vec2Processor,f.Wav2Vec2ProcessorWithLM,f.WavLMForAudioFrameClassification,f.WavLMForCTC,f.WavLMForSequenceClassification,f.WavLMForXVector,f.WavLMModel,f.WavLMPreTrainedModel,f.WeSpeakerFeatureExtractor,f.WeSpeakerResNetModel,f.WeSpeakerResNetPreTrainedModel,f.WhisperFeatureExtractor;var fT=f.WhisperForConditionalGeneration;f.WhisperModel,f.WhisperPreTrainedModel,f.WhisperProcessor,f.WhisperTextStreamer,f.WhisperTimeStampLogitsProcessor,f.WhisperTokenizer,f.XLMForQuestionAnswering,f.XLMForSequenceClassification,f.XLMForTokenClassification,f.XLMModel,f.XLMPreTrainedModel,f.XLMRobertaForMaskedLM,f.XLMRobertaForQuestionAnswering,f.XLMRobertaForSequenceClassification,f.XLMRobertaForTokenClassification,f.XLMRobertaModel,f.XLMRobertaPreTrainedModel,f.XLMRobertaTokenizer,f.XLMTokenizer,f.XLMWithLMHeadModel,f.XVectorOutput,f.YolosFeatureExtractor,f.YolosForObjectDetection,f.YolosImageProcessor,f.YolosModel,f.YolosObjectDetectionOutput,f.YolosPreTrainedModel,f.ZeroShotAudioClassificationPipeline,f.ZeroShotClassificationPipeline,f.ZeroShotImageClassificationPipeline,f.ZeroShotObjectDetectionPipeline,f.bankers_round,f.cat,f.cos_sim,f.dot,f.dynamic_time_warping,f.env;var _T=f.full;f.full_like,f.getKeyValueShapes,f.hamming,f.hanning,f.interpolate,f.interpolate_4d,f.interpolate_data,f.is_chinese_char,f.layer_norm,f.load_image,f.load_video,f.log_softmax,f.magnitude,f.matmul,f.max,f.mean,f.mean_pooling,f.medianFilter,f.mel_filter_bank,f.min,f.ones,f.ones_like,f.permute,f.permute_data,f.pipeline,f.quantize_embeddings,f.rand,f.read_audio,f.rfft,f.round,f.slice,f.softmax,f.spectrogram,f.stack,f.std_mean,f.topk,f.window_function,f.zeros,f.zeros_like;const gT=64;class Wn{static async getInstance(r){return this.model_id="onnx-community/whisper-large-v3-turbo",this.tokenizer??(this.tokenizer=hT.from_pretrained(this.model_id,{progress_callback:r})),this.processor??(this.processor=pT.from_pretrained(this.model_id,{progress_callback:r})),this.model??(this.model=fT.from_pretrained(this.model_id,{dtype:{encoder_model:"fp16",decoder_model_merged:"q4"},device:"webgpu",progress_callback:r})),Promise.all([this.tokenizer,this.processor,this.model])}}re(Wn,"model_id",null),re(Wn,"tokenizer"),re(Wn,"processor"),re(Wn,"model");async function wT(e){const r=atob(e),t=new Uint8Array(r.length);for(let n=0;n{o??(o=performance.now());let _;a++>0&&(_=a/(performance.now()-o)*1e3),globalThis.postMessage({status:"update",output:g,tps:_,numTokens:a})},c=new mT(s,{skip_prompt:!0,decode_kwargs:{skip_special_tokens:!0},callback_function:l}),p=await i(t),u=await n.generate({...p,max_new_tokens:gT,language:r,streamer:c}),h=s.batch_decode(u,{skip_special_tokens:!0});globalThis.postMessage({status:"complete",output:h}),Xc=!1}async function MT(){globalThis.postMessage({status:"loading",data:"Loading model..."});const[e,r,t]=await Wn.getInstance(s=>{globalThis.postMessage(s)});globalThis.postMessage({status:"loading",data:"Compiling shaders and warming up model..."}),await t.generate({input_features:_T([1,128,3e3],0),max_new_tokens:1}),globalThis.postMessage({status:"ready"})}globalThis.addEventListener("message",async e=>{const{type:r,data:t}=e.data;switch(r){case"load":MT();break;case"generate":yT(t);break}})})(); diff --git a/assets/xai-o2OiL_Fi.js b/assets/xai-hZPT-RIL.js similarity index 67% rename from assets/xai-o2OiL_Fi.js rename to assets/xai-hZPT-RIL.js index f8c362fe4736c723b66d0bfae48d73e42d544246..f336180779a0ebbd2c97100452029233af0451f0 100644 --- a/assets/xai-o2OiL_Fi.js +++ b/assets/xai-hZPT-RIL.js @@ -1 +1 @@ -import"./live2d-zip-loader-CvpgOHsT.js";import{d as x,q as U,bE as V,s as y,h as v,l as $,w as k,x as K,o as h,y as p,b as l,e as t}from"./index-BYewP6KR.js";import{u as w}from"./providers-CFIOZO6n.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DqCgexwu.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CgmyEAiK.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CSsbF9Dc.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CJFL6yWa.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D5HR-mm1.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-Dfw3gUCZ.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-8tXpziLA.js";import"./Input.vue_vue_type_script_setup_true_lang-C1tyFTKa.js";const a="xai",H=x({__name:"xai",setup(B){const{t:d}=U(),_=V(),m=w(),{providers:o}=y(m),n=v(()=>m.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;m.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),k([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=u=>r.value=u),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; +import"./live2d-zip-loader-DFrBymqv.js";import{d as x,q as U,bE as V,s as y,h as v,l as $,w as k,x as K,o as h,y as p,b as l,e as t}from"./index-CL4rmUJ-.js";import{u as w}from"./providers-BHCrT0RZ.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DSr7vzEO.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-kqNNdnJX.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-CQr6n3al.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CGV_kjud.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-D1l84PAS.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DyJvGcGI.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-bt8c6FDo.js";import"./Input.vue_vue_type_script_setup_true_lang-lz6q2FWu.js";const a="xai",H=x({__name:"xai",setup(B){const{t:d}=U(),_=V(),m=w(),{providers:o}=y(m),n=v(()=>m.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;m.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),k([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=u=>r.value=u),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{H as default}; diff --git a/index.html b/index.html index 9106f6dee9b726dfeed0ee1551d4e838669bbcfa..dae7e94c36a1ba7cdd29f4c2694176af0b8e8029 100644 --- a/index.html +++ b/index.html @@ -23,8 +23,8 @@ src="/remote-assets/page-external-data/js/script.js" > - - + +