diff --git a/assets/Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js b/assets/Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js similarity index 90% rename from assets/Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js rename to assets/Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js index eb04245c8c80cac030f6f82cd06adfe0505fd05e..cc1240b8c8c574d4fd651dcd6c44acbe2c8fdc4b 100644 --- a/assets/Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js +++ b/assets/Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js @@ -1 +1 @@ -import{d,m as c,u as f,r as s,p,y as v,z as x,o as y,c as h,q as _}from"./index-Bo-ykojl.js";const w=d({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:c(["submit"],["update:modelValue"]),setup(n,{emit:u}){const r=u,e=f(n,"modelValue"),a=s(),o=s("auto");function i(t){t.code==="Enter"&&!t.shiftKey&&(t.preventDefault(),r("submit",e.value))}return p(e,()=>{o.value="auto",requestAnimationFrame(()=>{a.value&&(o.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(t,l)=>v((y(),h("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":l[0]||(l[0]=m=>e.value=m),style:_({height:o.value}),onKeydown:i},null,36)),[[x,e.value]])}});export{w as _}; +import{d,m as c,u as f,r as s,p,y as v,z as x,o as y,c as h,q as _}from"./index-1_q7hlhr.js";const w=d({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:c(["submit"],["update:modelValue"]),setup(n,{emit:u}){const r=u,e=f(n,"modelValue"),a=s(),o=s("auto");function i(t){t.code==="Enter"&&!t.shiftKey&&(t.preventDefault(),r("submit",e.value))}return p(e,()=>{o.value="auto",requestAnimationFrame(()=>{a.value&&(o.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(t,l)=>v((y(),h("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":l[0]||(l[0]=m=>e.value=m),style:_({height:o.value}),onKeydown:i},null,36)),[[x,e.value]])}});export{w as _}; diff --git a/assets/CardDetailDialog-BMYdUjFX.js b/assets/CardDetailDialog-BMYdUjFX.js deleted file mode 100644 index b9c8246dbbeb39469bd327b3e181d217055e04d6..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-BMYdUjFX.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-CHDpOqJ6.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-B3_Iawdo.js";import"./index-Bo-ykojl.js";import"./index-DmpthJxW.js";import"./floating-ui.core-CgBsuaUc.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./airi-card-Vf6km3w_.js";import"./mini_xsschema-f5xAZ6yD.js";import"./consciousness-DjkUTNrC.js";import"./providers-B3p38pBl.js";import"./index-LHmcipjy.js";import"./speech-Br7XDY4_.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";export{o as default}; diff --git a/assets/CardDetailDialog-DAWUrvKq.js b/assets/CardDetailDialog-DAWUrvKq.js new file mode 100644 index 0000000000000000000000000000000000000000..919c265dbfaa905523267749916e837266408e4f --- /dev/null +++ b/assets/CardDetailDialog-DAWUrvKq.js @@ -0,0 +1 @@ +import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-DLR-50Jh.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-Beo1SYnL.js";import"./index-1_q7hlhr.js";import"./index-CmOAxAkQ.js";import"./floating-ui.core-CgBsuaUc.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./airi-card-CFCqiAzX.js";import"./mini_xsschema-f5xAZ6yD.js";import"./consciousness-esOkXpB1.js";import"./providers-BQORs1wj.js";import"./index-LHmcipjy.js";import"./speech-Bdg784LP.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";export{o as default}; diff --git a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-CHDpOqJ6.js b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DLR-50Jh.js similarity index 95% rename from assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-CHDpOqJ6.js rename to assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DLR-50Jh.js index bbe614ee8c17c344e72462f720f39f3eee8bed37..0cccec8cecc30084c688a0ef8cb79a941ee20f1c 100644 --- a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-CHDpOqJ6.js +++ b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DLR-50Jh.js @@ -1 +1 @@ -import{_ as O,a as E}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-B3_Iawdo.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as F,g as U,s as q,h as x,r as L,c as l,o as n,F as f,i as m,b as o,w as k,e,j as v,k as u,t as i,n as $,l as D}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import{u as R}from"./airi-card-Vf6km3w_.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import"./mini_xsschema-f5xAZ6yD.js";import{n as G,I as J,$ as K,P as Q,B as W}from"./index-DmpthJxW.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:"flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},oe={class:"mt-4"},le={class:"border-b border-neutral-200 dark:border-neutral-700"},ne={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"},Oe=F({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(j,{emit:A}){const b=j,B=A,{t:d}=U(),w=R(),{removeCard:N}=w,{activeCardId:M}=q(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 P(){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 z(){a.value&&(N(b.cardId),B("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 n(),l(f,null,[m(o(G),{open:j.modelValue,"onUpdate:open":t[0]||(t[0]=r=>B("update:modelValue",r))},{default:k(()=>[m(o(J),null,{default:k(()=>[m(o(K),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm"}),m(o(Q),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6"},{default:k(()=>[a.value?(n(),l("div",X,[e("div",Y,[e("div",Z,[e("div",null,[e("div",ee,[m(o(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?(n(),l("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(o(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(n(),l(f,{key:0},[u(" · "+i(o(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(o(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?o(d)("settings.pages.card.active"):o(d)("settings.pages.card.activate"),disabled:h.value,class:$({"animate-pulse":I.value}),onClick:P},null,8,["icon","label","disabled","class"])])]),e("div",oe,[e("div",le,[e("div",ne,[(n(!0),l(f,null,D(H.value,r=>(n(),l("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?(n(),l("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?(n(),l("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)?(n(),l("div",pe,[e("div",ge,[(n(!0),l(f,null,D(C.value,(r,g)=>(n(),l(f,{key:g},[r?(n(),l("div",xe,[e("h2",be,i(o(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"?(n(),l("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(o(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(o(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(o(d)("settings.pages.card.speech.voice")),1)]),e("div",Le,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(n(),l("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(o(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(E,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:z,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{Oe as _}; +import{_ as O,a as E}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-Beo1SYnL.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as F,g as U,s as q,h as x,r as L,c as l,o as n,F as f,i as m,b as o,w as k,e,j as v,k as u,t as i,n as $,l as D}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import{u as R}from"./airi-card-CFCqiAzX.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import"./mini_xsschema-f5xAZ6yD.js";import{n as G,I as J,$ as K,P as Q,B as W}from"./index-CmOAxAkQ.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:"flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},oe={class:"mt-4"},le={class:"border-b border-neutral-200 dark:border-neutral-700"},ne={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"},Oe=F({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(j,{emit:A}){const b=j,B=A,{t:d}=U(),w=R(),{removeCard:N}=w,{activeCardId:M}=q(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 P(){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 z(){a.value&&(N(b.cardId),B("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 n(),l(f,null,[m(o(G),{open:j.modelValue,"onUpdate:open":t[0]||(t[0]=r=>B("update:modelValue",r))},{default:k(()=>[m(o(J),null,{default:k(()=>[m(o(K),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm"}),m(o(Q),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6"},{default:k(()=>[a.value?(n(),l("div",X,[e("div",Y,[e("div",Z,[e("div",null,[e("div",ee,[m(o(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?(n(),l("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(o(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(n(),l(f,{key:0},[u(" · "+i(o(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(o(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?o(d)("settings.pages.card.active"):o(d)("settings.pages.card.activate"),disabled:h.value,class:$({"animate-pulse":I.value}),onClick:P},null,8,["icon","label","disabled","class"])])]),e("div",oe,[e("div",le,[e("div",ne,[(n(!0),l(f,null,D(H.value,r=>(n(),l("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?(n(),l("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?(n(),l("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)?(n(),l("div",pe,[e("div",ge,[(n(!0),l(f,null,D(C.value,(r,g)=>(n(),l(f,{key:g},[r?(n(),l("div",xe,[e("h2",be,i(o(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"?(n(),l("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(o(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(o(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(o(d)("settings.pages.card.speech.voice")),1)]),e("div",Le,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(n(),l("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(o(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(E,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:z,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{Oe as _}; diff --git a/assets/CardListItem-B1DYef5g.js b/assets/CardListItem-B1DYef5g.js deleted file mode 100644 index d155ce4748b818a7fc05f46566cc8f855bf5b7d4..0000000000000000000000000000000000000000 --- a/assets/CardListItem-B1DYef5g.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-Irw2DXRd.js";import"./index-Bo-ykojl.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import"./floating-ui.core-CgBsuaUc.js";export{o as default}; diff --git a/assets/CardListItem-CZfNqIRm.js b/assets/CardListItem-CZfNqIRm.js new file mode 100644 index 0000000000000000000000000000000000000000..9f6a275da669a20ca0f0683004375afccf2690b9 --- /dev/null +++ b/assets/CardListItem-CZfNqIRm.js @@ -0,0 +1 @@ +import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-qVLsovLx.js";import"./index-1_q7hlhr.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import"./floating-ui.core-CgBsuaUc.js";export{o as default}; diff --git a/assets/CardListItem.vue_vue_type_script_setup_true_lang-Irw2DXRd.js b/assets/CardListItem.vue_vue_type_script_setup_true_lang-qVLsovLx.js similarity index 93% rename from assets/CardListItem.vue_vue_type_script_setup_true_lang-Irw2DXRd.js rename to assets/CardListItem.vue_vue_type_script_setup_true_lang-qVLsovLx.js index 70a423a6e83bb701c5cd634de47765fe6ff5d8c6..b7c3c4d54027fc5df729471b4352d6bb3a895a50 100644 --- a/assets/CardListItem.vue_vue_type_script_setup_true_lang-Irw2DXRd.js +++ b/assets/CardListItem.vue_vue_type_script_setup_true_lang-qVLsovLx.js @@ -1 +1 @@ -import{d as M,r as s,H,c as p,o as d,f as R,q as V,_ as F,A as I,w as N,e as t,j as v,t as l,V as k,n as h,b as W}from"./index-Bo-ykojl.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";const q=M({__name:"CursorFloating",props:{intensity:{default:1.5}},setup(r){const n=r,o=s(null),a=s(""),e=s("50% 50%"),i=s("50% 50%"),y=s(.5);function w(c){if(!o.value)return;const u=o.value,x=u.getBoundingClientRect(),$=c.clientX-x.left,C=c.clientY-x.top,z=u.offsetWidth,B=u.offsetHeight,f=Math.abs(Math.floor(100/z*$)-100),m=Math.abs(Math.floor(100/B*C)-100),b=50+(f-50)/1.5,g=50+(m-50)/1.5,A=50+(f-50)/7,P=50+(m-50)/7,S=(b-50)/1.5*.2*n.intensity,X=(g-50)/2*-1*.2*n.intensity,Y=50-f+(50-m),j=.5+Math.abs(Y)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${X}deg) rotateY(${S}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${b}% ${g}%`,i.value=`${A}% ${P}%`,y.value=j}function _(){a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",e.value="50% 50%",i.value="50% 50%",y.value=.5}return H(()=>{a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"}),(c,u)=>(d(),p("div",{ref_key:"cardRef",ref:o,class:"card-hover-effect",style:V({transform:a.value,"--effect-intensity":r.intensity}),onMousemove:w,onMouseleave:_},[R(c.$slots,"default",{},void 0,!0)],36))}}),D=F(q,[["__scopeId","data-v-895421da"]]),E={relative:"",flex:"~ col 1","justify-between":"","gap-3":"","overflow-hidden":"","rounded-lg":"",bg:"white dark:neutral-900","p-5":"",transition:"all ease-in-out duration-400",after:"content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out",hover:"after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80"},L={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},O={"flex-1":"",truncate:"","text-lg":"","font-bold":""},G={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},J={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400"},K={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},Q={flex:"","items-center":"","gap-1.5":""},T={flex:"","items-center":"","gap-0.5":""},U={flex:"","items-center":"","gap-0.5":""},Z={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},ee=["disabled"],se=M({__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:n}){const o=n;return(a,e)=>(d(),I(W(D),{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:h([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: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:e[2]||(e[2]=i=>o("select"))},{default:N(()=>[t("div",E,[t("div",L,[t("h3",O,l(r.name),1),r.isActive?(d(),p("div",G,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",J,l(r.description),1)):v("",!0),t("div",K,[t("div",null,"v"+l(r.version),1),t("div",Q,[t("div",T,[e[4]||(e[4]=t("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),t("span",null,l(r.consciousnessModel),1)]),t("div",U,[e[5]||(e[5]=t("div",{"i-lucide:mic":"","text-xs":""},null,-1)),t("span",null,l(r.voiceModel),1)])])])]),t("div",Z,[t("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:e[0]||(e[0]=k(i=>o("activate"),["stop"]))},[t("div",{class:h([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,ee),r.id!=="default"?(d(),p("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:e[1]||(e[1]=k(i=>o("delete"),["stop"]))},e[6]||(e[6]=[t("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):v("",!0)])]),_:1},8,["class"]))}});export{se as _}; +import{d as M,r as s,H,c as p,o as d,f as R,q as V,_ as F,A as I,w as N,e as t,j as v,t as l,V as k,n as h,b as W}from"./index-1_q7hlhr.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";const q=M({__name:"CursorFloating",props:{intensity:{default:1.5}},setup(r){const n=r,o=s(null),a=s(""),e=s("50% 50%"),i=s("50% 50%"),y=s(.5);function w(c){if(!o.value)return;const u=o.value,x=u.getBoundingClientRect(),$=c.clientX-x.left,C=c.clientY-x.top,z=u.offsetWidth,B=u.offsetHeight,f=Math.abs(Math.floor(100/z*$)-100),m=Math.abs(Math.floor(100/B*C)-100),b=50+(f-50)/1.5,g=50+(m-50)/1.5,A=50+(f-50)/7,P=50+(m-50)/7,S=(b-50)/1.5*.2*n.intensity,X=(g-50)/2*-1*.2*n.intensity,Y=50-f+(50-m),j=.5+Math.abs(Y)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${X}deg) rotateY(${S}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${b}% ${g}%`,i.value=`${A}% ${P}%`,y.value=j}function _(){a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",e.value="50% 50%",i.value="50% 50%",y.value=.5}return H(()=>{a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"}),(c,u)=>(d(),p("div",{ref_key:"cardRef",ref:o,class:"card-hover-effect",style:V({transform:a.value,"--effect-intensity":r.intensity}),onMousemove:w,onMouseleave:_},[R(c.$slots,"default",{},void 0,!0)],36))}}),D=F(q,[["__scopeId","data-v-895421da"]]),E={relative:"",flex:"~ col 1","justify-between":"","gap-3":"","overflow-hidden":"","rounded-lg":"",bg:"white dark:neutral-900","p-5":"",transition:"all ease-in-out duration-400",after:"content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out",hover:"after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80"},L={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},O={"flex-1":"",truncate:"","text-lg":"","font-bold":""},G={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},J={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400"},K={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},Q={flex:"","items-center":"","gap-1.5":""},T={flex:"","items-center":"","gap-0.5":""},U={flex:"","items-center":"","gap-0.5":""},Z={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},ee=["disabled"],se=M({__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:n}){const o=n;return(a,e)=>(d(),I(W(D),{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:h([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: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:e[2]||(e[2]=i=>o("select"))},{default:N(()=>[t("div",E,[t("div",L,[t("h3",O,l(r.name),1),r.isActive?(d(),p("div",G,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",J,l(r.description),1)):v("",!0),t("div",K,[t("div",null,"v"+l(r.version),1),t("div",Q,[t("div",T,[e[4]||(e[4]=t("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),t("span",null,l(r.consciousnessModel),1)]),t("div",U,[e[5]||(e[5]=t("div",{"i-lucide:mic":"","text-xs":""},null,-1)),t("span",null,l(r.voiceModel),1)])])])]),t("div",Z,[t("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:e[0]||(e[0]=k(i=>o("activate"),["stop"]))},[t("div",{class:h([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,ee),r.id!=="default"?(d(),p("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:e[1]||(e[1]=k(i=>o("delete"),["stop"]))},e[6]||(e[6]=[t("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):v("",!0)])]),_:1},8,["class"]))}});export{se as _}; diff --git a/assets/Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js b/assets/Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js similarity index 82% rename from assets/Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js rename to assets/Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js index 18714fb8635b1a28d0847ba4445303d8f55a9b61..25139378d838cc98e613ad91ac7d84b393e6ecb9 100644 --- a/assets/Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js +++ b/assets/Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js @@ -1 +1 @@ -import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{d as p,m,u as f,B as c,c as b,o as v,f as r,i as V,e as s,k,t as u,C as i,D as y,b as C,w as g,j as x,E as B}from"./index-Bo-ykojl.js";const _={op50:""},M=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");c(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),b("div",null,[r(l.$slots,"trigger",i(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]=w=>e.value=!e.value)},[s("span",null,u(t.label??"Collapsable"),1),a[1]||(a[1]=k()),s("span",_,u(e.value?"▲":"▼"),1)])]),V(C(d),null,{default:g(()=>[e.value?r(l.$slots,"default",i(B({key:0},{visible:e.value,setVisible:n}))):x("",!0)]),_:3})]))}});export{M as _}; +import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{d as p,m,u as f,B as c,c as b,o as v,f as r,i as V,e as s,k,t as u,C as i,D as y,b as C,w as g,j as x,E as B}from"./index-1_q7hlhr.js";const _={op50:""},M=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");c(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),b("div",null,[r(l.$slots,"trigger",i(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]=w=>e.value=!e.value)},[s("span",null,u(t.label??"Collapsable"),1),a[1]||(a[1]=k()),s("span",_,u(e.value?"▲":"▼"),1)])]),V(C(d),null,{default:g(()=>[e.value?r(l.$slots,"default",i(B({key:0},{visible:e.value,setVisible:n}))):x("",!0)]),_:3})]))}});export{M as _}; diff --git a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-cX_hB6ek.js b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-B9HHyio1.js similarity index 87% rename from assets/ColorPalette.vue_vue_type_script_setup_true_lang-cX_hB6ek.js rename to assets/ColorPalette.vue_vue_type_script_setup_true_lang-B9HHyio1.js index 647c969dcb76bf155b8dc8a595f37138de6c4cfa..5bd96bcad2b03fc2c741e8f9d3871b115736322a 100644 --- a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-cX_hB6ek.js +++ b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-B9HHyio1.js @@ -1 +1 @@ -import{_ as k}from"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import{d as c,A as m,o as i,w as l,e as n,n as u,f as y,k as f,t as g,G as C,c as d,j as b,F as v,l as h,i as s,b as e,q as w,O as x}from"./index-Bo-ykojl.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{W as S,j as $,q as B,U as E,G as F,H as V}from"./index-DmpthJxW.js";const j=["onClick"],z={flex:"","gap-1.5":""},T=c({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(r,_)=>(i(),m(k,{default:t.expand},{trigger:l(o=>[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:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",onClick:a=>o.setVisible(!o.visible)},[n("div",z,[n("div",{class:u(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:u({"rotate-180":o.visible})},null,2)],8,j)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:u(t.innerClass)},[y(r.$slots,"default")],2)]),_:3},8,["default"]))}}),H={key:0,flex:"","gap-2":""},A=c({__name:"ColorPalette",props:{colors:null},setup(t){const r=C();return(_,o)=>t.colors.length?(i(),d("div",H,[(i(!0),d(v,null,h(t.colors,({hex:a,name:p})=>(i(),m(e(V),{key:a||"default"},{default:l(()=>[s(e(S),null,{default:l(()=>[s(e($),{transition:"all ease-in-out duration-250","size-6":"","cursor-pointer":"","rounded-full":"","bg-primary-500":"",style:w(a?{background:a}:{"--theme-colors-hue":e(x)}),class:u(e(r).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:N=>e(r).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e(B),null,{default:l(()=>[s(e(E),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(F),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):b("",!0)}});export{T as _,A as a}; +import{_ as k}from"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import{d as c,A as m,o as i,w as l,e as n,n as u,f as y,k as f,t as g,G as C,c as d,j as b,F as v,l as h,i as s,b as e,q as w,O as x}from"./index-1_q7hlhr.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{W as S,j as $,q as B,U as E,G as F,H as V}from"./index-CmOAxAkQ.js";const j=["onClick"],z={flex:"","gap-1.5":""},T=c({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(r,_)=>(i(),m(k,{default:t.expand},{trigger:l(o=>[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:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",onClick:a=>o.setVisible(!o.visible)},[n("div",z,[n("div",{class:u(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:u({"rotate-180":o.visible})},null,2)],8,j)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:u(t.innerClass)},[y(r.$slots,"default")],2)]),_:3},8,["default"]))}}),H={key:0,flex:"","gap-2":""},A=c({__name:"ColorPalette",props:{colors:null},setup(t){const r=C();return(_,o)=>t.colors.length?(i(),d("div",H,[(i(!0),d(v,null,h(t.colors,({hex:a,name:p})=>(i(),m(e(V),{key:a||"default"},{default:l(()=>[s(e(S),null,{default:l(()=>[s(e($),{transition:"all ease-in-out duration-250","size-6":"","cursor-pointer":"","rounded-full":"","bg-primary-500":"",style:w(a?{background:a}:{"--theme-colors-hue":e(x)}),class:u(e(r).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:N=>e(r).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e(B),null,{default:l(()=>[s(e(E),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(F),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):b("",!0)}});export{T as _,A as a}; diff --git a/assets/DeleteCardDialog-Cc6M_Ghk.js b/assets/DeleteCardDialog-Cc6M_Ghk.js deleted file mode 100644 index 25fd29d1f730580f434efa383d2ed92ccea2b993..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-Cc6M_Ghk.js +++ /dev/null @@ -1 +0,0 @@ -import{a as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-B3_Iawdo.js";import"./index-Bo-ykojl.js";import"./index-DmpthJxW.js";import"./floating-ui.core-CgBsuaUc.js";export{o as default}; diff --git a/assets/DeleteCardDialog-DgtK6LD9.js b/assets/DeleteCardDialog-DgtK6LD9.js new file mode 100644 index 0000000000000000000000000000000000000000..d1a04df90848eec739f131bdad9b3f2d0948d39d --- /dev/null +++ b/assets/DeleteCardDialog-DgtK6LD9.js @@ -0,0 +1 @@ +import{a as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-Beo1SYnL.js";import"./index-1_q7hlhr.js";import"./index-CmOAxAkQ.js";import"./floating-ui.core-CgBsuaUc.js";export{o as default}; diff --git a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-B3_Iawdo.js b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-Beo1SYnL.js similarity index 93% rename from assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-B3_Iawdo.js rename to assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-Beo1SYnL.js index 1f66acfe330066398472e72dd2ad19579f951f51..518ebff6a78640f771c5c2194367ed44ee4d22e4 100644 --- a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-B3_Iawdo.js +++ b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-Beo1SYnL.js @@ -1 +1 @@ -import{d as k,h as p,c as r,o as d,n as g,e as m,j as h,f as _,t as i,g as w,A as C,w as n,i as t,b as e,k as x}from"./index-Bo-ykojl.js";import{A as V,k as B,O as N,V as z,F as D,M as j,N as A,T as O}from"./index-DmpthJxW.js";const S=["disabled"],T={class:"flex flex-row items-center justify-center gap-2"},$={key:0,class:"i-lucide:loader-circle animate-spin"},F={key:2},y=k({__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",T,[a.loading?(d(),r("div",$)):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,S))}}),I={class:"flex flex-row justify-end gap-3"},H=k({__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(O),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=v=>l("update:modelValue",v))},{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-100 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-100 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800"},{default: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",I,[t(e(j),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(A),{"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{y as _,H as a}; +import{d as k,h as p,c as r,o as d,n as g,e as m,j as h,f as _,t as i,g as w,A as C,w as n,i as t,b as e,k as x}from"./index-1_q7hlhr.js";import{A as V,k as B,O as N,V as z,F as D,M as j,N as A,T as O}from"./index-CmOAxAkQ.js";const S=["disabled"],T={class:"flex flex-row items-center justify-center gap-2"},$={key:0,class:"i-lucide:loader-circle animate-spin"},F={key:2},y=k({__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",T,[a.loading?(d(),r("div",$)):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,S))}}),I={class:"flex flex-row justify-end gap-3"},H=k({__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(O),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=v=>l("update:modelValue",v))},{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-100 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-100 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800"},{default: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",I,[t(e(j),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(A),{"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{y as _,H as a}; diff --git a/assets/FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js b/assets/FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js similarity index 81% rename from assets/FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js rename to assets/FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js index e75b9e5aad133ee37410c4b087b934c916acdab7..a0488fa076547eb82fc49dc4a187a66152476395 100644 --- a/assets/FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js +++ b/assets/FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js @@ -1 +1 @@ -import{_ as u}from"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";import{d as i,m as c,u as p,c as o,o as n,e as l,i as m,k as _,j as x,t as d,n as f}from"./index-Bo-ykojl.js";const V={"max-w-full":""},h={flex:"~ col gap-4"},y={class:"flex items-center gap-1 text-sm font-medium"},v={key:0,class:"text-red-500"},k={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},N=i({__name:"FieldInput",props:c({label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=p(t,"modelValue");return(C,s)=>(n(),o("div",V,[l("label",h,[l("div",null,[l("div",y,[_(d(e.label)+" ",1),e.required!==!1?(n(),o("span",v,"*")):x("",!0)]),l("div",k,d(e.description),1)]),m(u,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=r=>a.value=r),type:e.type,placeholder:e.placeholder,class:f(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}});export{N as _}; +import{_ as u}from"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";import{d as i,m as c,u as p,c as o,o as n,e as l,i as m,k as _,j as x,t as d,n as f}from"./index-1_q7hlhr.js";const V={"max-w-full":""},h={flex:"~ col gap-4"},y={class:"flex items-center gap-1 text-sm font-medium"},v={key:0,class:"text-red-500"},k={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},N=i({__name:"FieldInput",props:c({label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=p(t,"modelValue");return(C,s)=>(n(),o("div",V,[l("label",h,[l("div",null,[l("div",y,[_(d(e.label)+" ",1),e.required!==!1?(n(),o("span",v,"*")):x("",!0)]),l("div",k,d(e.description),1)]),m(u,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=r=>a.value=r),type:e.type,placeholder:e.placeholder,class:f(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}});export{N as _}; diff --git a/assets/FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js b/assets/FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js similarity index 93% rename from assets/FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js rename to assets/FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js index 07de45a325786592c700662215e854aa90be856f..540d25d9265ccaee8a8ee395ad8ecb906be75056 100644 --- a/assets/FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js +++ b/assets/FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js @@ -1 +1 @@ -import{d as m,c as g,o as c,q as M,f as k,_ as B,r as V,bh as E,H as P,I as T,e as f,A as y,w as _,i as $,F as R,bi as N,E as w,bj as D,be as S,b as d,bd as z,bs as L,h as v,bE as j,ba as U,bF as H,p as K,l as G,b8 as W,bG as X,j as Y,bx as J,V as Q,u as C,m as q,t as x,y as Z,z as ee}from"./index-Bo-ykojl.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";const te=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,n)=>(c(),g("div",{class:"volumed",style:M({perspective:`${t.perspective}px`,transform:t.transform})},[k(e.$slots,"default",{},void 0,!0)],4))}}),ae=B(te,[["__scopeId","data-v-568551bc"]]),ne=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const n=t,o=V(1),l=V(0);let r=0;const a=E(()=>n.friction),u=E(()=>n.baseSpeed),p=E(()=>n.momentumFactor);function h(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(h)}function i(s){const b=Math.sqrt(s.movementX**2+s.movementY**2);o.value+=b*p.value}return P(()=>{window.addEventListener("mousemove",i),requestAnimationFrame(h)}),T(()=>{window.removeEventListener("mousemove",i)}),e({momentum:o,currentValue:l}),(s,b)=>k(s.$slots,"default",{momentum:o.value,currentValue:l.value})}}),le=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,n)=>(c(),g("div",{class:"test-dummy-flat",style:M({width:`${t.size}px`,height:`${t.size}px`})},n[0]||(n[0]=[f("div",{class:"marker"},null,-1)]),4))}}),oe=B(le,[["__scopeId","data-v-b4ef37ac"]]),Re=m({__name:"TestDummyMarker",setup(t){return(e,n)=>(c(),y(ne,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:o})=>[$(ae,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[$(oe,{size:24,style:M({transform:`rotate(${o}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});function I(t){return t?t.flatMap(e=>e.type===R?I(e.children):[e]):[]}const re=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var p,h;if(!n.default)return null;const o=I(n.default()),l=o.findIndex(i=>i.type!==N);if(l===-1)return o;const r=o[l];(p=r.props)==null||delete p.ref;const a=r.props?w(e,r.props):e;e.class&&((h=r.props)!=null&&h.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)}}}),se=["area","img","input"],A=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"&&se.includes(o)?()=>S(o,e):o!=="template"?()=>S(t.as,e,{default:n.default}):()=>S(re,e,{default:n.default})}}),ue=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,n)=>(c(),y(d(A),{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 ie(t,e){const n=`${t}Context`,o=Symbol(n);return[a=>{const u=z(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 O(){const t=U(),e=V(),n=v(()=>{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:j(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 de(){const t=V(),e=v(()=>{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:j(t)});return{primitiveElement:t,currentElement:e}}function ce(t){return v(()=>{var e;return H(t)?!!((e=j(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}=de(),l=v(()=>e.checked??e.value);return K(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(ue,w({ref_key:"primitiveElement",ref:n},{...e,...r.$attrs},{as:"input"}),null,16))}}),me=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=v(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),o=v(()=>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,w({key:l.name},{...e,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(c(!0),g(R,{key:1},G(o.value,a=>(c(),y(F,w({key:a.name,ref_for:!0},{...e,...l.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))}}),[pe,fe]=ie("SwitchRoot"),ve=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}=W(n),r=X(n,"modelValue",o,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function a(){l.value||(r.value=!r.value)}const{forwardRef:u,currentElement:p}=O(),h=ce(p),i=v(()=>{var s;return n.id&&p.value?(s=document.querySelector(`[for="${n.id}"]`))==null?void 0:s.innerText:void 0});return fe({modelValue:r,toggleCheck:a,disabled:l}),(s,b)=>(c(),y(d(A),w(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:J(Q(a,["prevent"]),["enter"])}),{default:_(()=>[k(s.$slots,"default",{modelValue:d(r)}),d(h)&&s.name?(c(),y(d(me),{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"])):Y("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),he=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=pe();return O(),(n,o)=>{var l;return c(),y(d(A),{"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"])}}}),be=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(ve),{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:_(()=>[$(d(he),{"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"]))}}),ye={flex:"~ col gap-4"},_e={flex:"~ row","items-center":"","gap-2":""},ge={flex:"1"},xe={class:"flex items-center gap-1 text-sm font-medium"},Ve={class:"text-xs text-neutral-500 dark:text-neutral-400"},Ie=m({__name:"FieldCheckbox",props:q({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",ye,[f("div",_e,[f("div",ge,[f("div",xe,x(e.label),1),f("div",Ve,x(e.description),1)]),$(be,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r)},null,8,["modelValue"])])]))}}),$e=["min","max","step"],we=m({__name:"Range",props:q({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=v(()=>e.min*1e4),l=v(()=>e.max*1e4),r=v(()=>e.step*1e4),a=V(),u=v({get:()=>n.value*1e4,set:i=>{n.value=i/1e4,p()}});P(()=>{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()))}function h(i){const s=i.target;s.style.setProperty("--value",s.value)}return(i,s)=>Z((c(),g("input",{ref_key:"sliderRef",ref:a,"onUpdate:modelValue":s[0]||(s[0]=b=>u.value=b),type:"range",min:o.value,max:l.value,step:r.value,class:"slider-progress form_input-range",onInput:h},null,40,$e)),[[ee,u.value,void 0,{number:!0}]])}}),ke=B(we,[["__scopeId","data-v-d88ffd28"]]),Ce={flex:"~ col gap-4"},Ee={flex:"~ row","items-center":"","gap-2":""},Se={flex:"1"},Me={class:"flex items-center gap-1 text-sm font-medium"},Be={class:"text-xs text-neutral-500 dark:text-neutral-400"},je={"font-mono":""},qe={flex:"~ row","items-center":"","gap-2":""},Oe=m({__name:"FieldRange",props:q({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",Ce,[f("div",Ee,[f("div",Se,[f("div",Me,x(t.label),1),f("div",Be,x(t.description),1)]),f("span",je,x(((r=e.formatValue)==null?void 0:r.call(e,n.value))||n.value),1)]),f("div",qe,[$(ke,{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"])])])}}});export{Oe as _,Ie as a,Re as b}; +import{d as m,c as g,o as c,q as M,f as k,_ as B,r as V,bh as E,H as P,I as T,e as f,A as y,w as _,i as $,F as I,bi as N,E as w,bj as D,be as S,b as d,bd as z,bs as L,h as v,bI as j,ba as U,bJ as H,p as K,l as G,b8 as W,bK as X,j as Y,bB as J,V as Q,u as C,m as q,t as x,y as Z,z as ee}from"./index-1_q7hlhr.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";const te=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,n)=>(c(),g("div",{class:"volumed",style:M({perspective:`${t.perspective}px`,transform:t.transform})},[k(e.$slots,"default",{},void 0,!0)],4))}}),ae=B(te,[["__scopeId","data-v-568551bc"]]),ne=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const n=t,o=V(1),l=V(0);let r=0;const a=E(()=>n.friction),u=E(()=>n.baseSpeed),p=E(()=>n.momentumFactor);function h(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(h)}function i(s){const b=Math.sqrt(s.movementX**2+s.movementY**2);o.value+=b*p.value}return P(()=>{window.addEventListener("mousemove",i),requestAnimationFrame(h)}),T(()=>{window.removeEventListener("mousemove",i)}),e({momentum:o,currentValue:l}),(s,b)=>k(s.$slots,"default",{momentum:o.value,currentValue:l.value})}}),le=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,n)=>(c(),g("div",{class:"test-dummy-flat",style:M({width:`${t.size}px`,height:`${t.size}px`})},n[0]||(n[0]=[f("div",{class:"marker"},null,-1)]),4))}}),oe=B(le,[["__scopeId","data-v-b4ef37ac"]]),Ie=m({__name:"TestDummyMarker",setup(t){return(e,n)=>(c(),y(ne,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:o})=>[$(ae,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[$(oe,{size:24,style:M({transform:`rotate(${o}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});function R(t){return t?t.flatMap(e=>e.type===I?R(e.children):[e]):[]}const re=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var p,h;if(!n.default)return null;const o=R(n.default()),l=o.findIndex(i=>i.type!==N);if(l===-1)return o;const r=o[l];(p=r.props)==null||delete p.ref;const a=r.props?w(e,r.props):e;e.class&&((h=r.props)!=null&&h.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)}}}),se=["area","img","input"],A=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"&&se.includes(o)?()=>S(o,e):o!=="template"?()=>S(t.as,e,{default:n.default}):()=>S(re,e,{default:n.default})}}),ue=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,n)=>(c(),y(d(A),{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 ie(t,e){const n=`${t}Context`,o=Symbol(n);return[a=>{const u=z(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 O(){const t=U(),e=V(),n=v(()=>{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:j(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 de(){const t=V(),e=v(()=>{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:j(t)});return{primitiveElement:t,currentElement:e}}function ce(t){return v(()=>{var e;return H(t)?!!((e=j(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}=de(),l=v(()=>e.checked??e.value);return K(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(ue,w({ref_key:"primitiveElement",ref:n},{...e,...r.$attrs},{as:"input"}),null,16))}}),me=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=v(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),o=v(()=>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,w({key:l.name},{...e,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(c(!0),g(I,{key:1},G(o.value,a=>(c(),y(F,w({key:a.name,ref_for:!0},{...e,...l.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))}}),[pe,fe]=ie("SwitchRoot"),ve=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}=W(n),r=X(n,"modelValue",o,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function a(){l.value||(r.value=!r.value)}const{forwardRef:u,currentElement:p}=O(),h=ce(p),i=v(()=>{var s;return n.id&&p.value?(s=document.querySelector(`[for="${n.id}"]`))==null?void 0:s.innerText:void 0});return fe({modelValue:r,toggleCheck:a,disabled:l}),(s,b)=>(c(),y(d(A),w(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:J(Q(a,["prevent"]),["enter"])}),{default:_(()=>[k(s.$slots,"default",{modelValue:d(r)}),d(h)&&s.name?(c(),y(d(me),{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"])):Y("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),he=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=pe();return O(),(n,o)=>{var l;return c(),y(d(A),{"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"])}}}),be=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(ve),{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:_(()=>[$(d(he),{"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"]))}}),ye={flex:"~ col gap-4"},_e={flex:"~ row","items-center":"","gap-2":""},ge={flex:"1"},xe={class:"flex items-center gap-1 text-sm font-medium"},Ve={class:"text-xs text-neutral-500 dark:text-neutral-400"},Re=m({__name:"FieldCheckbox",props:q({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",ye,[f("div",_e,[f("div",ge,[f("div",xe,x(e.label),1),f("div",Ve,x(e.description),1)]),$(be,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r)},null,8,["modelValue"])])]))}}),$e=["min","max","step"],we=m({__name:"Range",props:q({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=v(()=>e.min*1e4),l=v(()=>e.max*1e4),r=v(()=>e.step*1e4),a=V(),u=v({get:()=>n.value*1e4,set:i=>{n.value=i/1e4,p()}});P(()=>{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()))}function h(i){const s=i.target;s.style.setProperty("--value",s.value)}return(i,s)=>Z((c(),g("input",{ref_key:"sliderRef",ref:a,"onUpdate:modelValue":s[0]||(s[0]=b=>u.value=b),type:"range",min:o.value,max:l.value,step:r.value,class:"slider-progress form_input-range",onInput:h},null,40,$e)),[[ee,u.value,void 0,{number:!0}]])}}),ke=B(we,[["__scopeId","data-v-d88ffd28"]]),Ce={flex:"~ col gap-4"},Ee={flex:"~ row","items-center":"","gap-2":""},Se={flex:"1"},Me={class:"flex items-center gap-1 text-sm font-medium"},Be={class:"text-xs text-neutral-500 dark:text-neutral-400"},je={"font-mono":""},qe={flex:"~ row","items-center":"","gap-2":""},Oe=m({__name:"FieldRange",props:q({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",Ce,[f("div",Ee,[f("div",Se,[f("div",Me,x(t.label),1),f("div",Be,x(t.description),1)]),f("span",je,x(((r=e.formatValue)==null?void 0:r.call(e,n.value))||n.value),1)]),f("div",qe,[$(ke,{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"])])])}}});export{Oe as _,Re as a,Ie as b}; diff --git a/assets/HeaderLink-CATmmLWn.js b/assets/HeaderLink-D3zUgdpF.js similarity index 90% rename from assets/HeaderLink-CATmmLWn.js rename to assets/HeaderLink-D3zUgdpF.js index 661ec66dcf192f49b70ab869627ac1c205c1bac8..277736a1ce890dd1e3f78408848f0a354f372fac 100644 --- a/assets/HeaderLink-CATmmLWn.js +++ b/assets/HeaderLink-D3zUgdpF.js @@ -1 +1 @@ -import{d as r,bt as c,A as l,b as e,P as _,o as s,w as d,c as t,e as a,_ as i}from"./index-Bo-ykojl.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],g=r({__name:"HeaderLink",setup(x){const n=c();return(f,o)=>(s(),l(e(_),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:d(()=>[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,__:[0]}))}}),w=i(g,[["__scopeId","data-v-496b6cde"]]);export{w as H}; +import{d as r,bt as c,A as l,b as e,P as _,o as s,w as d,c as t,e as a,_ as i}from"./index-1_q7hlhr.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],g=r({__name:"HeaderLink",setup(x){const n=c();return(f,o)=>(s(),l(e(_),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:d(()=>[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,__:[0]}))}}),w=i(g,[["__scopeId","data-v-496b6cde"]]);export{w as H}; diff --git a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-Vav3WbNP.js b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-tDvrftik.js similarity index 95% rename from assets/IconAnimation.vue_vue_type_script_setup_true_lang-Vav3WbNP.js rename to assets/IconAnimation.vue_vue_type_script_setup_true_lang-tDvrftik.js index 5cfd2c7f02a8de8295488fc9b6c10f031a10d832..db0f29c9d7c2a8283b26a43f48a1f1287ab01d79 100644 --- a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-Vav3WbNP.js +++ b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-tDvrftik.js @@ -1 +1 @@ -import{d as m,r as s,p,h,c as f,o as x,q as l,e as u,n as y}from"./index-Bo-ykojl.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",{fixed:"","inset-0":"","bg-primary-500":"","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,r as s,p,h,c as f,o as x,q as l,e as u,n as y}from"./index-1_q7hlhr.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",{fixed:"","inset-0":"","bg-primary-500":"","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-CU771Upv.js b/assets/IconStatusItem-Z8CeAcrh.js similarity index 94% rename from assets/IconStatusItem-CU771Upv.js rename to assets/IconStatusItem-Z8CeAcrh.js index 4ab3ee75d97698026614c8165b792547c887389a..d0c2ba24f4731ce7f49088a1c0c4b699fbbe9c77 100644 --- a/assets/IconStatusItem-CU771Upv.js +++ b/assets/IconStatusItem-Z8CeAcrh.js @@ -1 +1 @@ -import{d as u,N as c,c as e,o as n,i as d,e as o,w as m,j as a,t as i,n as s,_}from"./index-Bo-ykojl.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";const p={flex:"~ col",bg:"neutral-50 dark:neutral-800",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(I,w)=>{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))])])}}}),B=_(b,[["__scopeId","data-v-6e5b5c9c"]]);export{B as I}; +import{d as u,N as c,c as e,o as n,i as d,e as o,w as m,j as a,t as i,n as s,_}from"./index-1_q7hlhr.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";const p={flex:"~ col",bg:"neutral-50 dark:neutral-800",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(I,w)=>{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))])])}}}),B=_(b,[["__scopeId","data-v-6e5b5c9c"]]);export{B as I}; diff --git a/assets/Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js b/assets/Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js similarity index 91% rename from assets/Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js rename to assets/Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js index f42d2a288ff1de2cf978617af99b96548b72e416..3e83a111a3fe0ea1bed3d443d9b78a447dc67da9 100644 --- a/assets/Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js +++ b/assets/Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js @@ -1 +1 @@ -import{d as r,m as n,u,y as s,J as d,o as i,c as m}from"./index-Bo-ykojl.js";const p=["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(),m("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.type||"text",border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,p)),[[d,t.value]])}});export{y as _}; +import{d as r,m as n,u,y as s,J as d,o as i,c as m}from"./index-1_q7hlhr.js";const p=["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(),m("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.type||"text",border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,p)),[[d,t.value]])}});export{y as _}; diff --git a/assets/InputFile.vue_vue_type_script_setup_true_lang-CWw-Ysae.js b/assets/InputFile.vue_vue_type_script_setup_true_lang-DsrPsbsJ.js similarity index 96% rename from assets/InputFile.vue_vue_type_script_setup_true_lang-CWw-Ysae.js rename to assets/InputFile.vue_vue_type_script_setup_true_lang-DsrPsbsJ.js index e8823d4f63079c745cced457d01625e43255e430..ca00db2ba16e7500d1a6ae40e2759507c6298021 100644 --- a/assets/InputFile.vue_vue_type_script_setup_true_lang-CWw-Ysae.js +++ b/assets/InputFile.vue_vue_type_script_setup_true_lang-DsrPsbsJ.js @@ -1 +1 @@ -import{d as g,m as b,u as v,r as p,a as y,c as i,o as n,n as m,b as t,e as l,f as x}from"./index-Bo-ykojl.js";const k=["accept","multiple"],h={key:0,text:"center","text-sm":""},D={key:1,text:"center","text-sm":""},C=g({__name:"InputFile",props:b({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const d=v(o,"modelValue"),u=p(),a=p(!1),r=y(a,150);function f(s){const e=s.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(s,e)=>(n(),i("label",{relative:"",class:m(["min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6",[t(r)?"border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700":"border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700",t(r)?"bg-primary-50/5 dark:bg-primary-900/5":"bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40"]]),border:"dashed 2",transition:"all duration-300","cursor-pointer":"","opacity-95":"",hover:"scale-100 opacity-100 shadow-md dark:shadow-lg",onDragover:e[0]||(e[0]=c=>a.value=!0),onDragleave:e[1]||(e[1]=c=>a.value=!1)},[l("input",{type:"file",accept:o.accept,multiple:o.multiple,"cursor-pointer":"",class:"absolute inset-0 h-full w-full opacity-0",onChange:f},null,40,k),x(s.$slots,"default",{isDragging:t(r),firstFile:u.value,files:d.value},()=>[l("div",{class:m(["flex flex-col items-center",[t(r)?"text-primary-500 dark:text-primary-400":"text-neutral-400 dark:text-neutral-500"]])},[e[2]||(e[2]=l("div",{"i-solar:upload-square-line-duotone":"","mb-2":"","text-5xl":""},null,-1)),e[3]||(e[3]=l("p",{"font-medium":"",text:"center lg"}," Upload ",-1)),t(r)?(n(),i("p",h," Release to upload ")):(n(),i("p",D," Click or drag and drop a file here "))],2)])],34))}});export{C as _}; +import{d as g,m as b,u as v,r as p,a as y,c as i,o as n,n as m,b as t,e as l,f as x}from"./index-1_q7hlhr.js";const k=["accept","multiple"],h={key:0,text:"center","text-sm":""},D={key:1,text:"center","text-sm":""},C=g({__name:"InputFile",props:b({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const d=v(o,"modelValue"),u=p(),a=p(!1),r=y(a,150);function f(s){const e=s.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(s,e)=>(n(),i("label",{relative:"",class:m(["min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6",[t(r)?"border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700":"border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700",t(r)?"bg-primary-50/5 dark:bg-primary-900/5":"bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40"]]),border:"dashed 2",transition:"all duration-300","cursor-pointer":"","opacity-95":"",hover:"scale-100 opacity-100 shadow-md dark:shadow-lg",onDragover:e[0]||(e[0]=c=>a.value=!0),onDragleave:e[1]||(e[1]=c=>a.value=!1)},[l("input",{type:"file",accept:o.accept,multiple:o.multiple,"cursor-pointer":"",class:"absolute inset-0 h-full w-full opacity-0",onChange:f},null,40,k),x(s.$slots,"default",{isDragging:t(r),firstFile:u.value,files:d.value},()=>[l("div",{class:m(["flex flex-col items-center",[t(r)?"text-primary-500 dark:text-primary-400":"text-neutral-400 dark:text-neutral-500"]])},[e[2]||(e[2]=l("div",{"i-solar:upload-square-line-duotone":"","mb-2":"","text-5xl":""},null,-1)),e[3]||(e[3]=l("p",{"font-medium":"",text:"center lg"}," Upload ",-1)),t(r)?(n(),i("p",h," Release to upload ")):(n(),i("p",D," Click or drag and drop a file here "))],2)])],34))}});export{C as _}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-6CsRcxL-.js b/assets/Model.vue_vue_type_script_setup_true_lang-6CsRcxL-.js deleted file mode 100644 index c53a3d1dd2876447aa3d53482ceb647b2f34eb2e..0000000000000000000000000000000000000000 --- a/assets/Model.vue_vue_type_script_setup_true_lang-6CsRcxL-.js +++ /dev/null @@ -1,299 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-DRzxklRU.js","assets/webworkerAll-CcKPzOrL.js","assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js","assets/index-Bo-ykojl.js","assets/index-C3aYAgU8.css","assets/Stage-D_kYuMHe.css","assets/three-vrm-animation.module-CbeIjn7h.js","assets/mcp-Ce-wxTN6.js","assets/mini_xsschema-f5xAZ6yD.js"])))=>i.map(i=>d[i]); -import{e as le,T as ds,A as ui,L as ue,a as fs,I as ci,l as Be,M as di,b as Ge}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{bI as fi,d as ps,r as $,p as N,H as ms,I as gs,c as _s,o as xs,f as ys,L as bs,bJ as pi,bh as Ue,h as Le,bt as mi,bK as gi,b4 as _i,s as xi,G as yi,au as bi,bL as vi,F as wi,e as Ai,bM as Ci}from"./index-Bo-ykojl.js";import{r as Mi}from"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";const Ti=s=>Math.max(0,Math.min(1,s||0)),Ut=s=>Math.round(Ti(s)*255),Si=fi("rgb"),Pi=s=>{if(s===void 0)return;let t=Ut(s.r),e=Ut(s.g),i=Ut(s.b);return"#"+(1<<24|t<<16|e<<8|i).toString(16).slice(1)},Fi=s=>Pi(Si(s)),Mn=ps({__name:"Canvas",props:{width:null,height:null},setup(s,{expose:t}){const e=s,i=$(),r=$(),n=$();async function o(l){ue.registerTicker(fs),le.add(ds),r.value=new ui({width:e.width,height:e.height,backgroundAlpha:0,preserveDrawingBuffer:!0}),n.value=r.value.view,n.value.style.objectFit="contain",l.appendChild(r.value.view)}function a(){var l;r.value&&r.value.renderer.resize(e.width,e.height),(l=r.value)!=null&&l.view&&(r.value.view.width=e.width,r.value.view.height=e.height)}N([()=>e.width,()=>e.height],()=>a()),ms(async()=>i.value&&await o(i.value)),gs(()=>{var l;return(l=r.value)==null?void 0:l.destroy()});async function h(){return new Promise(u=>{if(!n.value||!r.value)return u(null);r.value.render(),n.value.toBlob(u)})}return t({captureFrame:h}),(l,u)=>(xs(),_s("div",{ref_key:"containerRef",ref:i,"h-full":"","w-full":""},[ys(l.$slots,"default",{app:r.value})],512))}});var T=(s=>(s.Application="application",s.WebGLPipes="webgl-pipes",s.WebGLPipesAdaptor="webgl-pipes-adaptor",s.WebGLSystem="webgl-system",s.WebGPUPipes="webgpu-pipes",s.WebGPUPipesAdaptor="webgpu-pipes-adaptor",s.WebGPUSystem="webgpu-system",s.CanvasSystem="canvas-system",s.CanvasPipesAdaptor="canvas-pipes-adaptor",s.CanvasPipes="canvas-pipes",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s.MaskEffect="mask-effect",s.BlendMode="blend-mode",s.TextureSource="texture-source",s.Environment="environment",s.ShapeBuilder="shape-builder",s.Batcher="batcher",s))(T||{});const ce=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},Mt=(s,t)=>ce(s).priority??t,et={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(ce).forEach(t=>{t.type.forEach(e=>{var i,r;return(r=(i=this._removeHandlers)[e])==null?void 0:r.call(i,t)})}),this},add(...s){return s.map(ce).forEach(t=>{t.type.forEach(e=>{var n,o;const i=this._addHandlers,r=this._queue;i[e]?(o=i[e])==null||o.call(i,t):(r[e]=r[e]||[],(n=r[e])==null||n.push(t))})}),this},handle(s,t,e){var o;const i=this._addHandlers,r=this._removeHandlers;if(i[s]||r[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=t,r[s]=e;const n=this._queue;return n[s]&&((o=n[s])==null||o.forEach(a=>t(a)),delete n[s]),this},handleByMap(s,t){return this.handle(s,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(s,t,e=-1){return this.handle(s,i=>{t.findIndex(n=>n.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((n,o)=>Mt(o.value,e)-Mt(n.value,e)))},i=>{const r=t.findIndex(n=>n.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(s,t,e=-1){return this.handle(s,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>Mt(n,e)-Mt(r,e)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})},mixin(s,...t){for(const e of t)Object.defineProperties(s.prototype,Object.getOwnPropertyDescriptors(e))}},Ei={extension:{type:T.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await bs(()=>import("./browserAll-DRzxklRU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))}},ki={extension:{type:T.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await bs(()=>import("./webworkerAll-CcKPzOrL.js"),__vite__mapDeps([1,2,3,4,5,6,7,8]))}};class F{constructor(t,e,i){this._x=e||0,this._y=i||0,this._observer=t}clone(t){return new F(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Lt={exports:{}},ze;function Ii(){return ze||(ze=1,function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(h,l,u){this.fn=h,this.context=l,this.once=u||!1}function n(h,l,u,c,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var d=new r(u,c||h,f),m=e?e+l:l;return h._events[m]?h._events[m].fn?h._events[m]=[h._events[m],d]:h._events[m].push(d):(h._events[m]=d,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,c;if(this._eventsCount===0)return l;for(c in u=this._events)t.call(u,c)&&l.push(e?c.slice(1):c);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=e?e+l:l,c=this._events[u];if(!c)return[];if(c.fn)return[c.fn];for(var f=0,d=c.length,m=new Array(d);fq[s],uY:s=>j[s],vX:s=>K[s],vY:s=>Z[s],inv:s=>s&8?s&15:-s&7,add:(s,t)=>de[s][t],sub:(s,t)=>de[s][v.inv(t)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,t)=>Math.abs(s)*2<=Math.abs(t)?t>=0?v.S:v.N:Math.abs(t)*2<=Math.abs(s)?s>0?v.E:v.W:t>0?s>0?v.SE:v.SW:s>0?v.NE:v.NW,matrixAppendRotationInv:(s,t,e=0,i=0)=>{const r=vs[v.inv(t)];r.tx=e,r.ty=i,s.append(r)}},St=[new U,new U,new U,new U];class L{constructor(t=0,e=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new L(0,0,0,0)}clone(){return new L(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=c&&t<=f&&e>=d&&e<=m&&!(t>g&&t_&&et.right?t.right:this.right)<=Bt)return!1;const Gt=this.yt.bottom?t.bottom:this.bottom)>Gt}const i=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=i||o<=n)return!1;const a=St[0].set(t.left,t.top),h=St[1].set(t.left,t.bottom),l=St[2].set(t.right,t.top),u=St[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(c===0||(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(u,u),Math.max(a.x,h.x,l.x,u.x)<=i||Math.min(a.x,h.x,l.x,u.x)>=r||Math.max(a.y,h.y,l.y,u.y)<=n||Math.min(a.y,h.y,l.y,u.y)>=o))return!1;const f=c*(h.y-a.y),d=c*(a.x-h.x),m=f*i+d*n,g=f*r+d*n,p=f*i+d*o,_=f*r+d*o;if(Math.max(m,g,p,_)<=f*a.x+d*a.y||Math.min(m,g,p,_)>=f*u.x+d*u.y)return!1;const b=c*(a.y-l.y),x=c*(l.x-a.x),W=b*i+x*n,B=b*r+x*n,ut=b*i+x*o,At=b*r+x*o;return!(Math.max(W,B,ut,At)<=b*a.x+x*a.y||Math.min(W,B,ut,At)>=b*u.x+x*u.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this}getBounds(t){return t||(t=new L),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,i=t.y,r=t.x+t.width,n=t.y+t.height;return e>=this.x&&e=this.y&&i=this.x&&r=this.y&&n"u"?console.warn("PixiJS Deprecation Warning: ",`${t} -Deprecated since v${s}`):(i=i.split(` -`).splice(e).join(` -`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} -Deprecated since v${s}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} -Deprecated since v${s}`),console.warn(i))),Ye[t]=!0}const ws=()=>{};function De(s){return s+=s===0?1:0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function Xe(s){return!(s&s-1)&&!!s}function Yi(s){const t={};for(const e in s)s[e]!==void 0&&(t[e]=s[e]);return t}const Ne=Object.create(null);function Di(s){const t=Ne[s];return t===void 0&&(Ne[s]=O("resource")),t}const As=class Cs extends vt{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...Cs.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){z(ht,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Di(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};As.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Xi=As;const Ms=class Ts extends vt{constructor(t={}){super(),this.options=t,this.uid=O("textureSource"),this._resourceType="textureSource",this._resourceId=O("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Ts.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new Xi(Yi(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var e,i;this.style!==t&&((e=this._style)==null||e.off("change",this._onStyleChange,this),this._style=t,(i=this._style)==null||i.on("change",this._onStyleChange,this),this._onStyleChange())}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=O("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,i){i||(i=this._resolution),t||(t=this.width),e||(e=this.height);const r=Math.round(t*i),n=Math.round(e*i);return this.width=r/i,this.height=n/i,this._resolution=i,this.pixelWidth===r&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=n,this.emit("resize",this),this._resourceId=O("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Xe(this.pixelWidth)&&Xe(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Ms.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let Y=Ms;class Me extends Y{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let i=t.format;i||(e instanceof Float32Array?i="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?i="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?i="rgba16uint":(e instanceof Int8Array,i="bgra8unorm")),super({...t,resource:e,format:i}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}Me.extension=T.TextureSource;const $e=new w;class Ni{constructor(t,e){this.mapCoord=new w,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){var e;this.texture!==t&&((e=this._texture)==null||e.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){e===void 0&&(e=t);const i=this.mapCoord;for(let r=0;rthis.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new L);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ve,this}set(t,e,i,r){this.minX=t,this.minY=e,this.maxX=i,this.maxY=r}addFrame(t,e,i,r,n){n||(n=this.matrix);const o=n.a,a=n.b,h=n.c,l=n.d,u=n.tx,c=n.ty;let f=this.minX,d=this.minY,m=this.maxX,g=this.maxY,p=o*t+h*e+u,_=a*t+l*e+c;pm&&(m=p),_>g&&(g=_),p=o*i+h*e+u,_=a*i+l*e+c,pm&&(m=p),_>g&&(g=_),p=o*t+h*r+u,_=a*t+l*r+c,pm&&(m=p),_>g&&(g=_),p=o*i+h*r+u,_=a*i+l*r+c,pm&&(m=p),_>g&&(g=_),this.minX=f,this.minY=d,this.maxX=m,this.maxY=g}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxXthis.maxX?f:this.maxX,this.maxY=d>this.maxY?d:this.maxY,f=o*e+h*n+u,d=a*e+l*n+c,this.minX=fthis.maxX?f:this.maxX,this.maxY=d>this.maxY?d:this.maxY,f=o*r+h*n+u,d=a*r+l*n+c,this.minX=fthis.maxX?f:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minXt.right&&(this.maxX=t.right),this.minYt.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,i,r){return this.minXe&&(this.maxX=e),this.minYr&&(this.maxY=r),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new H(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,i,r){let n=this.minX,o=this.minY,a=this.maxX,h=this.maxY;r||(r=this.matrix);const l=r.a,u=r.b,c=r.c,f=r.d,d=r.tx,m=r.ty;for(let g=e;ga?b:a,h=x>h?x:h}this.minX=n,this.minY=o,this.maxX=a,this.maxY=h}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var Vi={grad:.9,turn:360,rad:360/(2*Math.PI)},X=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},C=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*s)/e+0},k=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),s>e?e:s>t?s:t},Ss=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},He=function(s){return{r:k(s.r,0,255),g:k(s.g,0,255),b:k(s.b,0,255),a:k(s.a)}},Dt=function(s){return{r:C(s.r),g:C(s.g),b:C(s.b),a:C(s.a,3)}},Hi=/^#([0-9a-f]{3,8})$/i,Pt=function(s){var t=s.toString(16);return t.length<2?"0"+t:t},Ps=function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=Math.max(t,e,i),o=n-Math.min(t,e,i),a=o?n===t?(e-i)/o:n===e?2+(i-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:r}},Fs=function(s){var t=s.h,e=s.s,i=s.v,r=s.a;t=t/360*6,e/=100,i/=100;var n=Math.floor(t),o=i*(1-e),a=i*(1-(t-n)*e),h=i*(1-(1-t+n)*e),l=n%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:r}},We=function(s){return{h:Ss(s.h),s:k(s.s,0,100),l:k(s.l,0,100),a:k(s.a)}},qe=function(s){return{h:C(s.h),s:C(s.s),l:C(s.l),a:C(s.a,3)}},je=function(s){return Fs((e=(t=s).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},gt=function(s){return{h:(t=Ps(s)).h,s:(r=(200-(e=t.s))*(i=t.v)/100)>0&&r<200?e*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,i,r},Wi=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qi=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ji=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ki=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fe={string:[[function(s){var t=Hi.exec(s);return t?(s=t[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?C(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?C(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var t=ji.exec(s)||Ki.exec(s);return t?t[2]!==t[4]||t[4]!==t[6]?null:He({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(s){var t=Wi.exec(s)||qi.exec(s);if(!t)return null;var e,i,r=We({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*(Vi[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return je(r)},"hsl"]],object:[[function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=r===void 0?1:r;return X(t)&&X(e)&&X(i)?He({r:Number(t),g:Number(e),b:Number(i),a:Number(n)}):null},"rgb"],[function(s){var t=s.h,e=s.s,i=s.l,r=s.a,n=r===void 0?1:r;if(!X(t)||!X(e)||!X(i))return null;var o=We({h:Number(t),s:Number(e),l:Number(i),a:Number(n)});return je(o)},"hsl"],[function(s){var t=s.h,e=s.s,i=s.v,r=s.a,n=r===void 0?1:r;if(!X(t)||!X(e)||!X(i))return null;var o=function(a){return{h:Ss(a.h),s:k(a.s,0,100),v:k(a.v,0,100),a:k(a.a)}}({h:Number(t),s:Number(e),v:Number(i),a:Number(n)});return Fs(o)},"hsv"]]},Ke=function(s,t){for(var e=0;e=.5},s.prototype.toHex=function(){return t=Dt(this.rgba),e=t.r,i=t.g,r=t.b,o=(n=t.a)<1?Pt(C(255*n)):"","#"+Pt(e)+Pt(i)+Pt(r)+o;var t,e,i,r,n,o},s.prototype.toRgb=function(){return Dt(this.rgba)},s.prototype.toRgbString=function(){return t=Dt(this.rgba),e=t.r,i=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+i+", "+r+", "+n+")":"rgb("+e+", "+i+", "+r+")";var t,e,i,r,n},s.prototype.toHsl=function(){return qe(gt(this.rgba))},s.prototype.toHslString=function(){return t=qe(gt(this.rgba)),e=t.h,i=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+i+"%, "+r+"%, "+n+")":"hsl("+e+", "+i+"%, "+r+"%)";var t,e,i,r,n},s.prototype.toHsv=function(){return t=Ps(this.rgba),{h:C(t.h),s:C(t.s),v:C(t.v),a:C(t.a,3)};var t},s.prototype.invert=function(){return G({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},s.prototype.saturate=function(t){return t===void 0&&(t=.1),G(Xt(this.rgba,t))},s.prototype.desaturate=function(t){return t===void 0&&(t=.1),G(Xt(this.rgba,-t))},s.prototype.grayscale=function(){return G(Xt(this.rgba,-1))},s.prototype.lighten=function(t){return t===void 0&&(t=.1),G(Ze(this.rgba,t))},s.prototype.darken=function(t){return t===void 0&&(t=.1),G(Ze(this.rgba,-t))},s.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},s.prototype.alpha=function(t){return typeof t=="number"?G({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):C(this.rgba.a,3);var e},s.prototype.hue=function(t){var e=gt(this.rgba);return typeof t=="number"?G({h:t,s:e.s,l:e.l,a:e.a}):C(e.h)},s.prototype.isEqual=function(t){return this.toHex()===G(t).toHex()},s}(),G=function(s){return s instanceof pe?s:new pe(s)},Je=[],Ji=function(s){s.forEach(function(t){Je.indexOf(t)<0&&(t(pe,fe),Je.push(t))})};function Qi(s,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var r in e)i[e[r]]=r;var n={};s.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,l=i[this.toHex()];if(l)return l;if(o!=null&&o.closest){var u=this.toRgb(),c=1/0,f="black";if(!n.length)for(var d in e)n[d]=new s(e[d]).toRgb();for(var m in e){var g=(a=u,h=n[m],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));gn===e[o]);if(t!==null&&e!==null){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,i,r]=this._components;return{r:t,g:e,b:i,a:r}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,i,r,n]=this._components;return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,i,r]=this._components;return t[0]=e,t[1]=i,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,e,i]=this.toUint8RgbArray();return(i<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,i,r,n]=ft._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,this._components[2]*=r,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(i=i*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(i<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(t){let e,i,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,i=(o>>8&255)/255,r=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,i,r,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,i,r,n=255]=t,e/=255,i/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=ft.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=G(t);o.isValid()&&({r:e,g:i,b:r,a:n}=o.rgba,e/=255,i/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,this._components[2]=r,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,e,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),i)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof ft||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};lt.shared=new lt;lt._temp=new lt;lt.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Es=lt;const tr={cullArea:null,cullable:!1,cullableChildren:!0};class Te{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e0?e=this._pool[--this._index]:e=new this._classType,(i=e.init)==null||i.call(e,t),e}return(t){var e;(e=t.reset)==null||e.call(t),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0}}class er{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Te(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(e=>{const i=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[i]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}}const It=new er,sr={get isCachedAsTexture(){var s;return!!((s=this.renderGroup)!=null&&s.isCachedAsTexture)},cacheAsTexture(s){typeof s=="boolean"&&s===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(s===!0?{}:s))},updateCacheTexture(){var s;(s=this.renderGroup)==null||s.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(s){z("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(s)}};function ir(s,t,e){const i=s.length;let r;if(t>=i||e===0)return;e=t+e>i?i-t:e;const n=i-e;for(r=t;r0&&i<=e){for(let a=e-1;a>=s;a--){const h=this.children[a];h&&(r.push(h),h.parent=null)}ir(this.children,s,e);const o=this.renderGroup||this.parentRenderGroup;o&&o.removeChildren(r);for(let a=0;a0&&this._didViewChangeTick++,r}else if(i===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(s){const t=this.getChildAt(s);return this.removeChild(t)},getChildAt(s){if(s<0||s>=this.children.length)throw new Error(`getChildAt: Index (${s}) does not exist.`);return this.children[s]},setChildIndex(s,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(s),this.addChildAt(s,t)},getChildIndex(s){const t=this.children.indexOf(s);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(s,t){this.allowChildren||z(ht,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:e}=this;if(t<0||t>e.length)throw new Error(`${s}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(s.parent){const r=s.parent.children.indexOf(s);if(s.parent===this&&r===t)return s;r!==-1&&s.parent.children.splice(r,1)}t===e.length?e.push(s):e.splice(t,0,s),s.parent=this,s.didChange=!0,s._updateFlags=15;const i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(s),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",s,this,t),s.emit("added",this),s},swapChildren(s,t){if(s===t)return;const e=this.getChildIndex(s),i=this.getChildIndex(t);this.children[e]=t,this.children[i]=s;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var s;(s=this.parent)==null||s.removeChild(this)},reparentChild(...s){return s.length===1?this.reparentChildAt(s[0],this.children.length):(s.forEach(t=>this.reparentChildAt(t,this.children.length)),s[0])},reparentChildAt(s,t){if(s.parent===this)return this.setChildIndex(s,t),s;const e=s.worldTransform.clone();s.removeFromParent(),this.addChildAt(s,t);const i=this.worldTransform.clone();return i.invert(),e.prepend(i),s.setFromMatrix(e),s}},nr={collectRenderables(s,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(s,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,s):this.collectRenderablesWithEffects(s,t,e))},collectRenderablesSimple(s,t,e){const i=this.children,r=i.length;for(let n=0;n=0;r--){const n=this.effects[r];i[n.pipe].pop(n,this,s)}}};class Qe{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;ee.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(s){const t=this.effects.indexOf(s);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(s){const t=this._maskEffect;(t==null?void 0:t.mask)!==s&&(t&&(this.removeEffect(t),me.returnMaskEffect(t),this._maskEffect=null),s!=null&&(this._maskEffect=me.getMaskEffect(s),this.addEffect(this._maskEffect)))},setMask(s){this._maskOptions={...this._maskOptions,...s},s.mask&&(this.mask=s.mask),this._markStructureAsChanged()},get mask(){var s;return(s=this._maskEffect)==null?void 0:s.mask},set filters(s){var n;!Array.isArray(s)&&s&&(s=[s]);const t=this._filterEffect||(this._filterEffect=new Qe);s=s;const e=(s==null?void 0:s.length)>0,i=((n=t.filters)==null?void 0:n.length)>0,r=e!==i;s=Array.isArray(s)?s.slice(0):s,t.filters=Object.freeze(s),r&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=s??null))},get filters(){var s;return(s=this._filterEffect)==null?void 0:s.filters},set filterArea(s){this._filterEffect||(this._filterEffect=new Qe),this._filterEffect.filterArea=s},get filterArea(){var s;return(s=this._filterEffect)==null?void 0:s.filterArea}},hr={label:null,get name(){return z(ht,"Container.name property has been removed, use Container.label instead"),this.label},set name(s){z(ht,"Container.name property has been removed, use Container.label instead"),this.label=s},getChildByName(s,t=!1){return this.getChildByLabel(s,t)},getChildByLabel(s,t=!1){const e=this.children;for(let i=0;i>16&255,i=s>>8&255,r=s&255,n=t>>16&255,o=t>>8&255,a=t&255,h=e*n/255|0,l=i*o/255|0,u=r*a/255|0;return(h<<16)+(l<<8)+u}const ts=16777215;function es(s,t){return s===ts?t:t===ts?s:cr(s,t)}function kt(s){return((s&255)<<16)+(s&65280)+(s>>16&255)}const dr={getGlobalAlpha(s){if(s)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(s,t){if(t)return s.copyFrom(this.worldTransform);this.updateLocalTransform();const e=Se(this,M.get().identity());return s.appendFrom(this.localTransform,e),M.return(e),s},getGlobalTint(s){if(s)return this.renderGroup?kt(this.renderGroup.worldColor):this.parentRenderGroup?kt(es(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=es(t,e.localColor),e=e.parent;return kt(t)}};let $t=0;const ss=500;function Q(...s){$t!==ss&&($t++,$t===ss?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...s))}function Rs(s,t,e){return t.clear(),e||(e=w.IDENTITY),Os(s,t,e,s,!0),t.isValid||t.set(0,0,0,0),t}function Os(s,t,e,i,r){var h,l;let n;if(r)n=M.get(),n=e.copyTo(n);else{if(!s.visible||!s.measurable)return;s.updateLocalTransform();const u=s.localTransform;n=M.get(),n.appendFrom(u,e)}const o=t,a=!!s.effects.length;if(a&&(t=V.get().clear()),s.boundsArea)t.addRect(s.boundsArea,n);else{s.renderPipeId&&(t.matrix=n,t.addBounds(s.bounds));const u=s.children;for(let c=0;c-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const e=t.children;for(let i=0;i0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;ethis.addChild(r)),(i=t.parent)==null||i.addChild(this)}static mixin(t){z("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),et.mixin(wt,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||z(ht,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let r=0;r1){for(let r=0;r-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,i),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),this.renderGroup=It.get(wr,this),this.groupTransform=w.IDENTITY,t==null||t.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),It.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t==null||t.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new w),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*Bi}set angle(t){this.rotation=t*Gi}get pivot(){return this._pivot===Ht&&(this._pivot=new F(this,0,0)),this._pivot}set pivot(t){this._pivot===Ht&&(this._pivot=new F(this,0,0)),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Vt&&(this._skew=new F(this,0,0)),this._skew}set skew(t){this._skew===Vt&&(this._skew=new F(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===Wt&&(this._scale=new F(this,1,1)),this._scale}set scale(t){this._scale===Wt&&(this._scale=new F(this,0,0)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const i=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,i.width),e!==void 0&&this._setHeight(e,i.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,i=this._scale,r=this._pivot,n=this._position,o=i._x,a=i._y,h=r._x,l=r._y;e.a=this._cx*o,e.b=this._sx*o,e.c=this._cy*a,e.d=this._sy*a,e.tx=n._x-(h*e.a+l*e.c),e.ty=n._y-(h*e.b+l*e.d)}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=is,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const i=Es.shared.setValue(t??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=is,this._onUpdate())}get tint(){return kt(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Cr,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=qt,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=qt,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=qt,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){var r;if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t==null?void 0:t.children)&&e)for(let n=0;n=e.minX&&i<=e.maxX&&r>=e.minY&&r<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}destroy(t){super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,i){const{renderPipes:r,renderableGC:n}=e;r.blendMode.setBlendMode(this,this.groupBlendMode,t),r[this.renderPipeId].addRenderable(this,t),n.addRenderable(this),this.didViewUpdate=!1;const a=this.children,h=a.length;for(let l=0;l{this.onViewUpdate()}}),i?this.anchor=i:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=r??!1,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof A?new xt(t):new xt(A.from(t,e))}set texture(t){t||(t=A.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return $i(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return z("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,i=this._bounds,{width:r,height:n}=e.orig;i.minX=-t._x*r,i.maxX=i.minX+r,i.minY=-t._y*n,i.maxY=i.minY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const i=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(i)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}}const Tr=new H;function Gs(s,t,e){const i=Tr;s.measurable=!0,ks(s,e,i),t.addBoundsMask(i),s.measurable=!1}function Us(s,t,e){const i=V.get();s.measurable=!0;const r=M.get().identity(),n=Ls(s,e,r);Rs(s,i,n),s.measurable=!1,t.addBoundsMask(i),M.return(r),V.return(i)}function Ls(s,t,e){return s?(s!==t&&(Ls(s.parent,t,e),s.updateLocalTransform(),e.append(s.localTransform)),e):(Q("Mask bounds, renderable is not inside the root container"),e)}class zs{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof xt),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(t,e){this.inverse||Gs(this.mask,t,e)}addLocalBounds(t,e){Us(this.mask,t,e)}containsPoint(t,e){const i=this.mask;return e(i,t)}destroy(){this.reset()}static test(t){return t instanceof xt}}zs.extension=T.MaskEffect;class Ys{constructor(t){this.priority=0,this.pipe="colorMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}Ys.extension=T.MaskEffect;class Ds{constructor(t){this.priority=0,this.pipe="stencilMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(t,e){Gs(this.mask,t,e)}addLocalBounds(t,e){Us(this.mask,t,e)}containsPoint(t,e){const i=this.mask;return e(i,t)}destroy(){this.reset()}static test(t){return t instanceof wt}}Ds.extension=T.MaskEffect;const Sr={createCanvas:(s,t)=>{const e=document.createElement("canvas");return e.width=s,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,t)=>fetch(s,t),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")};let rs=Sr;const Rt={get(){return rs},set(s){rs=s}};class Xs extends Y{constructor(t){t.resource||(t.resource=Rt.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,i=this._resolution){const r=super.resize(t,e,i);return r&&this.resizeCanvas(),r}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}Xs.extension=T.TextureSource;class Ns extends Y{constructor(t){if(t.resource&&globalThis.HTMLImageElement&&t.resource instanceof HTMLImageElement){const e=Rt.get().createCanvas(t.resource.width,t.resource.height);e.getContext("2d").drawImage(t.resource,0,0,t.resource.width,t.resource.height),t.resource=e,Q("ImageSource: Image element passed, converting to canvas. Use CanvasSource instead.")}super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}Ns.extension=T.TextureSource;var ge=(s=>(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(ge||{});class jt{constructor(t,e=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=i,this._once=r}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const $s=class P{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new jt(null,null,1/0),this.deltaMS=1/P.targetFPMS,this.elapsedMS=1/P.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,i=ge.NORMAL){return this._addListener(new jt(t,e,i))}addOnce(t,e,i=ge.NORMAL){return this._addListener(new jt(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n{var o;const t=document.createElement("canvas").getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(a=>{const h=document.createElement("video");h.onloadeddata=()=>a(h),h.onerror=()=>a(null),h.autoplay=!1,h.crossOrigin="anonymous",h.preload="auto",h.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",h.load()});if(!e)return"premultiply-alpha-on-upload";const i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(r),t.deleteTexture(i),(o=t.getExtension("WEBGL_lose_context"))==null||o.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Kt}const Ot=class Vs extends Y{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Vs.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=Ft.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await Pr(),this._load=new Promise((i,r)=>{this.isValid?i(this):(this._resolve=i,this._reject=r,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ft.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Ft.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ft.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};Ot.extension=T.TextureSource;Ot.defaultOptions={...Y.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Ot.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Fr=Ot;const nt=(s,t,e=!1)=>(Array.isArray(s)||(s=[s]),t?s.map(i=>typeof i=="string"||e?t(i):i):s);class Er{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||Q(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const i=nt(t);let r;for(let h=0;h{n.set(h,e)});const o=[...n.keys()],a={cacheKeys:o,keys:i};i.forEach(h=>{this._cacheMap.set(h,a)}),o.forEach(h=>{const l=r?r[h]:e;this._cache.has(h)&&this._cache.get(h)!==l&&Q("[Cache] already has key:",h),this._cache.set(h,n.get(h))})}remove(t){if(!this._cacheMap.has(t)){Q(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(r=>{this._cache.delete(r)}),e.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const ot=new Er,_e=[];et.handleByList(T.TextureSource,_e);function Hs(s={}){const t=s&&s.resource,e=t?s.resource:s,i=t?s:{resource:s};for(let r=0;r<_e.length;r++){const n=_e[r];if(n.test(e))return new n(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function kr(s={},t=!1){const e=s&&s.resource,i=e?s.resource:s,r=e?s:{resource:s};if(!t&&ot.has(i))return ot.get(i);const n=new A({source:Hs(r)});return n.on("destroy",()=>{ot.has(i)&&ot.remove(i)}),t||ot.set(i,n),n}function Ir(s,t=!1){return typeof s=="string"?ot.get(s):s instanceof Y?new A({source:s}):kr(s,t)}A.from=Ir;Y.from=Hs;et.add(zs,Ys,Ds,Fr,Ns,Xs,Me);var Ws=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(Ws||{});function R(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function dt(s){return s.split("?")[0].split("#")[0]}function Rr(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Or(s,t,e){return s.replace(new RegExp(Rr(t),"g"),e)}function Br(s,t){let e="",i=0,r=-1,n=0,o=-1;for(let a=0;a<=s.length;++a){if(a2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),r=a,n=0;continue}}else if(e.length===2||e.length===1){e="",i=0,r=a,n=0;continue}}}else e.length>0?e+=`/${s.slice(r+1,a)}`:e=s.slice(r+1,a),i=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}const yt={toPosix(s){return Or(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){R(s),s=this.toPosix(s);const t=/^file:\/\/\//.exec(s);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(s);return e?e[0]:""},toAbsolute(s,t,e){if(R(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=dt(this.toPosix(t??Rt.get().getBaseUrl())),r=dt(this.toPosix(e??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?yt.join(r,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(R(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let t="";const e=s.startsWith("/");this.hasProtocol(s)&&(t=this.rootname(s),s=s.slice(t.length));const i=s.endsWith("/");return s=Br(s),s.length>0&&i&&(s+="/"),e?`/${s}`:t+s},isAbsolute(s){return R(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=i;else{const r=s[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(s){if(R(s),s.length===0)return".";s=this.toPosix(s);let t=s.charCodeAt(0);const e=t===47;let i=-1,r=!0;const n=this.getProtocol(s),o=s;s=s.slice(n.length);for(let a=s.length-1;a>=1;--a)if(t=s.charCodeAt(a),t===47){if(!r){i=a;break}}else r=!1;return i===-1?e?"/":this.isUrl(o)?n+s:n:e&&i===1?"//":n+s.slice(0,i)},rootname(s){R(s),s=this.toPosix(s);let t="";if(s.startsWith("/")?t="/":t=this.getProtocol(s),this.isUrl(s)){const e=s.indexOf("/",t.length);e!==-1?t=s.slice(0,e):t=s,t.endsWith("/")||(t+="/")}return t},basename(s,t){R(s),t&&R(t),s=dt(this.toPosix(s));let e=0,i=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=s.length){if(t.length===s.length&&t===s)return"";let o=t.length-1,a=-1;for(n=s.length-1;n>=0;--n){const h=s.charCodeAt(n);if(h===47){if(!r){e=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(i=n):(o=-1,i=a))}return e===i?i=a:i===-1&&(i=s.length),s.slice(e,i)}for(n=s.length-1;n>=0;--n)if(s.charCodeAt(n)===47){if(!r){e=n+1;break}}else i===-1&&(r=!1,i=n+1);return i===-1?"":s.slice(e,i)},extname(s){R(s),s=dt(this.toPosix(s));let t=-1,e=0,i=-1,r=!0,n=0;for(let o=s.length-1;o>=0;--o){const a=s.charCodeAt(o);if(a===47){if(!r){e=o+1;break}continue}i===-1&&(r=!1,i=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||i===-1||n===0||n===1&&t===i-1&&t===e+1?"":s.slice(t,i)},parse(s){R(s);const t={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return t;s=dt(this.toPosix(s));let e=s.charCodeAt(0);const i=this.isAbsolute(s);let r;t.root=this.rootname(s),i||this.hasProtocol(s)?r=1:r=0;let n=-1,o=0,a=-1,h=!0,l=s.length-1,u=0;for(;l>=r;--l){if(e=s.charCodeAt(l),e===47){if(!h){o=l+1;break}continue}a===-1&&(h=!1,a=l+1),e===46?n===-1?n=l:u!==1&&(u=1):n!==-1&&(u=-1)}return n===-1||a===-1||u===0||u===1&&n===a-1&&n===o+1?a!==-1&&(o===0&&i?t.base=t.name=s.slice(1,a):t.base=t.name=s.slice(o,a)):(o===0&&i?(t.name=s.slice(1,n),t.base=s.slice(1,a)):(t.name=s.slice(o,n),t.base=s.slice(o,a)),t.ext=s.slice(n,a)),t.dir=this.dirname(s),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function qs(s,t,e,i,r){const n=t[e];for(let o=0;o{const o=n.substring(1,n.length-1).split(",");r.push(o)}),qs(s,r,0,e,i)}else i.push(s);return i}const ns=s=>!Array.isArray(s);class js{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`).join("&")}}getAlias(t){const{alias:e,src:i}=t;return nt(e||i,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>(o==null?void 0:o.src)??o):n!=null&&n.src?n.src:n,!0)}addManifest(t){this._manifest&&Q("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const i=[];let r=e;Array.isArray(e)||(r=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),r.forEach(n=>{const o=n.src,a=n.alias;let h;if(typeof a=="string"){const l=this._createBundleAssetId(t,a);i.push(l),h=[a,l]}else{const l=a.map(u=>this._createBundleAssetId(t,u));i.push(...l),h=[...a,...l]}this.add({...n,alias:h,src:o})}),this._bundles[t]=i}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let i;i=n=>{this.hasKey(n)&&Q(`[Resolver] already has key: ${n} overwriting`)},nt(e).forEach(n=>{const{src:o}=n;let{data:a,format:h,loadParser:l}=n;const u=nt(o).map(d=>typeof d=="string"?Gr(d):Array.isArray(d)?d:[d]),c=this.getAlias(n);Array.isArray(c)?c.forEach(i):i(c);const f=[];u.forEach(d=>{d.forEach(m=>{let g={};if(typeof m!="object"){g.src=m;for(let p=0;p{this._assetMap[d]=f})})}resolveBundle(t){const e=ns(t);t=nt(t);const i={};return t.forEach(r=>{const n=this._bundles[r];if(n){const o=this.resolve(n),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(r,h)]=l}i[r]=a}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const r in e)i[r]=e[r].src;return i}return e.src}resolve(t){const e=ns(t);t=nt(t);const i={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let n=this._assetMap[r];const o=this._getPreferredOrder(n);o==null||o.priority.forEach(a=>{o.params[a].forEach(h=>{const l=n.filter(u=>u[a]?u[a]===h:!1);l.length&&(n=l)})}),this._resolverHash[r]=n[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;en.params.format.includes(i.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:i,data:r,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=yt.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??Ur(t.src),t}}js.RETINA_PREFIX=/@([0-9\.]+)x/;function Ur(s){return s.split(".").pop().split("?").shift().split("#").shift()}const os=(s,t)=>{const e=t.split("?")[1];return e&&(s+=`?${e}`),s},Ks=class pt{constructor(t,e){this.linkedSheets=[],this._texture=t instanceof A?t:null,this.textureSource=t.source,this.textures={},this.animations={},this.data=e;const i=parseFloat(e.meta.scale);i?(this.resolution=i,t.source.resolution=this.resolution):this.resolution=t.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=pt.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const i=pt.BATCH_SIZE;for(;e-t{this._batchIndex*pt.BATCH_SIZE{i[r]=t}),Object.keys(t.textures).forEach(r=>{i[r]=t.textures[r]}),!e){const r=yt.dirname(s[0]);t.linkedSheets.forEach((n,o)=>{const a=Zs([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(i,a)})}return i}const zr={extension:T.Asset,cache:{test:s=>s instanceof as,getCacheableAssets:(s,t)=>Zs(s,t,!1)},resolver:{extension:{type:T.ResolveParser,name:"resolveSpritesheet"},test:s=>{const e=s.split("?")[0].split("."),i=e.pop(),r=e.pop();return i==="json"&&Lr.includes(r)},parse:s=>{var e;const t=s.split(".");return{resolution:parseFloat(((e=js.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:t[t.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:T.LoadParser,priority:Ws.Normal,name:"spritesheetLoader"},async testParse(s,t){return yt.extname(t.src).toLowerCase()===".json"&&!!s.frames},async parse(s,t,e){var u,c;const{texture:i,imageFilename:r,textureOptions:n}=(t==null?void 0:t.data)??{};let o=yt.dirname(t.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(i instanceof A)a=i;else{const f=os(o+(r??s.meta.image),t.src);a=(await e.load([{src:f,data:n}]))[f]}const h=new as(a.source,s);await h.parse();const l=(u=s==null?void 0:s.meta)==null?void 0:u.related_multi_packs;if(Array.isArray(l)){const f=[];for(const m of l){if(typeof m!="string")continue;let g=o+m;(c=t.data)!=null&&c.ignoreMultiPack||(g=os(g,t.src),f.push(e.load({src:g,data:{textureOptions:n,ignoreMultiPack:!0}})))}const d=await Promise.all(f);h.linkedSheets=d,d.forEach(m=>{m.linkedSheets=[h].concat(h.linkedSheets.filter(g=>g!==m))})}return h},async unload(s,t,e){await e.unload(s.textureSource._sourceOrigin),s.destroy(!1)}}};et.add(zr);const Zt=Object.create(null),hs=Object.create(null);function Pe(s,t){let e=hs[s];return e===void 0&&(Zt[t]===void 0&&(Zt[t]=1),hs[s]=e=Zt[t]++),e}let rt;function Yr(){return(!rt||rt!=null&&rt.isContextLost())&&(rt=Rt.get().createCanvas().getContext("webgl",{})),rt}let Et;function Dr(){if(!Et){Et="mediump";const s=Yr();s&&s.getShaderPrecisionFormat&&(Et=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision?"highp":"mediump")}return Et}function Xr(s,t,e){return t?s:e?(s=s.replace("out vec4 finalColor;",""),` - - #ifdef GL_ES // This checks if it is WebGL1 - #define in varying - #define finalColor gl_FragColor - #define texture texture2D - #endif - ${s} - `):` - - #ifdef GL_ES // This checks if it is WebGL1 - #define in attribute - #define out varying - #endif - ${s} - `}function Nr(s,t,e){const i=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(s.substring(0,9)!=="precision"){let r=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return r==="highp"&&i!=="highp"&&(r="mediump"),`precision ${r} float; -${s}`}else if(i!=="highp"&&s.substring(0,15)==="precision highp")return s.replace("precision highp","precision mediump");return s}function $r(s,t){return t?`#version 300 es -${s}`:s}const Vr={},Hr={};function Wr(s,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const i=e?Vr:Hr;return i[t]?(i[t]++,t+=`-${i[t]}`):i[t]=1,s.indexOf("#define SHADER_NAME")!==-1?s:`${`#define SHADER_NAME ${t}`} -${s}`}function qr(s,t){return t?s.replace("#version 300 es",""):s}const Jt={stripVersion:qr,ensurePrecision:Nr,addProgramDefines:Xr,setProgramName:Wr,insertVersion:$r},Qt=Object.create(null),Js=class xe{constructor(t){t={...xe.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Dr()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let r=t.fragment,n=t.vertex;Object.keys(Jt).forEach(o=>{const a=i[o];r=Jt[o](r,a,!0),n=Jt[o](n,a,!1)}),this.fragment=r,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Pe(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return Qt[e]||(Qt[e]=new xe(t)),Qt[e]}};Js.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let bt=Js;const ls={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function jr(s){return ls[s]??ls.float32}const Kr={f32:"float32","vec2":"float32x2","vec3":"float32x3","vec4":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2":"sint32x2","vec3":"sint32x3","vec4":"sint32x4",u32:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4",bool:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4"};function Zr({source:s,entryPoint:t}){const e={},i=s.indexOf(`fn ${t}`);if(i!==-1){const r=s.indexOf("->",i);if(r!==-1){const n=s.substring(i,r),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let a;for(;(a=o.exec(n))!==null;){const h=Kr[a[3]]??"float32";e[a[2]]={location:parseInt(a[1],10),format:h,stride:jr(h).stride,offset:0,instance:!1,start:0}}}}return e}function te(s){var c,f;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,h=/struct\s+(\w+)/,l=(c=s.match(t))==null?void 0:c.map(d=>({group:parseInt(d.match(e)[1],10),binding:parseInt(d.match(i)[1],10),name:d.match(r)[2],isUniform:d.match(r)[1]==="",type:d.match(n)[1]}));if(!l)return{groups:[],structs:[]};const u=((f=s.match(o))==null?void 0:f.map(d=>{const m=d.match(h)[1],g=d.match(a).reduce((p,_)=>{const[b,x]=_.split(":");return p[b.trim()]=x.trim(),p},{});return g?{name:m,members:g}:null}).filter(({name:d})=>l.some(m=>m.type===d)))??[];return{groups:l,structs:u}}var mt=(s=>(s[s.VERTEX=1]="VERTEX",s[s.FRAGMENT=2]="FRAGMENT",s[s.COMPUTE=4]="COMPUTE",s))(mt||{});function Jr({groups:s}){const t=[];for(let e=0;ee.has(o.name)?!1:(e.add(o.name),!0)),n=[...s.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return i.has(a)?!1:(i.add(a),!0)});return{structs:r,groups:n}}const ee=Object.create(null);class tt{constructor(t){var a,h;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:i,layout:r,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=i,e.source===i.source){const l=te(e.source);this.structsAndGroups=l}else{const l=te(i.source),u=te(e.source);this.structsAndGroups=tn(l,u)}this.layout=r??Qr(this.structsAndGroups),this.gpuLayout=n??Jr(this.structsAndGroups),this.autoAssignGlobalUniforms=((a=this.layout[0])==null?void 0:a.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((h=this.layout[1])==null?void 0:h.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,i=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Pe(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=Zr(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return ee[e]||(ee[e]=new tt(t)),ee[e]}}const Qs=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4","vec2","vec3","vec4"],en=Qs.reduce((s,t)=>(s[t]=!0,s),{});function sn(s,t){switch(s){case"f32":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"mat2x2":return new Float32Array([1,0,0,1]);case"mat3x3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const ti=class ei{constructor(t,e){this._touched=0,this.uid=O("uniform"),this._resourceType="uniformGroup",this._resourceId=O("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...ei.defaultOptions,...e},this.uniformStructures=t;const i={};for(const r in t){const n=t[r];if(n.name=r,n.size=n.size??1,!en[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${Qs.join(", ")}`);n.value??(n.value=sn(n.type,n.size)),i[r]=n.value}this.uniforms=i,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Pe(Object.keys(i).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};ti.defaultOptions={ubo:!1,isStatic:!1};let rn=ti;class se{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const i in t){const r=t[i];this.setResource(r,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const i in this.resources)t[e++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,e){var r,n;const i=this.resources[e];t!==i&&(i&&((r=t.off)==null||r.call(t,"change",this.onResourceChange,this)),(n=t.on)==null||n.call(t,"change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const e=this.resources;for(const i in e)e[i]._touched=t}destroy(){var e;const t=this.resources;for(const i in t){const r=t[i];(e=r.off)==null||e.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const i in e)e[i]===t&&(e[i]=null)}else this._updateKey()}}var ye=(s=>(s[s.WEBGL=1]="WEBGL",s[s.WEBGPU=2]="WEBGPU",s[s.BOTH=3]="BOTH",s))(ye||{});class Fe extends vt{constructor(t){super(),this.uid=O("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:e,glProgram:i,groups:r,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=i,o===void 0&&(o=0,e&&(o|=ye.WEBGPU),i&&(o|=ye.WEBGL)),this.compatibleRenderers=o;const h={};if(!n&&!r&&(n={}),n&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&r&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&r&&a)for(const l in a)for(const u in a[l]){const c=a[l][u];h[c]={group:l,binding:u,name:c}}else if(e&&r&&!a){const l=e.structsAndGroups.groups;a={},l.forEach(u=>{a[u.group]=a[u.group]||{},a[u.group][u.binding]=u.name,h[u.name]=u})}else if(n){r={},a={},e&&e.structsAndGroups.groups.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,h[c.name]=c});let l=0;for(const u in n)h[u]||(r[99]||(r[99]=new se,this._ownedBindGroups.push(r[99])),h[u]={group:99,binding:l,name:u},a[99]=a[99]||{},a[99][l]=u,l++);for(const u in n){const c=u;let f=n[u];!f.source&&!f._resourceType&&(f=new rn(f));const d=h[c];d&&(r[d.group]||(r[d.group]=new se,this._ownedBindGroups.push(r[d.group])),r[d.group].setResource(f,d.binding))}}this.groups=r,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(r,h)}addResource(t,e,i){var r,n;(r=this._uniformBindMap)[e]||(r[e]={}),(n=this._uniformBindMap[e])[i]||(n[i]=t),this.groups[e]||(this.groups[e]=new se,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const i={};for(const r in e){const n=e[r];Object.defineProperty(i,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return i}destroy(t=!1){var e,i;this.emit("destroy",this),t&&((e=this.gpuProgram)==null||e.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:e,gl:i,...r}=t;let n,o;return e&&(n=tt.from(e)),i&&(o=bt.from(i)),new Fe({gpuProgram:n,glProgram:o,...r})}}const nn={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},ie=0,re=1,ne=2,oe=3,ae=4,he=5,be=class si{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<, - uInputPixel:vec4, - uInputClamp:vec4, - uOutputFrame:vec4, - uGlobalFrame:vec4, - uOutputTexture:vec4, -}; - -@group(0) @binding(0) var gfu: GlobalFilterUniforms; - -struct VSOutput { - @builtin(position) position: vec4, - @location(0) uv : vec2 - }; - -fn filterVertexPosition(aPosition:vec2) -> vec4 -{ - var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy; - - position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0; - position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z; - - return vec4(position, 0.0, 1.0); -} - -fn filterTextureCoord( aPosition:vec2 ) -> vec2 -{ - return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw); -} - -fn globalTextureCoord( aPosition:vec2 ) -> vec2 -{ - return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw); -} - -fn getSize() -> vec2 -{ - return gfu.uGlobalFrame.zw; -} - -@vertex -fn mainVertex( - @location(0) aPosition : vec2, -) -> VSOutput { - return VSOutput( - filterVertexPosition(aPosition), - filterTextureCoord(aPosition) - ); -}`,an=` -in vec2 vTextureCoord; -out vec4 finalColor; - -uniform sampler2D uTexture; -uniform vec2 uOffset; - -void main(void) -{ - vec4 color = vec4(0.0); - - // Sample top left pixel - color += texture(uTexture, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y)); - - // Sample top right pixel - color += texture(uTexture, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y)); - - // Sample bottom right pixel - color += texture(uTexture, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y)); - - // Sample bottom left pixel - color += texture(uTexture, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y)); - - // Average - color *= 0.25; - - finalColor = color; -}`,hn=`struct KawaseBlurUniforms { - uOffset:vec2, -}; - -@group(0) @binding(1) var uTexture: texture_2d; -@group(0) @binding(2) var uSampler: sampler; -@group(1) @binding(0) var kawaseBlurUniforms : KawaseBlurUniforms; - -@fragment -fn mainFragment( - @builtin(position) position: vec4, - @location(0) uv : vec2 -) -> @location(0) vec4 { - let uOffset = kawaseBlurUniforms.uOffset; - var color: vec4 = vec4(0.0); - - // Sample top left pixel - color += textureSample(uTexture, uSampler, vec2(uv.x - uOffset.x, uv.y + uOffset.y)); - // Sample top right pixel - color += textureSample(uTexture, uSampler, vec2(uv.x + uOffset.x, uv.y + uOffset.y)); - // Sample bottom right pixel - color += textureSample(uTexture, uSampler, vec2(uv.x + uOffset.x, uv.y - uOffset.y)); - // Sample bottom left pixel - color += textureSample(uTexture, uSampler, vec2(uv.x - uOffset.x, uv.y - uOffset.y)); - // Average - color *= 0.25; - - return color; -}`,ln=` -precision highp float; -in vec2 vTextureCoord; -out vec4 finalColor; - -uniform sampler2D uTexture; -uniform vec2 uOffset; - -uniform vec4 uInputClamp; - -void main(void) -{ - vec4 color = vec4(0.0); - - // Sample top left pixel - color += texture(uTexture, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), uInputClamp.xy, uInputClamp.zw)); - - // Sample top right pixel - color += texture(uTexture, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), uInputClamp.xy, uInputClamp.zw)); - - // Sample bottom right pixel - color += texture(uTexture, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), uInputClamp.xy, uInputClamp.zw)); - - // Sample bottom left pixel - color += texture(uTexture, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), uInputClamp.xy, uInputClamp.zw)); - - // Average - color *= 0.25; - - finalColor = color; -} -`,un=`struct KawaseBlurUniforms { - uOffset:vec2, -}; - -struct GlobalFilterUniforms { - uInputSize:vec4, - uInputPixel:vec4, - uInputClamp:vec4, - uOutputFrame:vec4, - uGlobalFrame:vec4, - uOutputTexture:vec4, -}; - -@group(0) @binding(0) var gfu: GlobalFilterUniforms; - -@group(0) @binding(1) var uTexture: texture_2d; -@group(0) @binding(2) var uSampler: sampler; -@group(1) @binding(0) var kawaseBlurUniforms : KawaseBlurUniforms; - -@fragment -fn mainFragment( - @builtin(position) position: vec4, - @location(0) uv : vec2 -) -> @location(0) vec4 { - let uOffset = kawaseBlurUniforms.uOffset; - var color: vec4 = vec4(0.0); - - // Sample top left pixel - color += textureSample(uTexture, uSampler, clamp(vec2(uv.x - uOffset.x, uv.y + uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); - // Sample top right pixel - color += textureSample(uTexture, uSampler, clamp(vec2(uv.x + uOffset.x, uv.y + uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); - // Sample bottom right pixel - color += textureSample(uTexture, uSampler, clamp(vec2(uv.x + uOffset.x, uv.y - uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); - // Sample bottom left pixel - color += textureSample(uTexture, uSampler, clamp(vec2(uv.x - uOffset.x, uv.y - uOffset.y), gfu.uInputClamp.xy, gfu.uInputClamp.zw)); - // Average - color *= 0.25; - - return color; -}`,cn=Object.defineProperty,dn=(s,t,e)=>t in s?cn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,J=(s,t,e)=>(dn(s,typeof t!="symbol"?t+"":t,e),e);const ri=class ni extends we{constructor(...t){let e=t[0]??{};(typeof e=="number"||Array.isArray(e))&&(z("6.0.0","KawaseBlurFilter constructor params are now options object. See params: { strength, quality, clamp, pixelSize }"),e={strength:e},t[1]!==void 0&&(e.quality=t[1]),t[2]!==void 0&&(e.clamp=t[2])),e={...ni.DEFAULT_OPTIONS,...e};const i=tt.from({vertex:{source:Ce,entryPoint:"mainVertex"},fragment:{source:e!=null&&e.clamp?un:hn,entryPoint:"mainFragment"}}),r=bt.from({vertex:Ae,fragment:e!=null&&e.clamp?ln:an,name:"kawase-blur-filter"});super({gpuProgram:i,glProgram:r,resources:{kawaseBlurUniforms:{uOffset:{value:new Float32Array(2),type:"vec2"}}}}),J(this,"uniforms"),J(this,"_pixelSize",{x:0,y:0}),J(this,"_clamp"),J(this,"_kernels",[]),J(this,"_blur"),J(this,"_quality"),this.uniforms=this.resources.kawaseBlurUniforms.uniforms,this.pixelSize=e.pixelSize??{x:1,y:1},Array.isArray(e.strength)?this.kernels=e.strength:typeof e.strength=="number"&&(this._blur=e.strength,this.quality=e.quality??3),this._clamp=!!e.clamp}apply(t,e,i,r){const n=this.pixelSizeX/e.source.width,o=this.pixelSizeY/e.source.height;let a;if(this._quality===1||this._blur===0)a=this._kernels[0]+.5,this.uniforms.uOffset[0]=a*n,this.uniforms.uOffset[1]=a*o,t.applyFilter(this,e,i,r);else{const h=_t.getSameSizeTexture(e);let l=e,u=h,c;const f=this._quality-1;for(let d=0;d0?(this._kernels=t,this._quality=t.length,this._blur=Math.max(...t)):(this._kernels=[0],this._quality=1)}get pixelSize(){return this._pixelSize}set pixelSize(t){if(typeof t=="number"){this.pixelSizeX=this.pixelSizeY=t;return}if(Array.isArray(t)){this.pixelSizeX=t[0],this.pixelSizeY=t[1];return}this._pixelSize=t}get pixelSizeX(){return this.pixelSize.x}set pixelSizeX(t){this.pixelSize.x=t}get pixelSizeY(){return this.pixelSize.y}set pixelSizeY(t){this.pixelSize.y=t}get clamp(){return this._clamp}_updatePadding(){this.padding=Math.ceil(this._kernels.reduce((t,e)=>t+e+.5,0))}_generateKernels(){const t=this._blur,e=this._quality,i=[t];if(t>0){let r=t;const n=t/e;for(let o=1;o, - uOffset: vec2, -}; - -struct GlobalFilterUniforms { - uInputSize:vec4, - uInputPixel:vec4, - uInputClamp:vec4, - uOutputFrame:vec4, - uGlobalFrame:vec4, - uOutputTexture:vec4, -}; - -@group(0) @binding(0) var gfu: GlobalFilterUniforms; - -@group(0) @binding(1) var uTexture: texture_2d; -@group(0) @binding(2) var uSampler: sampler; -@group(1) @binding(0) var dropShadowUniforms : DropShadowUniforms; - -@fragment -fn mainFragment( - @builtin(position) position: vec4, - @location(0) uv : vec2 -) -> @location(0) vec4 { - var color: vec4 = textureSample(uTexture, uSampler, uv - dropShadowUniforms.uOffset * gfu.uInputSize.zw); - - // Premultiply alpha - color = vec4(vec3(dropShadowUniforms.uColor.rgb * color.a), color.a); - // alpha user alpha - color *= dropShadowUniforms.uAlpha; - - return color; -}`,gn=Object.defineProperty,_n=(s,t,e)=>t in s?gn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,at=(s,t,e)=>(_n(s,typeof t!="symbol"?t+"":t,e),e);const oi=class ai extends we{constructor(t){t={...ai.DEFAULT_OPTIONS,...t};const e=tt.from({vertex:{source:Ce,entryPoint:"mainVertex"},fragment:{source:mn,entryPoint:"mainFragment"}}),i=bt.from({vertex:Ae,fragment:pn,name:"drop-shadow-filter"});super({gpuProgram:e,glProgram:i,resources:{dropShadowUniforms:{uAlpha:{value:t.alpha,type:"f32"},uColor:{value:new Float32Array(3),type:"vec3"},uOffset:{value:t.offset,type:"vec2"}}},resolution:t.resolution}),at(this,"uniforms"),at(this,"shadowOnly",!1),at(this,"_color"),at(this,"_blurFilter"),at(this,"_basePass"),this.uniforms=this.resources.dropShadowUniforms.uniforms,this._color=new Es,this.color=t.color??0,this._blurFilter=new fn({strength:t.kernels??t.blur,quality:t.kernels?void 0:t.quality}),this._basePass=new we({gpuProgram:tt.from({vertex:{source:Ce,entryPoint:"mainVertex"},fragment:{source:` - @group(0) @binding(1) var uTexture: texture_2d; - @group(0) @binding(2) var uSampler: sampler; - @fragment - fn mainFragment( - @builtin(position) position: vec4, - @location(0) uv : vec2 - ) -> @location(0) vec4 { - return textureSample(uTexture, uSampler, uv); - } - `,entryPoint:"mainFragment"}}),glProgram:bt.from({vertex:Ae,fragment:` - in vec2 vTextureCoord; - out vec4 finalColor; - uniform sampler2D uTexture; - - void main(void){ - finalColor = texture(uTexture, vTextureCoord); - } - `,name:"drop-shadow-filter"}),resources:{}}),Object.assign(this,t)}apply(t,e,i,r){const n=_t.getSameSizeTexture(e);t.applyFilter(this,e,n,!0),this._blurFilter.apply(t,n,i,r),this.shadowOnly||t.applyFilter(this._basePass,e,i,!1),_t.returnTexture(n)}get offset(){return this.uniforms.uOffset}set offset(t){this.uniforms.uOffset=t,this._updatePadding()}get offsetX(){return this.offset.x}set offsetX(t){this.offset.x=t,this._updatePadding()}get offsetY(){return this.offset.y}set offsetY(t){this.offset.y=t,this._updatePadding()}get color(){return this._color.value}set color(t){this._color.setValue(t);const[e,i,r]=this._color.toArray();this.uniforms.uColor[0]=e,this.uniforms.uColor[1]=i,this.uniforms.uColor[2]=r}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}get blur(){return this._blurFilter.strength}set blur(t){this._blurFilter.strength=t,this._updatePadding()}get quality(){return this._blurFilter.quality}set quality(t){this._blurFilter.quality=t,this._updatePadding()}get kernels(){return this._blurFilter.kernels}set kernels(t){this._blurFilter.kernels=t}get pixelSize(){return this._blurFilter.pixelSize}set pixelSize(t){typeof t=="number"&&(t={x:t,y:t}),Array.isArray(t)&&(t={x:t[0],y:t[1]}),this._blurFilter.pixelSize=t}get pixelSizeX(){return this._blurFilter.pixelSizeX}set pixelSizeX(t){this._blurFilter.pixelSizeX=t}get pixelSizeY(){return this._blurFilter.pixelSizeY}set pixelSizeY(t){this._blurFilter.pixelSizeY=t}_updatePadding(){const t=Math.max(Math.abs(this.offsetX),Math.abs(this.offsetY));this.padding=t+this.blur*2+this.quality*4}};at(oi,"DEFAULT_OPTIONS",{offset:{x:4,y:4},color:0,alpha:.5,shadowOnly:!1,kernels:void 0,blur:2,quality:3,pixelSize:{x:1,y:1},resolution:1});let xn=oi;function us(s,t,e){return(1-e)*s+e*t}function cs(s,t){return s+Math.random()*(t-s)}function yn(){let s=-1,t,e=-1;function i(r,n){(n>=s||nt.app),i=Ue(()=>t.paused),r=$(),n=$(0),o=$(0),a=Le(()=>Math.max(0,Math.min(100,t.mouthOpenSize))),h=mi(),l=gi(Ci),u=Le(()=>l.between("sm","md").value||l.smaller("sm").value),c=yn(),f=_i(new xn({alpha:.2,blur:0,distance:20,rotation:45}));function d(){return r.value.internalModel.coreModel}function m(y){if(!y.value)return;let S=2.2;u.value&&(S=2.2);const st=t.height*.95/o.value*S,I=t.width*.95/n.value*S,it=Math.min(st,I);y.value.scale.set(it,it)}const{live2dModelFile:g,loadingLive2dModel:p,live2dCurrentMotion:_,availableLive2dMotions:b,live2dLoadSource:x,live2dModelUrl:W,themeColorsHue:B,themeColorsHueDynamic:ut}=xi(yi()),At=$({group:"Idle",index:0});async function Bt(){var Oe;if(!e.value)return;r.value&&(e.value.stage.removeChild(r.value),r.value.destroy(),r.value=void 0);const y=new ue;x.value==="file"?await Ge.setupLive2DModel(y,[g.value]):x.value==="url"&&await Ge.setupLive2DModel(y,W.value),r.value=y,e.value.stage.addChild(r.value),n.value=r.value.width,o.value=r.value.height,r.value.x=t.width/2,r.value.y=t.height,r.value.rotation=Math.PI,r.value.skew.x=Math.PI,r.value.anchor.set(.5,.5),m(r),r.value.on("hit",D=>{r.value&&D.includes("body")&&r.value.motion("tap_body")});const S=r.value.internalModel,st=S.coreModel,I=S.motionManager;st.setParameterValueById("ParamMouthOpenY",a.value),b.value=Object.entries(I.definitions).flatMap(([D,E])=>E?E.map((hi,li)=>({motionName:D,motionIndex:li,fileName:hi.File})):[]).filter(Boolean),I.groups.idle&&((Oe=I.motionGroups[I.groups.idle])==null||Oe.forEach(D=>{D._motionData.curves.forEach(E=>{(E.id==="ParamEyeBallX"||E.id==="ParamEyeBallY")&&(E.id=`_${E.id}`)})}));const it=I.update;I.update=function(D,E){return it==null||it.call(this,D,E),I.state.currentGroup===I.groups.idle&&c.update(S,E),!0},I.on("motionStart",(D,E)=>{At.value={group:D,index:E}}),g.value&&await Be.setItem("live2dModel",g.value),p.value=!1}async function Ee(){if(!e.value)return;ue.registerTicker(fs),le.add(ds),le.add(ci);const y=await Be.getItem("live2dModel");if(y){g.value=y,x.value="file",p.value=!0;return}if(W.value){x.value="url",p.value=!0;return}p.value=!1}async function Gt(y,S){await r.value.motion(y,S,di.FORCE)}const ke=bi(()=>{r.value&&(r.value.x=t.width/2,r.value.y=t.height,m(r))},100),Ie=$(),ct=$(0);function Ct(){if(r.value){const y=getComputedStyle(Ie.value).backgroundColor;f.value.color=Number(Fi(y).replace("#","0x")),r.value.filters=[f.value]}}N([()=>t.width,()=>t.height],()=>ke()),N(h,Ct,{immediate:!0}),N([r,B],Ct);function Re(){Ct(),ct.value=requestAnimationFrame(Re)}return N(ut,()=>{ut.value?ct.value=requestAnimationFrame(Re):(cancelAnimationFrame(ct.value),ct.value=0)},{immediate:!0}),N(a,y=>d().setParameterValueById("ParamMouthOpenY",y)),N(e,Ee),N(_,y=>Gt(y.group,y.index)),N(i,y=>{var S,st;y?(S=e.value)==null||S.stop():(st=e.value)==null||st.start()}),vi(p,y=>{y&&Bt()},{debounce:1e3}),ms(Ct),gs(()=>{var y;cancelAnimationFrame(ct.value),r.value&&((y=e.value)==null||y.stage.removeChild(r.value))}),(y,S)=>(xs(),_s(wi,null,[Ai("div",{ref_key:"dropShadowColorComputer",ref:Ie,hidden:"",bg:"primary-400 dark:primary-500"},null,512),ys(y.$slots,"default")],64))}});export{Xi as A,se as B,wt as C,Rt as D,T as E,$i as F,bt as G,Ns as I,w as M,U as P,L as R,Fe as S,Ft as T,ge as U,Mr as V,Sn as _,Mn as a,vt as b,cs as c,z as d,et as e,Yi as f,Es as g,A as h,Yr as i,H as j,tt as k,rn as l,cr as m,It as n,yr as o,Tn as p,De as q,ir as r,ot as s,_t as t,O as u,ht as v,Q as w,ye as x,on as y,jr as z}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-DoV2Qdhe.js b/assets/Model.vue_vue_type_script_setup_true_lang-DoV2Qdhe.js new file mode 100644 index 0000000000000000000000000000000000000000..d810922c8bb5c247cf41ab28c9c03a0f19b6e3ae --- /dev/null +++ b/assets/Model.vue_vue_type_script_setup_true_lang-DoV2Qdhe.js @@ -0,0 +1 @@ +import{e as P,T as Y,A as re,L as C,a as $,D as ue,I as se,l as R,M as de,b as T}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{bv as ce,d as G,r as f,p,H as N,I as X,c as j,o as q,f as U,bh as z,h as O,bt as ve,bw as pe,b4 as fe,s as he,G as me,au as ge,bx as Me,F as we,e as ye,by as be}from"./index-1_q7hlhr.js";import{r as Se}from"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";const xe=o=>Math.max(0,Math.min(1,o||0)),B=o=>Math.round(xe(o)*255),Fe=ce("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)},Pe=o=>Be(Fe(o)),Ee=G({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=f(),e=f(),i=f();async function c(n){C.registerTicker($),P.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 F(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:F}),(n,g)=>(q(),j("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[U(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 Ce(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=z(()=>l.paused),e=f(),i=f(0),c=f(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),F=ve(),n=pe(be),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),W=Ce(),I=fe(new ue({alpha:.2,blur:0,distance:20,rotation:45}));function J(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const h=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(h,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:K,availableLive2dMotions:Q,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=he(me()),ee=f({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 C;S.value==="file"?await T.setupLive2DModel(a,[b.value]):S.value==="url"&&await T.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,h=r.coreModel,s=r.motionManager;h.setParameterValueById("ParamMouthOpenY",y.value),Q.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&&W.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),b.value&&await R.setItem("live2dModel",b.value),M.value=!1}async function te(){if(!t.value)return;C.registerTicker($),P.add(Y),P.add(se);const a=await R.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,de.FORCE)}const oe=ge(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=f(),w=f(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Pe(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(F,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=>J().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(K,a=>le(a.group,a.index)),p(d,a=>{var r,h;a?(r=t.value)==null||r.stop():(h=t.value)==null||h.start()}),Me(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(we,null,[ye("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),U(a.$slots,"default")],64))}});export{Le as _,Ee as a,H as r}; diff --git a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js similarity index 78% rename from assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js rename to assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js index 2605fd26fb0de416c35dad2a332e096bfb8fa854..5020f338b2f24a3b70cdbd3dda5b5bfef3b308cb 100644 --- a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js +++ b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js @@ -1 +1 @@ -import{_ as t}from"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{d as u,m as n,g as m,u as p,h as c,A as f,o as v,b as a}from"./index-Bo-ykojl.js";const g=u({__name:"ProviderApiKeyInput",props:n({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:d}=m(),o=p(e,"modelValue"),i=c(()=>l.description||`API Key for ${l.providerName}`);return(V,r)=>(v(),f(a(t),{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||a(d)("settings.pages.providers.common.fields.field.api-key.label"),description:i.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{g as _}; +import{_ as t}from"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{d as u,m as n,g as m,u as p,h as c,A as f,o as v,b as a}from"./index-1_q7hlhr.js";const g=u({__name:"ProviderApiKeyInput",props:n({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:d}=m(),o=p(e,"modelValue"),i=c(()=>l.description||`API Key for ${l.providerName}`);return(V,r)=>(v(),f(a(t),{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||a(d)("settings.pages.providers.common.fields.field.api-key.label"),description:i.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{g as _}; diff --git a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js similarity index 81% rename from assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js rename to assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js index 7bd6471cd3d2890fd7494ab2ea023322a033acb0..d5811c3fd09078e90e67fd7a46e61f7c24b2c777 100644 --- a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js +++ b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js @@ -1 +1 @@ -import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import{d,r as m,A as u,o as c,w as n,e,f,t as _,n as v,m as b,u as V,b as g}from"./index-Bo-ykojl.js";import{_ as x}from"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";const h=["onClick"],B={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},w={"mt-4":""},U=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function s(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(r=>[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:()=>r.setVisible(!r.visible)&&s()},[e("h2",B,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":r.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,h)]),default:n(()=>[e("div",w,[f(o.$slots,"default")])]),_:3}))}}),$=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=V(l,"modelValue");return(s,o)=>(c(),u(g(x),{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{U as _,$ as a}; +import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import{d,r as m,A as u,o as c,w as n,e,f,t as _,n as v,m as b,u as V,b as g}from"./index-1_q7hlhr.js";import{_ as x}from"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";const h=["onClick"],B={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},w={"mt-4":""},U=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function s(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(r=>[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:()=>r.setVisible(!r.visible)&&s()},[e("h2",B,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":r.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,h)]),default:n(()=>[e("div",w,[f(o.$slots,"default")])]),_:3}))}}),$=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=V(l,"modelValue");return(s,o)=>(c(),u(g(x),{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{U as _,$ as a}; diff --git a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js similarity index 94% rename from assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js rename to assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js index c727050a86ba633d95e0e05cc2c8b1c497192444..a5bdeb407824971558956829e5f1502449659ee3 100644 --- a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js +++ b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js @@ -1 +1 @@ -import{d as o,c as s,o as a,e,f as i,j as u,t as l}from"./index-Bo-ykojl.js";const c={flex:"~ col gap-6"},f={flex:"~ row","items-center":"","justify-between":""},x={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",f,[e("div",null,[e("h2",x,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,e,f as i,j as u,t as l}from"./index-1_q7hlhr.js";const c={flex:"~ col gap-6"},f={flex:"~ row","items-center":"","justify-between":""},x={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",f,[e("div",null,[e("h2",x,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-4XsML54n.js b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js similarity index 90% rename from assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js rename to assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js index a24ab78dd3f585799fcfca2244a410554c339b6f..4ef7810faaef53de33dd28e4f525998b0f32c0d8 100644 --- a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js +++ b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js @@ -1 +1 @@ -import{d as a,K as i,c as o,o as t,f as s,y as l,e as c,n as d,F as p}from"./index-Bo-ykojl.js";const u={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},_=a({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,v)=>{const r=i("motion");return t(),o(p,null,[s(n.$slots,"default"),l((t(),o("div",u,[c("div",{text:"60",class:d(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}});export{_}; +import{d as a,K as i,c as o,o as t,f as s,y as l,e as c,n as d,F as p}from"./index-1_q7hlhr.js";const u={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},_=a({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,v)=>{const r=i("motion");return t(),o(p,null,[s(n.$slots,"default"),l((t(),o("div",u,[c("div",{text:"60",class:d(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}});export{_}; diff --git a/assets/RadioCardSimple-C6azzpaa.js b/assets/RadioCardSimple-DJEw3oE4.js similarity index 94% rename from assets/RadioCardSimple-C6azzpaa.js rename to assets/RadioCardSimple-DJEw3oE4.js index 2a98ef6c17660a3a3b0180955ac5fa45452b4de0..e991e9a3e8ddb64b1013df4ab2ccd560aa18d6f3 100644 --- a/assets/RadioCardSimple-C6azzpaa.js +++ b/assets/RadioCardSimple-DJEw3oE4.js @@ -1 +1 @@ -import{d as g,m as f,u as w,r as b,c as n,o as d,n as o,y as V,e as t,bD as I,j as v,t as c,i as $,w as S,V as k,b as B,_ as C,h as T,z,F as E,l as N,A as D}from"./index-Bo-ykojl.js";import{_ as P}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import{_ as U}from"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";const q=["checked","name","value"],L={class:"relative mr-3 mt-0.5 flex-shrink-0"},j={class:"w-full flex flex-col gap-2"},F={class:"flex items-center"},A={key:0,class:"relative"},Q=["title"],G={key:1,class:"mt-2"},H=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]=u=>a.value=u),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,q),[[I,a.value]]),t("div",L,[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",j,[t("div",F,[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,[$(B(P),null,{default:S(()=>[!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,Q)):(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:"mt-0.5 inline-flex items-center text-xs text-primary-500 dark:text-primary-600",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",G,[$(B(U),{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=u=>a.value=u),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))}}),J=C(H,[["__scopeId","data-v-86a9d442"]]),K={class:"radio-card-detail-many-select"},O={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},W=["placeholder"],X={class:"mt-4 space-y-2"},Y={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},Z={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"},_={class:"flex flex-col"},ee={class:"font-medium"},te={class:"text-sm text-amber-600 dark:text-amber-400"},ae={class:"relative"},le=g({__name:"RadioCardManySelect",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(""),u=b(!1),R=b(""),h=T(()=>{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 M(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",K,[e.searchable?(d(),n("div",O,[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]=i=>r.value=i),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,W),[[z,r.value]])])):v("",!0),t("div",X,[r.value?(d(),n("div",Y,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",Z,[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",_,[t("span",ee,c(e.searchNoResultsTitle),1),t("span",te,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",ae,[t("div",{class:o(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4 scrollbar-none",[u.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(E,null,N(h.value,i=>(d(),D(J,{id:i.id,key:i.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:i.id,title:i.name,description:i.description,deprecated:i.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":i.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=>M(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([u.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([u.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]=i=>u.value=!u.value)},[t("span",null,c(u.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([u.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),me=C(le,[["__scopeId","data-v-7ad6d626"]]),re=["checked","name","value"],oe={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},de=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:"absolute opacity-0 [&:checked+div]:border-primary-500 [&:checked+div_.radio-dot]:opacity-100 dark:[&:checked+div]:border-primary-400"},null,8,re),[[I,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",oe,[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))}}),ve=C(de,[["__scopeId","data-v-ab9cd9e1"]]);export{me as R,ve as a}; +import{d as g,m as f,u as w,r as b,c as n,o as d,n as o,y as V,e as t,bH as I,j as v,t as c,i as $,w as S,V as k,b as B,_ as C,h as T,z,F as E,l as N,A as D}from"./index-1_q7hlhr.js";import{_ as P}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import{_ as U}from"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";const q=["checked","name","value"],L={class:"relative mr-3 mt-0.5 flex-shrink-0"},j={class:"w-full flex flex-col gap-2"},F={class:"flex items-center"},A={key:0,class:"relative"},H=["title"],Q={key:1,class:"mt-2"},G=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]=u=>a.value=u),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,q),[[I,a.value]]),t("div",L,[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",j,[t("div",F,[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,[$(B(P),null,{default:S(()=>[!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,H)):(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:"mt-0.5 inline-flex items-center text-xs text-primary-500 dark:text-primary-600",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",Q,[$(B(U),{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=u=>a.value=u),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))}}),J=C(G,[["__scopeId","data-v-86a9d442"]]),K={class:"radio-card-detail-many-select"},O={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},W=["placeholder"],X={class:"mt-4 space-y-2"},Y={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},Z={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"},_={class:"flex flex-col"},ee={class:"font-medium"},te={class:"text-sm text-amber-600 dark:text-amber-400"},ae={class:"relative"},le=g({__name:"RadioCardManySelect",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(""),u=b(!1),R=b(""),h=T(()=>{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 M(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",K,[e.searchable?(d(),n("div",O,[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]=i=>r.value=i),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,W),[[z,r.value]])])):v("",!0),t("div",X,[r.value?(d(),n("div",Y,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",Z,[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",_,[t("span",ee,c(e.searchNoResultsTitle),1),t("span",te,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",ae,[t("div",{class:o(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4 scrollbar-none",[u.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(E,null,N(h.value,i=>(d(),D(J,{id:i.id,key:i.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:i.id,title:i.name,description:i.description,deprecated:i.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":i.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=>M(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([u.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([u.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]=i=>u.value=!u.value)},[t("span",null,c(u.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([u.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),me=C(le,[["__scopeId","data-v-7ad6d626"]]),re=["checked","name","value"],oe={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},de=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:"absolute opacity-0 [&:checked+div]:border-primary-500 [&:checked+div_.radio-dot]:opacity-100 dark:[&:checked+div]:border-primary-400"},null,8,re),[[I,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",oe,[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))}}),ve=C(de,[["__scopeId","data-v-ab9cd9e1"]]);export{me as R,ve as a}; diff --git a/assets/Select.vue_vue_type_style_index_0_lang-CSoknWgh.js b/assets/Select.vue_vue_type_style_index_0_lang-BNsd3INm.js similarity index 99% rename from assets/Select.vue_vue_type_style_index_0_lang-CSoknWgh.js rename to assets/Select.vue_vue_type_style_index_0_lang-BNsd3INm.js index 997bff268c0faf51688cf825eaa1caca2bed0899..56c841fb364ae12659e9d40c03737d6c222b3ca4 100644 --- a/assets/Select.vue_vue_type_style_index_0_lang-CSoknWgh.js +++ b/assets/Select.vue_vue_type_style_index_0_lang-BNsd3INm.js @@ -1 +1 @@ -import{d as U,bv as je,bw as Ve,N as te,c as ie,o as B,e as A,j as ce,F as qe,A as le,f as V,q as Z,bx as Ge,n as ze,b3 as Ue,by as Xe,w as fe,i as Ye,E as Ke,C as Ze,D as Qe}from"./index-Bo-ykojl.js";import{c as Je,r as Q,o as et,j as tt,s as it,f as ot,d as st,a as nt}from"./floating-ui.core-CgBsuaUc.js";function m(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _(e){return m(e).getComputedStyle(e)}const ge=Math.min,k=Math.max,q=Math.round;function Ae(e){const t=_(e);let i=parseFloat(t.width),o=parseFloat(t.height);const s=e.offsetWidth,n=e.offsetHeight,r=q(i)!==s||q(o)!==n;return r&&(i=s,o=n),{width:i,height:o,fallback:r}}function N(e){return Be(e)?(e.nodeName||"").toLowerCase():""}let I;function He(){if(I)return I;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(I=e.brands.map(t=>t.brand+"/"+t.version).join(" "),I):navigator.userAgent}function b(e){return e instanceof m(e).HTMLElement}function C(e){return e instanceof m(e).Element}function Be(e){return e instanceof m(e).Node}function me(e){return typeof ShadowRoot>"u"?!1:e instanceof m(e).ShadowRoot||e instanceof ShadowRoot}function X(e){const{overflow:t,overflowX:i,overflowY:o,display:s}=_(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+i)&&!["inline","contents"].includes(s)}function rt(e){return["table","td","th"].includes(N(e))}function oe(e){const t=/firefox/i.test(He()),i=_(e),o=i.backdropFilter||i.WebkitBackdropFilter;return i.transform!=="none"||i.perspective!=="none"||!!o&&o!=="none"||t&&i.willChange==="filter"||t&&!!i.filter&&i.filter!=="none"||["transform","perspective"].some(s=>i.willChange.includes(s))||["paint","layout","strict","content"].some(s=>{const n=i.contain;return n!=null&&n.includes(s)})}function Oe(){return!/^((?!chrome|android).)*safari/i.test(He())}function de(e){return["html","body","#document"].includes(N(e))}function ke(e){return C(e)?e:e.contextElement}const Le={x:1,y:1};function O(e){const t=ke(e);if(!b(t))return Le;const i=t.getBoundingClientRect(),{width:o,height:s,fallback:n}=Ae(t);let r=(n?q(i.width):i.width)/o,a=(n?q(i.height):i.height)/s;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function R(e,t,i,o){var s,n;t===void 0&&(t=!1),i===void 0&&(i=!1);const r=e.getBoundingClientRect(),a=ke(e);let l=Le;t&&(o?C(o)&&(l=O(o)):l=O(e));const d=a?m(a):window,c=!Oe()&&i;let h=(r.left+(c&&((s=d.visualViewport)==null?void 0:s.offsetLeft)||0))/l.x,u=(r.top+(c&&((n=d.visualViewport)==null?void 0:n.offsetTop)||0))/l.y,y=r.width/l.x,v=r.height/l.y;if(a){const g=m(a),T=o&&C(o)?m(o):o;let f=g.frameElement;for(;f&&o&&T!==g;){const $=O(f),F=f.getBoundingClientRect(),ue=getComputedStyle(f);F.x+=(f.clientLeft+parseFloat(ue.paddingLeft))*$.x,F.y+=(f.clientTop+parseFloat(ue.paddingTop))*$.y,h*=$.x,u*=$.y,y*=$.x,v*=$.y,h+=F.x,u+=F.y,f=m(f).frameElement}}return{width:y,height:v,top:u,right:h+y,bottom:u+v,left:h,x:h,y:u}}function P(e){return((Be(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Me(e){return R(P(e)).left+Y(e).scrollLeft}function D(e){if(N(e)==="html")return e;const t=e.assignedSlot||e.parentNode||me(e)&&e.host||P(e);return me(t)?t.host:t}function Re(e){const t=D(e);return de(t)?t.ownerDocument.body:b(t)&&X(t)?t:Re(t)}function G(e,t){var i;t===void 0&&(t=[]);const o=Re(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),n=m(o);return s?t.concat(n,n.visualViewport||[],X(o)?o:[]):t.concat(o,G(o))}function we(e,t,i){return t==="viewport"?Q(function(o,s){const n=m(o),r=P(o),a=n.visualViewport;let l=r.clientWidth,d=r.clientHeight,c=0,h=0;if(a){l=a.width,d=a.height;const u=Oe();(u||!u&&s==="fixed")&&(c=a.offsetLeft,h=a.offsetTop)}return{width:l,height:d,x:c,y:h}}(e,i)):C(t)?Q(function(o,s){const n=R(o,!0,s==="fixed"),r=n.top+o.clientTop,a=n.left+o.clientLeft,l=b(o)?O(o):{x:1,y:1};return{width:o.clientWidth*l.x,height:o.clientHeight*l.y,x:a*l.x,y:r*l.y}}(t,i)):Q(function(o){const s=P(o),n=Y(o),r=o.ownerDocument.body,a=k(s.scrollWidth,s.clientWidth,r.scrollWidth,r.clientWidth),l=k(s.scrollHeight,s.clientHeight,r.scrollHeight,r.clientHeight);let d=-n.scrollLeft+Me(o);const c=-n.scrollTop;return _(r).direction==="rtl"&&(d+=k(s.clientWidth,r.clientWidth)-a),{width:a,height:l,x:d,y:c}}(P(e)))}function ye(e){return b(e)&&_(e).position!=="fixed"?e.offsetParent:null}function ve(e){const t=m(e);let i=ye(e);for(;i&&rt(i)&&_(i).position==="static";)i=ye(i);return i&&(N(i)==="html"||N(i)==="body"&&_(i).position==="static"&&!oe(i))?t:i||function(o){let s=D(o);for(;b(s)&&!de(s);){if(oe(s))return s;s=D(s)}return null}(e)||t}function at(e,t,i){const o=b(t),s=P(t),n=R(e,!0,i==="fixed",t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&i!=="fixed")if((N(t)!=="body"||X(s))&&(r=Y(t)),b(t)){const l=R(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else s&&(a.x=Me(s));return{x:n.left+r.scrollLeft-a.x,y:n.top+r.scrollTop-a.y,width:n.width,height:n.height}}const lt={getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:o,strategy:s}=e;const n=i==="clippingAncestors"?function(d,c){const h=c.get(d);if(h)return h;let u=G(d).filter(T=>C(T)&&N(T)!=="body"),y=null;const v=_(d).position==="fixed";let g=v?D(d):d;for(;C(g)&&!de(g);){const T=_(g),f=oe(g);(v?f||y:f||T.position!=="static"||!y||!["absolute","fixed"].includes(y.position))?y=T:u=u.filter($=>$!==g),g=D(g)}return c.set(d,u),u}(t,this._c):[].concat(i),r=[...n,o],a=r[0],l=r.reduce((d,c)=>{const h=we(t,c,s);return d.top=k(h.top,d.top),d.right=ge(h.right,d.right),d.bottom=ge(h.bottom,d.bottom),d.left=k(h.left,d.left),d},we(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:i,strategy:o}=e;const s=b(i),n=P(i);if(i===n)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((s||!s&&o!=="fixed")&&((N(i)!=="body"||X(n))&&(r=Y(i)),b(i))){const d=R(i);a=O(i),l.x=d.x+i.clientLeft,l.y=d.y+i.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:C,getDimensions:function(e){return b(e)?Ae(e):e.getBoundingClientRect()},getOffsetParent:ve,getDocumentElement:P,getScale:O,async getElementRects(e){let{reference:t,floating:i,strategy:o}=e;const s=this.getOffsetParent||ve,n=this.getDimensions;return{reference:at(t,await s(i),o),floating:{x:0,y:0,...await n(i)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>_(e).direction==="rtl"},dt=(e,t,i)=>{const o=new Map,s={platform:lt,...i},n={...s.platform,_c:o};return Je(e,t,{...s,platform:n})},H={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:e=>[...e,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover"],delay:{show:0,hide:400}}}};function se(e,t){let i=H.themes[e]||{},o;do o=i[t],typeof o>"u"?i.$extend?i=H.themes[i.$extend]||{}:(i=null,o=H[t]):i=null;while(i);return o}function pt(e){const t=[e];let i=H.themes[e]||{};do i.$extend&&!i.$resetCss?(t.push(i.$extend),i=H.themes[i.$extend]||{}):i=null;while(i);return t.map(o=>`v-popper--theme-${o}`)}function $e(e){const t=[e];let i=H.themes[e]||{};do i.$extend?(t.push(i.$extend),i=H.themes[i.$extend]||{}):i=null;while(i);return t}let E=!1;if(typeof window<"u"){E=!1;try{const e=Object.defineProperty({},"passive",{get(){E=!0}});window.addEventListener("test",null,e)}catch{}}let De=!1;typeof window<"u"&&typeof navigator<"u"&&(De=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const ht=["auto","top","bottom","left","right"].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),_e={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},be={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function Te(e,t){const i=e.indexOf(t);i!==-1&&e.splice(i,1)}function J(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const w=[];let z=null;const Se={};function xe(e){let t=Se[e];return t||(t=Se[e]=[]),t}let ne=function(){};typeof window<"u"&&(ne=window.Element);function p(e){return function(t){return se(t.theme,e)}}const ee="__floating-vue__popper",Ee=()=>U({name:"VPopper",provide(){return{[ee]:{parentPopper:this}}},inject:{[ee]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:p("disabled")},positioningDisabled:{type:Boolean,default:p("positioningDisabled")},placement:{type:String,default:p("placement"),validator:e=>ht.includes(e)},delay:{type:[String,Number,Object],default:p("delay")},distance:{type:[Number,String],default:p("distance")},skidding:{type:[Number,String],default:p("skidding")},triggers:{type:Array,default:p("triggers")},showTriggers:{type:[Array,Function],default:p("showTriggers")},hideTriggers:{type:[Array,Function],default:p("hideTriggers")},popperTriggers:{type:Array,default:p("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:p("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:p("popperHideTriggers")},container:{type:[String,Object,ne,Boolean],default:p("container")},boundary:{type:[String,ne],default:p("boundary")},strategy:{type:String,validator:e=>["absolute","fixed"].includes(e),default:p("strategy")},autoHide:{type:[Boolean,Function],default:p("autoHide")},handleResize:{type:Boolean,default:p("handleResize")},instantMove:{type:Boolean,default:p("instantMove")},eagerMount:{type:Boolean,default:p("eagerMount")},popperClass:{type:[String,Array,Object],default:p("popperClass")},computeTransformOrigin:{type:Boolean,default:p("computeTransformOrigin")},autoMinSize:{type:Boolean,default:p("autoMinSize")},autoSize:{type:[Boolean,String],default:p("autoSize")},autoMaxSize:{type:Boolean,default:p("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:p("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:p("preventOverflow")},overflowPadding:{type:[Number,String],default:p("overflowPadding")},arrowPadding:{type:[Number,String],default:p("arrowPadding")},arrowOverflow:{type:Boolean,default:p("arrowOverflow")},flip:{type:Boolean,default:p("flip")},shift:{type:Boolean,default:p("shift")},shiftCrossAxis:{type:Boolean,default:p("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:p("noAutoFocus")},disposeTimeout:{type:Number,default:p("disposeTimeout")}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join("_")}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[ee])==null?void 0:e.parentPopper},hasPopperShowTriggerHover(){var e,t;return((e=this.popperTriggers)==null?void 0:e.includes("hover"))||((t=this.popperShowTriggers)==null?void 0:t.includes("hover"))}},watch:{shown:"$_autoShowHide",disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:"$_refreshListeners",deep:!0},positioningDisabled:"$_refreshListeners",...["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((e,t)=>(e[t]="$_computePosition",e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:i=!1}={}){var o,s;(o=this.parentPopper)!=null&&o.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(i||!this.disabled)&&(((s=this.parentPopper)==null?void 0:s.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:e=null,skipDelay:t=!1}={}){var i;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}((i=this.parentPopper)==null?void 0:i.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var e;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=((e=this.referenceNode)==null?void 0:e.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(t=>t.nodeType===t.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(et({mainAxis:this.distance,crossAxis:this.skidding}));const t=this.placement.startsWith("auto");if(t?e.middleware.push(tt({alignment:this.placement.split("-")[1]??""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(it({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(ot({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(st({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:o,rects:s,middlewareData:n})=>{let r;const{centerOffset:a}=n.arrow;return o.startsWith("top")||o.startsWith("bottom")?r=Math.abs(a)>s.reference.width/2:r=Math.abs(a)>s.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){const o=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:s,placement:n,middlewareData:r})=>{var a;if((a=r.autoSize)!=null&&a.skip)return{};let l,d;return n.startsWith("top")||n.startsWith("bottom")?l=s.reference.width:d=s.reference.height,this.$_innerNode.style[o==="min"?"minWidth":o==="max"?"maxWidth":"width"]=l!=null?`${l}px`:null,this.$_innerNode.style[o==="min"?"minHeight":o==="max"?"maxHeight":"height"]=d!=null?`${d}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(nt({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:o,availableHeight:s})=>{this.$_innerNode.style.maxWidth=o!=null?`${o}px`:null,this.$_innerNode.style.maxHeight=s!=null?`${s}px`:null}})));const i=await dt(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:i.x,y:i.y,placement:i.placement,strategy:i.strategy,arrow:{...i.middlewareData.arrow,...i.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),z&&this.instantMove&&z.instantMove&&z!==this.parentPopper){z.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(z=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(e){const t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await J(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...G(this.$_referenceNode),...G(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const t=this.$_referenceNode.getBoundingClientRect(),i=this.$_popperNode.querySelector(".v-popper__wrapper"),o=i.parentNode.getBoundingClientRect(),s=t.x+t.width/2-(o.left+i.offsetLeft),n=t.y+t.height/2-(o.top+i.offsetTop);this.result.transformOrigin=`${s}px ${n}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const e=this.showGroup;if(e){let t;for(let i=0;i0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Te(w,this),w.length===0&&document.body.classList.remove("v-popper--some-open");for(const i of $e(this.theme)){const o=xe(i);Te(o,this),o.length===0&&document.body.classList.remove(`v-popper--some-open--${i}`)}z===this&&(z=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await J(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e=="string"?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw new Error("No container for popover: "+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const e=i=>{this.isShown&&!this.$_hideInProgress||(i.usedByTooltip=!0,!this.$_preventShow&&this.show({event:i}))};this.$_registerTriggerListeners(this.$_targetNodes,_e,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],_e,this.popperTriggers,this.popperShowTriggers,e);const t=i=>{i.usedByTooltip||this.hide({event:i})};this.$_registerTriggerListeners(this.$_targetNodes,be,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],be,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,i){this.$_events.push({targetNodes:e,eventType:t,handler:i}),e.forEach(o=>o.addEventListener(t,i,E?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,i,o,s){let n=i;o!=null&&(n=typeof o=="function"?o(n):o),n.forEach(r=>{const a=t[r];a&&this.$_registerEventListeners(e,a,s)})},$_removeEventListeners(e){const t=[];this.$_events.forEach(i=>{const{targetNodes:o,eventType:s,handler:n}=i;!e||e===s?o.forEach(r=>r.removeEventListener(s,n)):t.push(i)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(const i of this.$_targetNodes){const o=i.getAttribute(e);o&&(i.removeAttribute(e),i.setAttribute(t,o))}},$_applyAttrsToTarget(e){for(const t of this.$_targetNodes)for(const i in e){const o=e[i];o==null?t.removeAttribute(i):t.setAttribute(i,o)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){const e=this.$_referenceNode.getBoundingClientRect();if(L>=e.left&&L<=e.right&&M>=e.top&&M<=e.bottom){const t=this.$_popperNode.getBoundingClientRect(),i=L-S,o=M-x,s=t.left+t.width/2-S+(t.top+t.height/2)-x+t.width+t.height,n=S+i*s,r=x+o*s;return W(S,x,n,r,t.left,t.top,t.left,t.bottom)||W(S,x,n,r,t.left,t.top,t.right,t.top)||W(S,x,n,r,t.right,t.top,t.right,t.bottom)||W(S,x,n,r,t.left,t.bottom,t.right,t.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<"u"&&typeof window<"u"){if(De){const e=E?{passive:!0,capture:!0}:!0;document.addEventListener("touchstart",t=>Ce(t),e),document.addEventListener("touchend",t=>Pe(t,!0),e)}else window.addEventListener("mousedown",e=>Ce(e),!0),window.addEventListener("click",e=>Pe(e,!1),!0);window.addEventListener("resize",ft)}function Ce(e,t){for(let i=0;i=0;o--){const s=w[o];try{const n=s.containsGlobalTarget=s.mouseDownContains||s.popperNode().contains(e.target);s.pendingHide=!1,requestAnimationFrame(()=>{if(s.pendingHide=!1,!i[s.randomId]&&Ne(s,n,e)){if(s.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&n){let a=s.parentPopper;for(;a;)i[a.randomId]=!0,a=a.parentPopper;return}let r=s.parentPopper;for(;r&&Ne(r,r.containsGlobalTarget,e);)r.$_handleGlobalClose(e,t),r=r.parentPopper}})}catch{}}}function Ne(e,t,i){return i.closeAllPopover||i.closePopover&&t||ct(e,i)&&!t}function ct(e,t){if(typeof e.autoHide=="function"){const i=e.autoHide(t);return e.lastAutoHide=i,i}return e.autoHide}function ft(){for(let e=0;e{S=L,x=M,L=e.clientX,M=e.clientY},E?{passive:!0}:void 0);function W(e,t,i,o,s,n,r,a){const l=((r-s)*(t-n)-(a-n)*(e-s))/((a-n)*(i-e)-(r-s)*(o-t)),d=((i-e)*(t-n)-(o-t)*(e-s))/((a-n)*(i-e)-(r-s)*(o-t));return l>=0&&l<=1&&d>=0&&d<=1}const gt={extends:Ee()},pe=(e,t)=>{const i=e.__vccOpts||e;for(const[o,s]of t)i[o]=s;return i};function mt(e,t,i,o,s,n){return B(),ie("div",{ref:"reference",class:ze(["v-popper",{"v-popper--shown":e.slotData.isShown}])},[V(e.$slots,"default",Ze(Qe(e.slotData)))],2)}const wt=pe(gt,[["render",mt]]);function yt(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):-1}let j;function re(){re.init||(re.init=!0,j=yt()!==-1)}var K={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){re(),Ue(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",j&&this.$el.appendChild(e),e.data="about:blank",j||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!j&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const vt=Xe();je("data-v-b329ee4c");const $t={class:"resize-observer",tabindex:"-1"};Ve();const _t=vt((e,t,i,o,s,n)=>(B(),le("div",$t)));K.render=_t;K.__scopeId="data-v-b329ee4c";K.__file="src/components/ResizeObserver.vue";const Fe=(e="theme")=>({computed:{themeClass(){return pt(this[e])}}}),bt=U({name:"VPopperContent",components:{ResizeObserver:K},mixins:[Fe()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Tt=["id","aria-hidden","tabindex","data-popper-placement"],St={ref:"inner",class:"v-popper__inner"},xt=A("div",{class:"v-popper__arrow-outer"},null,-1),Ct=A("div",{class:"v-popper__arrow-inner"},null,-1),Pt=[xt,Ct];function Nt(e,t,i,o,s,n){const r=te("ResizeObserver");return B(),ie("div",{id:e.popperId,ref:"popover",class:ze(["v-popper__popper",[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:Z(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?"false":"true",tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||(t[2]=Ge(a=>e.autoHide&&e.$emit("hide"),["esc"]))},[A("div",{class:"v-popper__backdrop",onClick:t[0]||(t[0]=a=>e.autoHide&&e.$emit("hide"))}),A("div",{class:"v-popper__wrapper",style:Z(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[A("div",St,[e.mounted?(B(),ie(qe,{key:0},[A("div",null,[V(e.$slots,"default")]),e.handleResize?(B(),le(r,{key:0,onNotify:t[1]||(t[1]=a=>e.$emit("resize",a))})):ce("",!0)],64)):ce("",!0)],512),A("div",{ref:"arrow",class:"v-popper__arrow-container",style:Z(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Pt,4)],4)],46,Tt)}const Ie=pe(bt,[["render",Nt]]),We={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}};let ae=function(){};typeof window<"u"&&(ae=window.Element);const zt=U({name:"VPopperWrapper",components:{Popper:wt,PopperContent:Ie},mixins:[We,Fe("finalTheme")],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,ae,Boolean],default:void 0},boundary:{type:[String,ae],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function At(e,t,i,o,s,n){const r=te("PopperContent"),a=te("Popper");return B(),le(a,Ke({ref:"popper"},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||(t[0]=()=>e.$emit("show")),onHide:t[1]||(t[1]=()=>e.$emit("hide")),"onUpdate:shown":t[2]||(t[2]=l=>e.$emit("update:shown",l)),onApplyShow:t[3]||(t[3]=()=>e.$emit("apply-show")),onApplyHide:t[4]||(t[4]=()=>e.$emit("apply-hide")),onCloseGroup:t[5]||(t[5]=()=>e.$emit("close-group")),onCloseDirective:t[6]||(t[6]=()=>e.$emit("close-directive")),onAutoHide:t[7]||(t[7]=()=>e.$emit("auto-hide")),onResize:t[8]||(t[8]=()=>e.$emit("resize"))}),{default:fe(({popperId:l,isShown:d,shouldMountContent:c,skipTransition:h,autoHide:u,show:y,hide:v,handleResize:g,onResize:T,classes:f,result:$})=>[V(e.$slots,"default",{shown:d,show:y,hide:v}),Ye(r,{ref:"popperContent","popper-id":l,theme:e.finalTheme,shown:d,mounted:c,"skip-transition":h,"auto-hide":u,"handle-resize":g,classes:f,result:$,onHide:v,onResize:T},{default:fe(()=>[V(e.$slots,"popper",{shown:d,hide:v})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},16,["theme","target-nodes","popper-node","class"])}const he=pe(zt,[["render",At]]),Ht={...he,name:"VDropdown",vPopperTheme:"dropdown"};({...he});({...he});U({name:"VTooltipDirective",components:{Popper:Ee(),PopperContent:Ie},mixins:[We],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:e=>se(e.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>se(e.theme,"loadingContent")},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content=="function"&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const t=++this.$_fetchId,i=this.content(this);i.then?i.then(o=>this.onResult(t,o)):this.onResult(t,i)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}});const kt=Ht;export{kt as k}; +import{d as U,bz as je,bA as Ve,N as te,c as ie,o as B,e as A,j as ce,F as qe,A as le,f as V,q as Z,bB as Ge,n as ze,b3 as Ue,bC as Xe,w as fe,i as Ye,E as Ke,C as Ze,D as Qe}from"./index-1_q7hlhr.js";import{c as Je,r as Q,o as et,j as tt,s as it,f as ot,d as st,a as nt}from"./floating-ui.core-CgBsuaUc.js";function m(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _(e){return m(e).getComputedStyle(e)}const ge=Math.min,k=Math.max,q=Math.round;function Ae(e){const t=_(e);let i=parseFloat(t.width),o=parseFloat(t.height);const s=e.offsetWidth,n=e.offsetHeight,r=q(i)!==s||q(o)!==n;return r&&(i=s,o=n),{width:i,height:o,fallback:r}}function N(e){return Be(e)?(e.nodeName||"").toLowerCase():""}let I;function He(){if(I)return I;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(I=e.brands.map(t=>t.brand+"/"+t.version).join(" "),I):navigator.userAgent}function b(e){return e instanceof m(e).HTMLElement}function C(e){return e instanceof m(e).Element}function Be(e){return e instanceof m(e).Node}function me(e){return typeof ShadowRoot>"u"?!1:e instanceof m(e).ShadowRoot||e instanceof ShadowRoot}function X(e){const{overflow:t,overflowX:i,overflowY:o,display:s}=_(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+i)&&!["inline","contents"].includes(s)}function rt(e){return["table","td","th"].includes(N(e))}function oe(e){const t=/firefox/i.test(He()),i=_(e),o=i.backdropFilter||i.WebkitBackdropFilter;return i.transform!=="none"||i.perspective!=="none"||!!o&&o!=="none"||t&&i.willChange==="filter"||t&&!!i.filter&&i.filter!=="none"||["transform","perspective"].some(s=>i.willChange.includes(s))||["paint","layout","strict","content"].some(s=>{const n=i.contain;return n!=null&&n.includes(s)})}function Oe(){return!/^((?!chrome|android).)*safari/i.test(He())}function de(e){return["html","body","#document"].includes(N(e))}function ke(e){return C(e)?e:e.contextElement}const Le={x:1,y:1};function O(e){const t=ke(e);if(!b(t))return Le;const i=t.getBoundingClientRect(),{width:o,height:s,fallback:n}=Ae(t);let r=(n?q(i.width):i.width)/o,a=(n?q(i.height):i.height)/s;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function R(e,t,i,o){var s,n;t===void 0&&(t=!1),i===void 0&&(i=!1);const r=e.getBoundingClientRect(),a=ke(e);let l=Le;t&&(o?C(o)&&(l=O(o)):l=O(e));const d=a?m(a):window,c=!Oe()&&i;let h=(r.left+(c&&((s=d.visualViewport)==null?void 0:s.offsetLeft)||0))/l.x,u=(r.top+(c&&((n=d.visualViewport)==null?void 0:n.offsetTop)||0))/l.y,y=r.width/l.x,v=r.height/l.y;if(a){const g=m(a),T=o&&C(o)?m(o):o;let f=g.frameElement;for(;f&&o&&T!==g;){const $=O(f),F=f.getBoundingClientRect(),ue=getComputedStyle(f);F.x+=(f.clientLeft+parseFloat(ue.paddingLeft))*$.x,F.y+=(f.clientTop+parseFloat(ue.paddingTop))*$.y,h*=$.x,u*=$.y,y*=$.x,v*=$.y,h+=F.x,u+=F.y,f=m(f).frameElement}}return{width:y,height:v,top:u,right:h+y,bottom:u+v,left:h,x:h,y:u}}function P(e){return((Be(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Me(e){return R(P(e)).left+Y(e).scrollLeft}function D(e){if(N(e)==="html")return e;const t=e.assignedSlot||e.parentNode||me(e)&&e.host||P(e);return me(t)?t.host:t}function Re(e){const t=D(e);return de(t)?t.ownerDocument.body:b(t)&&X(t)?t:Re(t)}function G(e,t){var i;t===void 0&&(t=[]);const o=Re(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),n=m(o);return s?t.concat(n,n.visualViewport||[],X(o)?o:[]):t.concat(o,G(o))}function we(e,t,i){return t==="viewport"?Q(function(o,s){const n=m(o),r=P(o),a=n.visualViewport;let l=r.clientWidth,d=r.clientHeight,c=0,h=0;if(a){l=a.width,d=a.height;const u=Oe();(u||!u&&s==="fixed")&&(c=a.offsetLeft,h=a.offsetTop)}return{width:l,height:d,x:c,y:h}}(e,i)):C(t)?Q(function(o,s){const n=R(o,!0,s==="fixed"),r=n.top+o.clientTop,a=n.left+o.clientLeft,l=b(o)?O(o):{x:1,y:1};return{width:o.clientWidth*l.x,height:o.clientHeight*l.y,x:a*l.x,y:r*l.y}}(t,i)):Q(function(o){const s=P(o),n=Y(o),r=o.ownerDocument.body,a=k(s.scrollWidth,s.clientWidth,r.scrollWidth,r.clientWidth),l=k(s.scrollHeight,s.clientHeight,r.scrollHeight,r.clientHeight);let d=-n.scrollLeft+Me(o);const c=-n.scrollTop;return _(r).direction==="rtl"&&(d+=k(s.clientWidth,r.clientWidth)-a),{width:a,height:l,x:d,y:c}}(P(e)))}function ye(e){return b(e)&&_(e).position!=="fixed"?e.offsetParent:null}function ve(e){const t=m(e);let i=ye(e);for(;i&&rt(i)&&_(i).position==="static";)i=ye(i);return i&&(N(i)==="html"||N(i)==="body"&&_(i).position==="static"&&!oe(i))?t:i||function(o){let s=D(o);for(;b(s)&&!de(s);){if(oe(s))return s;s=D(s)}return null}(e)||t}function at(e,t,i){const o=b(t),s=P(t),n=R(e,!0,i==="fixed",t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&i!=="fixed")if((N(t)!=="body"||X(s))&&(r=Y(t)),b(t)){const l=R(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else s&&(a.x=Me(s));return{x:n.left+r.scrollLeft-a.x,y:n.top+r.scrollTop-a.y,width:n.width,height:n.height}}const lt={getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:o,strategy:s}=e;const n=i==="clippingAncestors"?function(d,c){const h=c.get(d);if(h)return h;let u=G(d).filter(T=>C(T)&&N(T)!=="body"),y=null;const v=_(d).position==="fixed";let g=v?D(d):d;for(;C(g)&&!de(g);){const T=_(g),f=oe(g);(v?f||y:f||T.position!=="static"||!y||!["absolute","fixed"].includes(y.position))?y=T:u=u.filter($=>$!==g),g=D(g)}return c.set(d,u),u}(t,this._c):[].concat(i),r=[...n,o],a=r[0],l=r.reduce((d,c)=>{const h=we(t,c,s);return d.top=k(h.top,d.top),d.right=ge(h.right,d.right),d.bottom=ge(h.bottom,d.bottom),d.left=k(h.left,d.left),d},we(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:i,strategy:o}=e;const s=b(i),n=P(i);if(i===n)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((s||!s&&o!=="fixed")&&((N(i)!=="body"||X(n))&&(r=Y(i)),b(i))){const d=R(i);a=O(i),l.x=d.x+i.clientLeft,l.y=d.y+i.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:C,getDimensions:function(e){return b(e)?Ae(e):e.getBoundingClientRect()},getOffsetParent:ve,getDocumentElement:P,getScale:O,async getElementRects(e){let{reference:t,floating:i,strategy:o}=e;const s=this.getOffsetParent||ve,n=this.getDimensions;return{reference:at(t,await s(i),o),floating:{x:0,y:0,...await n(i)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>_(e).direction==="rtl"},dt=(e,t,i)=>{const o=new Map,s={platform:lt,...i},n={...s.platform,_c:o};return Je(e,t,{...s,platform:n})},H={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:e=>[...e,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover"],delay:{show:0,hide:400}}}};function se(e,t){let i=H.themes[e]||{},o;do o=i[t],typeof o>"u"?i.$extend?i=H.themes[i.$extend]||{}:(i=null,o=H[t]):i=null;while(i);return o}function pt(e){const t=[e];let i=H.themes[e]||{};do i.$extend&&!i.$resetCss?(t.push(i.$extend),i=H.themes[i.$extend]||{}):i=null;while(i);return t.map(o=>`v-popper--theme-${o}`)}function $e(e){const t=[e];let i=H.themes[e]||{};do i.$extend?(t.push(i.$extend),i=H.themes[i.$extend]||{}):i=null;while(i);return t}let E=!1;if(typeof window<"u"){E=!1;try{const e=Object.defineProperty({},"passive",{get(){E=!0}});window.addEventListener("test",null,e)}catch{}}let De=!1;typeof window<"u"&&typeof navigator<"u"&&(De=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const ht=["auto","top","bottom","left","right"].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),_e={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},be={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function Te(e,t){const i=e.indexOf(t);i!==-1&&e.splice(i,1)}function J(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const w=[];let z=null;const Se={};function xe(e){let t=Se[e];return t||(t=Se[e]=[]),t}let ne=function(){};typeof window<"u"&&(ne=window.Element);function p(e){return function(t){return se(t.theme,e)}}const ee="__floating-vue__popper",Ee=()=>U({name:"VPopper",provide(){return{[ee]:{parentPopper:this}}},inject:{[ee]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:p("disabled")},positioningDisabled:{type:Boolean,default:p("positioningDisabled")},placement:{type:String,default:p("placement"),validator:e=>ht.includes(e)},delay:{type:[String,Number,Object],default:p("delay")},distance:{type:[Number,String],default:p("distance")},skidding:{type:[Number,String],default:p("skidding")},triggers:{type:Array,default:p("triggers")},showTriggers:{type:[Array,Function],default:p("showTriggers")},hideTriggers:{type:[Array,Function],default:p("hideTriggers")},popperTriggers:{type:Array,default:p("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:p("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:p("popperHideTriggers")},container:{type:[String,Object,ne,Boolean],default:p("container")},boundary:{type:[String,ne],default:p("boundary")},strategy:{type:String,validator:e=>["absolute","fixed"].includes(e),default:p("strategy")},autoHide:{type:[Boolean,Function],default:p("autoHide")},handleResize:{type:Boolean,default:p("handleResize")},instantMove:{type:Boolean,default:p("instantMove")},eagerMount:{type:Boolean,default:p("eagerMount")},popperClass:{type:[String,Array,Object],default:p("popperClass")},computeTransformOrigin:{type:Boolean,default:p("computeTransformOrigin")},autoMinSize:{type:Boolean,default:p("autoMinSize")},autoSize:{type:[Boolean,String],default:p("autoSize")},autoMaxSize:{type:Boolean,default:p("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:p("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:p("preventOverflow")},overflowPadding:{type:[Number,String],default:p("overflowPadding")},arrowPadding:{type:[Number,String],default:p("arrowPadding")},arrowOverflow:{type:Boolean,default:p("arrowOverflow")},flip:{type:Boolean,default:p("flip")},shift:{type:Boolean,default:p("shift")},shiftCrossAxis:{type:Boolean,default:p("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:p("noAutoFocus")},disposeTimeout:{type:Number,default:p("disposeTimeout")}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join("_")}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[ee])==null?void 0:e.parentPopper},hasPopperShowTriggerHover(){var e,t;return((e=this.popperTriggers)==null?void 0:e.includes("hover"))||((t=this.popperShowTriggers)==null?void 0:t.includes("hover"))}},watch:{shown:"$_autoShowHide",disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:"$_refreshListeners",deep:!0},positioningDisabled:"$_refreshListeners",...["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((e,t)=>(e[t]="$_computePosition",e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:i=!1}={}){var o,s;(o=this.parentPopper)!=null&&o.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(i||!this.disabled)&&(((s=this.parentPopper)==null?void 0:s.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:e=null,skipDelay:t=!1}={}){var i;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}((i=this.parentPopper)==null?void 0:i.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var e;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=((e=this.referenceNode)==null?void 0:e.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(t=>t.nodeType===t.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(et({mainAxis:this.distance,crossAxis:this.skidding}));const t=this.placement.startsWith("auto");if(t?e.middleware.push(tt({alignment:this.placement.split("-")[1]??""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(it({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(ot({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(st({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:o,rects:s,middlewareData:n})=>{let r;const{centerOffset:a}=n.arrow;return o.startsWith("top")||o.startsWith("bottom")?r=Math.abs(a)>s.reference.width/2:r=Math.abs(a)>s.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){const o=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:s,placement:n,middlewareData:r})=>{var a;if((a=r.autoSize)!=null&&a.skip)return{};let l,d;return n.startsWith("top")||n.startsWith("bottom")?l=s.reference.width:d=s.reference.height,this.$_innerNode.style[o==="min"?"minWidth":o==="max"?"maxWidth":"width"]=l!=null?`${l}px`:null,this.$_innerNode.style[o==="min"?"minHeight":o==="max"?"maxHeight":"height"]=d!=null?`${d}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(nt({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:o,availableHeight:s})=>{this.$_innerNode.style.maxWidth=o!=null?`${o}px`:null,this.$_innerNode.style.maxHeight=s!=null?`${s}px`:null}})));const i=await dt(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:i.x,y:i.y,placement:i.placement,strategy:i.strategy,arrow:{...i.middlewareData.arrow,...i.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),z&&this.instantMove&&z.instantMove&&z!==this.parentPopper){z.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(z=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(e){const t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await J(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...G(this.$_referenceNode),...G(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const t=this.$_referenceNode.getBoundingClientRect(),i=this.$_popperNode.querySelector(".v-popper__wrapper"),o=i.parentNode.getBoundingClientRect(),s=t.x+t.width/2-(o.left+i.offsetLeft),n=t.y+t.height/2-(o.top+i.offsetTop);this.result.transformOrigin=`${s}px ${n}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const e=this.showGroup;if(e){let t;for(let i=0;i0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Te(w,this),w.length===0&&document.body.classList.remove("v-popper--some-open");for(const i of $e(this.theme)){const o=xe(i);Te(o,this),o.length===0&&document.body.classList.remove(`v-popper--some-open--${i}`)}z===this&&(z=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await J(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e=="string"?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw new Error("No container for popover: "+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const e=i=>{this.isShown&&!this.$_hideInProgress||(i.usedByTooltip=!0,!this.$_preventShow&&this.show({event:i}))};this.$_registerTriggerListeners(this.$_targetNodes,_e,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],_e,this.popperTriggers,this.popperShowTriggers,e);const t=i=>{i.usedByTooltip||this.hide({event:i})};this.$_registerTriggerListeners(this.$_targetNodes,be,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],be,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,i){this.$_events.push({targetNodes:e,eventType:t,handler:i}),e.forEach(o=>o.addEventListener(t,i,E?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,i,o,s){let n=i;o!=null&&(n=typeof o=="function"?o(n):o),n.forEach(r=>{const a=t[r];a&&this.$_registerEventListeners(e,a,s)})},$_removeEventListeners(e){const t=[];this.$_events.forEach(i=>{const{targetNodes:o,eventType:s,handler:n}=i;!e||e===s?o.forEach(r=>r.removeEventListener(s,n)):t.push(i)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(const i of this.$_targetNodes){const o=i.getAttribute(e);o&&(i.removeAttribute(e),i.setAttribute(t,o))}},$_applyAttrsToTarget(e){for(const t of this.$_targetNodes)for(const i in e){const o=e[i];o==null?t.removeAttribute(i):t.setAttribute(i,o)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){const e=this.$_referenceNode.getBoundingClientRect();if(L>=e.left&&L<=e.right&&M>=e.top&&M<=e.bottom){const t=this.$_popperNode.getBoundingClientRect(),i=L-S,o=M-x,s=t.left+t.width/2-S+(t.top+t.height/2)-x+t.width+t.height,n=S+i*s,r=x+o*s;return W(S,x,n,r,t.left,t.top,t.left,t.bottom)||W(S,x,n,r,t.left,t.top,t.right,t.top)||W(S,x,n,r,t.right,t.top,t.right,t.bottom)||W(S,x,n,r,t.left,t.bottom,t.right,t.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<"u"&&typeof window<"u"){if(De){const e=E?{passive:!0,capture:!0}:!0;document.addEventListener("touchstart",t=>Ce(t),e),document.addEventListener("touchend",t=>Pe(t,!0),e)}else window.addEventListener("mousedown",e=>Ce(e),!0),window.addEventListener("click",e=>Pe(e,!1),!0);window.addEventListener("resize",ft)}function Ce(e,t){for(let i=0;i=0;o--){const s=w[o];try{const n=s.containsGlobalTarget=s.mouseDownContains||s.popperNode().contains(e.target);s.pendingHide=!1,requestAnimationFrame(()=>{if(s.pendingHide=!1,!i[s.randomId]&&Ne(s,n,e)){if(s.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&n){let a=s.parentPopper;for(;a;)i[a.randomId]=!0,a=a.parentPopper;return}let r=s.parentPopper;for(;r&&Ne(r,r.containsGlobalTarget,e);)r.$_handleGlobalClose(e,t),r=r.parentPopper}})}catch{}}}function Ne(e,t,i){return i.closeAllPopover||i.closePopover&&t||ct(e,i)&&!t}function ct(e,t){if(typeof e.autoHide=="function"){const i=e.autoHide(t);return e.lastAutoHide=i,i}return e.autoHide}function ft(){for(let e=0;e{S=L,x=M,L=e.clientX,M=e.clientY},E?{passive:!0}:void 0);function W(e,t,i,o,s,n,r,a){const l=((r-s)*(t-n)-(a-n)*(e-s))/((a-n)*(i-e)-(r-s)*(o-t)),d=((i-e)*(t-n)-(o-t)*(e-s))/((a-n)*(i-e)-(r-s)*(o-t));return l>=0&&l<=1&&d>=0&&d<=1}const gt={extends:Ee()},pe=(e,t)=>{const i=e.__vccOpts||e;for(const[o,s]of t)i[o]=s;return i};function mt(e,t,i,o,s,n){return B(),ie("div",{ref:"reference",class:ze(["v-popper",{"v-popper--shown":e.slotData.isShown}])},[V(e.$slots,"default",Ze(Qe(e.slotData)))],2)}const wt=pe(gt,[["render",mt]]);function yt(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):-1}let j;function re(){re.init||(re.init=!0,j=yt()!==-1)}var K={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){re(),Ue(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",j&&this.$el.appendChild(e),e.data="about:blank",j||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!j&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const vt=Xe();je("data-v-b329ee4c");const $t={class:"resize-observer",tabindex:"-1"};Ve();const _t=vt((e,t,i,o,s,n)=>(B(),le("div",$t)));K.render=_t;K.__scopeId="data-v-b329ee4c";K.__file="src/components/ResizeObserver.vue";const Fe=(e="theme")=>({computed:{themeClass(){return pt(this[e])}}}),bt=U({name:"VPopperContent",components:{ResizeObserver:K},mixins:[Fe()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Tt=["id","aria-hidden","tabindex","data-popper-placement"],St={ref:"inner",class:"v-popper__inner"},xt=A("div",{class:"v-popper__arrow-outer"},null,-1),Ct=A("div",{class:"v-popper__arrow-inner"},null,-1),Pt=[xt,Ct];function Nt(e,t,i,o,s,n){const r=te("ResizeObserver");return B(),ie("div",{id:e.popperId,ref:"popover",class:ze(["v-popper__popper",[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:Z(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?"false":"true",tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||(t[2]=Ge(a=>e.autoHide&&e.$emit("hide"),["esc"]))},[A("div",{class:"v-popper__backdrop",onClick:t[0]||(t[0]=a=>e.autoHide&&e.$emit("hide"))}),A("div",{class:"v-popper__wrapper",style:Z(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[A("div",St,[e.mounted?(B(),ie(qe,{key:0},[A("div",null,[V(e.$slots,"default")]),e.handleResize?(B(),le(r,{key:0,onNotify:t[1]||(t[1]=a=>e.$emit("resize",a))})):ce("",!0)],64)):ce("",!0)],512),A("div",{ref:"arrow",class:"v-popper__arrow-container",style:Z(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Pt,4)],4)],46,Tt)}const Ie=pe(bt,[["render",Nt]]),We={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}};let ae=function(){};typeof window<"u"&&(ae=window.Element);const zt=U({name:"VPopperWrapper",components:{Popper:wt,PopperContent:Ie},mixins:[We,Fe("finalTheme")],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,ae,Boolean],default:void 0},boundary:{type:[String,ae],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function At(e,t,i,o,s,n){const r=te("PopperContent"),a=te("Popper");return B(),le(a,Ke({ref:"popper"},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||(t[0]=()=>e.$emit("show")),onHide:t[1]||(t[1]=()=>e.$emit("hide")),"onUpdate:shown":t[2]||(t[2]=l=>e.$emit("update:shown",l)),onApplyShow:t[3]||(t[3]=()=>e.$emit("apply-show")),onApplyHide:t[4]||(t[4]=()=>e.$emit("apply-hide")),onCloseGroup:t[5]||(t[5]=()=>e.$emit("close-group")),onCloseDirective:t[6]||(t[6]=()=>e.$emit("close-directive")),onAutoHide:t[7]||(t[7]=()=>e.$emit("auto-hide")),onResize:t[8]||(t[8]=()=>e.$emit("resize"))}),{default:fe(({popperId:l,isShown:d,shouldMountContent:c,skipTransition:h,autoHide:u,show:y,hide:v,handleResize:g,onResize:T,classes:f,result:$})=>[V(e.$slots,"default",{shown:d,show:y,hide:v}),Ye(r,{ref:"popperContent","popper-id":l,theme:e.finalTheme,shown:d,mounted:c,"skip-transition":h,"auto-hide":u,"handle-resize":g,classes:f,result:$,onHide:v,onResize:T},{default:fe(()=>[V(e.$slots,"popper",{shown:d,hide:v})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},16,["theme","target-nodes","popper-node","class"])}const he=pe(zt,[["render",At]]),Ht={...he,name:"VDropdown",vPopperTheme:"dropdown"};({...he});({...he});U({name:"VTooltipDirective",components:{Popper:Ee(),PopperContent:Ie},mixins:[We],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:e=>se(e.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>se(e.theme,"loadingContent")},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content=="function"&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const t=++this.$_fetchId,i=this.content(this);i.then?i.then(o=>this.onResult(t,o)):this.onResult(t,i)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}});const kt=Ht;export{kt as k}; diff --git a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BoWb4lIe.js b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BWViBS8t.js similarity index 93% rename from assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BoWb4lIe.js rename to assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BWViBS8t.js index 2a960434d3c9b98a870910ea0d916a47c3837063..a3f10aee5d748e8330fa0397174b7a76f2226008 100644 --- a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BoWb4lIe.js +++ b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BWViBS8t.js @@ -1 +1 @@ -import{d as B,K as ee,c as b,o as g,f as $,y as O,e as a,n as G,F as H,g as q,r as u,p as K,I as J,i as T,b as s,t as k,j as R,z as D,at as te,l as oe,S as ae,s as le,h as C,H as se,A as re,w as M,C as A,D as E,au as ie}from"./index-Bo-ykojl.js";import{b as ne,a as ue}from"./FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as de,g as ve}from"./speech-Br7XDY4_.js";import{u as ce}from"./providers-B3p38pBl.js";import{_ as pe,a as me}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as fe}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as ge,a as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";const he={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},_e=B({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(x){return(o,S)=>{const d=ee("motion");return g(),b(H,null,[$(o.$slots,"default"),O((g(),b("div",he,[a("div",{text:"60",class:G(x.providerIcon||x.providerIconColor)},null,2)])),[[d]])],64)}}}),xe={"w-full":"","rounded-xl":""},ye={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},ke={class:"inline-flex items-center gap-4"},Se={flex:"~ col gap-4"},Ue=["placeholder"],Ie=["placeholder"],we={flex:"~ col gap-6"},Ve={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},$e={class:"text-xs text-neutral-500 dark:text-neutral-400"},Le=["value"],Re={flex:"~ row","gap-4":""},Pe=["disabled"],Ce={flex:"~ row","items-center":"","gap-2":""},Me={flex:"~ row","items-center":"","gap-2":""},Oe={key:2,class:"mt-2 text-sm text-red-500"},ze={key:3,class:"mt-2 text-sm text-red-500"},Ke={key:4,class:"mt-2 text-sm text-red-500"},Be=["src"],at=B({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(x,{expose:o}){const S=x,{t:d}=q(),m=u(S.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),c=u(""),f=u(null),i=u(!1),h=u(""),p=u("");K(()=>S.availableVoices,n=>{var r;n.length>0&&!p.value&&(p.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function _(){if(!(!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value)){U.value=!0,c.value="";try{t.value&&w();const n=i.value?h.value:m.value,r=await S.generateSpeech(n,p.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{f.value&&f.value.play()},100)}catch(n){console.error("Error generating speech:",n),c.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function w(){f.value&&(f.value.pause(),f.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return J(()=>{t.value&&URL.revokeObjectURL(t.value)}),o({testText:m,ssmlText:h,useSSML:i,selectedVoice:p,isGenerating:U,audioUrl:t,errorMessage:c,audioPlayer:f,generateTestSpeech:_,stopTestAudio:w}),(n,r)=>(g(),b("div",xe,[a("h2",ye,[a("div",ke,[T(s(ne)),a("div",null,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),a("div",Se,[T(s(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=v=>i.value=v),label:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((g(),b("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=v=>h.value=v),placeholder:s(d)("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,Ie)),[[D,h.value]]):O((g(),b("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=v=>m.value=v),placeholder:s(d)("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,Ue)),[[D,m.value]]),a("div",we,[a("label",Ve,[a("div",null,[a("div",Te,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),a("div",$e,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(a("select",{"onUpdate:modelValue":r[3]||(r[3]=v=>p.value=v),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":""},[(g(!0),b(H,null,oe(x.availableVoices,v=>(g(),b("option",{key:v.id,value:v.id},k(v.name),9,Le))),128))],512),[[te,p.value]])])]),a("div",Re,[a("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:U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured,class:G({"opacity-50 cursor-not-allowed":U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:_},[a("div",Ce,[r[4]||(r[4]=a("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),a("span",null,k(U.value?s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Pe),t.value?(g(),b("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:w},[a("div",Me,[r[5]||(r[5]=a("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),a("span",null,k(s(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),x.apiKeyConfigured?R("",!0):(g(),b("div",Oe,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),p.value?R("",!0):(g(),b("div",ze,k(s(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),c.value?(g(),b("div",Ke,k(c.value),1)):R("",!0),t.value?(g(),b("audio",{key:5,ref_key:"audioPlayer",ref:f,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Be)):R("",!0)]),$(n.$slots,"default")]))}}),je={flex:"~ col md:row gap-6"},Fe={flex:"~ col gap-6"},Ne={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},De={flex:"~ col gap-4"},Ae={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ee={"w-full":"","rounded-xl":""},lt=B({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(x){const o=x,{t:S}=q(),d=ae(),m=ce(),U=de(),{providers:t}=le(m),c=C(()=>m.getProviderMetadata(o.providerId)),f=C({get:()=>{var e;return((e=t.value[o.providerId])==null?void 0:e.apiKey)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].apiKey=e}}),i=C({get:()=>{var e,l,y;return((e=t.value[o.providerId])==null?void 0:e.baseUrl)||((y=(l=c.value)==null?void 0:l.defaultOptions)==null?void 0:y.baseUrl)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].baseUrl=e}}),h=u("Hello! This is a test of voice synthesis."),p=u(!1),_=u(""),w=u(""),n=u(null),r=u(!1),v=u(""),j=u(""),I=u({});function Q(){var e;(e=t.value[o.providerId])!=null&&e.voiceSettings?I.value={...t.value[o.providerId].voiceSettings}:I.value={pitch:0,speed:1,volume:0,...o.additionalSettings}}se(()=>{var e,l,y,V;m.initializeProvider(o.providerId),f.value=((e=t.value[o.providerId])==null?void 0:e.apiKey)||"",i.value=((l=t.value[o.providerId])==null?void 0:l.baseUrl)||((V=(y=c.value)==null?void 0:y.defaultOptions)==null?void 0:V.baseUrl)||"",Q(),m.configuredProviders[o.providerId]&&U.loadVoicesForProvider(o.providerId)});const z=ie(()=>{var e,l;t.value[o.providerId]={...t.value[o.providerId],apiKey:f.value,baseUrl:i.value||((l=(e=c.value)==null?void 0:e.defaultOptions)==null?void 0:l.baseUrl)||"",voiceSettings:{...I.value}}},1e3);K([f,i],z),K(I,z,{deep:!0});async function W(){if(!h.value.trim()&&!r.value||r.value&&!v.value.trim())return;const e=m.getProviderInstance(o.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!j.value){console.error("No active speech voice selected");return}p.value=!0,w.value="";try{_.value&&F();const l=o.defaultModel||"default",y=r.value?v.value:h.value,V=await ve({...e.speech(l,{voiceSettings:I.value}),input:y,voice:j.value});_.value=URL.createObjectURL(new Blob([V])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(l){console.error("Error generating speech:",l),w.value=l instanceof Error?l.message:"An unknown error occurred"}finally{p.value=!1}}function F(){n.value&&(n.value.pause(),n.value.currentTime=0),_.value&&(URL.revokeObjectURL(_.value),_.value="")}J(()=>{_.value&&URL.revokeObjectURL(_.value)});function X(){var e,l;I.value={...((l=(e=c.value)==null?void 0:e.defaultOptions)==null?void 0:l.voiceSettings)||{}},z()}function Y(e,l){I.value[e]=l}const N=C(()=>({voiceSettings:I.value,updateVoiceSettings:Y,isGenerating:p.value,testText:h.value,useSSML:r.value,ssmlText:v.value,generateTestSpeech:W,stopTestAudio:F,audioUrl:_.value,audioPlayer:n.value,errorMessage:w.value}));return(e,l)=>{var y,V;return g(),re(_e,{"provider-name":(y=c.value)==null?void 0:y.localizedName,"provider-icon":(V=c.value)==null?void 0:V.icon,"on-back":()=>s(d).back()},{default:M(()=>[a("div",je,[T(s(ge),{class:"w-full md:w-[40%]"},{default:M(()=>[T(s(be),{title:s(S)("settings.pages.providers.common.section.basic.title"),description:s(S)("settings.pages.providers.common.section.basic.description"),"on-reset":X},{default:M(()=>{var L;return[T(s(fe),{modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=P=>f.value=P),"provider-name":(L=c.value)==null?void 0:L.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),$(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),a("div",Fe,[a("h2",Ne,k(s(S)("settings.pages.providers.common.section.voice.title")),1),a("div",De,[$(e.$slots,"voice-settings",A(E(N.value)))])]),T(s(pe),{title:s(S)("settings.pages.providers.common.section.advanced.title")},{default:M(()=>{var L,P;return[T(s(me),{modelValue:i.value,"onUpdate:modelValue":l[1]||(l[1]=Z=>i.value=Z),placeholder:((P=(L=c.value)==null?void 0:L.defaultOptions)==null?void 0:P.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),$(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),a("div",Ae,[a("div",Ee,[$(e.$slots,"playground",A(E(N.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{at as _,lt as a}; +import{d as B,K as ee,c as b,o as g,f as $,y as O,e as a,n as G,F as H,g as q,r as u,p as K,I as J,i as T,b as s,t as k,j as R,z as D,at as te,l as oe,S as ae,s as le,h as C,H as se,A as re,w as M,C as A,D as E,au as ie}from"./index-1_q7hlhr.js";import{b as ne,a as ue}from"./FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as de,g as ve}from"./speech-Bdg784LP.js";import{u as ce}from"./providers-BQORs1wj.js";import{_ as pe,a as me}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as fe}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as ge,a as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";const he={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},_e=B({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(x){return(o,S)=>{const d=ee("motion");return g(),b(H,null,[$(o.$slots,"default"),O((g(),b("div",he,[a("div",{text:"60",class:G(x.providerIcon||x.providerIconColor)},null,2)])),[[d]])],64)}}}),xe={"w-full":"","rounded-xl":""},ye={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},ke={class:"inline-flex items-center gap-4"},Se={flex:"~ col gap-4"},Ue=["placeholder"],Ie=["placeholder"],we={flex:"~ col gap-6"},Ve={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},$e={class:"text-xs text-neutral-500 dark:text-neutral-400"},Le=["value"],Re={flex:"~ row","gap-4":""},Pe=["disabled"],Ce={flex:"~ row","items-center":"","gap-2":""},Me={flex:"~ row","items-center":"","gap-2":""},Oe={key:2,class:"mt-2 text-sm text-red-500"},ze={key:3,class:"mt-2 text-sm text-red-500"},Ke={key:4,class:"mt-2 text-sm text-red-500"},Be=["src"],at=B({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(x,{expose:o}){const S=x,{t:d}=q(),m=u(S.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),c=u(""),f=u(null),i=u(!1),h=u(""),p=u("");K(()=>S.availableVoices,n=>{var r;n.length>0&&!p.value&&(p.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function _(){if(!(!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value)){U.value=!0,c.value="";try{t.value&&w();const n=i.value?h.value:m.value,r=await S.generateSpeech(n,p.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{f.value&&f.value.play()},100)}catch(n){console.error("Error generating speech:",n),c.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function w(){f.value&&(f.value.pause(),f.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return J(()=>{t.value&&URL.revokeObjectURL(t.value)}),o({testText:m,ssmlText:h,useSSML:i,selectedVoice:p,isGenerating:U,audioUrl:t,errorMessage:c,audioPlayer:f,generateTestSpeech:_,stopTestAudio:w}),(n,r)=>(g(),b("div",xe,[a("h2",ye,[a("div",ke,[T(s(ne)),a("div",null,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),a("div",Se,[T(s(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=v=>i.value=v),label:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((g(),b("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=v=>h.value=v),placeholder:s(d)("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,Ie)),[[D,h.value]]):O((g(),b("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=v=>m.value=v),placeholder:s(d)("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,Ue)),[[D,m.value]]),a("div",we,[a("label",Ve,[a("div",null,[a("div",Te,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),a("div",$e,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(a("select",{"onUpdate:modelValue":r[3]||(r[3]=v=>p.value=v),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":""},[(g(!0),b(H,null,oe(x.availableVoices,v=>(g(),b("option",{key:v.id,value:v.id},k(v.name),9,Le))),128))],512),[[te,p.value]])])]),a("div",Re,[a("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:U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured,class:G({"opacity-50 cursor-not-allowed":U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:_},[a("div",Ce,[r[4]||(r[4]=a("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),a("span",null,k(U.value?s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Pe),t.value?(g(),b("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:w},[a("div",Me,[r[5]||(r[5]=a("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),a("span",null,k(s(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),x.apiKeyConfigured?R("",!0):(g(),b("div",Oe,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),p.value?R("",!0):(g(),b("div",ze,k(s(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),c.value?(g(),b("div",Ke,k(c.value),1)):R("",!0),t.value?(g(),b("audio",{key:5,ref_key:"audioPlayer",ref:f,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Be)):R("",!0)]),$(n.$slots,"default")]))}}),je={flex:"~ col md:row gap-6"},Fe={flex:"~ col gap-6"},Ne={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},De={flex:"~ col gap-4"},Ae={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ee={"w-full":"","rounded-xl":""},lt=B({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(x){const o=x,{t:S}=q(),d=ae(),m=ce(),U=de(),{providers:t}=le(m),c=C(()=>m.getProviderMetadata(o.providerId)),f=C({get:()=>{var e;return((e=t.value[o.providerId])==null?void 0:e.apiKey)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].apiKey=e}}),i=C({get:()=>{var e,l,y;return((e=t.value[o.providerId])==null?void 0:e.baseUrl)||((y=(l=c.value)==null?void 0:l.defaultOptions)==null?void 0:y.baseUrl)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].baseUrl=e}}),h=u("Hello! This is a test of voice synthesis."),p=u(!1),_=u(""),w=u(""),n=u(null),r=u(!1),v=u(""),j=u(""),I=u({});function Q(){var e;(e=t.value[o.providerId])!=null&&e.voiceSettings?I.value={...t.value[o.providerId].voiceSettings}:I.value={pitch:0,speed:1,volume:0,...o.additionalSettings}}se(()=>{var e,l,y,V;m.initializeProvider(o.providerId),f.value=((e=t.value[o.providerId])==null?void 0:e.apiKey)||"",i.value=((l=t.value[o.providerId])==null?void 0:l.baseUrl)||((V=(y=c.value)==null?void 0:y.defaultOptions)==null?void 0:V.baseUrl)||"",Q(),m.configuredProviders[o.providerId]&&U.loadVoicesForProvider(o.providerId)});const z=ie(()=>{var e,l;t.value[o.providerId]={...t.value[o.providerId],apiKey:f.value,baseUrl:i.value||((l=(e=c.value)==null?void 0:e.defaultOptions)==null?void 0:l.baseUrl)||"",voiceSettings:{...I.value}}},1e3);K([f,i],z),K(I,z,{deep:!0});async function W(){if(!h.value.trim()&&!r.value||r.value&&!v.value.trim())return;const e=m.getProviderInstance(o.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!j.value){console.error("No active speech voice selected");return}p.value=!0,w.value="";try{_.value&&F();const l=o.defaultModel||"default",y=r.value?v.value:h.value,V=await ve({...e.speech(l,{voiceSettings:I.value}),input:y,voice:j.value});_.value=URL.createObjectURL(new Blob([V])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(l){console.error("Error generating speech:",l),w.value=l instanceof Error?l.message:"An unknown error occurred"}finally{p.value=!1}}function F(){n.value&&(n.value.pause(),n.value.currentTime=0),_.value&&(URL.revokeObjectURL(_.value),_.value="")}J(()=>{_.value&&URL.revokeObjectURL(_.value)});function X(){var e,l;I.value={...((l=(e=c.value)==null?void 0:e.defaultOptions)==null?void 0:l.voiceSettings)||{}},z()}function Y(e,l){I.value[e]=l}const N=C(()=>({voiceSettings:I.value,updateVoiceSettings:Y,isGenerating:p.value,testText:h.value,useSSML:r.value,ssmlText:v.value,generateTestSpeech:W,stopTestAudio:F,audioUrl:_.value,audioPlayer:n.value,errorMessage:w.value}));return(e,l)=>{var y,V;return g(),re(_e,{"provider-name":(y=c.value)==null?void 0:y.localizedName,"provider-icon":(V=c.value)==null?void 0:V.icon,"on-back":()=>s(d).back()},{default:M(()=>[a("div",je,[T(s(ge),{class:"w-full md:w-[40%]"},{default:M(()=>[T(s(be),{title:s(S)("settings.pages.providers.common.section.basic.title"),description:s(S)("settings.pages.providers.common.section.basic.description"),"on-reset":X},{default:M(()=>{var L;return[T(s(fe),{modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=P=>f.value=P),"provider-name":(L=c.value)==null?void 0:L.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),$(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),a("div",Fe,[a("h2",Ne,k(s(S)("settings.pages.providers.common.section.voice.title")),1),a("div",De,[$(e.$slots,"voice-settings",A(E(N.value)))])]),T(s(pe),{title:s(S)("settings.pages.providers.common.section.advanced.title")},{default:M(()=>{var L,P;return[T(s(me),{modelValue:i.value,"onUpdate:modelValue":l[1]||(l[1]=Z=>i.value=Z),placeholder:((P=(L=c.value)==null?void 0:L.defaultOptions)==null?void 0:P.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),$(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),a("div",Ae,[a("div",Ee,[$(e.$slots,"playground",A(E(N.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{at as _,lt as a}; diff --git a/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js b/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js deleted file mode 100644 index 4ae1f0b8b2b2d1bef34a21f9e6840fa698da9f72..0000000000000000000000000000000000000000 --- a/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js +++ /dev/null @@ -1,611 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-ClwjvsoD.js","assets/index-Bo-ykojl.js","assets/index-C3aYAgU8.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 Rw=Object.defineProperty;var Nw=(r,t,e)=>t in r?Rw(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var j=(r,t,e)=>Nw(r,typeof t!="symbol"?t+"":t,e);import{bJ as Vu,d2 as di,cY as Pw,L as nn}from"./index-Bo-ykojl.js";/*! - * @pixi/constants - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/constants is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var Ui;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(Ui||(Ui={}));var Po;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Po||(Po={}));var Ya;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(Ya||(Ya={}));var qt;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(qt||(qt={}));var Lo;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(Lo||(Lo={}));var wt;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(wt||(wt={}));var Yn;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Yn||(Yn={}));var le;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(le||(le={}));var Xa;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(Xa||(Xa={}));var fi;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(fi||(fi={}));var qa;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(qa||(qa={}));var an;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(an||(an={}));var un;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(un||(un={}));var tn;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(tn||(tn={}));var Qa;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(Qa||(Qa={}));var Ir;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Ir||(Ir={}));var ze;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})(ze||(ze={}));var cd;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(cd||(cd={}));var Pe;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(Pe||(Pe={}));var mi;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(mi||(mi={}));/*! - * @pixi/settings - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/settings is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var Lw={createCanvas:function(r,t){var e=document.createElement("canvas");return e.width=r,e.height=t,e},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,t){return fetch(r,t)}},ll=/iPhone/i,hd=/iPod/i,dd=/iPad/i,fd=/\biOS-universal(?:.+)Mac\b/i,cl=/\bAndroid(?:.+)Mobile\b/i,pd=/Android/i,ls=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,fa=/Silk/i,xi=/Windows Phone/i,md=/\bWindows(?:.+)ARM\b/i,yd=/BlackBerry/i,gd=/BB10/i,vd=/Opera Mini/i,_d=/\b(CriOS|Chrome)(?:.+)Mobile/i,bd=/Mobile(?:.+)Firefox\b/i,wd=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function Bw(r){return function(t){return t.test(r)}}function Uw(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var n=Bw(e),s={apple:{phone:n(ll)&&!n(xi),ipod:n(hd),tablet:!n(ll)&&(n(dd)||wd(t))&&!n(xi),universal:n(fd),device:(n(ll)||n(hd)||n(dd)||n(fd)||wd(t))&&!n(xi)},amazon:{phone:n(ls),tablet:!n(ls)&&n(fa),device:n(ls)||n(fa)},android:{phone:!n(xi)&&n(ls)||!n(xi)&&n(cl),tablet:!n(xi)&&!n(ls)&&!n(cl)&&(n(fa)||n(pd)),device:!n(xi)&&(n(ls)||n(fa)||n(cl)||n(pd))||n(/\bokhttp\b/i)},windows:{phone:n(xi),tablet:n(md),device:n(xi)||n(md)},other:{blackberry:n(yd),blackberry10:n(gd),opera:n(vd),firefox:n(bd),chrome:n(_d),device:n(yd)||n(gd)||n(vd)||n(bd)||n(_d)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}var Gn=Uw(globalThis.navigator);function kw(){return!Gn.apple.device}function zw(r){var t=!0;if(Gn.tablet||Gn.phone){if(Gn.apple.device){var e=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(e){var i=parseInt(e[1],10);i<11&&(t=!1)}}if(Gn.android.device){var e=navigator.userAgent.match(/Android\s([0-9.]*)/);if(e){var i=parseInt(e[1],10);i<7&&(t=!1)}}}return t?r:4}var Ft={ADAPTER:Lw,MIPMAP_TEXTURES:an.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:Pe.NONE,SPRITE_MAX_TEXTURES:zw(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:Qa.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:qa.CLAMP,SCALE_MODE:fi.LINEAR,PRECISION_VERTEX:Ir.HIGH,PRECISION_FRAGMENT:Gn.apple.device?Ir.HIGH:Ir.MEDIUM,CAN_UPLOAD_SAME_BUFFER:kw(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},hl={exports:{}},Sd;function $w(){return Sd||(Sd=1,function(r){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function n(u,l,c){this.fn=u,this.context=l,this.once=c||!1}function s(u,l,c,h,p){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new n(c,h||u,p),g=e?e+l:l;return u._events[g]?u._events[g].fn?u._events[g]=[u._events[g],d]:u._events[g].push(d):(u._events[g]=d,u._eventsCount++),u}function o(u,l){--u._eventsCount===0?u._events=new i:delete u._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,h;if(this._eventsCount===0)return l;for(h in c=this._events)t.call(c,h)&&l.push(e?h.slice(1):h);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,d=h.length,g=new Array(d);p80*R){V=J=D[0],et=yt=D[1];for(var gt=R;gtJ&&(J=vt),ft>yt&&(yt=ft);_t=Math.max(J-V,yt-et),_t=_t!==0?32767/_t:0}return i(A,O,R,V,et,_t,0),O}function t(D,C,R,k,U){var A,O;if(U===it(D,C,R,k)>0)for(A=C;A=C;A-=k)O=x(A,D[A],D[A+1],O);return O&&E(O,O.next)&&(Z(O),O=O.next),O}function e(D,C){if(!D)return D;C||(C=D);var R=D,k;do if(k=!1,!R.steiner&&(E(R,R.next)||I(R.prev,R,R.next)===0)){if(Z(R),R=C=R.prev,R===R.next)break;k=!0}else R=R.next;while(k||R!==C);return C}function i(D,C,R,k,U,A,O){if(D){!O&&A&&d(D,k,U,A);for(var V=D,et,J;D.prev!==D.next;){if(et=D.prev,J=D.next,A?s(D,k,U,A):n(D)){C.push(et.i/R|0),C.push(D.i/R|0),C.push(J.i/R|0),Z(D),D=J.next,V=J.next;continue}if(D=J,D===V){O?O===1?(D=o(e(D),C,R),i(D,C,R,k,U,A,2)):O===2&&a(D,C,R,k,U,A):i(e(D),C,R,k,U,A,1);break}}}}function n(D){var C=D.prev,R=D,k=D.next;if(I(C,R,k)>=0)return!1;for(var U=C.x,A=R.x,O=k.x,V=C.y,et=R.y,J=k.y,yt=UA?U>O?U:O:A>O?A:O,_t=V>et?V>J?V:J:et>J?et:J,gt=k.next;gt!==C;){if(gt.x>=yt&>.x<=ft&>.y>=vt&>.y<=_t&&m(U,V,A,et,O,J,gt.x,gt.y)&&I(gt.prev,gt,gt.next)>=0)return!1;gt=gt.next}return!0}function s(D,C,R,k){var U=D.prev,A=D,O=D.next;if(I(U,A,O)>=0)return!1;for(var V=U.x,et=A.x,J=O.x,yt=U.y,vt=A.y,ft=O.y,_t=Vet?V>J?V:J:et>J?et:J,ee=yt>vt?yt>ft?yt:ft:vt>ft?vt:ft,ce=y(_t,gt,C,R,k),v=y(Et,ee,C,R,k),K=D.prevZ,q=D.nextZ;K&&K.z>=ce&&q&&q.z<=v;){if(K.x>=_t&&K.x<=Et&&K.y>=gt&&K.y<=ee&&K!==U&&K!==O&&m(V,yt,et,vt,J,ft,K.x,K.y)&&I(K.prev,K,K.next)>=0||(K=K.prevZ,q.x>=_t&&q.x<=Et&&q.y>=gt&&q.y<=ee&&q!==U&&q!==O&&m(V,yt,et,vt,J,ft,q.x,q.y)&&I(q.prev,q,q.next)>=0))return!1;q=q.nextZ}for(;K&&K.z>=ce;){if(K.x>=_t&&K.x<=Et&&K.y>=gt&&K.y<=ee&&K!==U&&K!==O&&m(V,yt,et,vt,J,ft,K.x,K.y)&&I(K.prev,K,K.next)>=0)return!1;K=K.prevZ}for(;q&&q.z<=v;){if(q.x>=_t&&q.x<=Et&&q.y>=gt&&q.y<=ee&&q!==U&&q!==O&&m(V,yt,et,vt,J,ft,q.x,q.y)&&I(q.prev,q,q.next)>=0)return!1;q=q.nextZ}return!0}function o(D,C,R){var k=D;do{var U=k.prev,A=k.next.next;!E(U,A)&&b(U,k,k.next,A)&&B(U,A)&&B(A,U)&&(C.push(U.i/R|0),C.push(k.i/R|0),C.push(A.i/R|0),Z(k),Z(k.next),k=D=A),k=k.next}while(k!==D);return e(k)}function a(D,C,R,k,U,A){var O=D;do{for(var V=O.next.next;V!==O.prev;){if(O.i!==V.i&&_(O,V)){var et=st(O,V);O=e(O,O.next),et=e(et,et.next),i(O,C,R,k,U,A,0),i(et,C,R,k,U,A,0);return}V=V.next}O=O.next}while(O!==D)}function u(D,C,R,k){var U=[],A,O,V,et,J;for(A=0,O=C.length;A=R.next.y&&R.next.y!==R.y){var V=R.x+(U-R.y)*(R.next.x-R.x)/(R.next.y-R.y);if(V<=k&&V>A&&(A=V,O=R.x=R.x&&R.x>=J&&k!==R.x&&m(UO.x||R.x===O.x&&p(O,R)))&&(O=R,vt=ft)),R=R.next;while(R!==et);return O}function p(D,C){return I(D.prev,D,C.prev)<0&&I(C.next,D,D.next)<0}function d(D,C,R,k){var U=D;do U.z===0&&(U.z=y(U.x,U.y,C,R,k)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==D);U.prevZ.nextZ=null,U.prevZ=null,g(U)}function g(D){var C,R,k,U,A,O,V,et,J=1;do{for(R=D,D=null,A=null,O=0;R;){for(O++,k=R,V=0,C=0;C0||et>0&&k;)V!==0&&(et===0||!k||R.z<=k.z)?(U=R,R=R.nextZ,V--):(U=k,k=k.nextZ,et--),A?A.nextZ=U:D=U,U.prevZ=A,A=U;R=k}A.nextZ=null,J*=2}while(O>1);return D}function y(D,C,R,k,U){return D=(D-R)*U|0,C=(C-k)*U|0,D=(D|D<<8)&16711935,D=(D|D<<4)&252645135,D=(D|D<<2)&858993459,D=(D|D<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,D|C<<1}function f(D){var C=D,R=D;do(C.x=(D-O)*(A-V)&&(D-O)*(k-V)>=(R-O)*(C-V)&&(R-O)*(A-V)>=(U-O)*(k-V)}function _(D,C){return D.next.i!==C.i&&D.prev.i!==C.i&&!z(D,C)&&(B(D,C)&&B(C,D)&&tt(D,C)&&(I(D.prev,D,C.prev)||I(D,C.prev,C))||E(D,C)&&I(D.prev,D,D.next)>0&&I(C.prev,C,C.next)>0)}function I(D,C,R){return(C.y-D.y)*(R.x-C.x)-(C.x-D.x)*(R.y-C.y)}function E(D,C){return D.x===C.x&&D.y===C.y}function b(D,C,R,k){var U=S(I(D,C,R)),A=S(I(D,C,k)),O=S(I(R,k,D)),V=S(I(R,k,C));return!!(U!==A&&O!==V||U===0&&F(D,R,C)||A===0&&F(D,k,C)||O===0&&F(R,D,k)||V===0&&F(R,C,k))}function F(D,C,R){return C.x<=Math.max(D.x,R.x)&&C.x>=Math.min(D.x,R.x)&&C.y<=Math.max(D.y,R.y)&&C.y>=Math.min(D.y,R.y)}function S(D){return D>0?1:D<0?-1:0}function z(D,C){var R=D;do{if(R.i!==D.i&&R.next.i!==D.i&&R.i!==C.i&&R.next.i!==C.i&&b(R,R.next,D,C))return!0;R=R.next}while(R!==D);return!1}function B(D,C){return I(D.prev,D,D.next)<0?I(D,C,D.next)>=0&&I(D,D.prev,C)>=0:I(D,C,D.prev)<0||I(D,D.next,C)<0}function tt(D,C){var R=D,k=!1,U=(D.x+C.x)/2,A=(D.y+C.y)/2;do R.y>A!=R.next.y>A&&R.next.y!==R.y&&U<(R.next.x-R.x)*(A-R.y)/(R.next.y-R.y)+R.x&&(k=!k),R=R.next;while(R!==D);return k}function st(D,C){var R=new w(D.i,D.x,D.y),k=new w(C.i,C.x,C.y),U=D.next,A=C.prev;return D.next=C,C.prev=D,R.next=U,U.prev=R,k.next=R,R.prev=k,A.next=k,k.prev=A,k}function x(D,C,R,k){var U=new w(D,C,R);return k?(U.next=k.next,U.prev=k,k.next.prev=U,k.next=U):(U.prev=U,U.next=U),U}function Z(D){D.next.prev=D.prev,D.prev.next=D.next,D.prevZ&&(D.prevZ.nextZ=D.nextZ),D.nextZ&&(D.nextZ.prevZ=D.prevZ)}function w(D,C,R){this.i=D,this.x=C,this.y=R,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}r.deviation=function(D,C,R,k){var U=C&&C.length,A=U?C[0]*R:D.length,O=Math.abs(it(D,0,A,R));if(U)for(var V=0,et=C.length;V0&&(k+=D[U-1].length,R.holes.push(k))}return R},pa.exports}var Gw=Vw();const RD=Vu(Gw);var Tn={},fo={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Ww=fo.exports,Td;function Hw(){return Td||(Td=1,function(r,t){(function(e){var i=t&&!t.nodeType&&t,n=r&&!r.nodeType&&r,s=typeof di=="object"&&di;(s.global===s||s.window===s||s.self===s)&&(e=s);var o,a=2147483647,u=36,l=1,c=26,h=38,p=700,d=72,g=128,y="-",f=/^xn--/,m=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=u-l,b=Math.floor,F=String.fromCharCode,S;function z(U){throw new RangeError(I[U])}function B(U,A){for(var O=U.length,V=[];O--;)V[O]=A(U[O]);return V}function tt(U,A){var O=U.split("@"),V="";O.length>1&&(V=O[0]+"@",U=O[1]),U=U.replace(_,".");var et=U.split("."),J=B(et,A).join(".");return V+J}function st(U){for(var A=[],O=0,V=U.length,et,J;O=55296&&et<=56319&&O65535&&(A-=65536,O+=F(A>>>10&1023|55296),A=56320|A&1023),O+=F(A),O}).join("")}function Z(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:u}function w(U,A){return U+22+75*(U<26)-((A!=0)<<5)}function it(U,A,O){var V=0;for(U=O?b(U/p):U>>1,U+=b(U/A);U>E*c>>1;V+=u)U=b(U/E);return b(V+(E+1)*U/(U+h))}function D(U){var A=[],O=U.length,V,et=0,J=g,yt=d,vt,ft,_t,gt,Et,ee,ce,v,K;for(vt=U.lastIndexOf(y),vt<0&&(vt=0),ft=0;ft=128&&z("not-basic"),A.push(U.charCodeAt(ft));for(_t=vt>0?vt+1:0;_t=O&&z("invalid-input"),ce=Z(U.charCodeAt(_t++)),(ce>=u||ce>b((a-et)/Et))&&z("overflow"),et+=ce*Et,v=ee<=yt?l:ee>=yt+c?c:ee-yt,!(ceb(a/K)&&z("overflow"),Et*=K;V=A.length+1,yt=it(et-gt,V,gt==0),b(et/V)>a-J&&z("overflow"),J+=b(et/V),et%=V,A.splice(et++,0,J)}return x(A)}function C(U){var A,O,V,et,J,yt,vt,ft,_t,gt,Et,ee=[],ce,v,K,q;for(U=st(U),ce=U.length,A=g,O=0,J=d,yt=0;yt=A&&Etb((a-O)/v)&&z("overflow"),O+=(vt-A)*v,A=vt,yt=0;yta&&z("overflow"),Et==A){for(ft=O,_t=u;gt=_t<=J?l:_t>=J+c?c:_t-J,!(ft{if(l&&(typeof l=="object"||typeof l=="function")){if(i)return i.get(l)}else if(n)return n.get(l)},o=(l,c)=>{l&&(typeof l=="object"||typeof l=="function")?(i||(i=new WeakMap),i.set(l,c)):(n||(n=new Map),n.set(l,c))},a=l=>{if(l&&(typeof l=="object"||typeof l=="function")){if(i)return i.has(l)}else if(n)return n.has(l);return!1};return{get:s,set:o,has:a,assert:l=>{if(!a(l))throw new TypeError("Side channel does not contain the given key")}}}t.default=e,(typeof t.default=="object"&&t.default!==null||typeof t.default=="function")&&(Object.assign(t.default,t),r.exports=t.default)}(ma,ma.exports)),ma.exports}var dl,Ed;function Xc(){if(Ed)return dl;Ed=1;var r=String.prototype.replace,t=/%20/g,e={RFC1738:"RFC1738",RFC3986:"RFC3986"};return dl={default:e.RFC3986,formatters:{RFC1738:function(i){return r.call(i,t,"+")},RFC3986:function(i){return String(i)}},RFC1738:e.RFC1738,RFC3986:e.RFC3986},dl}var fl,Ad;function Hy(){if(Ad)return fl;Ad=1;var r=Xc(),t=Object.prototype.hasOwnProperty,e=Array.isArray,i=function(){for(var f=[],m=0;m<256;++m)f.push("%"+((m<16?"0":"")+m.toString(16)).toUpperCase());return f}(),n=function(m){for(;m.length>1;){var _=m.pop(),I=_.obj[_.prop];if(e(I)){for(var E=[],b=0;b=l?F.slice(z,z+l):F,tt=[],st=0;st=48&&x<=57||x>=65&&x<=90||x>=97&&x<=122||b===r.RFC1738&&(x===40||x===41)){tt[tt.length]=B.charAt(st);continue}if(x<128){tt[tt.length]=i[x];continue}if(x<2048){tt[tt.length]=i[192|x>>6]+i[128|x&63];continue}if(x<55296||x>=57344){tt[tt.length]=i[224|x>>12]+i[128|x>>6&63]+i[128|x&63];continue}st+=1,x=65536+((x&1023)<<10|B.charCodeAt(st)&1023),tt[tt.length]=i[240|x>>18]+i[128|x>>12&63]+i[128|x>>6&63]+i[128|x&63]}S+=tt.join("")}return S},h=function(m){for(var _=[{obj:{o:m},prop:"o"}],I=[],E=0;E<_.length;++E)for(var b=_[E],F=b.obj[b.prop],S=Object.keys(F),z=0;z"u"&&(U=0)}if(typeof B=="function"?R=B(m,R):R instanceof Date?R=x(R):_==="comma"&&s(R)&&(R=t.maybeMap(R,function(K){return K instanceof Date?x(K):K})),R===null){if(b)return z&&!it?z(m,c.encoder,D,"key",Z):m;R=""}if(h(R)||t.isBuffer(R)){if(z){var V=it?m:z(m,c.encoder,D,"key",Z);return[w(V)+"="+w(z(R,c.encoder,D,"value",Z))]}return[w(m)+"="+w(String(R))]}var et=[];if(typeof R>"u")return et;var J;if(_==="comma"&&s(R))it&&z&&(R=t.maybeMap(R,z)),J=[{value:R.length>0?R.join(",")||null:void 0}];else if(s(B))J=B;else{var yt=Object.keys(R);J=tt?yt.sort(tt):yt}var vt=S?String(m).replace(/\./g,"%2E"):String(m),ft=I&&s(R)&&R.length===1?vt+"[]":vt;if(E&&s(R)&&R.length===0)return ft+"[]";for(var _t=0;_t"u"?f.encodeDotInKeys===!0?!0:c.allowDots:!!f.allowDots;return{addQueryPrefix:typeof f.addQueryPrefix=="boolean"?f.addQueryPrefix:c.addQueryPrefix,allowDots:F,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:b,charset:m,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!f.commaRoundTrip,delimiter:typeof f.delimiter>"u"?c.delimiter:f.delimiter,encode:typeof f.encode=="boolean"?f.encode:c.encode,encodeDotInKeys:typeof f.encodeDotInKeys=="boolean"?f.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof f.encoder=="function"?f.encoder:c.encoder,encodeValuesOnly:typeof f.encodeValuesOnly=="boolean"?f.encodeValuesOnly:c.encodeValuesOnly,filter:E,format:_,formatter:I,serializeDate:typeof f.serializeDate=="function"?f.serializeDate:c.serializeDate,skipNulls:typeof f.skipNulls=="boolean"?f.skipNulls:c.skipNulls,sort:typeof f.sort=="function"?f.sort:null,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:c.strictNullHandling}};return pl=function(y,f){var m=y,_=g(f),I,E;typeof _.filter=="function"?(E=_.filter,m=E("",m)):s(_.filter)&&(E=_.filter,I=E);var b=[];if(typeof m!="object"||m===null)return"";var F=n[_.arrayFormat],S=F==="comma"&&_.commaRoundTrip;I||(I=Object.keys(m)),_.sort&&I.sort(_.sort);for(var z=r(),B=0;B0?Z+x:""},pl}var ml,Cd;function qw(){if(Cd)return ml;Cd=1;var r=Hy(),t=Object.prototype.hasOwnProperty,e=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},n=function(p){return p.replace(/&#(\d+);/g,function(d,g){return String.fromCharCode(parseInt(g,10))})},s=function(p,d,g){if(p&&typeof p=="string"&&d.comma&&p.indexOf(",")>-1)return p.split(",");if(d.throwOnLimitExceeded&&g>=d.arrayLimit)throw new RangeError("Array limit exceeded. Only "+d.arrayLimit+" element"+(d.arrayLimit===1?"":"s")+" allowed in an array.");return p},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",u=function(d,g){var y={__proto__:null},f=g.ignoreQueryPrefix?d.replace(/^\?/,""):d;f=f.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=g.parameterLimit===1/0?void 0:g.parameterLimit,_=f.split(g.delimiter,g.throwOnLimitExceeded?m+1:m);if(g.throwOnLimitExceeded&&_.length>m)throw new RangeError("Parameter limit exceeded. Only "+m+" parameter"+(m===1?"":"s")+" allowed.");var I=-1,E,b=g.charset;if(g.charsetSentinel)for(E=0;E<_.length;++E)_[E].indexOf("utf8=")===0&&(_[E]===a?b="utf-8":_[E]===o&&(b="iso-8859-1"),I=E,E=_.length);for(E=0;E<_.length;++E)if(E!==I){var F=_[E],S=F.indexOf("]="),z=S===-1?F.indexOf("="):S+1,B,tt;z===-1?(B=g.decoder(F,i.decoder,b,"key"),tt=g.strictNullHandling?null:""):(B=g.decoder(F.slice(0,z),i.decoder,b,"key"),tt=r.maybeMap(s(F.slice(z+1),g,e(y[B])?y[B].length:0),function(x){return g.decoder(x,i.decoder,b,"value")})),tt&&g.interpretNumericEntities&&b==="iso-8859-1"&&(tt=n(String(tt))),F.indexOf("[]=")>-1&&(tt=e(tt)?[tt]:tt);var st=t.call(y,B);st&&g.duplicates==="combine"?y[B]=r.combine(y[B],tt):(!st||g.duplicates==="last")&&(y[B]=tt)}return y},l=function(p,d,g,y){var f=0;if(p.length>0&&p[p.length-1]==="[]"){var m=p.slice(0,-1).join("");f=Array.isArray(d)&&d[m]?d[m].length:0}for(var _=y?d:s(d,g,f),I=p.length-1;I>=0;--I){var E,b=p[I];if(b==="[]"&&g.parseArrays)E=g.allowEmptyArrays&&(_===""||g.strictNullHandling&&_===null)?[]:r.combine([],_);else{E=g.plainObjects?{__proto__:null}:{};var F=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,S=g.decodeDotInKeys?F.replace(/%2E/g,"."):F,z=parseInt(S,10);!g.parseArrays&&S===""?E={0:_}:!isNaN(z)&&b!==S&&String(z)===S&&z>=0&&g.parseArrays&&z<=g.arrayLimit?(E=[],E[z]=_):S!=="__proto__"&&(E[S]=_)}_=E}return _},c=function(d,g,y,f){if(d){var m=y.allowDots?d.replace(/\.([^.[]+)/g,"[$1]"):d,_=/(\[[^[\]]*])/,I=/(\[[^[\]]*])/g,E=y.depth>0&&_.exec(m),b=E?m.slice(0,E.index):m,F=[];if(b){if(!y.plainObjects&&t.call(Object.prototype,b)&&!y.allowPrototypes)return;F.push(b)}for(var S=0;y.depth>0&&(E=I.exec(m))!==null&&S"u"?i.charset:d.charset,y=typeof d.duplicates>"u"?i.duplicates:d.duplicates;if(y!=="combine"&&y!=="first"&&y!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var f=typeof d.allowDots>"u"?d.decodeDotInKeys===!0?!0:i.allowDots:!!d.allowDots;return{allowDots:f,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof d.allowPrototypes=="boolean"?d.allowPrototypes:i.allowPrototypes,allowSparse:typeof d.allowSparse=="boolean"?d.allowSparse:i.allowSparse,arrayLimit:typeof d.arrayLimit=="number"?d.arrayLimit:i.arrayLimit,charset:g,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:i.charsetSentinel,comma:typeof d.comma=="boolean"?d.comma:i.comma,decodeDotInKeys:typeof d.decodeDotInKeys=="boolean"?d.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof d.decoder=="function"?d.decoder:i.decoder,delimiter:typeof d.delimiter=="string"||r.isRegExp(d.delimiter)?d.delimiter:i.delimiter,depth:typeof d.depth=="number"||d.depth===!1?+d.depth:i.depth,duplicates:y,ignoreQueryPrefix:d.ignoreQueryPrefix===!0,interpretNumericEntities:typeof d.interpretNumericEntities=="boolean"?d.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof d.parameterLimit=="number"?d.parameterLimit:i.parameterLimit,parseArrays:d.parseArrays!==!1,plainObjects:typeof d.plainObjects=="boolean"?d.plainObjects:i.plainObjects,strictDepth:typeof d.strictDepth=="boolean"?!!d.strictDepth:i.strictDepth,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof d.throwOnLimitExceeded=="boolean"?d.throwOnLimitExceeded:!1}};return ml=function(p,d){var g=h(d);if(p===""||p===null||typeof p>"u")return g.plainObjects?{__proto__:null}:{};for(var y=typeof p=="string"?u(p,g):p,f=g.plainObjects?{__proto__:null}:{},m=Object.keys(y),_=0;_",'"',"`"," ","\r",` -`," "],o=["{","}","|","\\","^","`"].concat(s),a=["'"].concat(o),u=["%","/","?",";","#"].concat(a),l=["/","?","#"],c=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},f=Qw();function m(b,F,S){if(b&&typeof b=="object"&&b instanceof t)return b;var z=new t;return z.parse(b,F,S),z}t.prototype.parse=function(b,F,S){if(typeof b!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof b);var z=b.indexOf("?"),B=z!==-1&&z127?yt+="x":yt+=J[vt];if(!yt.match(h)){var _t=V.slice(0,R),gt=V.slice(R+1),Et=J.match(p);Et&&(_t.push(Et[1]),gt.unshift(Et[2])),gt.length&&(x="/"+gt.join(".")+x),this.hostname=_t.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var ee=this.port?":"+this.port:"",ce=this.hostname||"";this.host=ce+ee,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),x[0]!=="/"&&(x="/"+x))}if(!d[it])for(var R=0,et=a.length;R0?S.host.split("@"):!1;yt&&(S.auth=yt.shift(),S.hostname=yt.shift(),S.host=S.hostname)}return S.search=b.search,S.query=b.query,(S.pathname!==null||S.search!==null)&&(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.href=S.format(),S}if(!V.length)return S.pathname=null,S.search?S.path="/"+S.search:S.path=null,S.href=S.format(),S;for(var vt=V.slice(-1)[0],ft=(S.host||b.host||V.length>1)&&(vt==="."||vt==="..")||vt==="",_t=0,gt=V.length;gt>=0;gt--)vt=V[gt],vt==="."?V.splice(gt,1):vt===".."?(V.splice(gt,1),_t++):_t&&(V.splice(gt,1),_t--);if(!A&&!O)for(;_t--;_t)V.unshift("..");A&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),ft&&V.join("/").substr(-1)!=="/"&&V.push("");var Et=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(J){S.hostname=Et?"":V.length?V.shift():"",S.host=S.hostname;var yt=S.host&&S.host.indexOf("@")>0?S.host.split("@"):!1;yt&&(S.auth=yt.shift(),S.hostname=yt.shift(),S.host=S.hostname)}return A=A||S.host&&V.length,A&&!Et&&V.unshift(""),V.length>0?S.pathname=V.join("/"):(S.pathname=null,S.path=null),(S.pathname!==null||S.search!==null)&&(S.path=(S.pathname?S.pathname:"")+(S.search?S.search:"")),S.auth=b.auth||S.auth,S.slashes=S.slashes||b.slashes,S.href=S.format(),S},t.prototype.parseHost=function(){var b=this.host,F=i.exec(b);F&&(F=F[0],F!==":"&&(this.port=F.substr(1)),b=b.substr(0,b.length-F.length)),b&&(this.hostname=b)},Tn.parse=m,Tn.resolve=I,Tn.resolveObject=E,Tn.format=_,Tn.Url=t,Tn}var gl=Kw();/*! - * @pixi/utils - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/utils is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var Gu={parse:gl.parse,format:gl.format,resolve:gl.resolve};Ft.RETINA_PREFIX=/@([0-9\.]+)x/;Ft.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Dd=!1,Rd="6.5.10";function Zw(r){var t;if(!Dd){if(Ft.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var e=[` - %c %c %c PixiJS `+Rd+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ - -`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,e)}else globalThis.console&&globalThis.console.log("PixiJS "+Rd+" - "+r+" - http://www.pixijs.com/");Dd=!0}}var vl;function Jw(){return typeof vl>"u"&&(vl=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:Ft.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Ft.ADAPTER.getWebGLRenderingContext())return!1;var e=Ft.ADAPTER.createCanvas(),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!!(i&&i.getContextAttributes().stencil);if(i){var s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,n}catch{return!1}}()),vl}function tS(r,t){return t===void 0&&(t=[]),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,t}function eS(r){var t=r.toString(16);return t="000000".substring(0,6-t.length)+t,"#"+t}function rS(){for(var r=[],t=[],e=0;e<32;e++)r[e]=e,t[e]=e;r[qt.NORMAL_NPM]=qt.NORMAL,r[qt.ADD_NPM]=qt.ADD,r[qt.SCREEN_NPM]=qt.SCREEN,t[qt.NORMAL]=qt.NORMAL_NPM,t[qt.ADD]=qt.ADD_NPM,t[qt.SCREEN]=qt.SCREEN_NPM;var i=[];return i.push(t),i.push(r),i}var iS=rS();function nS(r,t){if(t===1)return(t*255<<24)+r;if(t===0)return 0;var e=r>>16&255,i=r>>8&255,n=r&255;return e=e*t+.5|0,i=i*t+.5|0,n=n*t+.5|0,(t*255<<24)+(e<<16)+(i<<8)+n}function Yy(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}function Ka(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Nd(r){return!(r&r-1)&&!!r}function Pd(r){var t=(r>65535?1:0)<<4;r>>>=t;var e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}function Da(r,t,e){var i=r.length,n;if(!(t>=i||e===0)){e=t+e>i?i-t:e;var s=i-e;for(n=t;n"u"?console.warn("PixiJS Deprecation Warning: ",t+` -Deprecated since v`+r):(i=i.split(` -`).splice(e).join(` -`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t+` -Deprecated since v`+r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",t+` -Deprecated since v`+r),console.warn(i))),Ld[t]=!0}}var Bd={},Ei=Object.create(null),xn=Object.create(null);(function(){function r(t,e,i){this.canvas=Ft.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=i||Ft.RESOLUTION,this.resize(t,e)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),r})();var ya;function oS(r,t){if(t===void 0&&(t=globalThis.location),r.indexOf("data:")===0)return"";t=t||globalThis.location,ya||(ya=document.createElement("a")),ya.href=r;var e=Gu.parse(ya.href),i=!e.port&&t.port===""||e.port===t.port;return e.hostname!==t.hostname||!i||e.protocol!==t.protocol?"anonymous":""}function Ud(r,t){var e=Ft.RETINA_PREFIX.exec(r);return e?parseFloat(e[1]):t!==void 0?t:1}/*! - * @pixi/extensions - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/extensions is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - *//*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Oo=function(){return Oo=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n8)throw new Error("max arguments reached");var l=this,c=l.name,h=l.items;this._aliasCount++;for(var p=0,d=h.length;p0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},r.prototype.remove=function(t){var e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},r.prototype.contains=function(t){return this.items.indexOf(t)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r}();Object.defineProperties(Ye.prototype,{dispatch:{value:Ye.prototype.emit},run:{value:Ye.prototype.emit}});/*! - * @pixi/ticker - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/ticker is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */Ft.TARGET_FPMS=.06;var Vs;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(Vs||(Vs={}));var _l=function(){function r(t,e,i,n){e===void 0&&(e=null),i===void 0&&(i=0),n===void 0&&(n=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=n}return r.prototype.match=function(t,e){return e===void 0&&(e=null),this.fn===t&&this.context===e},r.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},r.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},r.prototype.destroy=function(t){t===void 0&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},r}(),ai=function(){function r(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new _l(null,null,1/0),this.deltaMS=1/Ft.TARGET_FPMS,this.elapsedMS=1/Ft.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&t._requestId===null&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(t,e,i){return i===void 0&&(i=Vs.NORMAL),this._addListener(new _l(t,e,i))},r.prototype.addOnce=function(t,e,i){return i===void 0&&(i=Vs.NORMAL),this._addListener(new _l(t,e,i,!0))},r.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this},r.prototype.remove=function(t,e){for(var i=this._head.next;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(t){t===void 0&&(t=performance.now());var e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i=this.x&&t=this.y&&et.right?t.right:this.right;if(n<=i)return!1;var s=this.yt.bottom?t.bottom:this.bottom;return o>s}var a=this.left,u=this.right,l=this.top,c=this.bottom;if(u<=a||c<=l)return!1;var h=ga[0].set(t.left,t.top),p=ga[1].set(t.left,t.bottom),d=ga[2].set(t.right,t.top),g=ga[3].set(t.right,t.bottom);if(d.x<=h.x||p.y<=h.y)return!1;var y=Math.sign(e.a*e.d-e.b*e.c);if(y===0||(e.apply(h,h),e.apply(p,p),e.apply(d,d),e.apply(g,g),Math.max(h.x,p.x,d.x,g.x)<=a||Math.min(h.x,p.x,d.x,g.x)>=u||Math.max(h.y,p.y,d.y,g.y)<=l||Math.min(h.y,p.y,d.y,g.y)>=c))return!1;var f=y*(p.y-h.y),m=y*(h.x-p.x),_=f*a+m*l,I=f*u+m*l,E=f*a+m*c,b=f*u+m*c;if(Math.max(_,I,E,b)<=f*h.x+m*h.y||Math.min(_,I,E,b)>=f*g.x+m*g.y)return!1;var F=y*(h.y-d.y),S=y*(d.x-h.x),z=F*a+S*l,B=F*u+S*l,tt=F*a+S*c,st=F*u+S*c;return!(Math.max(z,B,tt,st)<=F*h.x+S*h.y||Math.min(z,B,tt,st)>=F*g.x+S*g.y)},r.prototype.pad=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this},r.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(s-n,0),this},r.prototype.ceil=function(t,e){t===void 0&&(t=1),e===void 0&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=n-this.y,this},r.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=s-n,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),po=function(){function r(t,e,i,n){i===void 0&&(i=0),n===void 0&&(n=0),this._x=i,this._y=n,this.cb=t,this.scope=e}return r.prototype.clone=function(t,e){return t===void 0&&(t=this.cb),e===void 0&&(e=this.scope),new r(t,e,this._x,this._y)},r.prototype.set=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(t){return t.set(this._x,this._y),t},r.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r}(),Qe=function(){function r(t,e,i,n,s,o){t===void 0&&(t=1),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=0),o===void 0&&(o=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o}return r.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},r.prototype.set=function(t,e,i,n,s,o){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o,this},r.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},r.prototype.apply=function(t,e){e=e||new sr;var i=t.x,n=t.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e},r.prototype.applyInverse=function(t,e){e=e||new sr;var i=1/(this.a*this.d+this.c*-this.b),n=t.x,s=t.y;return e.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e},r.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},r.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},r.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a,s=this.c,o=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=s*e-this.d*i,this.d=s*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this},r.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,s=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*s,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*s,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this},r.prototype.setTransform=function(t,e,i,n,s,o,a,u,l){return this.a=Math.cos(a+l)*s,this.b=Math.sin(a+l)*s,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=t-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this},r.prototype.prepend=function(t){var e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){var i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},r.prototype.decompose=function(t){var e=this.a,i=this.b,n=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-n,s),u=Math.atan2(i,e),l=Math.abs(a+u);return l<1e-5||Math.abs(aS-l)<1e-5?(t.rotation=u,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=u),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(n*n+s*s),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*i+o.y*s),t},r.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,s=this.tx,o=t*n-e*i;return this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-n*s)/o,this.ty=-(t*this.ty-e*s)/o,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var t=new r;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r}(),Fn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Mn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Dn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Rn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],rc=[],Xy=[],va=Math.sign;function cS(){for(var r=0;r<16;r++){var t=[];rc.push(t);for(var e=0;e<16;e++)for(var i=va(Fn[r]*Fn[e]+Dn[r]*Mn[e]),n=va(Mn[r]*Fn[e]+Rn[r]*Mn[e]),s=va(Fn[r]*Dn[e]+Dn[r]*Rn[e]),o=va(Mn[r]*Dn[e]+Rn[r]*Rn[e]),a=0;a<16;a++)if(Fn[a]===i&&Mn[a]===n&&Dn[a]===s&&Rn[a]===o){t.push(a);break}}for(var r=0;r<16;r++){var u=new Qe;u.set(Fn[r],Mn[r],Dn[r],Rn[r],0,0),Xy.push(u)}}cS();var Ae={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(r){return Fn[r]},uY:function(r){return Mn[r]},vX:function(r){return Dn[r]},vY:function(r){return Rn[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,t){return rc[r][t]},sub:function(r,t){return rc[r][Ae.inv(t)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,t){return Math.abs(r)*2<=Math.abs(t)?t>=0?Ae.S:Ae.N:Math.abs(t)*2<=Math.abs(r)?r>0?Ae.E:Ae.W:t>0?r>0?Ae.SE:Ae.SW:r>0?Ae.NE:Ae.NW},matrixAppendRotationInv:function(r,t,e,i){e===void 0&&(e=0),i===void 0&&(i=0);var n=Xy[Ae.inv(t)];n.tx=e,n.ty=i,r.append(n)}},qy=function(){function r(){this.worldTransform=new Qe,this.localTransform=new Qe,this.position=new po(this.onChange,this,0,0),this.scale=new po(this.onChange,this,1,1),this.pivot=new po(this.onChange,this,0,0),this.skew=new po(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,n=this.worldTransform;n.a=e.a*i.a+e.b*i.c,n.b=e.a*i.b+e.b*i.d,n.c=e.c*i.a+e.d*i.c,n.d=e.c*i.b+e.d*i.d,n.tx=e.tx*i.a+e.ty*i.c+i.tx,n.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},r.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r}();/*! - * @pixi/core - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/core is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */Ft.PREFER_ENV=Gn.any?Ui.WEBGL:Ui.WEBGL2;Ft.STRICT_TEXTURE_CACHE=!1;var ic=[];function Qy(r,t){if(!r)return null;var e="";if(typeof r=="string"){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);i&&(e=i[1].toLowerCase())}for(var n=ic.length-1;n>=0;--n){var s=ic[n];if(s.test&&s.test(r,e))return new s(r,t)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var nc=function(r,t){return nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},nc(r,t)};function Te(r,t){nc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var sc=function(){return sc=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n0&&c>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(e),n}return Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,i){var n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),i!==void 0&&i!==this.mipmap&&(this.mipmap=i,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,i,n){return n=n||this.resolution,this.setRealSize(e*n,i*n,n)},t.prototype.setRealSize=function(e,i,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(i)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Nd(this.realWidth)&&Nd(this.realHeight)},t.prototype.setResolution=function(e){var i=this.resolution;return i===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*i)/e,this.height=Math.round(this.height*i)/e,this.emit("update",this)),this._refreshPOT(),this)},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete xn[this.cacheId],delete Ei[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,i,n){n===void 0&&(n=Ft.STRICT_TEXTURE_CACHE);var s=typeof e=="string",o=null;if(s)o=e;else{if(!e._pixiId){var a=i&&i.pixiIdPrefix||"pixiid";e._pixiId=a+"_"+Bo()}o=e._pixiId}var u=xn[o];if(s&&n&&!u)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return u||(u=new t(e,i),u.cacheId=o,t.addToCache(u,o)),u},t.fromBuffer=function(e,i,n,s){e=e||new Float32Array(i*n*4);var o=new qc(e,{width:i,height:n}),a=e instanceof Float32Array?le.FLOAT:le.UNSIGNED_BYTE;return new t(o,Object.assign({},dS,s||{width:i,height:n,type:a}))},t.addToCache=function(e,i){i&&(e.textureCacheIds.indexOf(i)===-1&&e.textureCacheIds.push(i),xn[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),xn[i]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var i=xn[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete xn[e],i}}else if(e&&e.textureCacheIds){for(var s=0;s0)if(e.resource)this.addResourceAt(e.resource,i);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Yn.TEXTURE_CUBE_MAP_POSITIVE_X+i,e.parentTextureArray=this.baseTexture,this.items[i]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[i]=e,this},t.prototype.upload=function(e,i,n){for(var s=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(ln),gS=function(r){Te(t,r);function t(e,i){var n=this;if(i=i||{},!(e instanceof HTMLVideoElement)){var s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);var o=e[0].src||e[0];ln.crossOrigin(s,o,i.crossorigin);for(var a=0;a2},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(ai.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(ai.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var i=this.valid;this.resize(e.videoWidth,e.videoHeight),!i&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(ai.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),r.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(ai.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(ai.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,i){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(i)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(ln),vS=function(r){Te(t,r);function t(e){return r.call(this,e)||this}return t.test=function(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap},t}(ln);ic.push(Zy,vS,pS,gS,yS,qc,mS,fS);var _S=function(r){Te(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.upload=function(e,i,n){var s=e.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===un.UNPACK);var o=i.realWidth,a=i.realHeight;return n.width===o&&n.height===a?s.texSubImage2D(i.target,0,0,0,o,a,i.format,n.type,this.data):(n.width=o,n.height=a,s.texImage2D(i.target,0,n.internalFormat,o,a,0,i.format,n.type,this.data)),!0},t}(qc),oc=function(){function r(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Ye("disposeFramebuffer"),this.multisample=Pe.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(t,e){return t===void 0&&(t=0),this.colorTextures[t]=e||new $e(null,{scaleMode:fi.NEAREST,resolution:1,mipmap:an.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(t){return this.depthTexture=t||new $e(new _S(null,{width:this.width,height:this.height}),{scaleMode:fi.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:an.OFF,format:wt.DEPTH_COMPONENT,type:le.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&i.textureCacheIds.splice(n,1),delete Ei[e],i}}else if(e&&e.textureCacheIds){for(var s=0;sthis.baseTexture.width,u=n+o>this.baseTexture.height;if(a||u){var l=a&&u?"and":"or",c="X: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.width,h="Y: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(c+" "+l+" "+h))}this.valid=s&&o&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new $e),_a(t._EMPTY),_a(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=Ft.ADAPTER.createCanvas(16,16),i=e.getContext("2d");e.width=16,e.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),t._WHITE=new t($e.from(e)),_a(t._WHITE),_a(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(gn),Qc=function(r){Te(t,r);function t(e,i){var n=r.call(this,e,i)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,i,n){n===void 0&&(n=!0);var s=this.baseTexture.resolution,o=Math.round(e*s)/s,a=Math.round(i*s)/s;this.valid=o>0&&a>0,this._frame.width=this.orig.width=o,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(o,a),this.updateUvs()},t.prototype.setResolution=function(e){var i=this.baseTexture;i.resolution!==e&&(i.setResolution(e),this.resize(i.width,i.height,!1))},t.create=function(e){for(var i=arguments,n=[],s=1;s>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);var o=this.texturePool[s].pop();return o||(o=this.createTexture(t,e,n)),o.filterPoolKey=s,o.setResolution(i),o},r.prototype.getFilterTexture=function(t,e,i){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||Pe.NONE);return n.filterFrame=t.filterFrame,n},r.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},r.prototype.returnFilterTexture=function(t){this.returnTexture(t)},r.prototype.clear=function(t){if(t=t!==!1,t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var n=0;n0&&t.height>0;for(var e in this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var n=0;n1){for(var c=0;c1&&(h=this.getOptimalFilterTexture(c.width,c.height,e.resolution),h.filterFrame=c.filterFrame),i[p].apply(this,c,h,tn.CLEAR,e);var d=c;c=h,h=d}i[p].apply(this,c,l.renderTexture,tn.BLEND,e),p>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}e.clear(),this.statePool.push(e)},r.prototype.bindAndClear=function(t,e){e===void 0&&(e=tn.CLEAR);var i=this.renderer,n=i.renderTexture,s=i.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,n.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=s.stateId&1||this.forceClear;(e===tn.CLEAR||e===tn.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(t,e,i,n){var s=this.renderer;s.state.set(t.state),this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Lo.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Lo.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,n=i.sourceFrame,s=i.destinationFrame,o=e._texture.orig,a=t.set(s.width,0,0,s.height,n.x,n.y),u=e.worldTransform.copyTo(Qe.TEMP_MATRIX);return u.invert(),a.prepend(u),a.scale(1/o.width,1/o.height),a.translate(e.anchor.x,e.anchor.y),a},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(t,e,i,n){return i===void 0&&(i=1),n===void 0&&(n=Pe.NONE),this.texturePool.getOptimalTexture(t,e,i,n)},r.prototype.getFilterTexture=function(t,e,i){if(typeof t=="number"){var n=t;t=e,e=n}t=t||this.activeState.renderTexture;var s=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||Pe.NONE);return s.filterFrame=t.filterFrame,s},r.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(t,e){var i=ba[0],n=ba[1],s=ba[2],o=ba[3];i.set(e.left,e.top),n.set(e.left,e.bottom),s.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(i,i),t.apply(n,n),t.apply(s,s),t.apply(o,o);var a=Math.min(i.x,n.x,s.x,o.x),u=Math.min(i.y,n.y,s.y,o.y),l=Math.max(i.x,n.x,s.x,o.x),c=Math.max(i.y,n.y,s.y,o.y);e.x=a,e.y=u,e.width=l-a,e.height=c-u},r.prototype.roundFrame=function(t,e,i,n,s){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(s){var o=s.a,a=s.b,u=s.c,l=s.d;if((Math.abs(a)>1e-4||Math.abs(u)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}s=s?bl.copyFrom(s):bl.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}},r}(),eg=function(){function r(t){this.renderer=t}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(t){},r}(),MS=function(){function r(t){this.renderer=t,this.emptyRenderer=new eg(t),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,n=e-1;n>=0;--n)t[n]=i[n]||null,t[n]&&(t[n]._batchLocation=n)},r.prototype.boundArray=function(t,e,i,n){for(var s=t.elements,o=t.ids,a=t.count,u=0,l=0;l=0&&h=Ui.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(t){var e=this;t.preventDefault(),setTimeout(function(){e.gl.isContextLost()&&e.extensions.loseContext&&e.extensions.loseContext.restoreContext()},0)},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r}(),RS=function(){function r(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Pe.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),NS=new Be,PS=function(){function r(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new oc(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Be,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;Ft.PREFER_ENV===Ui.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(n){return e.drawBuffersWEBGL(n)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},r.prototype.bind=function(t,e,i){i===void 0&&(i=0);var n=this.gl;if(t){var s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=i),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o>i,l=e.height>>i,c=u/e.width;this.setViewport(e.x*c,e.y*c,u,l)}else{var u=t.width>>i,l=t.height>>i;this.setViewport(0,0,u,l)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(t,e,i,n){var s=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=i,s.height=n,this.gl.viewport(t,e,i,n))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(t,e,i,n,s){s===void 0&&(s=Ya.COLOR|Ya.DEPTH);var o=this.gl;o.clearColor(t,e,i,n),o.clear(s)},r.prototype.initFramebuffer=function(t){var e=this.gl,i=new RS(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i},r.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var n=t.colorTextures,s=n.length;e.drawBuffers||(s=Math.min(s,1));for(var o=0;o1&&this.canMultisampleFramebuffer(t)?(n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA8,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var a=[],u=0;u1&&i.drawBuffers(a),t.depthTexture){var h=this.writeDepthTexture;if(h){var p=t.depthTexture;this.renderer.texture.bind(p,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,p._glTextures[this.CONTEXT_UID].texture,e)}}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)},r.prototype.canMultisampleFramebuffer=function(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture},r.prototype.detectSamples=function(t){var e=this.msaaSamples,i=Pe.NONE;if(t<=1||e===null)return i;for(var n=0;n=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=Ui.WEBGL2&&(t=r.getContext("webgl2",{})),t||(t=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),no=t}return no}var wa;function zS(){if(!wa){wa=Ir.MEDIUM;var r=kS();if(r&&r.getShaderPrecisionFormat){var t=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);wa=t.precision?Ir.HIGH:Ir.MEDIUM}}return wa}function Hd(r,t,e){if(r.substring(0,9)!=="precision"){var i=t;return t===Ir.HIGH&&e!==Ir.HIGH&&(i=Ir.MEDIUM),"precision "+i+` float; -`+r}else if(e!==Ir.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var $S={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function ng(r){return $S[r]}var Sa=null,Yd={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function sg(r,t){if(!Sa){var e=Object.keys(Yd);Sa={};for(var i=0;i0&&(t+=` -else `),e"u"?.5:e,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(t,e){e===void 0&&(e=t);for(var i=this.mapCoord,n=0;n0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r}(),ag=function(){function r(t){this.renderer=t,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var n=this.getStackLength();n!==i&&(n===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r}(),qd=new Qe,Qd=[],oI=function(r){Te(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=Ft.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},t.prototype.calcScissorRect=function(e){var i;if(!e._scissorRectLocal){var n=e._scissorRect,s=e.maskObject,o=this.renderer,a=o.renderTexture,u=s.getBounds(!0,(i=Qd.pop())!==null&&i!==void 0?i:new Be);this.roundFrameToPixels(u,a.current?a.current.resolution:o.resolution,a.sourceFrame,a.destinationFrame,o.projection.transform),n&&u.fit(n),e._scissorRectLocal=u}},t.isMatrixRotated=function(e){if(!e)return!1;var i=e.a,n=e.b,s=e.c,o=e.d;return(Math.abs(n)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(o)>1e-4)},t.prototype.testScissor=function(e){var i=e.maskObject;if(!i.isFastRect||!i.isFastRect()||t.isMatrixRotated(i.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},t.prototype.roundFrameToPixels=function(e,i,n,s,o){t.isMatrixRotated(o)||(o=o?qd.copyFrom(o):qd.identity(),o.translate(-n.x,-n.y).scale(s.width/n.width,s.height/n.height).translate(s.x,s.y),this.renderer.filter.transformAABB(o,e),e.fit(s),e.x=Math.round(e.x*i),e.y=Math.round(e.y*i),e.width=Math.round(e.width*i),e.height=Math.round(e.height*i))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var i=this.renderer.gl;e._scissorRect||i.enable(i.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(e){var i=this.renderer.gl;e&&Qd.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():i.disable(i.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,i;this.renderer.renderTexture.current?i=e.y:i=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,i,e.width,e.height)},t}(ag),aI=function(r){Te(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=Ft.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var i=e.maskObject,n=this.renderer.gl,s=e._stencilCounter;s===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;var o=e._colorMask;o!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,s,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,o!==0&&(e._colorMask=o,n.colorMask((o&1)!==0,(o&2)!==0,(o&4)!==0,(o&8)!==0)),this._useCurrent()},t.prototype.pop=function(e){var i=this.renderer.gl;if(this.getStackLength()===0)i.disable(i.STENCIL_TEST);else{var n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,s=n?n._colorMask:15;s!==0&&(n._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilOp(i.KEEP,i.KEEP,i.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,s!==0&&(n._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(ag),uI=function(){function r(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Qe,this.transform=null}return r.prototype.update=function(t,e,i,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(t,e,i,n){var s=this.projectionMatrix,o=n?-1:1;s.identity(),s.a=1/e.width*2,s.d=o*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-o-e.y*s.d},r.prototype.setTransform=function(t){},r.prototype.destroy=function(){this.renderer=null},r}(),En=new Be,oo=new Be,lI=function(){function r(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Be,this.destinationFrame=new Be,this.viewportFrame=new Be}return r.prototype.bind=function(t,e,i){t===void 0&&(t=null);var n=this.renderer;this.current=t;var s,o,a;t?(s=t.baseTexture,a=s.resolution,e||(En.width=t.frame.width,En.height=t.frame.height,e=En),i||(oo.x=t.frame.x,oo.y=t.frame.y,oo.width=e.width,oo.height=e.height,i=oo),o=s.framebuffer):(a=n.resolution,e||(En.width=n.screen.width,En.height=n.screen.height,e=En),i||(i=En,i.width=e.width,i.height=e.height));var u=this.viewportFrame;u.x=i.x*a,u.y=i.y*a,u.width=i.width*a,u.height=i.height*a,t||(u.y=n.view.height-(u.y+u.height)),u.ceil(),this.renderer.framebuffer.bind(o,u),this.renderer.projection.update(i,e,a,!o),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},r.prototype.clear=function(t,e){this.current?t=t||this.current.baseTexture.clearColor:t=t||this.clearColor;var i=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,s=i.width!==n.width||i.height!==n.height;if(s){var o=this.viewportFrame,a=o.x,u=o.y,l=o.width,c=o.height;a=Math.round(a),u=Math.round(u),l=Math.round(l),c=Math.round(c),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,u,l,c)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),s&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r}();function cI(r,t,e,i,n){e.buffer.update(n)}var hI={float:` - data[offset] = v; - `,vec2:` - data[offset] = v[0]; - data[offset+1] = v[1]; - `,vec3:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - - `,vec4:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - data[offset+3] = v[3]; - `,mat2:` - data[offset] = v[0]; - data[offset+1] = v[1]; - - data[offset+4] = v[2]; - data[offset+5] = v[3]; - `,mat3:` - data[offset] = v[0]; - data[offset+1] = v[1]; - data[offset+2] = v[2]; - - data[offset + 4] = v[3]; - data[offset + 5] = v[4]; - data[offset + 6] = v[5]; - - data[offset + 8] = v[6]; - data[offset + 9] = v[7]; - data[offset + 10] = v[8]; - `,mat4:` - for(var i = 0; i < 16; i++) - { - data[offset + i] = v[i]; - } - `},ug={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function dI(r){for(var t=r.map(function(u){return{data:u,offset:0,dataLen:0,dirty:0}}),e=0,i=0,n=0,s=0;s1&&(e=Math.max(e,16)*o.data.size),o.dataLen=e,i%e!==0&&i<16){var a=i%e%16;i+=a,n+=a}i+e>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=e,i=e):(o.offset=n,i+=e,n+=e)}return n=Math.ceil(n/16)*16,{uboElements:t,size:n}}function fI(r,t){var e=[];for(var i in r)t[i]&&e.push(t[i]);return e.sort(function(n,s){return n.index-s.index}),e}function pI(r,t){if(!r.autoManage)return{size:0,syncFunc:cI};for(var e=fI(r.uniforms,t),i=dI(e),n=i.uboElements,s=i.size,o=[` - var v = null; - var v2 = null; - var cv = null; - var t = 0; - var gl = renderer.gl - var index = 0; - var data = buffer.data; - `],a=0;a1){var g=ng(u.data.type),y=Math.max(ug[u.data.type]/16,1),f=g/y,m=(4-f%4)%4;o.push(` - cv = ud.`+c+`.value; - v = uv.`+c+`; - offset = `+u.offset/4+`; - - t = 0; - - for(var i=0; i < `+u.data.size*y+`; i++) - { - for(var j = 0; j < `+f+`; j++) - { - data[offset++] = v[t++]; - } - offset += `+m+`; - } - - `)}else{var _=hI[u.data.type];o.push(` - cv = ud.`+c+`.value; - v = uv.`+c+`; - offset = `+u.offset/4+`; - `+_+`; - `)}}return o.push(` - renderer.buffer.update(buffer); - `),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join(` -`))}}var mI=function(){function r(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r}();function yI(r,t){for(var e={},i=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),n=0;nh?1:-1});for(var o=0;o>1,i++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,n=0;nthis.maxIdle&&(t.destroyTexture(s,!0),e[n]=null,i=!0)}if(i){for(var o=0,n=0;n=0;n--)this.unload(t.children[n])},r.prototype.destroy=function(){this.renderer=null},r}();function FI(r){var t,e,i,n,s,o,a,u,l,c,h,p,d,g,y,f,m,_,I,E,b,F,S;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?S=(t={},t[le.UNSIGNED_BYTE]=(e={},e[wt.RGBA]=r.RGBA8,e[wt.RGB]=r.RGB8,e[wt.RG]=r.RG8,e[wt.RED]=r.R8,e[wt.RGBA_INTEGER]=r.RGBA8UI,e[wt.RGB_INTEGER]=r.RGB8UI,e[wt.RG_INTEGER]=r.RG8UI,e[wt.RED_INTEGER]=r.R8UI,e[wt.ALPHA]=r.ALPHA,e[wt.LUMINANCE]=r.LUMINANCE,e[wt.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,e),t[le.BYTE]=(i={},i[wt.RGBA]=r.RGBA8_SNORM,i[wt.RGB]=r.RGB8_SNORM,i[wt.RG]=r.RG8_SNORM,i[wt.RED]=r.R8_SNORM,i[wt.RGBA_INTEGER]=r.RGBA8I,i[wt.RGB_INTEGER]=r.RGB8I,i[wt.RG_INTEGER]=r.RG8I,i[wt.RED_INTEGER]=r.R8I,i),t[le.UNSIGNED_SHORT]=(n={},n[wt.RGBA_INTEGER]=r.RGBA16UI,n[wt.RGB_INTEGER]=r.RGB16UI,n[wt.RG_INTEGER]=r.RG16UI,n[wt.RED_INTEGER]=r.R16UI,n[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),t[le.SHORT]=(s={},s[wt.RGBA_INTEGER]=r.RGBA16I,s[wt.RGB_INTEGER]=r.RGB16I,s[wt.RG_INTEGER]=r.RG16I,s[wt.RED_INTEGER]=r.R16I,s),t[le.UNSIGNED_INT]=(o={},o[wt.RGBA_INTEGER]=r.RGBA32UI,o[wt.RGB_INTEGER]=r.RGB32UI,o[wt.RG_INTEGER]=r.RG32UI,o[wt.RED_INTEGER]=r.R32UI,o[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,o),t[le.INT]=(a={},a[wt.RGBA_INTEGER]=r.RGBA32I,a[wt.RGB_INTEGER]=r.RGB32I,a[wt.RG_INTEGER]=r.RG32I,a[wt.RED_INTEGER]=r.R32I,a),t[le.FLOAT]=(u={},u[wt.RGBA]=r.RGBA32F,u[wt.RGB]=r.RGB32F,u[wt.RG]=r.RG32F,u[wt.RED]=r.R32F,u[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,u),t[le.HALF_FLOAT]=(l={},l[wt.RGBA]=r.RGBA16F,l[wt.RGB]=r.RGB16F,l[wt.RG]=r.RG16F,l[wt.RED]=r.R16F,l),t[le.UNSIGNED_SHORT_5_6_5]=(c={},c[wt.RGB]=r.RGB565,c),t[le.UNSIGNED_SHORT_4_4_4_4]=(h={},h[wt.RGBA]=r.RGBA4,h),t[le.UNSIGNED_SHORT_5_5_5_1]=(p={},p[wt.RGBA]=r.RGB5_A1,p),t[le.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[wt.RGBA]=r.RGB10_A2,d[wt.RGBA_INTEGER]=r.RGB10_A2UI,d),t[le.UNSIGNED_INT_10F_11F_11F_REV]=(g={},g[wt.RGB]=r.R11F_G11F_B10F,g),t[le.UNSIGNED_INT_5_9_9_9_REV]=(y={},y[wt.RGB]=r.RGB9_E5,y),t[le.UNSIGNED_INT_24_8]=(f={},f[wt.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,f),t[le.FLOAT_32_UNSIGNED_INT_24_8_REV]=(m={},m[wt.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,m),t):S=(_={},_[le.UNSIGNED_BYTE]=(I={},I[wt.RGBA]=r.RGBA,I[wt.RGB]=r.RGB,I[wt.ALPHA]=r.ALPHA,I[wt.LUMINANCE]=r.LUMINANCE,I[wt.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,I),_[le.UNSIGNED_SHORT_5_6_5]=(E={},E[wt.RGB]=r.RGB,E),_[le.UNSIGNED_SHORT_4_4_4_4]=(b={},b[wt.RGBA]=r.RGBA,b),_[le.UNSIGNED_SHORT_5_5_5_1]=(F={},F[wt.RGBA]=r.RGBA,F),_),S}var Cl=function(){function r(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=le.UNSIGNED_BYTE,this.internalFormat=wt.RGBA,this.samplerType=0}return r}(),MI=function(){function r(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new $e,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=FI(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=0;--o){var a=i[o];if(a){var u=a._glTextures[s];u.samplerType!==Xa.FLOAT&&this.renderer.texture.unbind(a)}}},r.prototype.initTexture=function(t){var e=new Cl(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},r.prototype.initTextureType=function(t,e){var i,n;e.internalFormat=(n=(i=this.internalFormats[t.type])===null||i===void 0?void 0:i[t.format])!==null&&n!==void 0?n:t.format,this.webGLVersion===2&&t.type===le.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},r.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e))e.samplerType!==Xa.FLOAT&&(this.hasIntegerTextures=!0);else{var n=t.realWidth,s=t.realHeight,o=i.gl;(e.width!==n||e.height!==s||e.dirtyId<0)&&(e.width=n,e.height=s,o.texImage2D(t.target,0,e.internalFormat,n,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},r.prototype.destroyTexture=function(t,e){var i=this.gl;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(t);n!==-1&&Da(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===an.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=qa.CLAMP:e.wrapMode=t.wrapMode,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},r.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&t.mipmap!==an.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===fi.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===fi.LINEAR){var s=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===fi.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===fi.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),Fl=new Qe,DI=function(r){Te(t,r);function t(e,i){e===void 0&&(e=Po.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},Ft.RENDER_OPTIONS,i),n.options=i,n.type=e,n.screen=new Be(0,0,i.width,i.height),n.view=i.view||Ft.ADAPTER.createCanvas(),n.resolution=i.resolution||Ft.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,i.transparent!==void 0&&(Xn("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return t.prototype.initPlugins=function(e){for(var i in e)this.plugins[i]=new e[i](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,i){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(i*this.resolution);var n=this.view.width/this.resolution,s=this.view.height/this.resolution;this.screen.width=n,this.screen.height=s,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=s+"px"),this.emit("resize",n,s)},t.prototype.generateTexture=function(e,i,n,s){i===void 0&&(i={}),typeof i=="number"&&(Xn("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var o=i.region,a=hS(i,["region"]);s=o||e.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var u=Qc.create(sc({width:s.width,height:s.height},a));return Fl.tx=-s.x,Fl.ty=-s.y,this.render(e,{renderTexture:u,clear:!1,transform:Fl,skipUpdateTransform:!!e.parent}),u},t.prototype.destroy=function(e){for(var i in this.plugins)this.plugins[i].destroy(),this.plugins[i]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=Po.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=eS(e),tS(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(gn),RI=function(){function r(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),NI=function(){function r(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,s=t._glBuffers[n]||this.createGLBuffer(t);i.bindBuffer(t.type,s.buffer)},r.prototype.bindBufferBase=function(t,e){var i=this,n=i.gl,s=i.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var o=t._glBuffers[s]||this.createGLBuffer(t);this.boundBufferBases[e]=t,n.bindBufferBase(n.UNIFORM_BUFFER,e,o.buffer)}},r.prototype.bindBufferRange=function(t,e,i){var n=this,s=n.gl,o=n.CONTEXT_UID;i=i||0;var a=t._glBuffers[o]||this.createGLBuffer(t);s.bindBufferRange(s.UNIFORM_BUFFER,e||0,a.buffer,i*256,256)},r.prototype.update=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,s=t._glBuffers[n];if(t._updateID!==s.updateID)if(s.updateID=t._updateID,i.bindBuffer(t.type,s.buffer),s.byteLength>=t.data.byteLength)i.bufferSubData(t.type,0,t.data);else{var o=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;s.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,o)}},r.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),i=0;i=Pe.HIGH?this.multisample=Pe.HIGH:i>=Pe.MEDIUM?this.multisample=Pe.MEDIUM:i>=Pe.LOW?this.multisample=Pe.LOW:this.multisample=Pe.NONE},t.prototype.addSystem=function(e,i){var n=new e(this);if(this[i])throw new Error('Whoops! The name "'+i+'" is already in use');this[i]=n;for(var s in this.runners)this.runners[s].add(n);return this},t.prototype.render=function(e,i){var n,s,o,a;if(i&&(i instanceof Qc?(Xn("6.0.0","Renderer#render arguments changed, use options instead."),n=i,s=arguments[2],o=arguments[3],a=arguments[4]):(n=i.renderTexture,s=i.clear,o=i.transform,a=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=o,!this.context.isLost){if(n||(this._lastObjectRendered=e),!a){var u=e.enableTempParent();e.updateTransform(),e.disableTempParent(u)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(s!==void 0?s:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(e,i,n,s){i===void 0&&(i={});var o=r.prototype.generateTexture.call(this,e,i,n,s);return this.framebuffer.blit(),o},t.prototype.resize=function(e,i){r.prototype.resize.call(this,e,i),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(e){this.runners.destroy.emit();for(var i in this.runners)this.runners[i].destroy();r.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return Xn("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,i){Xn("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),ta.add({name:e,type:jr.RendererPlugin,ref:i})},t.__plugins={},t}(DI);ta.handleByMap(jr.RendererPlugin,lg.__plugins);function PI(r){return lg.create(r)}var LI=function(){function r(){this.texArray=null,this.blend=0,this.type=Lo.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),BI=function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this,i=e._bufferedTextures,n=e.MAX_TEXTURES,s=t._textureArrayPool,o=this.renderer.batch,a=this._tempBoundTextures,u=this.renderer.textureGC.count,l=++$e._globalBatch,c=0,h=s[0],p=0;o.copyBoundTextures(a,n);for(var d=0;d=n&&(o.boundArray(h,a,l,n),this.buildDrawCalls(h,p,d),p=d,h=s[++c],++l),g._batchEnabled=l,g.touched=u,h.elements[h.count++]=g)}h.count>0&&(o.boundArray(h,a,l,n),this.buildDrawCalls(h,p,this._bufferSize),++c,++l);for(var d=0;d0&&(e+=` -else `),ithis.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Be.EMPTY:(t=t||new Be(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},r.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},r.prototype.addPointMatrix=function(t,e){var i=t.a,n=t.b,s=t.c,o=t.d,a=t.tx,u=t.ty,l=i*e.x+s*e.y+a,c=n*e.x+o*e.y+u;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)},r.prototype.addQuad=function(t){var e=this.minX,i=this.minY,n=this.maxX,s=this.maxY,o=t[0],a=t[1];e=on?o:n,s=a>s?a:s,o=t[2],a=t[3],e=on?o:n,s=a>s?a:s,o=t[4],a=t[5],e=on?o:n,s=a>s?a:s,o=t[6],a=t[7],e=on?o:n,s=a>s?a:s,this.minX=e,this.minY=i,this.maxX=n,this.maxY=s},r.prototype.addFrame=function(t,e,i,n,s){this.addFrameMatrix(t.worldTransform,e,i,n,s)},r.prototype.addFrameMatrix=function(t,e,i,n,s){var o=t.a,a=t.b,u=t.c,l=t.d,c=t.tx,h=t.ty,p=this.minX,d=this.minY,g=this.maxX,y=this.maxY,f=o*e+u*i+c,m=a*e+l*i+h;p=fg?f:g,y=m>y?m:y,f=o*n+u*i+c,m=a*n+l*i+h,p=fg?f:g,y=m>y?m:y,f=o*e+u*s+c,m=a*e+l*s+h,p=fg?f:g,y=m>y?m:y,f=o*n+u*s+c,m=a*n+l*s+h,p=fg?f:g,y=m>y?m:y,this.minX=p,this.minY=d,this.maxX=g,this.maxY=y},r.prototype.addVertexData=function(t,e,i){for(var n=this.minX,s=this.minY,o=this.maxX,a=this.maxY,u=e;uo?l:o,a=c>a?c:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a},r.prototype.addVertices=function(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)},r.prototype.addVerticesMatrix=function(t,e,i,n,s,o){s===void 0&&(s=0),o===void 0&&(o=s);for(var a=t.a,u=t.b,l=t.c,c=t.d,h=t.tx,p=t.ty,d=this.minX,g=this.minY,y=this.maxX,f=this.maxY,m=i;mn?t.maxX:n,this.maxY=t.maxY>s?t.maxY:s},r.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,s=t.maxXl?s:l,this.maxY=o>c?o:c}},r.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},r.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,s=t.maxXl?s:l,this.maxY=o>c?o:c}},r.prototype.pad=function(t,e){t===void 0&&(t=0),e===void 0&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},r.prototype.addFramePad=function(t,e,i,n,s,o){t-=s,e-=o,i+=s,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n},r}();/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var ac=function(r,t){return ac=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},ac(r,t)};function th(r,t){ac(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var ko=function(r){th(t,r);function t(){var e=r.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new qy,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new Jd,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return t.mixin=function(e){for(var i=Object.keys(e),n=0;n1)for(var s=0;sthis.children.length)throw new Error(e+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(i,0,e),this._boundsID++,this.onChildrenChange(i),e.emit("added",this),this.emit("childAdded",e,this,i),e},t.prototype.swapChildren=function(e,i){if(e!==i){var n=this.getChildIndex(e),s=this.getChildIndex(i);this.children[n]=i,this.children[s]=e,this.onChildrenChange(n=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);Da(this.children,n,1),this.children.splice(i,0,e),this.onChildrenChange(i)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,i=[],n=0;n1)for(var s=0;s0&&o<=s){a=this.children.splice(n,o);for(var u=0;u1&&this.children.sort(GI),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,i=this.children.length;e0&&i.height>0){var n,s;if(this.cullArea?(n=this.cullArea,s=this.worldTransform):this._render!==t.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,s))this._render(e);else if(this.cullArea)return;for(var o=0,a=this.children.length;onew Promise((i,n)=>{var s=u=>{try{a(e.next(u))}catch(l){n(l)}},o=u=>{try{a(e.throw(u))}catch(l){n(l)}},a=u=>u.done?i(u.value):Promise.resolve(u.value).then(s,o);a((e=e.apply(r,t)).next())});class eh{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new eh}setParameters(t){this._breathParameters=t}getParameters(){return this._breathParameters}updateParameters(t,e){this._currentTime+=e;const i=this._currentTime*2*3.14159;for(let n=0;n=1&&(i=1,this._blinkingState=Dr.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),e=1-i;break;case Dr.EyeState_Closed:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,i>=1&&(this._blinkingState=Dr.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),e=0;break;case Dr.EyeState_Opening:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,i>=1&&(i=1,this._blinkingState=Dr.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),e=i;break;case Dr.EyeState_Interval:this._nextBlinkingTime(r[r.EyeState_First=0]="EyeState_First",r[r.EyeState_Interval=1]="EyeState_Interval",r[r.EyeState_Closing=2]="EyeState_Closing",r[r.EyeState_Closed=3]="EyeState_Closed",r[r.EyeState_Opening=4]="EyeState_Opening",r))(Dr||{});const YI=.001,tf=.5;class rh{static create(t){const e=new rh;typeof t.FadeInTime=="number"&&(e._fadeTimeSeconds=t.FadeInTime,e._fadeTimeSeconds<=0&&(e._fadeTimeSeconds=tf));const i=t.Groups,n=i.length;for(let s=0;sYI){if(s>=0)break;s=l,o=t.getPartOpacityByIndex(c),o+=e/this._fadeTimeSeconds,o>1&&(o=1)}}s<0&&(s=0,o=1);for(let l=i;lu&&(p=1-u/(1-o)),h>p&&(h=p),t.setPartOpacityByIndex(c,h)}}}constructor(){this._fadeTimeSeconds=tf,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}}class Ja{constructor(t){this.parameterIndex=0,this.partIndex=0,this.partId="",this.link=[],t!=null&&this.assignment(t)}assignment(t){return this.partId=t.partId,this.link=t.link.map(e=>e.clone()),this}initialize(t){this.parameterIndex=t.getParameterIndex(this.partId),this.partIndex=t.getPartIndex(this.partId),t.setParameterValueByIndex(this.parameterIndex,1)}clone(){const t=new Ja;return t.partId=this.partId,t.parameterIndex=this.parameterIndex,t.partIndex=this.partIndex,t.link=this.link.map(e=>e.clone()),t}}class te{constructor(t,e){this.x=t||0,this.y=e||0}add(t){const e=new te(0,0);return e.x=this.x+t.x,e.y=this.y+t.y,e}substract(t){const e=new te(0,0);return e.x=this.x-t.x,e.y=this.y-t.y,e}multiply(t){const e=new te(0,0);return e.x=this.x*t.x,e.y=this.y*t.y,e}multiplyByScaler(t){return this.multiply(new te(t,t))}division(t){const e=new te(0,0);return e.x=this.x/t.x,e.y=this.y/t.y,e}divisionByScalar(t){return this.division(new te(t,t))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))}dot(t){return this.x*t.x+this.y*t.y}normalize(){const t=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/t,this.y=this.y/t}isEqual(t){return this.x==t.x&&this.y==t.y}isNotEqual(t){return!this.isEqual(t)}}const Na=class{static range(r,t,e){return re&&(r=e),r}static sin(r){return Math.sin(r)}static cos(r){return Math.cos(r)}static abs(r){return Math.abs(r)}static sqrt(r){return Math.sqrt(r)}static cbrt(r){if(r===0)return r;let t=r;const e=t<0;e&&(t=-t);let i;return t===1/0?i=1/0:(i=Math.exp(Math.log(t)/3),i=(t/(i*i)+2*i)/3),e?-i:i}static getEasingSine(r){return r<0?0:r>1?1:.5-.5*this.cos(r*Math.PI)}static max(r,t){return r>t?r:t}static min(r,t){return r>t?t:r}static degreesToRadian(r){return r/180*Math.PI}static radianToDegrees(r){return r*180/Math.PI}static directionToRadian(r,t){const e=Math.atan2(t.y,t.x),i=Math.atan2(r.y,r.x);let n=e-i;for(;n<-Math.PI;)n+=Math.PI*2;for(;n>Math.PI;)n-=Math.PI*2;return n}static directionToDegrees(r,t){const e=this.directionToRadian(r,t);let i=this.radianToDegrees(e);return t.x-r.x>0&&(i=-i),i}static radianToDirection(r){const t=new te;return t.x=this.sin(r),t.y=this.cos(r),t}static quadraticEquation(r,t,e){return this.abs(r)1&&(t=1),e<0?e=0:e>1&&(e=1),i<0?i=0:i>1&&(i=1),n<0?n=0:n>1&&(n=1),this._modelColor.R=t,this._modelColor.G=e,this._modelColor.B=i,this._modelColor.A=n}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(t){this._isPremultipliedAlpha=t}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(t){this._isCulling=t}isCulling(){return this._isCulling}setAnisotropy(t){this._anisortopy=t}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new mo,this._mvpMatrix4x4=new zr,this._mvpMatrix4x4.loadIdentity()}}var on=(r=>(r[r.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",r[r.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",r[r.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative",r))(on||{});class mo{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}}let ei=!1,cs=!1,hs;const Ml={vertexOffset:0,vertexStep:2};class zo{static startUp(t){if(ei)return uo("CubismFramework.startUp() is already done."),ei;if(Live2DCubismCore._isStarted)return ei=!0,!0;if(Live2DCubismCore._isStarted=!0,hs=t,hs&&Live2DCubismCore.Logging.csmSetLogFunction(hs.logFunction),ei=!0,ei){const e=Live2DCubismCore.Version.csmGetVersion(),i=(e&4278190080)>>24,n=(e&16711680)>>16,s=e&65535,o=e;uo("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+i).slice(-2),("00"+n).slice(-2),("0000"+s).slice(-4),o)}return uo("CubismFramework.startUp() is complete."),ei}static cleanUp(){ei=!1,cs=!1,hs=void 0}static initialize(){if(!ei){yo("CubismFramework is not started.");return}if(cs){yo("CubismFramework.initialize() skipped, already initialized.");return}cs=!0,uo("CubismFramework.initialize() is complete.")}static dispose(){if(!ei){yo("CubismFramework is not started.");return}if(!cs){yo("CubismFramework.dispose() skipped, not initialized.");return}ih.staticRelease(),cs=!1,uo("CubismFramework.dispose() is complete.")}static isStarted(){return ei}static isInitialized(){return cs}static coreLogFunction(t){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(t)}static getLoggingLevel(){return hs!=null?hs.loggingLevel:is.LogLevel_Off}constructor(){}}var is=(r=>(r[r.LogLevel_Verbose=0]="LogLevel_Verbose",r[r.LogLevel_Debug=1]="LogLevel_Debug",r[r.LogLevel_Info=2]="LogLevel_Info",r[r.LogLevel_Warning=3]="LogLevel_Warning",r[r.LogLevel_Error=4]="LogLevel_Error",r[r.LogLevel_Off=5]="LogLevel_Off",r))(is||{});const xa=()=>{};function ef(r,...t){Wu.print(is.LogLevel_Debug,"[CSM][D]"+r+` -`,t)}function uo(r,...t){Wu.print(is.LogLevel_Info,"[CSM][I]"+r+` -`,t)}function yo(r,...t){Wu.print(is.LogLevel_Warning,"[CSM][W]"+r+` -`,t)}function ms(r,...t){Wu.print(is.LogLevel_Error,"[CSM][E]"+r+` -`,t)}class Wu{static print(t,e,i){if(ti[a]);n(s)}static dumpBytes(t,e,i){for(let n=0;n0?this.print(t,` -`):n%8==0&&n>0&&this.print(t," "),this.print(t,"{0} ",[e[n]&255]);this.print(t,` -`)}constructor(){}}class XI{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){const t=this._model.parameters.count,e=this._savedParameters.length;for(let i=0;ie&&(e=this._model.parameters.minimumValues[t]),this._parameterValues[t]=i==1?e:this._parameterValues[t]=this._parameterValues[t]*(1-i)+e*i}setParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.setParameterValueByIndex(n,e,i)}addParameterValueByIndex(t,e,i=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)+e*i)}addParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.addParameterValueByIndex(n,e,i)}multiplyParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.multiplyParameterValueByIndex(n,e,i)}multiplyParameterValueByIndex(t,e,i=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)*(1+(e-1)*i))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(t){const e=this._model.drawables.count;for(let i=0;ie&&(t=e);for(let i=0;i0&&e.getEndTime()(r[r.ExpressionBlendType_Add=0]="ExpressionBlendType_Add",r[r.ExpressionBlendType_Multiply=1]="ExpressionBlendType_Multiply",r[r.ExpressionBlendType_Overwrite=2]="ExpressionBlendType_Overwrite",r))(Nn||{}),$o;(r=>{r.supportMoreMaskDivisions=!0,r.setOpacityFromMotion=!1})($o||($o={}));var Pn=(r=>(r[r.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",r[r.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",r[r.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity",r))(Pn||{}),ii=(r=>(r[r.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",r[r.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",r[r.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",r[r.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped",r))(ii||{});class Zi{constructor(t=0,e=0){this.time=t,this.value=e}}class qI{constructor(){this.basePointIndex=0,this.segmentType=0}}class QI{constructor(){this.id="",this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}}class KI{constructor(){this.fireTime=0,this.value=""}}class ZI{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}}class fg{constructor(t){this._json=t}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(t){return oh.EvaluationOptionFlag_AreBeziersRistricted==t?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(t){return this._json.Curves[t].Target}getMotionCurveId(t){return this._json.Curves[t].Id}getMotionCurveFadeInTime(t){return this._json.Curves[t].FadeInTime}getMotionCurveFadeOutTime(t){return this._json.Curves[t].FadeOutTime}getMotionCurveSegmentCount(t){return this._json.Curves[t].Segments.length}getMotionCurveSegment(t,e){return this._json.Curves[t].Segments[e]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(t){return this._json.UserData[t].Time}getEventValue(t){return this._json.UserData[t].Value}}var oh=(r=>(r[r.EvaluationOptionFlag_AreBeziersRistricted=0]="EvaluationOptionFlag_AreBeziersRistricted",r))(oh||{});const JI="EyeBlink",t1="LipSync",e1="Model",r1="Parameter",i1="PartOpacity",n1=!1;function Br(r,t,e){const i=new Zi;return i.time=r.time+(t.time-r.time)*e,i.value=r.value+(t.value-r.value)*e,i}function s1(r,t){let e=(t-r[0].time)/(r[1].time-r[0].time);return e<0&&(e=0),r[0].value+(r[1].value-r[0].value)*e}function o1(r,t){let e=(t-r[0].time)/(r[3].time-r[0].time);e<0&&(e=0);const i=Br(r[0],r[1],e),n=Br(r[1],r[2],e),s=Br(r[2],r[3],e),o=Br(i,n,e),a=Br(n,s,e);return Br(o,a,e).value}function a1(r,t){const e=t,i=r[0].time,n=r[3].time,s=r[1].time,o=r[2].time,a=n-3*o+3*s-i,u=3*o-6*s+3*i,l=3*s-3*i,c=i-e,h=Ie.cardanoAlgorithmForBezier(a,u,l,c),p=Br(r[0],r[1],h),d=Br(r[1],r[2],h),g=Br(r[2],r[3],h),y=Br(p,d,h),f=Br(d,g,h);return Br(y,f,h).value}function u1(r,t){return r[0].value}function l1(r,t){return r[1].value}function Dl(r,t,e){const i=r.curves[t];let n=-1;const s=i.baseSegmentIndex+i.segmentCount;let o=0;for(let u=i.baseSegmentIndex;ue){n=u;break}if(n==-1)return r.points[o].value;const a=r.segments[n];return a.evaluate(r.points.slice(a.basePointIndex),e)}class ah extends dg{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(t,e){const i=new ah;return i.parse(t),i._sourceFrameRate=i._motionData.fps,i._loopDurationSeconds=i._motionData.duration,i._onFinishedMotion=e,i}doUpdateParameters(t,e,i,n){this._modelCurveIdEyeBlink==null&&(this._modelCurveIdEyeBlink=JI),this._modelCurveIdLipSync==null&&(this._modelCurveIdLipSync=t1);let s=e-n.getStartTime();s<0&&(s=0);let o=Number.MAX_VALUE,a=Number.MAX_VALUE;const u=64;let l=0,c=0;this._eyeBlinkParameterIds.length>u&&ef("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>u&&ef("too many lip sync targets : {0}",this._lipSyncParameterIds.length);const h=this._fadeInSeconds<=0?1:Ie.getEasingSine((e-n.getFadeInStartTime())/this._fadeInSeconds),p=this._fadeOutSeconds<=0||n.getEndTime()<0?1:Ie.getEasingSine((n.getEndTime()-e)/this._fadeOutSeconds);let d,g,y,f=s;if(this._isLoop)for(;f>this._motionData.duration;)f-=this._motionData.duration;const m=this._motionData.curves;for(g=0;g>_&1)continue;const E=I+(a-I)*i;t.setParameterValueById(this._eyeBlinkParameterIds[_],E)}if(o!=Number.MAX_VALUE)for(let _=0;_>_&1)continue;const E=I+(o-I)*i;t.setParameterValueById(this._lipSyncParameterIds[_],E)}}for(;g=this._motionData.duration&&(this._isLoop?(n.setStartTime(e),this._isLoopFadeIn&&n.setFadeInStartTime(e)):(this._onFinishedMotion&&this._onFinishedMotion(this),n.setIsFinished(!0))),this._lastWeight=i}setIsLoop(t){this._isLoop=t}isLoop(){return this._isLoop}setIsLoopFadeIn(t){this._isLoopFadeIn=t}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(t,e){const i=this._motionData.curves;for(let n=0;nnew QI),this._motionData.segments=Array.from({length:e.getMotionTotalSegmentCount()}).map(()=>new qI),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new KI),this._motionData.points=[];let o=0,a=0;for(let u=0;ut&&this._motionData.events[i].fireTime<=e&&this._firedEventValues.push(this._motionData.events[i].value);return this._firedEventValues}}class c1{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(t){this._fadeOutSeconds=t,this._isTriggeredFadeOut=!0}startFadeOut(t,e){const i=e+t;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||ie!=null&&e._motionQueueEntryHandle==t)}setEventCallback(t,e=null){this._eventCallBack=t,this._eventCustomData=e}doUpdateMotion(t,e){let i=!1,n=0;for(;n(r[r.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter",r))(lc||{}),Ln=(r=>(r[r.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",r[r.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",r[r.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle",r))(Ln||{});class d1{constructor(){this.initialPosition=new te(0,0),this.position=new te(0,0),this.lastPosition=new te(0,0),this.lastGravity=new te(0,0),this.force=new te(0,0),this.velocity=new te(0,0)}}class f1{constructor(){this.normalizationPosition={},this.normalizationAngle={}}}class p1{constructor(){this.source={}}}class m1{constructor(){this.destination={},this.translationScale=new te(0,0)}}class y1{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new te(0,0),this.wind=new te(0,0)}}class g1{constructor(t){this._json=t}release(){this._json=void 0}getGravity(){const t=new te(0,0);return t.x=this._json.Meta.EffectiveForces.Gravity.X,t.y=this._json.Meta.EffectiveForces.Gravity.Y,t}getWind(){const t=new te(0,0);return t.x=this._json.Meta.EffectiveForces.Wind.X,t.y=this._json.Meta.EffectiveForces.Wind.Y,t}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Default}getNormalizationAngleMinimumValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Default}getInputCount(t){return this._json.PhysicsSettings[t].Input.length}getInputWeight(t,e){return this._json.PhysicsSettings[t].Input[e].Weight}getInputReflect(t,e){return this._json.PhysicsSettings[t].Input[e].Reflect}getInputType(t,e){return this._json.PhysicsSettings[t].Input[e].Type}getInputSourceId(t,e){return this._json.PhysicsSettings[t].Input[e].Source.Id}getOutputCount(t){return this._json.PhysicsSettings[t].Output.length}getOutputVertexIndex(t,e){return this._json.PhysicsSettings[t].Output[e].VertexIndex}getOutputAngleScale(t,e){return this._json.PhysicsSettings[t].Output[e].Scale}getOutputWeight(t,e){return this._json.PhysicsSettings[t].Output[e].Weight}getOutputDestinationId(t,e){return this._json.PhysicsSettings[t].Output[e].Destination.Id}getOutputType(t,e){return this._json.PhysicsSettings[t].Output[e].Type}getOutputReflect(t,e){return this._json.PhysicsSettings[t].Output[e].Reflect}getParticleCount(t){return this._json.PhysicsSettings[t].Vertices.length}getParticleMobility(t,e){return this._json.PhysicsSettings[t].Vertices[e].Mobility}getParticleDelay(t,e){return this._json.PhysicsSettings[t].Vertices[e].Delay}getParticleAcceleration(t,e){return this._json.PhysicsSettings[t].Vertices[e].Acceleration}getParticleRadius(t,e){return this._json.PhysicsSettings[t].Vertices[e].Radius}getParticlePosition(t,e){const i=new te(0,0);return i.x=this._json.PhysicsSettings[t].Vertices[e].Position.X,i.y=this._json.PhysicsSettings[t].Vertices[e].Position.Y,i}}const nf="X",sf="Y",of="Angle",v1=5,mg=100,_1=.001;class uh{static create(t){const e=new uh;return e.parse(t),e._physicsRig.gravity.y=0,e}evaluate(t,e){let i,n,s,o;const a=new te;let u,l,c,h,p,d,g,y;p=t.getModel().parameters.values,d=t.getModel().parameters.maximumValues,g=t.getModel().parameters.minimumValues,y=t.getModel().parameters.defaultValues;for(let f=0;f=u.particleCount)break;c[m].destinationParameterIndex==-1&&(c[m].destinationParameterIndex=t.getParameterIndex(c[m].destination.id));const I=new te;I.x=h[_].position.x-h[_-1].position.x,I.y=h[_].position.y-h[_-1].position.y,o=c[m].getValue(I,h,_,c[m].reflect,this._options.gravity);const E=c[m].destinationParameterIndex,b=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(p.subarray(E))):p.slice(E);R1(b,g[E],d[E],o,c[m]);for(let F=E,S=0;F=2?n=t[e-1].position.substract(t[e-2].position):n=n.multiplyByScaler(-1),s=Ie.directionToRadian(n,r),i&&(s*=-1),s}function A1(r,t){return Math.abs(Math.max(r,t)-Math.min(r,t))}function O1(r,t){return Math.min(r,t)+A1(r,t)/2}function C1(r,t){return r.x}function F1(r,t){return r.y}function M1(r,t){return t}function D1(r,t,e,i,n,s,o,a){let u,l,c,h,p=new te(0,0),d=new te(0,0),g=new te(0,0),y=new te(0,0);r[0].position=new te(e.x,e.y),u=Ie.degreesToRadian(i),h=Ie.radianToDirection(u),h.normalize();for(let f=1;fe&&(o>n.valueExceededMaximum&&(n.valueExceededMaximum=o),o=e),a=n.weight/mg,a>=1||(o=r[0]*(1-a)+o*a),r[0]=o}function lh(r,t,e,i,n,s,o,a){let u=0;const l=Ie.max(e,t);lr&&(r=c);const h=Ie.min(n,s),p=Ie.max(n,s),d=o,g=O1(c,l),y=r-g;switch(Math.sign(y)){case 1:{const f=p-d,m=l-g;m!=0&&(u=y*(f/m),u+=d);break}case-1:{const f=h-d,m=c-g;m!=0&&(u=y*(f/m),u+=d);break}case 0:{u=d;break}}return a?u:u*-1}class cc{constructor(t=0,e=0,i=0,n=0){this.x=t,this.y=e,this.width=i,this.height=n}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height}expand(t,e){this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2}}const Rl=4,N1=10;let On,go,hc;class Nl{getChannelFlagAsColor(t){return this._channelColors[t]}getMaskRenderTexture(){let t=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,t=this._maskTexture.texture),t==0){const e=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),t=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,hc),this._maskTexture=new P1(this._currentFrameNo,t)}return t}setGL(t){this.gl=t}calcClippedDrawTotalBounds(t,e){let i=Number.MAX_VALUE,n=Number.MAX_VALUE,s=Number.MIN_VALUE,o=Number.MIN_VALUE;const a=e._clippedDrawableIndexList.length;for(let u=0;ug&&(g=_),Iy&&(y=I)}if(p!=Number.MAX_VALUE)if(ps&&(s=g),y>o&&(o=y),i==Number.MAX_VALUE)e._allClippedDrawRect.x=0,e._allClippedDrawRect.y=0,e._allClippedDrawRect.width=0,e._allClippedDrawRect.height=0,e._isUsing=!1;else{e._isUsing=!0;const m=s-i,_=o-n;e._allClippedDrawRect.x=i,e._allClippedDrawRect.y=n,e._allClippedDrawRect.width=m,e._allClippedDrawRect.height=_}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new cc,this._tmpMatrix=new zr,this._tmpMatrixForMask=new zr,this._tmpMatrixForDraw=new zr;let t=new mo;t.R=1,t.G=0,t.B=0,t.A=0,this._channelColors.push(t),t=new mo,t.R=0,t.G=1,t.B=0,t.A=0,this._channelColors.push(t),t=new mo,t.R=0,t.G=0,t.B=1,t.A=0,this._channelColors.push(t),t=new mo,t.R=0,t.G=0,t.B=0,t.A=1,this._channelColors.push(t)}release(){var t,e,i;const n=this;for(let s=0;s0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),e.getMvpMatrix(),e.preDraw(),this.setupLayoutBounds(i),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let n=0;n(r[r.ShaderNames_SetupMask=0]="ShaderNames_SetupMask",r[r.ShaderNames_NormalPremultipliedAlpha=1]="ShaderNames_NormalPremultipliedAlpha",r[r.ShaderNames_NormalMaskedPremultipliedAlpha=2]="ShaderNames_NormalMaskedPremultipliedAlpha",r[r.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]="ShaderNames_NomralMaskedInvertedPremultipliedAlpha",r[r.ShaderNames_AddPremultipliedAlpha=4]="ShaderNames_AddPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlpha=5]="ShaderNames_AddMaskedPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]="ShaderNames_AddMaskedPremultipliedAlphaInverted",r[r.ShaderNames_MultPremultipliedAlpha=7]="ShaderNames_MultPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlpha=8]="ShaderNames_MultMaskedPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]="ShaderNames_MultMaskedPremultipliedAlphaInverted",r))(vo||{});const B1="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",U1="precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}",k1="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",af="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",z1="precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}",$1="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}",j1="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}";class yg extends ih{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new Nl,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(t){t.isUsingMasking()&&(this._clippingManager=new Nl,this._clippingManager.initialize(t,t.getDrawableCount(),t.getDrawableMasks(),t.getDrawableMaskCounts()));for(let e=t.getDrawableCount()-1;e>=0;e--)this._sortedDrawableIndexList[e]=0;super.initialize(t)}bindTexture(t,e){this._textures[t]=e}getBindedTextures(){return this._textures}setClippingMaskBufferSize(t){this._clippingManager.release(),this._clippingManager=new Nl,this._clippingManager.setClippingMaskBufferSize(t),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var t,e,i;const n=this;this._clippingManager.release(),n._clippingManager=void 0,(t=this.gl)==null||t.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(e=this.gl)==null||e.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(i=this.gl)==null||i.deleteBuffer(this._bufferData.index),this._bufferData.index=null,n._bufferData=void 0,n._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);const t=this.getModel().getDrawableCount(),e=this.getModel().getDrawableRenderOrders();for(let i=0;i{yg.doStaticRelease()};class gg{constructor(t){this.groups=t.Groups,this.hitAreas=t.HitAreas,this.layout=t.Layout,this.moc=t.FileReferences.Moc,this.expressions=t.FileReferences.Expressions,this.motions=t.FileReferences.Motions,this.textures=t.FileReferences.Textures,this.physics=t.FileReferences.Physics,this.pose=t.FileReferences.Pose}getEyeBlinkParameters(){var t,e;return(e=(t=this.groups)==null?void 0:t.find(i=>i.Name==="EyeBlink"))==null?void 0:e.Ids}getLipSyncParameters(){var t,e;return(e=(t=this.groups)==null?void 0:t.find(i=>i.Name==="LipSync"))==null?void 0:e.Ids}}const V1="ParamAngleX",G1="ParamAngleY",W1="ParamAngleZ",H1="ParamEyeBallX",Y1="ParamEyeBallY",X1="ParamBodyAngleX",q1="ParamBreath",uf=2,lf=2;var br;(r=>{r.LOG_LEVEL_VERBOSE=0,r.LOG_LEVEL_WARNING=1,r.LOG_LEVEL_ERROR=2,r.LOG_LEVEL_NONE=999,r.logLevel=r.LOG_LEVEL_WARNING,r.sound=!0,r.motionSync=!0,r.motionFadingDuration=500,r.idleMotionFadingDuration=2e3,r.expressionFadingDuration=500,r.preserveExpressionOnMotion=!0,r.cubism4=$o})(br||(br={}));const _e={log(r,...t){br.logLevel<=br.LOG_LEVEL_VERBOSE&&console.log(`[${r}]`,...t)},warn(r,...t){br.logLevel<=br.LOG_LEVEL_WARNING&&console.warn(`[${r}]`,...t)},error(r,...t){br.logLevel<=br.LOG_LEVEL_ERROR&&console.error(`[${r}]`,...t)}};function cf(r,t,e){return re?e:r}function vg(r,t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i))})})}function Q1(r){let t=r.lastIndexOf("/");return t!=-1&&(r=r.slice(0,t)),t=r.lastIndexOf("/"),t!==-1&&(r=r.slice(t+1)),r}function K1(r,t){const e=r.indexOf(t);e!==-1&&r.splice(e,1)}class _g extends gn{constructor(t,e){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=t,this.tag=`ExpressionManager(${t.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(t){return Oe(this,null,function*(){if(!this.definitions[t]){_e.warn(this.tag,`Undefined expression at [${t}]`);return}if(this.expressions[t]===null){_e.warn(this.tag,`Cannot set expression at [${t}] because it's already failed in loading.`);return}if(this.expressions[t])return this.expressions[t];const e=yield this._loadExpression(t);return this.expressions[t]=e,e})}_loadExpression(t){throw new Error("Not implemented.")}setRandomExpression(){return Oe(this,null,function*(){if(this.definitions.length){const t=[];for(let e=0;e-1&&tl&&(o*=l/u,a*=l/u),this.vx+=o,this.vy+=a;const c=Math.sqrt(An(this.vx,2)+An(this.vy,2)),h=.5*(Math.sqrt(An(l,2)+8*l*n)-l);c>h&&(this.vx*=h/c,this.vy*=h/c),this.x+=this.vx,this.y+=this.vy}}class ch{constructor(t){this.json=t;let e=t.url;if(typeof e!="string")throw new TypeError("The `url` field in settings JSON must be defined as a string.");this.url=e,this.name=Q1(this.url)}resolveURL(t){return Gu.resolve(this.url,t)}replaceFiles(t){this.moc=t(this.moc,"moc"),this.pose!==void 0&&(this.pose=t(this.pose,"pose")),this.physics!==void 0&&(this.physics=t(this.physics,"physics"));for(let e=0;e(t.push(e),e)),t}validateFiles(t){const e=(s,o)=>{const a=this.resolveURL(s);if(!t.includes(a)){if(o)throw new Error(`File "${s}" is defined in settings, but doesn't exist in given files`);return!1}return!0};return[this.moc,...this.textures].forEach(s=>e(s,!0)),this.getDefinedFiles().filter(s=>e(s,!1))}}var dc=(r=>(r[r.NONE=0]="NONE",r[r.IDLE=1]="IDLE",r[r.NORMAL=2]="NORMAL",r[r.FORCE=3]="FORCE",r))(dc||{});class eT{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(t,e,i){if(i<=0)return _e.log(this.tag,"Cannot start a motion with MotionPriority.NONE."),!1;if(t===this.currentGroup&&e===this.currentIndex)return _e.log(this.tag,"Motion is already playing.",this.dump(t,e)),!1;if(t===this.reservedGroup&&e===this.reservedIndex||t===this.reservedIdleGroup&&e===this.reservedIdleIndex)return _e.log(this.tag,"Motion is already reserved.",this.dump(t,e)),!1;if(i===1){if(this.currentPriority!==0)return _e.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(t,e)),!1;if(this.reservedIdleGroup!==void 0)return _e.log(this.tag,"Cannot start idle motion because another idle motion has reserved.",this.dump(t,e)),!1;this.setReservedIdle(t,e)}else{if(i<3){if(i<=this.currentPriority)return _e.log(this.tag,"Cannot start motion because another motion is playing as an equivalent or higher priority.",this.dump(t,e)),!1;if(i<=this.reservePriority)return _e.log(this.tag,"Cannot start motion because another motion has reserved as an equivalent or higher priority.",this.dump(t,e)),!1}this.setReserved(t,e,i)}return!0}start(t,e,i,n){if(n===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return _e.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(e,i)),!1}else{if(e!==this.reservedGroup||i!==this.reservedIndex)return _e.log(this.tag,"Cannot start motion because another motion has taken the place.",this.dump(e,i)),!1;this.setReserved(void 0,void 0,0)}return t?(this.setCurrent(e,i,n),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(t,e,i){this.currentPriority=i,this.currentGroup=t,this.currentIndex=e}setReserved(t,e,i){this.reservePriority=i,this.reservedGroup=t,this.reservedIndex=e}setReservedIdle(t,e){this.reservedIdleGroup=t,this.reservedIdleIndex=e}isActive(t,e){return t===this.currentGroup&&e===this.currentIndex||t===this.reservedGroup&&e===this.reservedIndex||t===this.reservedIdleGroup&&e===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!br.preserveExpressionOnMotion&&this.currentPriority>1}dump(t,e){if(this.debug){const i=["currentPriority","reservePriority","currentGroup","currentIndex","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex"];return` - group = "${t}", index = ${e} -`+i.map(n=>"["+n+"] "+this[n]).join(` -`)}return""}}const rT="SoundManager",iT=.5;class $n{static get volume(){return this._volume}static set volume(t){this._volume=(t>1?1:t<0?0:t)||0,this.audios.forEach(e=>e.volume=this._volume)}static add(t,e,i){const n=new Audio(t);return n.volume=this._volume,n.preload="auto",n.addEventListener("ended",()=>{this.dispose(n),e==null||e()}),n.addEventListener("error",s=>{this.dispose(n),_e.warn(rT,`Error occurred on "${t}"`,s.error),i==null||i(s.error)}),this.audios.push(n),n}static play(t){return new Promise((e,i)=>{var n;(n=t.play())==null||n.catch(s=>{t.dispatchEvent(new ErrorEvent("error",{error:s})),i(s)}),t.readyState===t.HAVE_ENOUGH_DATA?e():t.addEventListener("canplaythrough",e)})}static dispose(t){t.pause(),t.removeAttribute("src"),K1(this.audios,t)}static destroy(){for(let t=this.audios.length-1;t>=0;t--)this.dispose(this.audios[t])}}$n.audios=[];$n._volume=iT;class hh extends gn{constructor(t,e){super(),this.motionGroups={},this.state=new eT,this.playing=!1,this.destroyed=!1,this.settings=t,this.tag=`MotionManager(${t.name})`,this.state.tag=this.tag}init(t){t!=null&&t.idleMotionGroup&&(this.groups.idle=t.idleMotionGroup),this.setupMotions(t),this.stopAllMotions()}setupMotions(t){for(const i of Object.keys(this.definitions))this.motionGroups[i]=[];let e;switch(t==null?void 0:t.motionPreload){case"NONE":return;case"ALL":e=Object.keys(this.definitions);break;case"IDLE":default:e=[this.groups.idle];break}for(const i of e)if(this.definitions[i])for(let n=0;nthis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=u}catch(h){_e.warn(this.tag,"Failed to create audio",c,h)}}const l=yield this.loadMotion(i,n);if(u){const c=$n.play(u).catch(h=>_e.warn(this.tag,"Failed to play audio",u.src,h));br.motionSync&&(yield c)}return this.state.start(l,i,n,s)?(_e.log(this.tag,"Start motion:",this.getMotionName(a)),this.emit("motionStart",i,n,u),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(l),!0):(u&&($n.dispose(u),this.currentAudio=void 0),!1)})}startRandomMotion(t,e){return Oe(this,null,function*(){const i=this.definitions[t];if(i!=null&&i.length){const n=[];for(let s=0;se.index>=0);for(const e of t)this.hitAreas[e.name]=e}hitTest(t,e){return Object.keys(this.hitAreas).filter(i=>this.isHit(i,t,e))}isHit(t,e,i){if(!this.hitAreas[t])return!1;const n=this.hitAreas[t].index,s=this.getDrawableBounds(n,nT);return s.x<=e&&e<=s.x+s.width&&s.y<=i&&i<=s.y+s.height}getDrawableBounds(t,e){const i=this.getDrawableVertices(t);let n=i[0],s=i[0],o=i[1],a=i[1];for(let u=0;u{(s.status===200||s.status===0)&&s.response?i(s.response):s.onerror()},s.onerror=()=>{_e.warn(oT,`Failed to load resource as ${s.responseType} (Status ${s.status}): ${t}`),n(new df("Network error.",t,s.status))},s.onabort=()=>n(new df("Aborted.",t,s.status,!0)),s.onloadend=()=>{var o;rr.allXhrSet.delete(s),r&&((o=rr.xhrMap.get(r))==null||o.delete(s))},s}static cancelXHRs(){var r;(r=rr.xhrMap.get(this))==null||r.forEach(t=>{t.abort(),rr.allXhrSet.delete(t)}),rr.xhrMap.delete(this)}static release(){rr.allXhrSet.forEach(r=>r.abort()),rr.allXhrSet.clear(),rr.xhrMap=new WeakMap}};let Hu=rr;Hu.xhrMap=new WeakMap;Hu.allXhrSet=new Set;Hu.loader=(r,t)=>new Promise((e,i)=>{rr.createXHR(r.target,r.settings?r.settings.resolveURL(r.url):r.url,r.type,s=>{r.result=s,e()},i).send()});function bg(r,t){let e=-1;return i(0);function i(n,s){if(s)return Promise.reject(s);if(n<=e)return Promise.reject(new Error("next() called multiple times"));e=n;const o=r[n];if(!o)return Promise.resolve();try{return Promise.resolve(o(t,i.bind(null,n+1)))}catch(a){return Promise.reject(a)}}}class cn{static load(t){return bg(this.middlewares,t).then(()=>t.result)}}cn.middlewares=[Hu.loader];function aT(r,t={}){var e;const i={resourceOptions:{crossorigin:t.crossOrigin}};if(Ra.fromURL)return Ra.fromURL(r,i).catch(o=>{if(o instanceof Error)throw o;const a=new Error("Texture loading error");throw a.event=o,a});i.resourceOptions.autoLoad=!1;const n=Ra.from(r,i);if(n.baseTexture.valid)return Promise.resolve(n);const s=n.baseTexture.resource;return(e=s._live2d_load)!=null||(s._live2d_load=new Promise((o,a)=>{const u=l=>{s.source.removeEventListener("error",u);const c=new Error("Texture loading error");c.event=l,a(c)};s.source.addEventListener("error",u),s.load().then(()=>o(n)).catch(u)})),s._live2d_load}const ff="Live2DFactory",wg=(r,t)=>Oe(void 0,null,function*(){if(typeof r.source=="string"){const e=yield cn.load({url:r.source,type:"json",target:r.live2dModel});e.url=r.source,r.source=e,r.live2dModel.emit("settingsJSONLoaded",e)}return t()}),Sg=(r,t)=>Oe(void 0,null,function*(){if(r.source instanceof ch)return r.settings=r.source,t();if(typeof r.source=="object"){const e=De.findRuntime(r.source);if(e){const i=e.createModelSettings(r.source);return r.settings=i,r.live2dModel.emit("settingsLoaded",i),t()}}throw new TypeError("Unknown settings format.")}),Ig=(r,t)=>{if(r.settings){const e=De.findRuntime(r.settings);if(e)return e.ready().then(t)}return t()},Tg=(r,t)=>Oe(void 0,null,function*(){yield t();const e=r.internalModel;if(e){const i=r.settings,n=De.findRuntime(i);if(n){const s=[];i.pose&&s.push(cn.load({settings:i,url:i.pose,type:"json",target:e}).then(o=>{e.pose=n.createPose(e.coreModel,o),r.live2dModel.emit("poseLoaded",e.pose)}).catch(o=>{r.live2dModel.emit("poseLoadError",o),_e.warn(ff,"Failed to load pose.",o)})),i.physics&&s.push(cn.load({settings:i,url:i.physics,type:"json",target:e}).then(o=>{e.physics=n.createPhysics(e.coreModel,o),r.live2dModel.emit("physicsLoaded",e.physics)}).catch(o=>{r.live2dModel.emit("physicsLoadError",o),_e.warn(ff,"Failed to load physics.",o)})),s.length&&(yield Promise.all(s))}}}),xg=(r,t)=>Oe(void 0,null,function*(){if(r.settings){const e=r.live2dModel,i=r.settings.textures.map(n=>{const s=r.settings.resolveURL(n);return aT(s,{crossOrigin:r.options.crossOrigin})});if(yield t(),r.internalModel)e.internalModel=r.internalModel,e.emit("modelLoaded",r.internalModel);else throw new TypeError("Missing internal model.");e.textures=yield Promise.all(i),e.emit("textureLoaded",e.textures)}else throw new TypeError("Missing settings.")}),Eg=(r,t)=>Oe(void 0,null,function*(){const e=r.settings;if(e instanceof ch){const i=De.findRuntime(e);if(!i)throw new TypeError("Unknown model settings.");const n=yield cn.load({settings:e,url:e.moc,type:"arraybuffer",target:r.live2dModel});if(!i.isValidMoc(n))throw new Error("Invalid moc data");const s=i.createCoreModel(n);return r.internalModel=i.createInternalModel(s,e,r.options),t()}throw new TypeError("Missing settings.")}),He=class{static registerRuntime(r){He.runtimes.push(r),He.runtimes.sort((t,e)=>e.version-t.version)}static findRuntime(r){for(const t of He.runtimes)if(t.test(r))return t}static setupLive2DModel(r,t,e){return Oe(this,null,function*(){const i=new Promise(o=>r.once("textureLoaded",o)),n=new Promise(o=>r.once("modelLoaded",o)),s=Promise.all([i,n]).then(()=>r.emit("ready"));yield bg(He.live2DModelMiddlewares,{live2dModel:r,source:t,options:e||{}}),yield s,r.emit("load")})}static loadMotion(r,t,e){var i,n;const s=o=>r.emit("motionLoadError",t,e,o);try{const o=(i=r.definitions[t])==null?void 0:i[e];if(!o)return Promise.resolve(void 0);r.listeners("destroy").includes(He.releaseTasks)||r.once("destroy",He.releaseTasks);let a=He.motionTasksMap.get(r);a||(a={},He.motionTasksMap.set(r,a));let u=a[t];u||(u=[],a[t]=u);const l=r.getMotionFile(o);return(n=u[e])!=null||(u[e]=cn.load({url:l,settings:r.settings,type:r.motionDataType,target:r}).then(c=>{var h;const p=(h=He.motionTasksMap.get(r))==null?void 0:h[t];p&&delete p[e];const d=r.createMotion(c,t,o);return r.emit("motionLoaded",t,e,d),d}).catch(c=>{_e.warn(r.tag,`Failed to load motion: ${l} -`,c),s(c)})),u[e]}catch(o){_e.warn(r.tag,`Failed to load motion at "${t}"[${e}] -`,o),s(o)}return Promise.resolve(void 0)}static loadExpression(r,t){var e;const i=n=>r.emit("expressionLoadError",t,n);try{const n=r.definitions[t];if(!n)return Promise.resolve(void 0);r.listeners("destroy").includes(He.releaseTasks)||r.once("destroy",He.releaseTasks);let s=He.expressionTasksMap.get(r);s||(s=[],He.expressionTasksMap.set(r,s));const o=r.getExpressionFile(n);return(e=s[t])!=null||(s[t]=cn.load({url:o,settings:r.settings,type:"json",target:r}).then(a=>{const u=He.expressionTasksMap.get(r);u&&delete u[t];const l=r.createExpression(a,n);return r.emit("expressionLoaded",t,l),l}).catch(a=>{_e.warn(r.tag,`Failed to load expression: ${o} -`,a),i(a)})),s[t]}catch(n){_e.warn(r.tag,`Failed to load expression at [${t}] -`,n),i(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof hh?He.motionTasksMap.delete(this):He.expressionTasksMap.delete(this)}};let De=He;De.runtimes=[];De.urlToJSON=wg;De.jsonToSettings=Sg;De.waitUntilReady=Ig;De.setupOptionals=Tg;De.setupEssentials=xg;De.createInternalModel=Eg;De.live2DModelMiddlewares=[wg,Sg,Ig,Tg,xg,Eg];De.motionTasksMap=new WeakMap;De.expressionTasksMap=new WeakMap;hh.prototype._loadMotion=function(r,t){return De.loadMotion(this,r,t)};_g.prototype._loadExpression=function(r){return De.loadExpression(this,r)};class uT{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(t){t!==this._autoInteract&&(t?this.on("pointertap",pf,this):this.off("pointertap",pf,this),this._autoInteract=t)}registerInteraction(t){t!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&t&&(this.interactionManager=t,t.on("pointermove",mf,this)))}unregisterInteraction(){var t;this.interactionManager&&((t=this.interactionManager)==null||t.off("pointermove",mf,this),this.interactionManager=void 0)}}function pf(r){this.tap(r.data.global.x,r.data.global.y)}function mf(r){this.focus(r.data.global.x,r.data.global.y)}class lT extends qy{}const Mr=new sr,cT=new Qe;let qi;class hT extends Za{constructor(t){super(),this.tag="Live2DModel(uninitialized)",this.textures=[],this.transform=new lT,this.anchor=new po(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once("modelLoaded",()=>this.init(t))}static from(t,e){const i=new this(e);return De.setupLive2DModel(i,t,e).then(()=>i)}static fromSync(t,e){const i=new this(e);return De.setupLive2DModel(i,t,e).then(e==null?void 0:e.onLoad).catch(e==null?void 0:e.onError),i}static registerTicker(t){qi=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){var e;qi||(qi=(e=window.PIXI)==null?void 0:e.Ticker),t?this._destroyed||(qi?(qi.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):_e.warn(this.tag,"No Ticker registered, please call Live2DModel.registerTicker(Ticker).")):(qi==null||qi.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(t){this.tag=`Live2DModel(${this.internalModel.settings.name})`;const e=Object.assign({autoUpdate:!0,autoInteract:!0},t);e.autoInteract&&(this.interactive=!0),this.autoInteract=e.autoInteract,this.autoUpdate=e.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(t,e,i){return e===void 0?this.internalModel.motionManager.startRandomMotion(t,i):this.internalModel.motionManager.startMotion(t,e,i)}expression(t){return this.internalModel.motionManager.expressionManager?t===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(t):Promise.resolve(!1)}focus(t,e,i=!1){Mr.x=t,Mr.y=e,this.toModelPosition(Mr,Mr,!0);let n=Mr.x/this.internalModel.originalWidth*2-1,s=Mr.y/this.internalModel.originalHeight*2-1,o=Math.atan2(s,n);this.internalModel.focusController.focus(Math.cos(o),-Math.sin(o),i)}tap(t,e){const i=this.hitTest(t,e);i.length&&(_e.log(this.tag,"Hit",i),this.emit("hit",i))}hitTest(t,e){return Mr.x=t,Mr.y=e,this.toModelPosition(Mr,Mr),this.internalModel.hitTest(Mr.x,Mr.y)}toModelPosition(t,e=t.clone(),i){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(t,e),this.internalModel.localTransform.applyInverse(e,e),e}containsPoint(t){return this.getBounds(!0).contains(t.x,t.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(qi.shared.deltaMS)}update(t){this.deltaTime+=t,this.elapsedTime+=t}_render(t){this.registerInteraction(t.plugins.interaction),t.batch.reset(),t.geometry.reset(),t.shader.reset(),t.state.reset();let e=!1;this.glContextID!==t.CONTEXT_UID&&(this.glContextID=t.CONTEXT_UID,this.internalModel.updateWebGLContext(t.gl,this.glContextID),e=!0);for(let s=0;se.destroy(t.baseTexture)),this.internalModel.destroy(),super.destroy(t)}}vg(hT,[uT]);const ui=class{static resolveURL(r,t){var e;const i=(e=ui.filesMap[r])==null?void 0:e[t];if(i===void 0)throw new Error("Cannot find this file from uploaded files: "+t);return i}static upload(r,t){return Oe(this,null,function*(){const e={};for(const i of t.getDefinedFiles()){const n=decodeURI(Gu.resolve(t.url,i)),s=r.find(o=>o.webkitRelativePath===n);s&&(e[i]=URL.createObjectURL(s))}ui.filesMap[t._objectURL]=e})}static createSettings(r){return Oe(this,null,function*(){const t=r.find(o=>o.name.endsWith("model.json")||o.name.endsWith("model3.json"));if(!t)throw new TypeError("Settings file not found");const e=yield ui.readText(t),i=JSON.parse(e);i.url=t.webkitRelativePath;const n=De.findRuntime(i);if(!n)throw new Error("Unknown settings JSON");const s=n.createModelSettings(i);return s._objectURL=URL.createObjectURL(t),s})}static readText(r){return Oe(this,null,function*(){return new Promise((t,e)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=e,i.readAsText(r,"utf8")})})}};let dh=ui;dh.filesMap={};dh.factory=(r,t)=>Oe(void 0,null,function*(){if(Array.isArray(r.source)&&r.source[0]instanceof File){const e=r.source;let i=e.settings;if(!i)i=yield ui.createSettings(e);else if(!i._objectURL)throw new Error('"_objectURL" must be specified in ModelSettings');i.validateFiles(e.map(n=>encodeURI(n.webkitRelativePath))),yield ui.upload(e,i),i.resolveURL=function(n){return ui.resolveURL(this._objectURL,n)},r.source=i,r.live2dModel.once("modelLoaded",n=>{n.once("destroy",function(){const s=this.settings._objectURL;if(URL.revokeObjectURL(s),ui.filesMap[s])for(const o of Object.values(ui.filesMap[s]))URL.revokeObjectURL(o);delete ui.filesMap[s]})})}return t()});De.live2DModelMiddlewares.unshift(dh.factory);const lr=class{static unzip(r,t){return Oe(this,null,function*(){const e=yield lr.getFilePaths(r),i=[];for(const s of t.getDefinedFiles()){const o=decodeURI(Gu.resolve(t.url,s));e.includes(o)&&i.push(o)}const n=yield lr.getFiles(r,i);for(let s=0;so.endsWith("model.json")||o.endsWith("model3.json"));if(!e)throw new Error("Settings file not found");const i=yield lr.readText(r,e);if(!i)throw new Error("Empty settings file: "+e);const n=JSON.parse(i);n.url=e;const s=De.findRuntime(n);if(!s)throw new Error("Unknown settings JSON");return s.createModelSettings(n)})}static zipReader(r,t){return Oe(this,null,function*(){throw new Error("Not implemented")})}static getFilePaths(r){return Oe(this,null,function*(){throw new Error("Not implemented")})}static getFiles(r,t){return Oe(this,null,function*(){throw new Error("Not implemented")})}static readText(r,t){return Oe(this,null,function*(){throw new Error("Not implemented")})}static releaseReader(r){}};let Ii=lr;Ii.ZIP_PROTOCOL="zip://";Ii.uid=0;Ii.factory=(r,t)=>Oe(void 0,null,function*(){const e=r.source;let i,n,s;if(typeof e=="string"&&(e.endsWith(".zip")||e.startsWith(lr.ZIP_PROTOCOL))?(e.startsWith(lr.ZIP_PROTOCOL)?i=e.slice(lr.ZIP_PROTOCOL.length):i=e,n=yield cn.load({url:i,type:"blob",target:r.live2dModel})):Array.isArray(e)&&e.length===1&&e[0]instanceof File&&e[0].name.endsWith(".zip")&&(n=e[0],i=URL.createObjectURL(n),s=e.settings),n){if(!n.size)throw new Error("Empty zip file");const o=yield lr.zipReader(n,i);s||(s=yield lr.createSettings(o)),s._objectURL=lr.ZIP_PROTOCOL+lr.uid+"/"+s.url;const a=yield lr.unzip(o,s);a.settings=s,r.source=a,i.startsWith("blob:")&&r.live2dModel.once("modelLoaded",u=>{u.once("destroy",function(){URL.revokeObjectURL(i)})}),lr.releaseReader(o)}return t()});De.live2DModelMiddlewares.unshift(Ii.factory);if(!window.Live2DCubismCore)throw new Error("Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.");class dT extends _g{constructor(t,e){var i;super(t,e),this.queueManager=new pg,this.definitions=(i=t.expressions)!=null?i:[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(t){return this.definitions.findIndex(e=>e.Name===t)}getExpressionFile(t){return t.File}createExpression(t,e){return sh.create(t)}_setExpression(t){return this.queueManager.startMotion(t,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}}class qn extends ch{constructor(t){if(super(t),!qn.isValidJSON(t))throw new TypeError("Invalid JSON.");Object.assign(this,new gg(t))}static isValidJSON(t){var e;return!!(t!=null&&t.FileReferences)&&typeof t.FileReferences.Moc=="string"&&((e=t.FileReferences.Textures)==null?void 0:e.length)>0&&t.FileReferences.Textures.every(i=>typeof i=="string")}replaceFiles(t){if(super.replaceFiles(t),this.motions)for(const[e,i]of Object.entries(this.motions))for(let n=0;n{this.emit("motion:"+i)})}isFinished(){return this.queueManager.isFinished()}_startMotion(t,e){return t.setFinishedMotionHandler(e),this.queueManager.stopAllMotions(),this.queueManager.startMotion(t,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(t,e,i){const n=ah.create(t),s=new fg(t),o=(e===this.groups.idle?br.idleMotionFadingDuration:br.motionFadingDuration)/1e3;return s.getMotionFadeInTime()===void 0&&n.setFadeInTime(i.FadeInTime>0?i.FadeInTime:o),s.getMotionFadeOutTime()===void 0&&n.setFadeOutTime(i.FadeOutTime>0?i.FadeOutTime:o),n.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),n}getMotionFile(t){return t.File}getMotionName(t){return t.File}getSoundFile(t){return t.Sound}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}}const yf=new zr;class pT extends sT{constructor(t,e,i){super(),this.lipSync=!0,this.breath=eh.create(),this.renderer=new yg,this.idParamAngleX=V1,this.idParamAngleY=G1,this.idParamAngleZ=W1,this.idParamEyeBallX=H1,this.idParamEyeBallY=Y1,this.idParamBodyAngleX=X1,this.idParamBreath=q1,this.pixelsPerUnit=1,this.centeringTransform=new Qe,this.coreModel=t,this.settings=e,this.motionManager=new fT(e,i),this.init()}init(){var t;super.init(),((t=this.settings.getEyeBlinkParameters())==null?void 0:t.length)>0&&(this.eyeBlink=hg.create(this.settings)),this.breath.setParameters([new ao(this.idParamAngleX,0,15,6.5345,.5),new ao(this.idParamAngleY,0,8,3.5345,.5),new ao(this.idParamAngleZ,0,10,5.5345,.5),new ao(this.idParamBodyAngleX,0,4,15.5345,.5),new ao(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){const t={};if(this.settings.layout)for(const e of Object.keys(this.settings.layout)){const i=e.charAt(0).toLowerCase()+e.slice(1);t[i]=this.settings.layout[e]}return t}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(t,e){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(t),this.renderer._clippingManager._currentFrameNo=e,this.renderer._clippingManager._maskTexture=void 0,Rs.getInstance()._shaderSets=[]}bindTexture(t,e){this.renderer.bindTexture(t,e)}getHitAreaDefs(){var t,e;return(e=(t=this.settings.hitAreas)==null?void 0:t.map(i=>({id:i.Id,name:i.Name,index:this.coreModel.getDrawableIndex(i.Id)})))!=null?e:[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(t){return this.coreModel.getDrawableIndex(t)}getDrawableVertices(t){if(typeof t=="string"&&(t=this.coreModel.getDrawableIndex(t),t===-1))throw new TypeError("Unable to find drawable ID: "+t);const e=this.coreModel.getDrawableVertices(t).slice();for(let i=0;i{function e(){try{yT(),r()}catch(i){if(gf--,gf<0){const n=new Error("Failed to start up Cubism 4 framework.");n.cause=i,t(n);return}_e.log("Cubism4","Startup failed, retrying 10ms later..."),setTimeout(e,10)}}e()})),Ea)}function yT(r){r=Object.assign({logFunction:console.log,loggingLevel:is.LogLevel_Verbose},r),zo.startUp(r),zo.initialize()}De.registerRuntime({version:4,ready:mT,test(r){return r instanceof qn||qn.isValidJSON(r)},isValidMoc(r){if(r.byteLength<4)return!1;const t=new Int8Array(r,0,4);return String.fromCharCode(...t)==="MOC3"},createModelSettings(r){return new qn(r)},createCoreModel(r){const t=nh.create(r);try{const e=t.createModel();return e.__moc=t,e}catch(e){try{t.release()}catch{}throw e}},createInternalModel(r,t,e){const i=new pT(r,t,e),n=r;return n.__moc&&(i.__moc=n.__moc,delete n.__moc,i.once("destroy",gT)),i},createPhysics(r,t){return uh.create(t)},createPose(r,t){return rh.create(t)}});function gT(){var r;(r=this.__moc)==null||r.release()}/*! - * @pixi/interaction - v6.5.10 - * Compiled Thu, 06 Jul 2023 15:25:11 UTC - * - * @pixi/interaction is licensed under the MIT License. - * http://www.opensource.org/licenses/mit-license - */var vf=function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new sr,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(r.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),r.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},r.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},r.prototype.reset=function(){this.isPrimary=!1},r}();/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var fc=function(r,t){return fc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},fc(r,t)};function vT(r,t){fc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var _T=function(){function r(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return r.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},r.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},r}(),Pl=function(){function r(t){this._pointerId=t,this._flags=r.FLAGS.NONE}return r.prototype._doSet=function(t,e){e?this._flags=this._flags|t:this._flags=this._flags&~t},Object.defineProperty(r.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"none",{get:function(){return this._flags===r.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"over",{get:function(){return(this._flags&r.FLAGS.OVER)!==0},set:function(t){this._doSet(r.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightDown",{get:function(){return(this._flags&r.FLAGS.RIGHT_DOWN)!==0},set:function(t){this._doSet(r.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftDown",{get:function(){return(this._flags&r.FLAGS.LEFT_DOWN)!==0},set:function(t){this._doSet(r.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),r.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),r}(),bT=function(){function r(){this._tempPoint=new sr}return r.prototype.recursiveFindHit=function(t,e,i,n,s){var o;if(!e||!e.visible)return!1;var a=t.data.global;s=e.interactive||s;var u=!1,l=s,c=!0;if(e.hitArea)n&&(e.worldTransform.applyInverse(a,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?u=!0:(n=!1,c=!1)),l=!1;else if(e._mask&&n){var h=e._mask.isMaskData?e._mask.maskObject:e._mask;h&&!(!((o=h.containsPoint)===null||o===void 0)&&o.call(h,a))&&(n=!1)}if(c&&e.interactiveChildren&&e.children)for(var p=e.children,d=p.length-1;d>=0;d--){var g=p[d],y=this.recursiveFindHit(t,g,i,n,l);if(y){if(!g.parent)continue;l=!1,y&&(t.target&&(n=!1),u=!0)}}return s&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(a)&&(u=!0),e.interactive&&(u&&!t.target&&(t.target=e),i&&i(t,e,!!u))),u},r.prototype.findHit=function(t,e,i,n){this.recursiveFindHit(t,e,i,n,!1)},r}(),wT={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(r){r?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};ko.mixin(wT);var Aa=1,Oa={target:null,data:{global:null}},PD=function(r){vT(t,r);function t(e,i){var n=r.call(this)||this;return i=i||{},n.renderer=e,n.autoPreventDefault=i.autoPreventDefault!==void 0?i.autoPreventDefault:!0,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new vf,n.mouse.identifier=Aa,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[Aa]=n.mouse,n.interactionDataPool=[],n.eventData=new _T,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new bT,n._tempDisplayObject=new cg,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=i.useSystemTicker!==void 0?i.useSystemTicker:!0,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,i){return Oa.target=null,Oa.data.global=e,i||(i=this.lastObjectRendered),this.processInteractive(Oa,i,null,!0),Oa.target},t.prototype.setTargetElement=function(e,i){i===void 0&&(i=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=i,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(ai.system.add(this.tickerUpdate,this,Vs.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(ai.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime0&&(a=e.composedPath()[0]);for(var u=a!==this.interactionDOMElement?"outside":"",l=0;l"u"&&(o.button=e.touches.length?1:0),typeof o.buttons>"u"&&(o.buttons=e.touches.length?1:0),typeof o.isPrimary>"u"&&(o.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof o.width>"u"&&(o.width=o.radiusX||1),typeof o.height>"u"&&(o.height=o.radiusY||1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="touch"),typeof o.pointerId>"u"&&(o.pointerId=o.identifier||0),typeof o.pressure>"u"&&(o.pressure=o.force||.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),typeof o.layerX>"u"&&(o.layerX=o.offsetX=o.clientX),typeof o.layerY>"u"&&(o.layerY=o.offsetY=o.clientY),o.isNormalized=!0,i.push(o)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){var a=e;typeof a.isPrimary>"u"&&(a.isPrimary=!0),typeof a.width>"u"&&(a.width=1),typeof a.height>"u"&&(a.height=1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="mouse"),typeof a.pointerId>"u"&&(a.pointerId=Aa),typeof a.pressure>"u"&&(a.pressure=.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),a.isNormalized=!0,i.push(a)}else i.push(e);return i},t.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},t.extension={name:"interaction",type:[jr.RendererPlugin,jr.CanvasRendererPlugin]},t}(gn);function sn(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ll={exports:{}};/*! - localForage -- Offline Storage, Improved - Version 1.10.0 - https://localforage.github.io/localForage - (c) 2013-2017 Mozilla, Apache License 2.0 -*/var _f;function ST(){return _f||(_f=1,function(r,t){(function(e){r.exports=e()})(function(){return function e(i,n,s){function o(l,c){if(!n[l]){if(!i[l]){var h=typeof sn=="function"&&sn;if(!c&&h)return h(l,!0);if(a)return a(l,!0);var p=new Error("Cannot find module '"+l+"'");throw p.code="MODULE_NOT_FOUND",p}var d=n[l]={exports:{}};i[l][0].call(d.exports,function(g){var y=i[l][1][g];return o(y||g)},d,d.exports,e,i,n,s)}return n[l].exports}for(var a=typeof sn=="function"&&sn,u=0;u"u"&&e(3);var h=Promise;function p(T,$){$&&T.then(function(M){$(null,M)},function(M){$(M)})}function d(T,$,M){typeof $=="function"&&T.then($),typeof M=="function"&&T.catch(M)}function g(T){return typeof T!="string"&&(console.warn(T+" used as a key, but it is not a string."),T=String(T)),T}function y(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var f="local-forage-detect-blob-support",m=void 0,_={},I=Object.prototype.toString,E="readonly",b="readwrite";function F(T){for(var $=T.length,M=new ArrayBuffer($),Y=new Uint8Array(M),Q=0;Q<$;Q++)Y[Q]=T.charCodeAt(Q);return M}function S(T){return new h(function($){var M=T.transaction(f,b),Y=c([""]);M.objectStore(f).put(Y,"key"),M.onabort=function(Q){Q.preventDefault(),Q.stopPropagation(),$(!1)},M.oncomplete=function(){var Q=navigator.userAgent.match(/Chrome\/(\d+)/),G=navigator.userAgent.match(/Edge\//);$(G||!Q||parseInt(Q[1],10)>=43)}}).catch(function(){return!1})}function z(T){return typeof m=="boolean"?h.resolve(m):S(T).then(function($){return m=$,m})}function B(T){var $=_[T.name],M={};M.promise=new h(function(Y,Q){M.resolve=Y,M.reject=Q}),$.deferredOperations.push(M),$.dbReady?$.dbReady=$.dbReady.then(function(){return M.promise}):$.dbReady=M.promise}function tt(T){var $=_[T.name],M=$.deferredOperations.pop();if(M)return M.resolve(),M.promise}function st(T,$){var M=_[T.name],Y=M.deferredOperations.pop();if(Y)return Y.reject($),Y.promise}function x(T,$){return new h(function(M,Y){if(_[T.name]=_[T.name]||O(),T.db)if($)B(T),T.db.close();else return M(T.db);var Q=[T.name];$&&Q.push(T.version);var G=u.open.apply(u,Q);$&&(G.onupgradeneeded=function(nt){var lt=G.result;try{lt.createObjectStore(T.storeName),nt.oldVersion<=1&<.createObjectStore(f)}catch(ct){if(ct.name==="ConstraintError")console.warn('The database "'+T.name+'" has been upgraded from version '+nt.oldVersion+" to version "+nt.newVersion+', but the storage "'+T.storeName+'" already exists.');else throw ct}}),G.onerror=function(nt){nt.preventDefault(),Y(G.error)},G.onsuccess=function(){var nt=G.result;nt.onversionchange=function(lt){lt.target.close()},M(nt),tt(T)}})}function Z(T){return x(T,!1)}function w(T){return x(T,!0)}function it(T,$){if(!T.db)return!0;var M=!T.db.objectStoreNames.contains(T.storeName),Y=T.versionT.db.version;if(Y&&(T.version!==$&&console.warn('The database "'+T.name+`" can't be downgraded from version `+T.db.version+" to version "+T.version+"."),T.version=T.db.version),Q||M){if(M){var G=T.db.version+1;G>T.version&&(T.version=G)}return!0}return!1}function D(T){return new h(function($,M){var Y=new FileReader;Y.onerror=M,Y.onloadend=function(Q){var G=btoa(Q.target.result||"");$({__local_forage_encoded_blob:!0,data:G,type:T.type})},Y.readAsBinaryString(T)})}function C(T){var $=F(atob(T.data));return c([$],{type:T.type})}function R(T){return T&&T.__local_forage_encoded_blob}function k(T){var $=this,M=$._initReady().then(function(){var Y=_[$._dbInfo.name];if(Y&&Y.dbReady)return Y.dbReady});return d(M,T,T),M}function U(T){B(T);for(var $=_[T.name],M=$.forages,Y=0;Y0&&(!T.db||G.name==="InvalidStateError"||G.name==="NotFoundError"))return h.resolve().then(function(){if(!T.db||G.name==="NotFoundError"&&!T.db.objectStoreNames.contains(T.storeName)&&T.version<=T.db.version)return T.db&&(T.version=T.db.version+1),w(T)}).then(function(){return U(T).then(function(){A(T,$,M,Y-1)})}).catch(M);M(G)}}function O(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function V(T){var $=this,M={db:null};if(T)for(var Y in T)M[Y]=T[Y];var Q=_[M.name];Q||(Q=O(),_[M.name]=Q),Q.forages.push($),$._initReady||($._initReady=$.ready,$.ready=k);var G=[];function nt(){return h.resolve()}for(var lt=0;lt>4,mt[Q++]=(nt&15)<<4|lt>>2,mt[Q++]=(lt&3)<<6|ct&63;return dt}function Xi(T){var $=new Uint8Array(T),M="",Y;for(Y=0;Y<$.length;Y+=3)M+=K[$[Y]>>2],M+=K[($[Y]&3)<<4|$[Y+1]>>4],M+=K[($[Y+1]&15)<<2|$[Y+2]>>6],M+=K[$[Y+2]&63];return $.length%3===2?M=M.substring(0,M.length-1)+"=":$.length%3===1&&(M=M.substring(0,M.length-2)+"=="),M}function eo(T,$){var M="";if(T&&(M=Yi.call(T)),T&&(M==="[object ArrayBuffer]"||T.buffer&&Yi.call(T.buffer)==="[object ArrayBuffer]")){var Y,Q=N;T instanceof ArrayBuffer?(Y=T,Q+=ot):(Y=T.buffer,M==="[object Int8Array]"?Q+=rt:M==="[object Uint8Array]"?Q+=ht:M==="[object Uint8ClampedArray]"?Q+=bt:M==="[object Int16Array]"?Q+=pt:M==="[object Uint16Array]"?Q+=me:M==="[object Int32Array]"?Q+=Ot:M==="[object Uint32Array]"?Q+=se:M==="[object Float32Array]"?Q+=er:M==="[object Float64Array]"?Q+=Hi:$(new Error("Failed to get type for BinaryArray"))),$(Q+Xi(Y))}else if(M==="[object Blob]"){var G=new FileReader;G.onload=function(){var nt=q+T.type+"~"+Xi(this.result);$(N+at+nt)},G.readAsArrayBuffer(T)}else try{$(JSON.stringify(T))}catch(nt){console.error("Couldn't convert value into a JSON string: ",T),$(null,nt)}}function Yr(T){if(T.substring(0,X)!==N)return JSON.parse(T);var $=T.substring(gr),M=T.substring(X,gr),Y;if(M===at&&P.test($)){var Q=$.match(P);Y=Q[1],$=$.substring(Q[0].length)}var G=Ee($);switch(M){case ot:return G;case at:return c([G],{type:Y});case rt:return new Int8Array(G);case ht:return new Uint8Array(G);case bt:return new Uint8ClampedArray(G);case pt:return new Int16Array(G);case me:return new Uint16Array(G);case Ot:return new Int32Array(G);case se:return new Uint32Array(G);case er:return new Float32Array(G);case Hi:return new Float64Array(G);default:throw new Error("Unkown type: "+M)}}var as={serialize:eo,deserialize:Yr,stringToBuffer:Ee,bufferToString:Xi};function ca(T,$,M,Y){T.executeSql("CREATE TABLE IF NOT EXISTS "+$.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],M,Y)}function nl(T){var $=this,M={db:null};if(T)for(var Y in T)M[Y]=typeof T[Y]!="string"?T[Y].toString():T[Y];var Q=new h(function(G,nt){try{M.db=openDatabase(M.name,String(M.version),M.description,M.size)}catch(lt){return nt(lt)}M.db.transaction(function(lt){ca(lt,M,function(){$._dbInfo=M,G()},function(ct,dt){nt(dt)})},nt)});return M.serializer=as,Q}function ti(T,$,M,Y,Q,G){T.executeSql(M,Y,Q,function(nt,lt){lt.code===lt.SYNTAX_ERR?nt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[$.storeName],function(ct,dt){dt.rows.length?G(ct,lt):ca(ct,$,function(){ct.executeSql(M,Y,Q,G)},G)},G):G(nt,lt)},G)}function ha(T,$){var M=this;T=g(T);var Y=new h(function(Q,G){M.ready().then(function(){var nt=M._dbInfo;nt.db.transaction(function(lt){ti(lt,nt,"SELECT * FROM "+nt.storeName+" WHERE key = ? LIMIT 1",[T],function(ct,dt){var mt=dt.rows.length?dt.rows.item(0).value:null;mt&&(mt=nt.serializer.deserialize(mt)),Q(mt)},function(ct,dt){G(dt)})})}).catch(G)});return p(Y,$),Y}function Sn(T,$){var M=this,Y=new h(function(Q,G){M.ready().then(function(){var nt=M._dbInfo;nt.db.transaction(function(lt){ti(lt,nt,"SELECT * FROM "+nt.storeName,[],function(ct,dt){for(var mt=dt.rows,It=mt.length,ie=0;ie0){nt(In.apply(Q,[T,ct,M,Y-1]));return}lt(ie)}})})}).catch(lt)});return p(G,M),G}function tw(T,$,M){return In.apply(this,[T,$,M,1])}function ew(T,$){var M=this;T=g(T);var Y=new h(function(Q,G){M.ready().then(function(){var nt=M._dbInfo;nt.db.transaction(function(lt){ti(lt,nt,"DELETE FROM "+nt.storeName+" WHERE key = ?",[T],function(){Q()},function(ct,dt){G(dt)})})}).catch(G)});return p(Y,$),Y}function rw(T){var $=this,M=new h(function(Y,Q){$.ready().then(function(){var G=$._dbInfo;G.db.transaction(function(nt){ti(nt,G,"DELETE FROM "+G.storeName,[],function(){Y()},function(lt,ct){Q(ct)})})}).catch(Q)});return p(M,T),M}function iw(T){var $=this,M=new h(function(Y,Q){$.ready().then(function(){var G=$._dbInfo;G.db.transaction(function(nt){ti(nt,G,"SELECT COUNT(key) as c FROM "+G.storeName,[],function(lt,ct){var dt=ct.rows.item(0).c;Y(dt)},function(lt,ct){Q(ct)})})}).catch(Q)});return p(M,T),M}function nw(T,$){var M=this,Y=new h(function(Q,G){M.ready().then(function(){var nt=M._dbInfo;nt.db.transaction(function(lt){ti(lt,nt,"SELECT key FROM "+nt.storeName+" WHERE id = ? LIMIT 1",[T+1],function(ct,dt){var mt=dt.rows.length?dt.rows.item(0).key:null;Q(mt)},function(ct,dt){G(dt)})})}).catch(G)});return p(Y,$),Y}function sw(T){var $=this,M=new h(function(Y,Q){$.ready().then(function(){var G=$._dbInfo;G.db.transaction(function(nt){ti(nt,G,"SELECT key FROM "+G.storeName,[],function(lt,ct){for(var dt=[],mt=0;mt '__WebKitDatabaseInfoTable__'",[],function(Q,G){for(var nt=[],lt=0;lt0}function dw(T){var $=this,M={};if(T)for(var Y in T)M[Y]=T[Y];return M.keyPrefix=od(T,$._defaultConfig),hw()?($._dbInfo=M,M.serializer=as,h.resolve()):h.reject()}function fw(T){var $=this,M=$.ready().then(function(){for(var Y=$._dbInfo.keyPrefix,Q=localStorage.length-1;Q>=0;Q--){var G=localStorage.key(Q);G.indexOf(Y)===0&&localStorage.removeItem(G)}});return p(M,T),M}function pw(T,$){var M=this;T=g(T);var Y=M.ready().then(function(){var Q=M._dbInfo,G=localStorage.getItem(Q.keyPrefix+T);return G&&(G=Q.serializer.deserialize(G)),G});return p(Y,$),Y}function mw(T,$){var M=this,Y=M.ready().then(function(){for(var Q=M._dbInfo,G=Q.keyPrefix,nt=G.length,lt=localStorage.length,ct=1,dt=0;dt=0;nt--){var lt=localStorage.key(nt);lt.indexOf(G)===0&&localStorage.removeItem(lt)}}):Q=h.reject("Invalid arguments"),p(Q,$),Q}var Sw={_driver:"localStorageWrapper",_initStorage:dw,_support:lw(),iterate:mw,getItem:pw,setItem:bw,removeItem:_w,clear:fw,length:vw,key:yw,keys:gw,dropInstance:ww},Iw=function($,M){return $===M||typeof $=="number"&&typeof M=="number"&&isNaN($)&&isNaN(M)},Tw=function($,M){for(var Y=$.length,Q=0;Q"u"?"undefined":s(M))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var Y in M){if(Y==="storeName"&&(M[Y]=M[Y].replace(/\W/g,"_")),Y==="version"&&typeof M[Y]!="number")return new Error("Database version must be a number.");this._config[Y]=M[Y]}return"driver"in M&&M.driver?this.setDriver(this._config.driver):!0}else return typeof M=="string"?this._config[M]:this._config},T.prototype.defineDriver=function(M,Y,Q){var G=new h(function(nt,lt){try{var ct=M._driver,dt=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!M._driver){lt(dt);return}for(var mt=sl.concat("_initStorage"),It=0,ie=mt.length;It - -(c) 2009-2016 Stuart Knightley -Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - -JSZip uses the library pako released under the MIT license : -https://github.com/nodeca/pako/blob/main/LICENSE -*/var bf;function TT(){return bf||(bf=1,function(r,t){(function(e){r.exports=e()})(function(){return function e(i,n,s){function o(l,c){if(!n[l]){if(!i[l]){var h=typeof sn=="function"&&sn;if(!c&&h)return h(l,!0);if(a)return a(l,!0);var p=new Error("Cannot find module '"+l+"'");throw p.code="MODULE_NOT_FOUND",p}var d=n[l]={exports:{}};i[l][0].call(d.exports,function(g){var y=i[l][1][g];return o(y||g)},d,d.exports,e,i,n,s)}return n[l].exports}for(var a=typeof sn=="function"&&sn,u=0;u>2,d=(3&l)<<4|c>>4,g=1>6:64,y=2>4,c=(15&p)<<4|(d=a.indexOf(u.charAt(y++)))>>2,h=(3&d)<<6|(g=a.indexOf(u.charAt(y++))),_[f++]=l,d!==64&&(_[f++]=c),g!==64&&(_[f++]=h);return _}},{"./support":30,"./utils":32}],2:[function(e,i,n){var s=e("./external"),o=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),u=e("./stream/DataLengthProbe");function l(c,h,p,d,g){this.compressedSize=c,this.uncompressedSize=h,this.crc32=p,this.compression=d,this.compressedContent=g}l.prototype={getContentWorker:function(){var c=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),h=this;return c.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),c},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(c,h,p){return c.pipe(new a).pipe(new u("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new u("compressedSize")).withStreamInfo("compression",h)},i.exports=l},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,i,n){var s=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,i,n){var s=e("./utils"),o=function(){for(var a,u=[],l=0;l<256;l++){a=l;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;u[l]=a}return u}();i.exports=function(a,u){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(l,c,h,p){var d=o,g=p+h;l^=-1;for(var y=p;y>>8^d[255&(l^c[y])];return-1^l}(0|u,a,a.length,0):function(l,c,h,p){var d=o,g=p+h;l^=-1;for(var y=p;y>>8^d[255&(l^c.charCodeAt(y))];return-1^l}(0|u,a,a.length,0):0}},{"./utils":32}],5:[function(e,i,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,i,n){var s=null;s=typeof Promise<"u"?Promise:e("lie"),i.exports={Promise:s}},{lie:37}],7:[function(e,i,n){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=e("pako"),a=e("./utils"),u=e("./stream/GenericWorker"),l=s?"uint8array":"array";function c(h,p){u.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}n.magic="\b\0",a.inherits(c,u),c.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(l,h.data),!1)},c.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},n.compressWorker=function(h){return new c("Deflate",h)},n.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,i,n){function s(d,g){var y,f="";for(y=0;y>>=8;return f}function o(d,g,y,f,m,_){var I,E,b=d.file,F=d.compression,S=_!==l.utf8encode,z=a.transformTo("string",_(b.name)),B=a.transformTo("string",l.utf8encode(b.name)),tt=b.comment,st=a.transformTo("string",_(tt)),x=a.transformTo("string",l.utf8encode(tt)),Z=B.length!==b.name.length,w=x.length!==tt.length,it="",D="",C="",R=b.dir,k=b.date,U={crc32:0,compressedSize:0,uncompressedSize:0};g&&!y||(U.crc32=d.crc32,U.compressedSize=d.compressedSize,U.uncompressedSize=d.uncompressedSize);var A=0;g&&(A|=8),S||!Z&&!w||(A|=2048);var O=0,V=0;R&&(O|=16),m==="UNIX"?(V=798,O|=function(J,yt){var vt=J;return J||(vt=yt?16893:33204),(65535&vt)<<16}(b.unixPermissions,R)):(V=20,O|=function(J){return 63&(J||0)}(b.dosPermissions)),I=k.getUTCHours(),I<<=6,I|=k.getUTCMinutes(),I<<=5,I|=k.getUTCSeconds()/2,E=k.getUTCFullYear()-1980,E<<=4,E|=k.getUTCMonth()+1,E<<=5,E|=k.getUTCDate(),Z&&(D=s(1,1)+s(c(z),4)+B,it+="up"+s(D.length,2)+D),w&&(C=s(1,1)+s(c(st),4)+x,it+="uc"+s(C.length,2)+C);var et="";return et+=` -\0`,et+=s(A,2),et+=F.magic,et+=s(I,2),et+=s(E,2),et+=s(U.crc32,4),et+=s(U.compressedSize,4),et+=s(U.uncompressedSize,4),et+=s(z.length,2),et+=s(it.length,2),{fileRecord:h.LOCAL_FILE_HEADER+et+z+it,dirRecord:h.CENTRAL_FILE_HEADER+s(V,2)+et+s(st.length,2)+"\0\0\0\0"+s(O,4)+s(f,4)+z+it+st}}var a=e("../utils"),u=e("../stream/GenericWorker"),l=e("../utf8"),c=e("../crc32"),h=e("../signature");function p(d,g,y,f){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=y,this.encodeFileName=f,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,u),p.prototype.push=function(d){var g=d.meta.percent||0,y=this.entriesCount,f=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,u.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:y?(g+100*(y-f-1))/y:100}}))},p.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var g=this.streamFiles&&!d.file.dir;if(g){var y=o(d,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:y.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(d){this.accumulate=!1;var g=this.streamFiles&&!d.file.dir,y=o(d,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(y.dirRecord),g)this.push({data:function(f){return h.DATA_DESCRIPTOR+s(f.crc32,4)+s(f.compressedSize,4)+s(f.uncompressedSize,4)}(d),meta:{percent:100}});else for(this.push({data:y.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var d=this.bytesWritten,g=0;g=this.index;u--)l=(l<<8)+this.byteAt(u);return this.index+=a,l},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},i.exports=o},{"../utils":32}],19:[function(e,i,n){var s=e("./Uint8ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var u=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,u},i.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,i,n){var s=e("./DataReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var u=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,u},i.exports=o},{"../utils":32,"./DataReader":18}],21:[function(e,i,n){var s=e("./ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,u},i.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(e,i,n){var s=e("../utils"),o=e("../support"),a=e("./ArrayReader"),u=e("./StringReader"),l=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");i.exports=function(h){var p=s.getTypeOf(h);return s.checkSupport(p),p!=="string"||o.uint8array?p==="nodebuffer"?new l(h):o.uint8array?new c(s.transformTo("uint8array",h)):new a(s.transformTo("array",h)):new u(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,i,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,i,n){var s=e("./GenericWorker"),o=e("../utils");function a(u){s.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(a,s),a.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},i.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,i,n){var s=e("./GenericWorker"),o=e("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,s),a.prototype.processChunk=function(u){this.streamInfo.crc32=o(u.data,this.streamInfo.crc32||0),this.push(u)},i.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}s.inherits(a,o),a.prototype.processChunk=function(u){if(u){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+u.data.length}o.prototype.processChunk.call(this,u)},i.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(u){o.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(c){l.dataIsReady=!0,l.data=c,l.max=c&&c.length||0,l.type=s.getTypeOf(c),l.isPaused||l._tickAndRepeat()},function(c){l.error(c)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,l);break;case"uint8array":u=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":u=this.data.slice(this.index,l)}return this.index=l,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,i,n){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var u=0;u "+o:o}},i.exports=s},{}],29:[function(e,i,n){var s=e("../utils"),o=e("./ConvertWorker"),a=e("./GenericWorker"),u=e("../base64"),l=e("../support"),c=e("../external"),h=null;if(l.nodestream)try{h=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(g,y){return new c.Promise(function(f,m){var _=[],I=g._internalType,E=g._outputType,b=g._mimeType;g.on("data",function(F,S){_.push(F),y&&y(S)}).on("error",function(F){_=[],m(F)}).on("end",function(){try{var F=function(S,z,B){switch(S){case"blob":return s.newBlob(s.transformTo("arraybuffer",z),B);case"base64":return u.encode(z);default:return s.transformTo(S,z)}}(E,function(S,z){var B,tt=0,st=null,x=0;for(B=0;B"u")n.blob=!1;else{var s=new ArrayBuffer(0);try{n.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),n.blob=o.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,i,n){for(var s=e("./utils"),o=e("./support"),a=e("./nodejsUtils"),u=e("./stream/GenericWorker"),l=new Array(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;l[254]=l[254]=1;function h(){u.call(this,"utf-8 decode"),this.leftOver=null}function p(){u.call(this,"utf-8 encode")}n.utf8encode=function(d){return o.nodebuffer?a.newBufferFrom(d,"utf-8"):function(g){var y,f,m,_,I,E=g.length,b=0;for(_=0;_>>6:(f<65536?y[I++]=224|f>>>12:(y[I++]=240|f>>>18,y[I++]=128|f>>>12&63),y[I++]=128|f>>>6&63),y[I++]=128|63&f);return y}(d)},n.utf8decode=function(d){return o.nodebuffer?s.transformTo("nodebuffer",d).toString("utf-8"):function(g){var y,f,m,_,I=g.length,E=new Array(2*I);for(y=f=0;y>10&1023,E[f++]=56320|1023&m)}return E.length!==f&&(E.subarray?E=E.subarray(0,f):E.length=f),s.applyFromCharCode(E)}(d=s.transformTo(o.uint8array?"uint8array":"array",d))},s.inherits(h,u),h.prototype.processChunk=function(d){var g=s.transformTo(o.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var y=g;(g=new Uint8Array(y.length+this.leftOver.length)).set(this.leftOver,0),g.set(y,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var f=function(_,I){var E;for((I=I||_.length)>_.length&&(I=_.length),E=I-1;0<=E&&(192&_[E])==128;)E--;return E<0||E===0?I:E+l[_[E]]>I?E:I}(g),m=g;f!==g.length&&(o.uint8array?(m=g.subarray(0,f),this.leftOver=g.subarray(f,g.length)):(m=g.slice(0,f),this.leftOver=g.slice(f,g.length))),this.push({data:n.utf8decode(m),meta:d.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=h,s.inherits(p,u),p.prototype.processChunk=function(d){this.push({data:n.utf8encode(d.data),meta:d.meta})},n.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,i,n){var s=e("./support"),o=e("./base64"),a=e("./nodejsUtils"),u=e("./external");function l(y){return y}function c(y,f){for(var m=0;m>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var g,y,f,m=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4>>6:(d<65536?p[f++]=224|d>>>12:(p[f++]=240|d>>>18,p[f++]=128|d>>>12&63),p[f++]=128|d>>>6&63),p[f++]=128|63&d);return p},n.buf2binstring=function(h){return c(h,h.length)},n.binstring2buf=function(h){for(var p=new s.Buf8(h.length),d=0,g=p.length;d>10&1023,_[g++]=56320|1023&y)}return c(_,g)},n.utf8border=function(h,p){var d;for((p=p||h.length)>h.length&&(p=h.length),d=p-1;0<=d&&(192&h[d])==128;)d--;return d<0||d===0?p:d+u[h[d]]>p?d:p}},{"./common":41}],43:[function(e,i,n){i.exports=function(s,o,a,u){for(var l=65535&s|0,c=s>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3>>1:o>>>1;a[u]=o}return a}();i.exports=function(o,a,u,l){var c=s,h=l+u;o^=-1;for(var p=l;p>>8^c[255&(o^a[p])];return-1^o}},{}],46:[function(e,i,n){var s,o=e("../utils/common"),a=e("./trees"),u=e("./adler32"),l=e("./crc32"),c=e("./messages"),h=0,p=4,d=0,g=-2,y=-1,f=4,m=2,_=8,I=9,E=286,b=30,F=19,S=2*E+1,z=15,B=3,tt=258,st=tt+B+1,x=42,Z=113,w=1,it=2,D=3,C=4;function R(v,K){return v.msg=c[K],K}function k(v){return(v<<1)-(4v.avail_out&&(q=v.avail_out),q!==0&&(o.arraySet(v.output,K.pending_buf,K.pending_out,q,v.next_out),v.next_out+=q,K.pending_out+=q,v.total_out+=q,v.avail_out-=q,K.pending-=q,K.pending===0&&(K.pending_out=0))}function O(v,K){a._tr_flush_block(v,0<=v.block_start?v.block_start:-1,v.strstart-v.block_start,K),v.block_start=v.strstart,A(v.strm)}function V(v,K){v.pending_buf[v.pending++]=K}function et(v,K){v.pending_buf[v.pending++]=K>>>8&255,v.pending_buf[v.pending++]=255&K}function J(v,K){var q,P,N=v.max_chain_length,X=v.strstart,ot=v.prev_length,at=v.nice_match,rt=v.strstart>v.w_size-st?v.strstart-(v.w_size-st):0,ht=v.window,bt=v.w_mask,pt=v.prev,Ot=v.strstart+tt,me=ht[X+ot-1],se=ht[X+ot];v.prev_length>=v.good_match&&(N>>=2),at>v.lookahead&&(at=v.lookahead);do if(ht[(q=K)+ot]===se&&ht[q+ot-1]===me&&ht[q]===ht[X]&&ht[++q]===ht[X+1]){X+=2,q++;do;while(ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&ht[++X]===ht[++q]&&Xrt&&--N!=0);return ot<=v.lookahead?ot:v.lookahead}function yt(v){var K,q,P,N,X,ot,at,rt,ht,bt,pt=v.w_size;do{if(N=v.window_size-v.lookahead-v.strstart,v.strstart>=pt+(pt-st)){for(o.arraySet(v.window,v.window,pt,pt,0),v.match_start-=pt,v.strstart-=pt,v.block_start-=pt,K=q=v.hash_size;P=v.head[--K],v.head[K]=pt<=P?P-pt:0,--q;);for(K=q=pt;P=v.prev[--K],v.prev[K]=pt<=P?P-pt:0,--q;);N+=pt}if(v.strm.avail_in===0)break;if(ot=v.strm,at=v.window,rt=v.strstart+v.lookahead,ht=N,bt=void 0,bt=ot.avail_in,ht=B)for(X=v.strstart-v.insert,v.ins_h=v.window[X],v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B)if(P=a._tr_tally(v,v.strstart-v.match_start,v.match_length-B),v.lookahead-=v.match_length,v.match_length<=v.max_lazy_match&&v.lookahead>=B){for(v.match_length--;v.strstart++,v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B&&v.match_length<=v.prev_length){for(N=v.strstart+v.lookahead-B,P=a._tr_tally(v,v.strstart-1-v.prev_match,v.prev_length-B),v.lookahead-=v.prev_length-1,v.prev_length-=2;++v.strstart<=N&&(v.ins_h=(v.ins_h<v.pending_buf_size-5&&(q=v.pending_buf_size-5);;){if(v.lookahead<=1){if(yt(v),v.lookahead===0&&K===h)return w;if(v.lookahead===0)break}v.strstart+=v.lookahead,v.lookahead=0;var P=v.block_start+q;if((v.strstart===0||v.strstart>=P)&&(v.lookahead=v.strstart-P,v.strstart=P,O(v,!1),v.strm.avail_out===0)||v.strstart-v.block_start>=v.w_size-st&&(O(v,!1),v.strm.avail_out===0))return w}return v.insert=0,K===p?(O(v,!0),v.strm.avail_out===0?D:C):(v.strstart>v.block_start&&(O(v,!1),v.strm.avail_out),w)}),new _t(4,4,8,4,vt),new _t(4,5,16,8,vt),new _t(4,6,32,32,vt),new _t(4,4,16,16,ft),new _t(8,16,32,32,ft),new _t(8,16,128,128,ft),new _t(8,32,128,256,ft),new _t(32,128,258,1024,ft),new _t(32,258,258,4096,ft)],n.deflateInit=function(v,K){return ce(v,K,_,15,8,0)},n.deflateInit2=ce,n.deflateReset=ee,n.deflateResetKeep=Et,n.deflateSetHeader=function(v,K){return v&&v.state?v.state.wrap!==2?g:(v.state.gzhead=K,d):g},n.deflate=function(v,K){var q,P,N,X;if(!v||!v.state||5>8&255),V(P,P.gzhead.time>>16&255),V(P,P.gzhead.time>>24&255),V(P,P.level===9?2:2<=P.strategy||P.level<2?4:0),V(P,255&P.gzhead.os),P.gzhead.extra&&P.gzhead.extra.length&&(V(P,255&P.gzhead.extra.length),V(P,P.gzhead.extra.length>>8&255)),P.gzhead.hcrc&&(v.adler=l(v.adler,P.pending_buf,P.pending,0)),P.gzindex=0,P.status=69):(V(P,0),V(P,0),V(P,0),V(P,0),V(P,0),V(P,P.level===9?2:2<=P.strategy||P.level<2?4:0),V(P,3),P.status=Z);else{var ot=_+(P.w_bits-8<<4)<<8;ot|=(2<=P.strategy||P.level<2?0:P.level<6?1:P.level===6?2:3)<<6,P.strstart!==0&&(ot|=32),ot+=31-ot%31,P.status=Z,et(P,ot),P.strstart!==0&&(et(P,v.adler>>>16),et(P,65535&v.adler)),v.adler=1}if(P.status===69)if(P.gzhead.extra){for(N=P.pending;P.gzindex<(65535&P.gzhead.extra.length)&&(P.pending!==P.pending_buf_size||(P.gzhead.hcrc&&P.pending>N&&(v.adler=l(v.adler,P.pending_buf,P.pending-N,N)),A(v),N=P.pending,P.pending!==P.pending_buf_size));)V(P,255&P.gzhead.extra[P.gzindex]),P.gzindex++;P.gzhead.hcrc&&P.pending>N&&(v.adler=l(v.adler,P.pending_buf,P.pending-N,N)),P.gzindex===P.gzhead.extra.length&&(P.gzindex=0,P.status=73)}else P.status=73;if(P.status===73)if(P.gzhead.name){N=P.pending;do{if(P.pending===P.pending_buf_size&&(P.gzhead.hcrc&&P.pending>N&&(v.adler=l(v.adler,P.pending_buf,P.pending-N,N)),A(v),N=P.pending,P.pending===P.pending_buf_size)){X=1;break}X=P.gzindexN&&(v.adler=l(v.adler,P.pending_buf,P.pending-N,N)),X===0&&(P.gzindex=0,P.status=91)}else P.status=91;if(P.status===91)if(P.gzhead.comment){N=P.pending;do{if(P.pending===P.pending_buf_size&&(P.gzhead.hcrc&&P.pending>N&&(v.adler=l(v.adler,P.pending_buf,P.pending-N,N)),A(v),N=P.pending,P.pending===P.pending_buf_size)){X=1;break}X=P.gzindexN&&(v.adler=l(v.adler,P.pending_buf,P.pending-N,N)),X===0&&(P.status=103)}else P.status=103;if(P.status===103&&(P.gzhead.hcrc?(P.pending+2>P.pending_buf_size&&A(v),P.pending+2<=P.pending_buf_size&&(V(P,255&v.adler),V(P,v.adler>>8&255),v.adler=0,P.status=Z)):P.status=Z),P.pending!==0){if(A(v),v.avail_out===0)return P.last_flush=-1,d}else if(v.avail_in===0&&k(K)<=k(q)&&K!==p)return R(v,-5);if(P.status===666&&v.avail_in!==0)return R(v,-5);if(v.avail_in!==0||P.lookahead!==0||K!==h&&P.status!==666){var at=P.strategy===2?function(rt,ht){for(var bt;;){if(rt.lookahead===0&&(yt(rt),rt.lookahead===0)){if(ht===h)return w;break}if(rt.match_length=0,bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++,bt&&(O(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(O(rt,!0),rt.strm.avail_out===0?D:C):rt.last_lit&&(O(rt,!1),rt.strm.avail_out===0)?w:it}(P,K):P.strategy===3?function(rt,ht){for(var bt,pt,Ot,me,se=rt.window;;){if(rt.lookahead<=tt){if(yt(rt),rt.lookahead<=tt&&ht===h)return w;if(rt.lookahead===0)break}if(rt.match_length=0,rt.lookahead>=B&&0rt.lookahead&&(rt.match_length=rt.lookahead)}if(rt.match_length>=B?(bt=a._tr_tally(rt,1,rt.match_length-B),rt.lookahead-=rt.match_length,rt.strstart+=rt.match_length,rt.match_length=0):(bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++),bt&&(O(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(O(rt,!0),rt.strm.avail_out===0?D:C):rt.last_lit&&(O(rt,!1),rt.strm.avail_out===0)?w:it}(P,K):s[P.level].func(P,K);if(at!==D&&at!==C||(P.status=666),at===w||at===D)return v.avail_out===0&&(P.last_flush=-1),d;if(at===it&&(K===1?a._tr_align(P):K!==5&&(a._tr_stored_block(P,0,0,!1),K===3&&(U(P.head),P.lookahead===0&&(P.strstart=0,P.block_start=0,P.insert=0))),A(v),v.avail_out===0))return P.last_flush=-1,d}return K!==p?d:P.wrap<=0?1:(P.wrap===2?(V(P,255&v.adler),V(P,v.adler>>8&255),V(P,v.adler>>16&255),V(P,v.adler>>24&255),V(P,255&v.total_in),V(P,v.total_in>>8&255),V(P,v.total_in>>16&255),V(P,v.total_in>>24&255)):(et(P,v.adler>>>16),et(P,65535&v.adler)),A(v),0=q.w_size&&(X===0&&(U(q.head),q.strstart=0,q.block_start=0,q.insert=0),ht=new o.Buf8(q.w_size),o.arraySet(ht,K,bt-q.w_size,q.w_size,0),K=ht,bt=q.w_size),ot=v.avail_in,at=v.next_in,rt=v.input,v.avail_in=bt,v.next_in=0,v.input=K,yt(q);q.lookahead>=B;){for(P=q.strstart,N=q.lookahead-(B-1);q.ins_h=(q.ins_h<>>=B=z>>>24,I-=B,(B=z>>>16&255)===0)it[c++]=65535&z;else{if(!(16&B)){if((64&B)==0){z=E[(65535&z)+(_&(1<>>=B,I-=B),I<15&&(_+=w[u++]<>>=B=z>>>24,I-=B,!(16&(B=z>>>16&255))){if((64&B)==0){z=b[(65535&z)+(_&(1<>>=B,I-=B,(B=c-h)>3,_&=(1<<(I-=tt<<3))-1,s.next_in=u,s.next_out=c,s.avail_in=u>>24&255)+(x>>>8&65280)+((65280&x)<<8)+((255&x)<<24)}function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function I(x){var Z;return x&&x.state?(Z=x.state,x.total_in=x.total_out=Z.total=0,x.msg="",Z.wrap&&(x.adler=1&Z.wrap),Z.mode=g,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new s.Buf32(y),Z.distcode=Z.distdyn=new s.Buf32(f),Z.sane=1,Z.back=-1,p):d}function E(x){var Z;return x&&x.state?((Z=x.state).wsize=0,Z.whave=0,Z.wnext=0,I(x)):d}function b(x,Z){var w,it;return x&&x.state?(it=x.state,Z<0?(w=0,Z=-Z):(w=1+(Z>>4),Z<48&&(Z&=15)),Z&&(Z<8||15=C.wsize?(s.arraySet(C.window,Z,w-C.wsize,C.wsize,0),C.wnext=0,C.whave=C.wsize):(it<(D=C.wsize-C.wnext)&&(D=it),s.arraySet(C.window,Z,w-it,D,C.wnext),(it-=D)?(s.arraySet(C.window,Z,w-it,it,0),C.wnext=it,C.whave=C.wsize):(C.wnext+=D,C.wnext===C.wsize&&(C.wnext=0),C.whave>>8&255,w.check=a(w.check,X,2,0),O=A=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&A)<<8)+(A>>8))%31){x.msg="incorrect header check",w.mode=30;break}if((15&A)!=8){x.msg="unknown compression method",w.mode=30;break}if(O-=4,v=8+(15&(A>>>=4)),w.wbits===0)w.wbits=v;else if(v>w.wbits){x.msg="invalid window size",w.mode=30;break}w.dmax=1<>8&1),512&w.flags&&(X[0]=255&A,X[1]=A>>>8&255,w.check=a(w.check,X,2,0)),O=A=0,w.mode=3;case 3:for(;O<32;){if(k===0)break t;k--,A+=it[C++]<>>8&255,X[2]=A>>>16&255,X[3]=A>>>24&255,w.check=a(w.check,X,4,0)),O=A=0,w.mode=4;case 4:for(;O<16;){if(k===0)break t;k--,A+=it[C++]<>8),512&w.flags&&(X[0]=255&A,X[1]=A>>>8&255,w.check=a(w.check,X,2,0)),O=A=0,w.mode=5;case 5:if(1024&w.flags){for(;O<16;){if(k===0)break t;k--,A+=it[C++]<>>8&255,w.check=a(w.check,X,2,0)),O=A=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(k<(J=w.length)&&(J=k),J&&(w.head&&(v=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),s.arraySet(w.head.extra,it,C,J,v)),512&w.flags&&(w.check=a(w.check,it,J,C)),k-=J,C+=J,w.length-=J),w.length))break t;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(k===0)break t;for(J=0;v=it[C+J++],w.head&&v&&w.length<65536&&(w.head.name+=String.fromCharCode(v)),v&&J>9&1,w.head.done=!0),x.adler=w.check=0,w.mode=12;break;case 10:for(;O<32;){if(k===0)break t;k--,A+=it[C++]<>>=7&O,O-=7&O,w.mode=27;break}for(;O<3;){if(k===0)break t;k--,A+=it[C++]<>>=1)){case 0:w.mode=14;break;case 1:if(tt(w),w.mode=20,Z!==6)break;A>>>=2,O-=2;break t;case 2:w.mode=17;break;case 3:x.msg="invalid block type",w.mode=30}A>>>=2,O-=2;break;case 14:for(A>>>=7&O,O-=7&O;O<32;){if(k===0)break t;k--,A+=it[C++]<>>16^65535)){x.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&A,O=A=0,w.mode=15,Z===6)break t;case 15:w.mode=16;case 16:if(J=w.length){if(k>>=5,O-=5,w.ndist=1+(31&A),A>>>=5,O-=5,w.ncode=4+(15&A),A>>>=4,O-=4,286>>=3,O-=3}for(;w.have<19;)w.lens[ot[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,q={bits:w.lenbits},K=l(0,w.lens,0,19,w.lencode,0,w.work,q),w.lenbits=q.bits,K){x.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have>>16&255,gt=65535&N,!((ft=N>>>24)<=O);){if(k===0)break t;k--,A+=it[C++]<>>=ft,O-=ft,w.lens[w.have++]=gt;else{if(gt===16){for(P=ft+2;O>>=ft,O-=ft,w.have===0){x.msg="invalid bit length repeat",w.mode=30;break}v=w.lens[w.have-1],J=3+(3&A),A>>>=2,O-=2}else if(gt===17){for(P=ft+3;O>>=ft)),A>>>=3,O-=3}else{for(P=ft+7;O>>=ft)),A>>>=7,O-=7}if(w.have+J>w.nlen+w.ndist){x.msg="invalid bit length repeat",w.mode=30;break}for(;J--;)w.lens[w.have++]=v}}if(w.mode===30)break;if(w.lens[256]===0){x.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,q={bits:w.lenbits},K=l(c,w.lens,0,w.nlen,w.lencode,0,w.work,q),w.lenbits=q.bits,K){x.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,q={bits:w.distbits},K=l(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,q),w.distbits=q.bits,K){x.msg="invalid distances set",w.mode=30;break}if(w.mode=20,Z===6)break t;case 20:w.mode=21;case 21:if(6<=k&&258<=U){x.next_out=R,x.avail_out=U,x.next_in=C,x.avail_in=k,w.hold=A,w.bits=O,u(x,et),R=x.next_out,D=x.output,U=x.avail_out,C=x.next_in,it=x.input,k=x.avail_in,A=w.hold,O=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;_t=(N=w.lencode[A&(1<>>16&255,gt=65535&N,!((ft=N>>>24)<=O);){if(k===0)break t;k--,A+=it[C++]<>Et)])>>>16&255,gt=65535&N,!(Et+(ft=N>>>24)<=O);){if(k===0)break t;k--,A+=it[C++]<>>=Et,O-=Et,w.back+=Et}if(A>>>=ft,O-=ft,w.back+=ft,w.length=gt,_t===0){w.mode=26;break}if(32&_t){w.back=-1,w.mode=12;break}if(64&_t){x.msg="invalid literal/length code",w.mode=30;break}w.extra=15&_t,w.mode=22;case 22:if(w.extra){for(P=w.extra;O>>=w.extra,O-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;_t=(N=w.distcode[A&(1<>>16&255,gt=65535&N,!((ft=N>>>24)<=O);){if(k===0)break t;k--,A+=it[C++]<>Et)])>>>16&255,gt=65535&N,!(Et+(ft=N>>>24)<=O);){if(k===0)break t;k--,A+=it[C++]<>>=Et,O-=Et,w.back+=Et}if(A>>>=ft,O-=ft,w.back+=ft,64&_t){x.msg="invalid distance code",w.mode=30;break}w.offset=gt,w.extra=15&_t,w.mode=24;case 24:if(w.extra){for(P=w.extra;O>>=w.extra,O-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){x.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(U===0)break t;if(J=et-U,w.offset>J){if((J=w.offset-J)>w.whave&&w.sane){x.msg="invalid distance too far back",w.mode=30;break}yt=J>w.wnext?(J-=w.wnext,w.wsize-J):w.wnext-J,J>w.length&&(J=w.length),vt=w.window}else vt=D,yt=R-w.offset,J=w.length;for(US?(B=yt[vt+f[Z]],O[V+f[Z]]):(B=96,0),_=1<>R)+(I-=_)]=z<<24|B<<16|tt|0,I!==0;);for(_=1<>=1;if(_!==0?(A&=_-1,A+=_):A=0,Z++,--et[x]==0){if(x===it)break;x=h[p+f[Z]]}if(D>>7)]}function V(N,X){N.pending_buf[N.pending++]=255&X,N.pending_buf[N.pending++]=X>>>8&255}function et(N,X,ot){N.bi_valid>m-ot?(N.bi_buf|=X<>m-N.bi_valid,N.bi_valid+=ot-m):(N.bi_buf|=X<>>=1,ot<<=1,0<--X;);return ot>>>1}function vt(N,X,ot){var at,rt,ht=new Array(f+1),bt=0;for(at=1;at<=f;at++)ht[at]=bt=bt+ot[at-1]<<1;for(rt=0;rt<=X;rt++){var pt=N[2*rt+1];pt!==0&&(N[2*rt]=yt(ht[pt]++,pt))}}function ft(N){var X;for(X=0;X>1;1<=ot;ot--)Et(N,ht,ot);for(rt=Ot;ot=N.heap[1],N.heap[1]=N.heap[N.heap_len--],Et(N,ht,1),at=N.heap[1],N.heap[--N.heap_max]=ot,N.heap[--N.heap_max]=at,ht[2*rt]=ht[2*ot]+ht[2*at],N.depth[rt]=(N.depth[ot]>=N.depth[at]?N.depth[ot]:N.depth[at])+1,ht[2*ot+1]=ht[2*at+1]=rt,N.heap[1]=rt++,Et(N,ht,1),2<=N.heap_len;);N.heap[--N.heap_max]=N.heap[1],function(se,er){var Hi,gr,Yi,Ee,Xi,eo,Yr=er.dyn_tree,as=er.max_code,ca=er.stat_desc.static_tree,nl=er.stat_desc.has_stree,ti=er.stat_desc.extra_bits,ha=er.stat_desc.extra_base,Sn=er.stat_desc.max_length,In=0;for(Ee=0;Ee<=f;Ee++)se.bl_count[Ee]=0;for(Yr[2*se.heap[se.heap_max]+1]=0,Hi=se.heap_max+1;Hi>=7;rt>>=1)if(1&me&&pt.dyn_ltree[2*Ot]!==0)return o;if(pt.dyn_ltree[18]!==0||pt.dyn_ltree[20]!==0||pt.dyn_ltree[26]!==0)return a;for(Ot=32;Ot>>3,(ht=N.static_len+3+7>>>3)<=rt&&(rt=ht)):rt=ht=ot+5,ot+4<=rt&&X!==-1?P(N,X,ot,at):N.strategy===4||ht===rt?(et(N,2+(at?1:0),3),ee(N,st,x)):(et(N,4+(at?1:0),3),function(pt,Ot,me,se){var er;for(et(pt,Ot-257,5),et(pt,me-1,5),et(pt,se-4,4),er=0;er>>8&255,N.pending_buf[N.d_buf+2*N.last_lit+1]=255&X,N.pending_buf[N.l_buf+N.last_lit]=255&ot,N.last_lit++,X===0?N.dyn_ltree[2*ot]++:(N.matches++,X--,N.dyn_ltree[2*(w[ot]+h+1)]++,N.dyn_dtree[2*O(X)]++),N.last_lit===N.lit_bufsize-1},n._tr_align=function(N){et(N,2,3),J(N,I,st),function(X){X.bi_valid===16?(V(X,X.bi_buf),X.bi_buf=0,X.bi_valid=0):8<=X.bi_valid&&(X.pending_buf[X.pending++]=255&X.bi_buf,X.bi_buf>>=8,X.bi_valid-=8)}(N)}},{"../utils/common":41}],53:[function(e,i,n){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,i,n){(function(s){(function(o,a){if(!o.setImmediate){var u,l,c,h,p=1,d={},g=!1,y=o.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(o);f=f&&f.setTimeout?f:o,u={}.toString.call(o.process)==="[object process]"?function(E){process.nextTick(function(){_(E)})}:function(){if(o.postMessage&&!o.importScripts){var E=!0,b=o.onmessage;return o.onmessage=function(){E=!1},o.postMessage("","*"),o.onmessage=b,E}}()?(h="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",I,!1):o.attachEvent("onmessage",I),function(E){o.postMessage(h+E,"*")}):o.MessageChannel?((c=new MessageChannel).port1.onmessage=function(E){_(E.data)},function(E){c.port2.postMessage(E)}):y&&"onreadystatechange"in y.createElement("script")?(l=y.documentElement,function(E){var b=y.createElement("script");b.onreadystatechange=function(){_(E),b.onreadystatechange=null,l.removeChild(b),b=null},l.appendChild(b)}):function(E){setTimeout(_,0,E)},f.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var b=new Array(arguments.length-1),F=0;F"u"?s===void 0?this:s:self)}).call(this,typeof di<"u"?di:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(Bl)),Bl.exports}var xT=TT();const ET=Vu(xT);Ii.zipReader=(r,t)=>ET.loadAsync(r);const AT=Ii.createSettings;Ii.createSettings=async r=>{const t=Object.keys(r.files);return t.find(e=>OT(e))?AT(r):MT(t)};function OT(r){return r.endsWith("model3.json")}function CT(r){return r.endsWith(".moc3")}function FT(r){return r.split(/[\\/]/).pop()}function MT(r){const t=r.filter(l=>CT(l));if(t.length!==1){const l=t.length?`(${t.map(c=>`"${c}"`).join(",")})`:"";throw new Error(`Expected exactly one moc file, got ${t.length} ${l}`)}const e=t[0],i=FT(e).replace(/\.moc3?/,""),n=r.filter(l=>l.endsWith(".png"));if(!n.length)throw new Error("Textures not found");const s=r.filter(l=>l.endsWith(".mtn")||l.endsWith(".motion3.json")),o=r.find(l=>l.includes("physics")),a=r.find(l=>l.includes("pose")),u=new qn({url:`${i}.model3.json`,Version:3,FileReferences:{Moc:e,Textures:n,Physics:o,Pose:a,Motions:s.length?{"":s.map(l=>({File:l}))}:void 0}});return u.name=i,u._objectURL=`example://${u.url}`,u}Ii.readText=(r,t)=>{const e=r.file(t);if(!e)throw new Error(`Cannot find file: ${t}`);return e.async("text")};Ii.getFilePaths=r=>{const t=[];return r.forEach(e=>t.push(e)),Promise.resolve(t)};Ii.getFiles=(r,t)=>Promise.all(t.map(async e=>{const i=e.slice(e.lastIndexOf("/")+1),n=await r.file(e).async("blob");return new File([n],i)}));function Zt(r,t,e,i){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{l(i.next(c))}catch(h){o(h)}}function u(c){try{l(i.throw(c))}catch(h){o(h)}}function l(c){c.done?s(c.value):n(c.value).then(a,u)}l((i=i.apply(r,t||[])).next())})}function wf(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Mt(r){return this instanceof Mt?(this.v=r,this):new Mt(r)}function dr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(r,t||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(d){return function(g){return Promise.resolve(g).then(d,h)}}function a(d,g){i[d]&&(n[d]=function(y){return new Promise(function(f,m){s.push([d,y,f,m])>1||u(d,y)})},g&&(n[d]=g(n[d])))}function u(d,g){try{l(i[d](g))}catch(y){p(s[0][3],y)}}function l(d){d.value instanceof Mt?Promise.resolve(d.value.v).then(c,h):p(s[0][2],d)}function c(d){u("next",d)}function h(d){u("throw",d)}function p(d,g){d(g),s.shift(),s.length&&u(s[0][0],s[0][1])}}function Qn(r){var t,e;return t={},i("next"),i("throw",function(n){throw n}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(n,s){t[n]=r[n]?function(o){return(e=!e)?{value:Mt(r[n](o)),done:!1}:s?s(o):o}:s}}function yi(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 wf=="function"?wf(r):r[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=r[s]&&function(o){return new Promise(function(a,u){o=r[s](o),n(a,u,o.done,o.value)})}}function n(s,o,a,u){Promise.resolve(u).then(function(l){s({value:l,done:a})},o)}}const DT=new TextDecoder("utf-8"),pc=r=>DT.decode(r),RT=new TextEncoder,fh=r=>RT.encode(r),NT=r=>typeof r=="number",Ag=r=>typeof r=="boolean",je=r=>typeof r=="function",fr=r=>r!=null&&Object(r)===r,Kn=r=>fr(r)&&je(r.then),ea=r=>fr(r)&&je(r[Symbol.iterator]),Zs=r=>fr(r)&&je(r[Symbol.asyncIterator]),mc=r=>fr(r)&&fr(r.schema),Og=r=>fr(r)&&"done"in r&&"value"in r,Cg=r=>fr(r)&&je(r.stat)&&NT(r.fd),Fg=r=>fr(r)&&ph(r.body),Yu=r=>"_getDOMStream"in r&&"_getNodeStream"in r,PT=r=>fr(r)&&je(r.abort)&&je(r.getWriter)&&!Yu(r),ph=r=>fr(r)&&je(r.cancel)&&je(r.getReader)&&!Yu(r),LT=r=>fr(r)&&je(r.end)&&je(r.write)&&Ag(r.writable)&&!Yu(r),Mg=r=>fr(r)&&je(r.read)&&je(r.pipe)&&Ag(r.readable)&&!Yu(r),BT=r=>fr(r)&&je(r.clear)&&je(r.bytes)&&je(r.position)&&je(r.setPosition)&&je(r.capacity)&&je(r.getBufferIdentifier)&&je(r.createLong),mh=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function UT(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,u=0,l=0,c=r.length;++uc+h.byteLength,0);let n,s,o,a=0,u=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++uve(Int32Array,r),If=r=>ve(BigInt64Array,r),oe=r=>ve(Uint8Array,r),yc=r=>(r.next(),r);function*kT(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof mh?e(t):ea(t)?t:e(t);return yield*yc(function*(n){let s=null;do s=n.next(yield ve(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const zT=r=>kT(Uint8Array,r);function Dg(r,t){return dr(this,arguments,function*(){if(Kn(t))return yield Mt(yield Mt(yield*Qn(yi(Dg(r,yield Mt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Mt(yield Mt(o))})},n=function(o){return dr(this,arguments,function*(){yield Mt(yield*Qn(yi(yc(function*(a){let u=null;do u=a.next(yield u==null?void 0:u.value);while(!u.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof mh?i(t):ea(t)?n(t):Zs(t)?t:i(t);return yield Mt(yield*Qn(yi(yc(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Mt(o.next(yield yield Mt(ve(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Mt(new r)})}const $T=r=>Dg(Uint8Array,r);function Rg(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++e(r.next(),r);function*VT(r){let t,e=!1,i=[],n,s,o,a=0;function u(){return s==="peek"?gi(i,o)[0]:([n,i,a]=gi(i,o),n)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const l=zT(r)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(o-a)?l.next():l.next(o-a),!t&&n.byteLength>0&&(i.push(n),a+=n.byteLength),t||o<=a)do({cmd:s,size:o}=yield u());while(o0&&(n.push(s),u+=s.byteLength),e||a<=u)do({cmd:o,size:a}=yield yield Mt(l()));while(a0&&(n.push(oe(s)),u+=s.byteLength),e||a<=u)do({cmd:o,size:a}=yield yield Mt(l()));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 Zt(this,void 0,void 0,function*(){const{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return Zt(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=oe(e)),e})}}const Ul=(r,t)=>{const e=n=>i([t,n]);let i;return[t,e,new Promise(n=>(i=n)&&r.once(t,e))]};function YT(r){return dr(this,arguments,function*(){const e=[];let i="error",n=!1,s=null,o,a,u=0,l=[],c;function h(){return o==="peek"?gi(l,a)[0]:([c,l,u]=gi(l,a),c)}if({cmd:o,size:a}=(yield yield Mt(null))||{cmd:"read",size:0},r.isTTY)return yield yield Mt(new Uint8Array(0)),yield Mt(null);try{e[0]=Ul(r,"end"),e[1]=Ul(r,"error");do{if(e[2]=Ul(r,"readable"),[i,s]=yield Mt(Promise.race(e.map(d=>d[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(a-u)?(c=oe(r.read(a-u)),c.byteLength0&&(l.push(c),u+=c.byteLength)),n||a<=u)do({cmd:o,size:a}=yield yield Mt(h()));while(a{for(const[m,_]of d)r.off(m,_);try{const m=r.destroy;m&&m.call(r,g),g=void 0}catch(m){g=m||g}finally{g!=null?f(g):y()}})}})}var Le;(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"})(Le||(Le={}));var Je;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(Je||(Je={}));var Ze;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(Ze||(Ze={}));var Vr;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Vr||(Vr={}));var zt;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(zt||(zt={}));var vi;(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"})(vi||(vi={}));const kl=2,li=4,Li=4,pe=4,en=new Int32Array(2),Tf=new Float32Array(en.buffer),xf=new Float64Array(en.buffer),Fa=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var gc;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(gc||(gc={}));let Gs=class Ng{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Ng(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){Tf[0]=e,this.writeInt32(t,en[0])}writeFloat64(t,e){xf[0]=e,this.writeInt32(t,en[Fa?0:1]),this.writeInt32(t+4,en[Fa?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*kl;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,li+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(e=0;i--)t.addInt32(e[i]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,i){return cr.startUnion(t),cr.addMode(t,e),cr.addTypeIds(t,i),cr.endUnion(t)}}let Df=class xo{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 xo).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+pe),(e||new xo).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return xo.startUtf8(t),xo.endUtf8(t)}};var we;(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"})(we||(we={}));let Rr=class za{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 za).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+pe),(e||new za).__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):we.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 Bi).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const i=this.bb.__offset(this.bb_pos,14);return i?(e||new za).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,16);return i?(e||new Ve).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,we.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},ni=class Ai{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 Ai).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+pe),(e||new Ai).__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):Ws.Little}fields(t,e){const i=this.bb.__offset(this.bb_pos,6);return i?(e||new Rr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,8);return i?(e||new Ve).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,Ws.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addInt64(e[i]);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,i,n,s){return Ai.startSchema(t),Ai.addEndianness(t,e),Ai.addFields(t,i),Ai.addCustomMetadata(t,n),Ai.addFeatures(t,s),Ai.endSchema(t)}};var he;(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"})(he||(he={}));var L;(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"})(L||(L={}));var Ri;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(Ri||(Ri={}));const XT=void 0;function jo(r){if(r===null)return"null";if(r===XT)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=>jo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}function be(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 kg(r,t){return be(r/t)+be(r%t)/be(t)}const qT=Symbol.for("isArrowBigNum");function Kr(r,...t){return t.length===0?Object.setPrototypeOf(ve(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}Kr.prototype[qT]=!0;Kr.prototype.toJSON=function(){return`"${Go(this)}"`};Kr.prototype.valueOf=function(r){return zg(this,r)};Kr.prototype.toString=function(){return Go(this)};Kr.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return zg(this);case"string":return Go(this);case"default":return ZT(this)}return Go(this)};function Ns(...r){return Kr.apply(this,r)}function Ps(...r){return Kr.apply(this,r)}function Vo(...r){return Kr.apply(this,r)}Object.setPrototypeOf(Ns.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ps.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Vo.prototype,Object.create(Uint32Array.prototype));Object.assign(Ns.prototype,Kr.prototype,{constructor:Ns,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ps.prototype,Kr.prototype,{constructor:Ps,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Vo.prototype,Kr.prototype,{constructor:Vo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const QT=BigInt(4294967296)*BigInt(4294967296),KT=QT-BigInt(1);function zg(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return zl(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(At.prototype);let hn=class extends At{constructor(){super(L.Null)}toString(){return"Null"}};Vg=Symbol.toStringTag;hn[Vg]=(r=>r[Symbol.toStringTag]="Null")(hn.prototype);let Zn=class extends At{constructor(t,e){super(L.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}`}};Gg=Symbol.toStringTag;Zn[Gg]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Zn.prototype);class Wo extends Zn{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Wo.prototype,"ArrayType",{value:Int32Array});let iu=class extends At{constructor(t){super(L.Float),this.precision=t}get ArrayType(){switch(this.precision){case Ze.HALF:return Uint16Array;case Ze.SINGLE:return Float32Array;case Ze.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Wg=Symbol.toStringTag;iu[Wg]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(iu.prototype);let nu=class extends At{constructor(){super(L.Binary)}toString(){return"Binary"}};Hg=Symbol.toStringTag;nu[Hg]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(nu.prototype);let su=class extends At{constructor(){super(L.LargeBinary)}toString(){return"LargeBinary"}};Yg=Symbol.toStringTag;su[Yg]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(su.prototype);let ou=class extends At{constructor(){super(L.Utf8)}toString(){return"Utf8"}};Xg=Symbol.toStringTag;ou[Xg]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(ou.prototype);let au=class extends At{constructor(){super(L.LargeUtf8)}toString(){return"LargeUtf8"}};qg=Symbol.toStringTag;au[qg]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(au.prototype);let uu=class extends At{constructor(){super(L.Bool)}toString(){return"Bool"}};Qg=Symbol.toStringTag;uu[Qg]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(uu.prototype);let lu=class extends At{constructor(t,e,i=128){super(L.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Kg=Symbol.toStringTag;lu[Kg]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(lu.prototype);let cu=class extends At{constructor(t){super(L.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Vr[this.unit]}>`}get ArrayType(){return this.unit===Vr.DAY?Int32Array:BigInt64Array}};Zg=Symbol.toStringTag;cu[Zg]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(cu.prototype);let hu=class extends At{constructor(t,e){super(L.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${zt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Jg=Symbol.toStringTag;hu[Jg]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(hu.prototype);let du=class extends At{constructor(t,e){super(L.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${zt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};tv=Symbol.toStringTag;du[tv]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(du.prototype);let fu=class extends At{constructor(t){super(L.Interval),this.unit=t}toString(){return`Interval<${vi[this.unit]}>`}};ev=Symbol.toStringTag;fu[ev]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(fu.prototype);let pu=class extends At{constructor(t){super(L.Duration),this.unit=t}toString(){return`Duration<${zt[this.unit]}>`}};rv=Symbol.toStringTag;pu[rv]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(pu.prototype);let mu=class extends At{constructor(t){super(L.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}};iv=Symbol.toStringTag;mu[iv]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(mu.prototype);let ir=class extends At{constructor(t){super(L.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};nv=Symbol.toStringTag;ir[nv]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(ir.prototype);let yu=class extends At{constructor(t,e,i){super(L.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};sv=Symbol.toStringTag;yu[sv]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(yu.prototype);let gu=class extends At{constructor(t){super(L.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};ov=Symbol.toStringTag;gu[ov]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(gu.prototype);let vu=class extends At{constructor(t,e){super(L.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}>`}};av=Symbol.toStringTag;vu[av]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(vu.prototype);let _u=class extends At{constructor(t,e=!1){var i,n,s;if(super(L.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.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(", ")}}>`}};uv=Symbol.toStringTag;_u[uv]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(_u.prototype);const tx=(r=>()=>++r)(-1);let Hs=class extends At{constructor(t,e,i,n){super(L.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?tx():be(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};lv=Symbol.toStringTag;Hs[lv]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Hs.prototype);function Ni(r){const t=r;switch(r.typeId){case L.Decimal:return r.bitWidth/32;case L.Interval:return 1+t.unit;case L.FixedSizeList:return t.listSize;case L.FixedSizeBinary:return t.byteWidth;default:return 1}}let re=class{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return ex(this,t,e)}getVisitFnByTypeId(t,e=!0){return Is(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 ex(r,t,e=!0){return typeof t=="number"?Is(r,t,e):typeof t=="string"&&t in L?Is(r,L[t],e):t&&t instanceof At?Is(r,Rf(t),e):t!=null&&t.type&&t.type instanceof At?Is(r,Rf(t.type),e):Is(r,L.NONE,e)}function Is(r,t,e=!0){let i=null;switch(t){case L.Null:i=r.visitNull;break;case L.Bool:i=r.visitBool;break;case L.Int:i=r.visitInt;break;case L.Int8:i=r.visitInt8||r.visitInt;break;case L.Int16:i=r.visitInt16||r.visitInt;break;case L.Int32:i=r.visitInt32||r.visitInt;break;case L.Int64:i=r.visitInt64||r.visitInt;break;case L.Uint8:i=r.visitUint8||r.visitInt;break;case L.Uint16:i=r.visitUint16||r.visitInt;break;case L.Uint32:i=r.visitUint32||r.visitInt;break;case L.Uint64:i=r.visitUint64||r.visitInt;break;case L.Float:i=r.visitFloat;break;case L.Float16:i=r.visitFloat16||r.visitFloat;break;case L.Float32:i=r.visitFloat32||r.visitFloat;break;case L.Float64:i=r.visitFloat64||r.visitFloat;break;case L.Utf8:i=r.visitUtf8;break;case L.LargeUtf8:i=r.visitLargeUtf8;break;case L.Binary:i=r.visitBinary;break;case L.LargeBinary:i=r.visitLargeBinary;break;case L.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case L.Date:i=r.visitDate;break;case L.DateDay:i=r.visitDateDay||r.visitDate;break;case L.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case L.Timestamp:i=r.visitTimestamp;break;case L.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case L.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case L.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case L.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case L.Time:i=r.visitTime;break;case L.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case L.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case L.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case L.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case L.Decimal:i=r.visitDecimal;break;case L.List:i=r.visitList;break;case L.Struct:i=r.visitStruct;break;case L.Union:i=r.visitUnion;break;case L.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case L.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case L.Dictionary:i=r.visitDictionary;break;case L.Interval:i=r.visitInterval;break;case L.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case L.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case L.Duration:i=r.visitDuration;break;case L.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case L.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case L.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case L.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case L.FixedSizeList:i=r.visitFixedSizeList;break;case L.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${L[t]}'`)}function Rf(r){switch(r.typeId){case L.Null:return L.Null;case L.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?L.Int8:L.Uint8;case 16:return e?L.Int16:L.Uint16;case 32:return e?L.Int32:L.Uint32;case 64:return e?L.Int64:L.Uint64}return L.Int}case L.Float:switch(r.precision){case Ze.HALF:return L.Float16;case Ze.SINGLE:return L.Float32;case Ze.DOUBLE:return L.Float64}return L.Float;case L.Binary:return L.Binary;case L.LargeBinary:return L.LargeBinary;case L.Utf8:return L.Utf8;case L.LargeUtf8:return L.LargeUtf8;case L.Bool:return L.Bool;case L.Decimal:return L.Decimal;case L.Time:switch(r.unit){case zt.SECOND:return L.TimeSecond;case zt.MILLISECOND:return L.TimeMillisecond;case zt.MICROSECOND:return L.TimeMicrosecond;case zt.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(r.unit){case zt.SECOND:return L.TimestampSecond;case zt.MILLISECOND:return L.TimestampMillisecond;case zt.MICROSECOND:return L.TimestampMicrosecond;case zt.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(r.unit){case Vr.DAY:return L.DateDay;case Vr.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(r.unit){case vi.DAY_TIME:return L.IntervalDayTime;case vi.YEAR_MONTH:return L.IntervalYearMonth}return L.Interval;case L.Duration:switch(r.unit){case zt.SECOND:return L.DurationSecond;case zt.MILLISECOND:return L.DurationMillisecond;case zt.MICROSECOND:return L.DurationMicrosecond;case zt.NANOSECOND:return L.DurationNanosecond}return L.Duration;case L.Map:return L.Map;case L.List:return L.List;case L.Struct:return L.Struct;case L.Union:switch(r.mode){case Je.Dense:return L.DenseUnion;case Je.Sparse:return L.SparseUnion}return L.Union;case L.FixedSizeBinary:return L.FixedSizeBinary;case L.FixedSizeList:return L.FixedSizeList;case L.Dictionary:return L.Dictionary}throw new Error(`Unrecognized type '${L[r.typeId]}'`)}re.prototype.visitInt8=null;re.prototype.visitInt16=null;re.prototype.visitInt32=null;re.prototype.visitInt64=null;re.prototype.visitUint8=null;re.prototype.visitUint16=null;re.prototype.visitUint32=null;re.prototype.visitUint64=null;re.prototype.visitFloat16=null;re.prototype.visitFloat32=null;re.prototype.visitFloat64=null;re.prototype.visitDateDay=null;re.prototype.visitDateMillisecond=null;re.prototype.visitTimestampSecond=null;re.prototype.visitTimestampMillisecond=null;re.prototype.visitTimestampMicrosecond=null;re.prototype.visitTimestampNanosecond=null;re.prototype.visitTimeSecond=null;re.prototype.visitTimeMillisecond=null;re.prototype.visitTimeMicrosecond=null;re.prototype.visitTimeNanosecond=null;re.prototype.visitDenseUnion=null;re.prototype.visitSparseUnion=null;re.prototype.visitIntervalDayTime=null;re.prototype.visitIntervalYearMonth=null;re.prototype.visitDuration=null;re.prototype.visitDurationSecond=null;re.prototype.visitDurationMillisecond=null;re.prototype.visitDurationMicrosecond=null;re.prototype.visitDurationNanosecond=null;const cv=new Float64Array(1),ds=new Uint32Array(cv.buffer);function hv(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function rx(r){if(r!==r)return 32256;cv[0]=r;const t=(ds[1]&2147483648)>>16&65535;let e=ds[1]&2146435072,i=0;return e>=1089470464?ds[0]>0?e=31744:(e=(e&2080374784)>>16,i=(ds[1]&1048575)>>10):e<=1056964608?(i=1048576+(ds[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(ds[1]&1048575)+512>>10),t|e|i&65535}let $t=class extends re{};function Yt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const ix=(r,t,e)=>{r[t]=Math.floor(e/864e5)},dv=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},yh=({values:r},t,e)=>{r[t]=e},fv=({values:r},t,e)=>{r[t]=rx(e)},sx=(r,t,e)=>{switch(r.type.precision){case Ze.HALF:return fv(r,t,e);case Ze.SINGLE:case Ze.DOUBLE:return yh(r,t,e)}},pv=({values:r},t,e)=>{ix(r,t,e.valueOf())},mv=({values:r},t,e)=>{r[t]=BigInt(e)},ox=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},yv=({values:r,valueOffsets:t},e,i)=>dv(r,t,e,i),gv=({values:r,valueOffsets:t},e,i)=>dv(r,t,e,fh(i)),ax=(r,t,e)=>{r.type.unit===Vr.DAY?pv(r,t,e):mv(r,t,e)},vv=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},_v=({values:r},t,e)=>{r[t]=BigInt(e)},bv=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},wv=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},ux=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return vv(r,t,e);case zt.MILLISECOND:return _v(r,t,e);case zt.MICROSECOND:return bv(r,t,e);case zt.NANOSECOND:return wv(r,t,e)}},Sv=({values:r},t,e)=>{r[t]=e},Iv=({values:r},t,e)=>{r[t]=e},Tv=({values:r},t,e)=>{r[t]=e},xv=({values:r},t,e)=>{r[t]=e},lx=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return Sv(r,t,e);case zt.MILLISECOND:return Iv(r,t,e);case zt.MICROSECOND:return Tv(r,t,e);case zt.NANOSECOND:return xv(r,t,e)}},cx=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},hx=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Gr.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],u=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Gr.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const u=e instanceof Map?e.entries():Object.entries(e);for(const l of u)if(s(i,o,l),++o>=a)break},fx=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),px=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),mx=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),yx=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),gx=(r,t,e)=>{const i=r.type.children.map(s=>Gr.getVisitFn(s.type)),n=e instanceof Map?mx(t,e):e instanceof Fe?px(t,e):Array.isArray(e)?fx(t,e):yx(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},vx=(r,t,e)=>{r.type.mode===Je.Dense?Ev(r,t,e):Av(r,t,e)},Ev=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Gr.visit(n,r.valueOffsets[t],e)},Av=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Gr.visit(n,t,e)},_x=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},bx=(r,t,e)=>{r.type.unit===vi.DAY_TIME?Ov(r,t,e):Cv(r,t,e)},Ov=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},Cv=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Fv=({values:r},t,e)=>{r[t]=e},Mv=({values:r},t,e)=>{r[t]=e},Dv=({values:r},t,e)=>{r[t]=e},Rv=({values:r},t,e)=>{r[t]=e},wx=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return Fv(r,t,e);case zt.MILLISECOND:return Mv(r,t,e);case zt.MICROSECOND:return Dv(r,t,e);case zt.NANOSECOND:return Rv(r,t,e)}},Sx=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Gr.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${jo(t)}: ${jo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Ix(this[Xr],this[Ls])}},Ix=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[Xr].type.children.findIndex(i=>i.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Xr].type.children.findIndex(i=>i.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Xr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=pr.visit(t[Xr].children[i],t[Ls]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Xr].type.children.findIndex(s=>s.name===e);return n!==-1?(Gr.visit(t[Xr].children[n],t[Ls],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}},Dt=class extends re{};function jt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const xx=(r,t)=>864e5*r[t],Ex=(r,t)=>null,Nv=(r,t,e)=>{if(e+1>=t.length)return null;const i=be(t[e]),n=be(t[e+1]);return r.subarray(i,n)},Ax=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<xx(r,t),Lv=({values:r},t)=>be(r[t]),vn=({stride:r,values:t},e)=>t[r*e],Ox=({stride:r,values:t},e)=>hv(t[r*e]),Bv=({values:r},t)=>r[t],Cx=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),Uv=({values:r,valueOffsets:t},e)=>Nv(r,t,e),kv=({values:r,valueOffsets:t},e)=>{const i=Nv(r,t,e);return i!==null?pc(i):null},Fx=({values:r},t)=>r[t],Mx=({type:r,values:t},e)=>r.precision!==Ze.HALF?t[e]:hv(t[e]),Dx=(r,t)=>r.type.unit===Vr.DAY?Pv(r,t):Lv(r,t),zv=({values:r},t)=>1e3*be(r[t]),$v=({values:r},t)=>be(r[t]),jv=({values:r},t)=>kg(r[t],BigInt(1e3)),Vv=({values:r},t)=>kg(r[t],BigInt(1e6)),Rx=(r,t)=>{switch(r.type.unit){case zt.SECOND:return zv(r,t);case zt.MILLISECOND:return $v(r,t);case zt.MICROSECOND:return jv(r,t);case zt.NANOSECOND:return Vv(r,t)}},Gv=({values:r},t)=>r[t],Wv=({values:r},t)=>r[t],Hv=({values:r},t)=>r[t],Yv=({values:r},t)=>r[t],Nx=(r,t)=>{switch(r.type.unit){case zt.SECOND:return Gv(r,t);case zt.MILLISECOND:return Wv(r,t);case zt.MICROSECOND:return Hv(r,t);case zt.NANOSECOND:return Yv(r,t)}},Px=({values:r,stride:t},e)=>JT.decimal(r.subarray(t*e,t*(e+1))),Lx=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,u=n[0].slice(s,o-s);return new Fe([u])},Bx=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new vh(o.slice(n,s-n))},Ux=(r,t)=>new gh(r,t),kx=(r,t)=>r.type.mode===Je.Dense?Xv(r,t):qv(r,t),Xv=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return pr.visit(i,r.valueOffsets[t])},qv=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return pr.visit(i,t)},zx=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},$x=(r,t)=>r.type.unit===vi.DAY_TIME?Qv(r,t):Kv(r,t),Qv=({values:r},t)=>r.subarray(2*t,2*(t+1)),Kv=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Zv=({values:r},t)=>r[t],Jv=({values:r},t)=>r[t],t_=({values:r},t)=>r[t],e_=({values:r},t)=>r[t],jx=(r,t)=>{switch(r.type.unit){case zt.SECOND:return Zv(r,t);case zt.MILLISECOND:return Jv(r,t);case zt.MICROSECOND:return t_(r,t);case zt.NANOSECOND:return e_(r,t)}},Vx=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Fe([s])};Dt.prototype.visitNull=jt(Ex);Dt.prototype.visitBool=jt(Ax);Dt.prototype.visitInt=jt(Fx);Dt.prototype.visitInt8=jt(vn);Dt.prototype.visitInt16=jt(vn);Dt.prototype.visitInt32=jt(vn);Dt.prototype.visitInt64=jt(Bv);Dt.prototype.visitUint8=jt(vn);Dt.prototype.visitUint16=jt(vn);Dt.prototype.visitUint32=jt(vn);Dt.prototype.visitUint64=jt(Bv);Dt.prototype.visitFloat=jt(Mx);Dt.prototype.visitFloat16=jt(Ox);Dt.prototype.visitFloat32=jt(vn);Dt.prototype.visitFloat64=jt(vn);Dt.prototype.visitUtf8=jt(kv);Dt.prototype.visitLargeUtf8=jt(kv);Dt.prototype.visitBinary=jt(Uv);Dt.prototype.visitLargeBinary=jt(Uv);Dt.prototype.visitFixedSizeBinary=jt(Cx);Dt.prototype.visitDate=jt(Dx);Dt.prototype.visitDateDay=jt(Pv);Dt.prototype.visitDateMillisecond=jt(Lv);Dt.prototype.visitTimestamp=jt(Rx);Dt.prototype.visitTimestampSecond=jt(zv);Dt.prototype.visitTimestampMillisecond=jt($v);Dt.prototype.visitTimestampMicrosecond=jt(jv);Dt.prototype.visitTimestampNanosecond=jt(Vv);Dt.prototype.visitTime=jt(Nx);Dt.prototype.visitTimeSecond=jt(Gv);Dt.prototype.visitTimeMillisecond=jt(Wv);Dt.prototype.visitTimeMicrosecond=jt(Hv);Dt.prototype.visitTimeNanosecond=jt(Yv);Dt.prototype.visitDecimal=jt(Px);Dt.prototype.visitList=jt(Lx);Dt.prototype.visitStruct=jt(Ux);Dt.prototype.visitUnion=jt(kx);Dt.prototype.visitDenseUnion=jt(Xv);Dt.prototype.visitSparseUnion=jt(qv);Dt.prototype.visitDictionary=jt(zx);Dt.prototype.visitInterval=jt($x);Dt.prototype.visitIntervalDayTime=jt(Qv);Dt.prototype.visitIntervalYearMonth=jt(Kv);Dt.prototype.visitDuration=jt(jx);Dt.prototype.visitDurationSecond=jt(Zv);Dt.prototype.visitDurationMillisecond=jt(Jv);Dt.prototype.visitDurationMicrosecond=jt(t_);Dt.prototype.visitDurationNanosecond=jt(e_);Dt.prototype.visitFixedSizeList=jt(Vx);Dt.prototype.visitMap=jt(Bx);const pr=new Dt,Ts=Symbol.for("keys"),Bs=Symbol.for("vals"),xs=Symbol.for("kKeysAsStrings"),wc=Symbol.for("_kKeysAsStrings");let vh=class{constructor(t){return this[Ts]=new Fe([t.children[0]]).memoize(),this[Bs]=t.children[1],new Proxy(this,new Wx)}get[xs](){return this[wc]||(this[wc]=Array.from(this[Ts].toArray(),String))}[Symbol.iterator](){return new Gx(this[Ts],this[Bs])}get size(){return this[Ts].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ts],e=this[Bs],i={};for(let n=-1,s=t.length;++n`${jo(t)}: ${jo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Gx=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),pr.visit(this.vals,t)]})}},Wx=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[xs]}has(t,e){return t[xs].includes(e)}getOwnPropertyDescriptor(t,e){if(t[xs].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[xs].indexOf(e);if(i!==-1){const n=pr.visit(Reflect.get(t,Bs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[xs].indexOf(e);return n!==-1?(Gr.visit(Reflect.get(t,Bs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}};Object.defineProperties(vh.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ts]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Bs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wc]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Nf;function r_(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const _h=(r,t)=>r<0?t+r:r,Pf=r=>r!==r;function Js(r){if(typeof r!=="object"||r===null)return Pf(r)?Pf:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?jT(r,e):!1:r instanceof Map?Yx(r):Array.isArray(r)?Hx(r):r instanceof Fe?Xx(r):qx(r,!0)}function Hx(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return Qx(r,e);case Map:return Lf(r,e,e.keys());case vh:case gh:case Object:case void 0:return Lf(r,e,t||Object.keys(e))}return e instanceof Fe?Kx(r,e):!1}}function Qx(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function bu(r,t,e){const i=e.byteLength+7&-8;if(r>0||e.byteLength>3):wu(new bh(e,r,t,null,i_)).subarray(0,i)),n}return e}function wu(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}let bh=class{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,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,n=t+(t%8===0?0:8-t%8);return Sc(r,t,n)+Sc(r,i,e)+Jx(r,n>>3,i-n>>3)}function Jx(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=$l(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=$l(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=$l(s.getUint8(n)),n+=1;return i}function $l(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 tE=-1;let Se=class Ic{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 At.isSparseUnion(t)?this.children.some(e=>e.nullable):At.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:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(At.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=tE&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Sc(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,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(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let u;s instanceof Ic?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Ni(t),s&&((u=s[0])&&(this.valueOffsets=u),(u=s[1])&&(this.values=u),(u=s[2])&&(this.nullBitmap=u),(u=s[3])&&(this.typeIds=u)))}getValid(t){const{type:e}=this;if(At.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===Je.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(bu(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&l)!==0,s[c]=e?h|l:h&~l}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new Ic(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,u=this._sliceBuffers(t,e,i,n);return this.clone(this.type,this.offset+t,e,o,u,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===L.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(bu(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[Ri.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[Ri.TYPE])&&(o[Ri.TYPE]=s.subarray(t,t+e)),(s=o[Ri.OFFSET])&&(o[Ri.OFFSET]=s.subarray(t,t+e+1))||(s=o[Ri.DATA])&&(o[Ri.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}};Se.prototype.children=Object.freeze([]);class Co extends re{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:i=0,["length"]:n=0}=t;return new Se(e,i,n,n)}visitBool(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitInt(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFloat(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.data),s=oe(t.nullBitmap),o=lo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Se(e,i,a,u,[o,n,s])}visitLargeUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.data),s=oe(t.nullBitmap),o=If(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Se(e,i,a,u,[o,n,s])}visitBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.data),s=oe(t.nullBitmap),o=lo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Se(e,i,a,u,[o,n,s])}visitLargeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.data),s=oe(t.nullBitmap),o=If(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Se(e,i,a,u,[o,n,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length/Ni(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDate(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length/Ni(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTimestamp(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length/Ni(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTime(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length/Ni(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDecimal(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length/Ni(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitList(t){const{["type"]:e,["offset"]:i=0,["child"]:n}=t,s=oe(t.nullBitmap),o=lo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Se(e,i,a,u,[o,void 0,s],[n])}visitStruct(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=oe(t.nullBitmap),{length:o=n.reduce((u,{length:l})=>Math.max(u,l),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],n)}visitUnion(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=ve(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(At.isSparseUnion(e))return new Se(e,i,o,a,[void 0,void 0,void 0,s],n);const u=lo(t.valueOffsets);return new Se(e,i,o,a,[u,void 0,void 0,s],n)}visitDictionary(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.indices.ArrayType,t.data),{["dictionary"]:o=new Fe([new Co().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Se(e,i,a,u,[void 0,s,n],[],o)}visitInterval(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length/Ni(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDuration(t){const{["type"]:e,["offset"]:i=0}=t,n=oe(t.nullBitmap),s=ve(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFixedSizeList(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Co().visit({type:e.valueType})}=t,s=oe(t.nullBitmap),{["length"]:o=n.length/Ni(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],[n])}visitMap(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Co().visit({type:e.childType})}=t,s=oe(t.nullBitmap),o=lo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:u=t.nullBitmap?-1:0}=t;return new Se(e,i,a,u,[o,void 0,s],[n])}}const eE=new Co;function ne(r){return eE.visit(r)}let Bf=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 n_(r){return r.reduce((t,e)=>t+e.nullCount,0)}function s_(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function o_(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=u+l)continue;if(u>=e&&u+l<=i){n.push(a);continue}const c=Math.max(0,e-u),h=Math.min(i-u,l);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function wh(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function nE(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new bh(e,r.offset+(t||0),r.length,e,i_)){if(!n)return i;++i}return-1}function Qt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case L.Union:break;case L.Dictionary:break;default:return nE(r,e)}const i=pr.getVisitFn(r),n=Js(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new Bf(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new sE(o)})}let sE=class{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Se)))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:u,indexOf:l}=h_[o.typeId],c=s[0];this.isValid=h=>Sh(c,h),this.get=h=>a(c,h),this.set=(h,p)=>u(c,h,p),this.indexOf=h=>l(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,d_[o.typeId]),this._offsets=s_(s);break}this.data=s,this.type=o,this.stride=Ni(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return rE(this.data)}get nullCount(){return n_(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${L[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(_h(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return Ih.visit(this)}concat(...t){return new Bn(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Bn(r_(this,t,e,({data:i,_offsets:n},s,o)=>o_(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case L.Int:case L.Float:case L.Decimal:case L.Time:case L.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:u})=>(o.array.set(a.subarray(0,u*n),o.offset),o.offset+=u*n,o),{array:new s(i*n),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(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return At.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(At.isDictionary(this.type)){const t=new Uf(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Bn(e)}return new Uf(this)}unmemoize(){if(At.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Bn(e)}return this}};c_=Symbol.toStringTag;Fe[c_]=(r=>{r.type=At.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(L).map(e=>L[e]).filter(e=>typeof e=="number"&&e!==L.NONE);for(const e of t){const i=pr.getVisitFnByTypeId(e),n=Gr.getVisitFnByTypeId(e),s=Iu.getVisitFnByTypeId(e);h_[e]={get:i,set:n,indexOf:s},d_[e]=Object.create(r,{isValid:{value:Su(Sh)},get:{value:Su(pr.getVisitFnByTypeId(e))},set:{value:a_(Gr.getVisitFnByTypeId(e))},indexOf:{value:u_(Iu.getVisitFnByTypeId(e))}})}return"Vector"})(Fe.prototype);let Uf=class f_ extends Fe{constructor(t){super(t.data);const e=this.get,i=this.set,n=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const u=e.call(this,o);return s[o]=u,u}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new f_(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Fe(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};class Tc{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,i,n){return t.prep(8,24),t.writeInt64(BigInt(n??0)),t.pad(4),t.writeInt32(i),t.writeInt64(BigInt(e??0)),t.offset()}}class vr{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 vr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+pe),(e||new vr).__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):Le.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new ni).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new Tc).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,10);return i?(e||new Tc).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new Ve).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,Le.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 Ce=class Un{constructor(t=[],e,i,n=Le.V5){this.fields=t||[],this.metadata=e||new Map,i||(i=xc(this.fields)),this.dictionaries=i,this.metadataVersion=n}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),i=this.fields.filter(n=>e.has(n.name));return new Un(i,this.metadata)}selectAt(t){const e=t.map(i=>this.fields[i]).filter(Boolean);return new Un(e,this.metadata)}assign(...t){const e=t[0]instanceof Un?t[0]:Array.isArray(t[0])?new Un(t[0]):new Un(t),i=[...this.fields],n=Ma(Ma(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const u=i.findIndex(l=>l.name===a.name);return~u?(i[u]=a.clone({metadata:Ma(Ma(new Map,i[u].metadata),a.metadata)}))&&!1:!0}),o=xc(s,new Map);return new Un([...i,...s],n,new Map([...this.dictionaries,...o]))}};Ce.prototype.fields=null;Ce.prototype.metadata=null;Ce.prototype.dictionaries=null;class xe{static new(...t){let[e,i,n,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],i===void 0&&(i=t[0].type),n===void 0&&(n=t[0].nullable),s===void 0&&(s=t[0].metadata)),new xe(`${e}`,i,n,s)}constructor(t,e,i=!1,n){this.name=t,this.type=e,this.nullable=i,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,i,n,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,i=this.type,n=this.nullable,s=this.metadata]=t:{name:e=this.name,type:i=this.type,nullable:n=this.nullable,metadata:s=this.metadata}=t[0],xe.new(e,i,n,s)}}xe.prototype.type=null;xe.prototype.name=null;xe.prototype.nullable=null;xe.prototype.metadata=null;function Ma(r,t){return new Map([...r||new Map,...t||new Map])}function xc(r,t=new Map){for(let e=-1,i=r.length;++e0&&xc(s.children,t)}return t}var oE=Pg,aE=Gs;class Ho{static decode(t){t=new aE(oe(t));const e=vr.getRootAsFooter(t),i=Ce.decode(e.schema(),new Map,e.version());return new uE(i,e)}static encode(t){const e=new oE,i=Ce.encode(e,t.schema);vr.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())dn.encode(e,o);const n=e.endVector();vr.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())dn.encode(e,o);const s=e.endVector();return vr.startFooter(e),vr.addSchema(e,i),vr.addVersion(e,Le.V5),vr.addRecordBatches(e,n),vr.addDictionaries(e,s),vr.finishFooterBuffer(e,vr.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=Le.V5,i,n){this.schema=t,this.version=e,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let t,e=-1,i=this.numRecordBatches;++e=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Zt(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(Me);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Lr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Lr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Zt(this,void 0,void 0,function*(){return yield this.abort(t),Me})}return(t){return Zt(this,void 0,void 0,function*(){return yield this.close(),Me})}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(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,i)=>{this.resolvers.push({resolve:e,reject:i})}):Promise.resolve(Me)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class $a extends lE{write(t){if((t=oe(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?pc(this.toUint8Array(!0)):this.toUint8Array(!1).then(pc)}toUint8Array(t=!1){return t?gi(this._values)[0]:Zt(this,void 0,void 0,function*(){var e,i,n,s;const o=[];let a=0;try{for(var u=!0,l=yi(this),c;c=yield l.next(),e=c.done,!e;u=!0){s=c.value,u=!1;const h=s;o.push(h),a+=h.byteLength}}catch(h){i={error:h}}finally{try{!u&&!e&&(n=l.return)&&(yield n.call(l))}finally{if(i)throw i.error}}return gi(o,a)[0]})}}class Tu{constructor(t){t&&(this.source=new cE(Lr.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 Ys{constructor(t){t instanceof Ys?this.source=t.source:t instanceof $a?this.source=new Cn(Lr.fromAsyncIterable(t)):Mg(t)?this.source=new Cn(Lr.fromNodeStream(t)):ph(t)?this.source=new Cn(Lr.fromDOMStream(t)):Fg(t)?this.source=new Cn(Lr.fromDOMStream(t.body)):ea(t)?this.source=new Cn(Lr.fromIterable(t)):Kn(t)?this.source=new Cn(Lr.fromAsyncIterable(t)):Zs(t)&&(this.source=new Cn(Lr.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 cE{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)||Me)}return(t){return Object.create(this.source.return&&this.source.return(t)||Me)}}class Cn{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return Zt(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return Zt(this,arguments,void 0,function*(e,i="read"){return yield this.source.next({cmd:i,size:e})})}throw(t){return Zt(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||Me;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return Zt(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||Me;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class zf extends Tu{constructor(t,e){super(),this.position=0,this.buffer=oe(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:i}=this.readAt(t,4);return new DataView(e,i).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]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[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`${Cs(this.buffer[3])} ${Cs(this.buffer[2])} ${Cs(this.buffer[1])} ${Cs(this.buffer[0])}`}static multiply(t,e){return new Fi(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Fi(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Fi.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Fi.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new Fi(e);for(let o=i?1:0;o0&&this.readData(t,i)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class fE extends m_{constructor(t,e,i,n,s){super(new Uint8Array(0),e,i,n,s),this.sources=t}readNullBitmap(t,e,{offset:i}=this.nextBufferRange()){return e<=0?new Uint8Array(0):wu(this.sources[i])}readOffsets(t,{offset:e}=this.nextBufferRange()){return ve(Uint8Array,ve(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return ve(Uint8Array,ve(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:i}=this;return At.isTimestamp(t)||(At.isInt(t)||At.isTime(t))&&t.bitWidth===64||At.isDuration(t)||At.isDate(t)&&t.unit===Vr.MILLISECOND?ve(Uint8Array,Fo.convertArray(i[e])):At.isDecimal(t)?ve(Uint8Array,dE.convertArray(i[e])):At.isBinary(t)||At.isLargeBinary(t)||At.isFixedSizeBinary(t)?pE(i[e]):At.isBool(t)?wu(i[e]):At.isUtf8(t)||At.isLargeUtf8(t)?fh(i[e].join("")):ve(Uint8Array,ve(t.ArrayType,i[e].map(n=>+n)))}}function pE(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let i=0;i>1]=Number.parseInt(t.slice(i,i+2),16);return e}let Pt=class extends re{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((i,n)=>this.compareFields(i,e[n]))}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 ar(r,t){return t instanceof r.constructor}function ns(r,t){return r===t||ar(r,t)}function ji(r,t){return r===t||ar(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function qu(r,t){return r===t||ar(r,t)&&r.precision===t.precision}function mE(r,t){return r===t||ar(r,t)&&r.byteWidth===t.byteWidth}function Eh(r,t){return r===t||ar(r,t)&&r.unit===t.unit}function ra(r,t){return r===t||ar(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function ia(r,t){return r===t||ar(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function yE(r,t){return r===t||ar(r,t)&&r.children.length===t.children.length&&fn.compareManyFields(r.children,t.children)}function gE(r,t){return r===t||ar(r,t)&&r.children.length===t.children.length&&fn.compareManyFields(r.children,t.children)}function Ah(r,t){return r===t||ar(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&fn.compareManyFields(r.children,t.children)}function vE(r,t){return r===t||ar(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&fn.visit(r.indices,t.indices)&&fn.visit(r.dictionary,t.dictionary)}function Oh(r,t){return r===t||ar(r,t)&&r.unit===t.unit}function na(r,t){return r===t||ar(r,t)&&r.unit===t.unit}function _E(r,t){return r===t||ar(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&fn.compareManyFields(r.children,t.children)}function bE(r,t){return r===t||ar(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&fn.compareManyFields(r.children,t.children)}Pt.prototype.visitNull=ns;Pt.prototype.visitBool=ns;Pt.prototype.visitInt=ji;Pt.prototype.visitInt8=ji;Pt.prototype.visitInt16=ji;Pt.prototype.visitInt32=ji;Pt.prototype.visitInt64=ji;Pt.prototype.visitUint8=ji;Pt.prototype.visitUint16=ji;Pt.prototype.visitUint32=ji;Pt.prototype.visitUint64=ji;Pt.prototype.visitFloat=qu;Pt.prototype.visitFloat16=qu;Pt.prototype.visitFloat32=qu;Pt.prototype.visitFloat64=qu;Pt.prototype.visitUtf8=ns;Pt.prototype.visitLargeUtf8=ns;Pt.prototype.visitBinary=ns;Pt.prototype.visitLargeBinary=ns;Pt.prototype.visitFixedSizeBinary=mE;Pt.prototype.visitDate=Eh;Pt.prototype.visitDateDay=Eh;Pt.prototype.visitDateMillisecond=Eh;Pt.prototype.visitTimestamp=ra;Pt.prototype.visitTimestampSecond=ra;Pt.prototype.visitTimestampMillisecond=ra;Pt.prototype.visitTimestampMicrosecond=ra;Pt.prototype.visitTimestampNanosecond=ra;Pt.prototype.visitTime=ia;Pt.prototype.visitTimeSecond=ia;Pt.prototype.visitTimeMillisecond=ia;Pt.prototype.visitTimeMicrosecond=ia;Pt.prototype.visitTimeNanosecond=ia;Pt.prototype.visitDecimal=ns;Pt.prototype.visitList=yE;Pt.prototype.visitStruct=gE;Pt.prototype.visitUnion=Ah;Pt.prototype.visitDenseUnion=Ah;Pt.prototype.visitSparseUnion=Ah;Pt.prototype.visitDictionary=vE;Pt.prototype.visitInterval=Oh;Pt.prototype.visitIntervalDayTime=Oh;Pt.prototype.visitIntervalYearMonth=Oh;Pt.prototype.visitDuration=na;Pt.prototype.visitDurationSecond=na;Pt.prototype.visitDurationMillisecond=na;Pt.prototype.visitDurationMicrosecond=na;Pt.prototype.visitDurationNanosecond=na;Pt.prototype.visitFixedSizeList=_E;Pt.prototype.visitMap=bE;const fn=new Pt;function Ec(r,t){return fn.compareSchemas(r,t)}function jl(r,t){return wE(r,t.map(e=>e.data.concat()))}function wE(r,t){const e=[...r.fields],i=[],n={numBatches:t.reduce((h,p)=>Math.max(h,p.length),0)};let s=0,o=0,a=-1;const u=t.length;let l,c=[];for(;n.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(i[s++]=ne({type:new ir(e),length:o,nullCount:0,children:c.slice()})))}return[r=r.assign(e),i.map(h=>new hr(r,h))]}function SE(r,t,e,i,n){var s;const o=(t+63&-64)>>3;for(let a=-1,u=i.length;++a=t)c===t?e[a]=l:(e[a]=l.slice(0,t),n.numBatches=Math.max(n.numBatches,i[a].unshift(l.slice(t,c-t))));else{const h=r[a];r[a]=h.clone({nullable:!0}),e[a]=(s=l==null?void 0:l._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:ne({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var y_;let pn=class kn{constructor(...t){var e,i;if(t.length===0)return this.batches=[],this.schema=new Ce([]),this._offsets=[0],this;let n,s;t[0]instanceof Ce&&(n=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=u=>{if(u){if(u instanceof hr)return[u];if(u instanceof kn)return u.batches;if(u instanceof Se){if(u.type instanceof ir)return[new hr(new Ce(u.type.children),u)]}else{if(Array.isArray(u))return u.flatMap(l=>o(l));if(typeof u[Symbol.iterator]=="function")return[...u].flatMap(l=>o(l));if(typeof u=="object"){const l=Object.keys(u),c=l.map(d=>new Fe([u[d]])),h=n??new Ce(l.map((d,g)=>new xe(String(d),c[g].type,c[g].nullable))),[,p]=jl(h,c);return p.length===0?[new hr(u)]:p}}}return[]},a=t.flatMap(u=>o(u));if(n=(i=n??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&i!==void 0?i:new Ce([]),!(n instanceof Ce))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const u of a){if(!(u instanceof hr))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Ec(n,u.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=a,this._offsets=s??s_(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=n_(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(_h(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?Ih.visit(new Fe(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ - ${this.toArray().join(`, - `)} -]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:n})=>n));return new kn(e,i.map(n=>new hr(e,n)))}slice(t,e){const i=this.schema;[t,e]=r_({length:this.numRows},t,e);const n=o_(this.data,this._offsets,t,e);return new kn(i,n.map(s=>new hr(i,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&ti.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],n=ne({type:i,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Fe(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),e)}setChildAt(t,e){let i=this.schema,n=[...this.batches];if(t>-1&&tthis.getChildAt(l));[s[t],a[t]]=[o,e],[i,n]=jl(i,a)}return new kn(i,n)}select(t){const e=this.schema.fields.reduce((i,n,s)=>i.set(n.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(n=>n.selectAt(t));return new kn(e,i)}assign(t){const e=this.schema.fields,[i,n]=t.schema.fields.reduce((a,u,l)=>{const[c,h]=a,p=e.findIndex(d=>d.name===u.name);return~p?h[p]=l:c.push(l),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,u)=>[u,n[u]]).map(([a,u])=>u===void 0?this.getChildAt(a):t.getChildAt(u)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new kn(...jl(s,o))}};y_=Symbol.toStringTag;pn[y_]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Su(Sh),r.get=Su(pr.getVisitFn(L.Struct)),r.set=a_(Gr.getVisitFn(L.Struct)),r.indexOf=u_(Iu.getVisitFn(L.Struct)),"Table"))(pn.prototype);var g_;let hr=class Eo{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Ce))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=ne({nullCount:0,type:new ir(this.schema.fields),children:this.schema.fields.map(e=>ne({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=$f(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:n,length:s}=Object.keys(e).reduce((u,l,c)=>(u.children[c]=e[l],u.length=Math.max(u.length,e[l].length),u.fields[c]=xe.new({name:l,type:e[l].type,nullable:!0}),u),{length:0,fields:new Array,children:new Array}),o=new Ce(i),a=ne({type:new ir(i),length:s,children:n,nullCount:0});[this.schema,this.data]=$f(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=v_(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 pr.visit(this.data,t)}at(t){return this.get(_h(t,this.numRows))}set(t,e){return Gr.visit(this.data,t,e)}indexOf(t,e){return Iu.visit(this.data,t,e)}[Symbol.iterator](){return Ih.visit(new Fe([this.data]))}toArray(){return[...this]}concat(...t){return new pn(this.schema,[this,...t])}slice(t,e){const[i]=new Fe([this.data]).slice(t,e).data;return new Eo(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&tn.name===t),e)}setChildAt(t,e){let i=this.schema,n=this.data;if(t>-1&&ta.name===s);~o&&(n[o]=this.data.children[o])}return new Eo(e,ne({type:i,length:this.numRows,children:n}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),n=ne({type:new ir(e.fields),length:this.numRows,children:i});return new Eo(e,n)}};g_=Symbol.toStringTag;hr[g_]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(hr.prototype);function $f(r,t,e=t.reduce((i,n)=>Math.max(i,n.length),0)){var i;const n=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,u]of r.fields.entries()){const l=t[a];(!l||l.length!==e)&&(n[a]=u.clone({nullable:!0}),s[a]=(i=l==null?void 0:l._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:ne({type:u.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(n),ne({type:new ir(n),length:e,children:s})]}function v_(r,t,e=new Map){var i,n;if(((i=r==null?void 0:r.length)!==null&&i!==void 0?i:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sne({type:n.type})),i=ne({type:new ir(t.fields),nullCount:0,children:e});super(t,i)}}let Qi=class ri{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 ri).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+pe),(e||new ri).__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):Le.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):he.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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new Ve).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,Le.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,he.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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,i,n,s,o){return ri.startMessage(t),ri.addVersion(t,e),ri.addHeaderType(t,i),ri.addHeader(t,n),ri.addBodyLength(t,s),ri.addCustomMetadata(t,o),ri.endMessage(t)}};class IE extends re{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return Mf.startNull(e),Mf.endNull(e)}visitInt(t,e){return wr.startInt(e),wr.addBitWidth(e,t.bitWidth),wr.addIsSigned(e,t.isSigned),wr.endInt(e)}visitFloat(t,e){return ci.startFloatingPoint(e),ci.addPrecision(e,t.precision),ci.endFloatingPoint(e)}visitBinary(t,e){return Ef.startBinary(e),Ef.endBinary(e)}visitLargeBinary(t,e){return Of.startLargeBinary(e),Of.endLargeBinary(e)}visitBool(t,e){return Af.startBool(e),Af.endBool(e)}visitUtf8(t,e){return Df.startUtf8(e),Df.endUtf8(e)}visitLargeUtf8(t,e){return Cf.startLargeUtf8(e),Cf.endLargeUtf8(e)}visitDecimal(t,e){return vs.startDecimal(e),vs.addScale(e,t.scale),vs.addPrecision(e,t.precision),vs.addBitWidth(e,t.bitWidth),vs.endDecimal(e)}visitDate(t,e){return Pa.startDate(e),Pa.addUnit(e,t.unit),Pa.endDate(e)}visitTime(t,e){return Ur.startTime(e),Ur.addUnit(e,t.unit),Ur.addBitWidth(e,t.bitWidth),Ur.endTime(e)}visitTimestamp(t,e){const i=t.timezone&&e.createString(t.timezone)||void 0;return kr.startTimestamp(e),kr.addUnit(e,t.unit),i!==void 0&&kr.addTimezone(e,i),kr.endTimestamp(e)}visitInterval(t,e){return hi.startInterval(e),hi.addUnit(e,t.unit),hi.endInterval(e)}visitDuration(t,e){return La.startDuration(e),La.addUnit(e,t.unit),La.endDuration(e)}visitList(t,e){return Ff.startList(e),Ff.endList(e)}visitStruct(t,e){return Wn.startStruct_(e),Wn.endStruct_(e)}visitUnion(t,e){cr.startTypeIdsVector(e,t.typeIds.length);const i=cr.createTypeIdsVector(e,t.typeIds);return cr.startUnion(e),cr.addMode(e,t.mode),cr.addTypeIds(e,i),cr.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return Bi.startDictionaryEncoding(e),Bi.addId(e,BigInt(t.id)),Bi.addIsOrdered(e,t.isOrdered),i!==void 0&&Bi.addIndexType(e,i),Bi.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return Ba.startFixedSizeBinary(e),Ba.addByteWidth(e,t.byteWidth),Ba.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Ua.startFixedSizeList(e),Ua.addListSize(e,t.listSize),Ua.endFixedSizeList(e)}visitMap(t,e){return ka.startMap(e),ka.addKeysSorted(e,t.keysSorted),ka.endMap(e)}}const Vl=new IE;function TE(r,t=new Map){return new Ce(EE(r,t),ja(r.metadata),t)}function __(r){return new Or(r.count,b_(r.columns),w_(r.columns))}function xE(r){return new _i(__(r.data),r.id,r.isDelta)}function EE(r,t){return(r.fields||[]).filter(Boolean).map(e=>xe.fromJSON(e,t))}function jf(r,t){return(r.children||[]).filter(Boolean).map(e=>xe.fromJSON(e,t))}function b_(r){return(r||[]).reduce((t,e)=>[...t,new mn(e.count,AE(e.VALIDITY)),...b_(e.children)],[])}function w_(r,t=[]){for(let e=-1,i=(r||[]).length;++et+ +(e===0),0)}function OE(r,t){let e,i,n,s,o,a;return!t||!(s=r.dictionary)?(o=Gf(r,jf(r,t)),n=new xe(r.name,o,r.nullable,ja(r.metadata))):t.has(e=s.id)?(i=(i=s.indexType)?Vf(i):new Wo,a=new Hs(t.get(e),i,e,s.isOrdered),n=new xe(r.name,a,r.nullable,ja(r.metadata))):(i=(i=s.indexType)?Vf(i):new Wo,t.set(e,o=Gf(r,jf(r,t))),a=new Hs(o,i,e,s.isOrdered),n=new xe(r.name,a,r.nullable,ja(r.metadata))),n||null}function ja(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function Vf(r){return new Zn(r.isSigned,r.bitWidth)}function Gf(r,t){const e=r.type.name;switch(e){case"NONE":return new hn;case"null":return new hn;case"binary":return new nu;case"largebinary":return new su;case"utf8":return new ou;case"largeutf8":return new au;case"bool":return new uu;case"list":return new mu((t||[])[0]);case"struct":return new ir(t||[]);case"struct_":return new ir(t||[])}switch(e){case"int":{const i=r.type;return new Zn(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=r.type;return new iu(Ze[i.precision])}case"decimal":{const i=r.type;return new lu(i.scale,i.precision,i.bitWidth)}case"date":{const i=r.type;return new cu(Vr[i.unit])}case"time":{const i=r.type;return new hu(zt[i.unit],i.bitWidth)}case"timestamp":{const i=r.type;return new du(zt[i.unit],i.timezone)}case"interval":{const i=r.type;return new fu(vi[i.unit])}case"duration":{const i=r.type;return new pu(zt[i.unit])}case"union":{const i=r.type,[n,...s]=(i.mode+"").toLowerCase(),o=n.toUpperCase()+s.join("");return new yu(Je[o],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=r.type;return new gu(i.byteWidth)}case"fixedsizelist":{const i=r.type;return new vu(i.listSize,(t||[])[0])}case"map":{const i=r.type;return new _u((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var CE=Pg,FE=Gs;class nr{static fromJSON(t,e){const i=new nr(0,Le.V5,e);return i._createHeader=ME(t,e),i}static decode(t){t=new FE(oe(t));const e=Qi.getRootAsMessage(t),i=e.bodyLength(),n=e.version(),s=e.headerType(),o=new nr(i,n,s);return o._createHeader=DE(e,s),o}static encode(t){const e=new CE;let i=-1;return t.isSchema()?i=Ce.encode(e,t.header()):t.isRecordBatch()?i=Or.encode(e,t.header()):t.isDictionaryBatch()&&(i=_i.encode(e,t.header())),Qi.startMessage(e),Qi.addVersion(e,Le.V5),Qi.addHeader(e,i),Qi.addHeaderType(e,t.headerType),Qi.addBodyLength(e,BigInt(t.bodyLength)),Qi.finishMessageBuffer(e,Qi.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Ce)return new nr(0,Le.V5,he.Schema,t);if(t instanceof Or)return new nr(e,Le.V5,he.RecordBatch,t);if(t instanceof _i)return new nr(e,Le.V5,he.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===he.Schema}isRecordBatch(){return this.headerType===he.RecordBatch}isDictionaryBatch(){return this.headerType===he.DictionaryBatch}constructor(t,e,i,n){this._version=e,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=be(t)}}class Or{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=be(t)}}class _i{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,i=!1){this._data=t,this._isDelta=i,this._id=be(e)}}class pi{constructor(t,e){this.offset=be(t),this.length=be(e)}}class mn{constructor(t,e){this.length=be(t),this.nullCount=be(e)}}function ME(r,t){return()=>{switch(t){case he.Schema:return Ce.fromJSON(r);case he.RecordBatch:return Or.fromJSON(r);case he.DictionaryBatch:return _i.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${he[t]}, type: ${t} }`)}}function DE(r,t){return()=>{switch(t){case he.Schema:return Ce.decode(r.header(new ni),new Map,r.version());case he.RecordBatch:return Or.decode(r.header(new Di),r.version());case he.DictionaryBatch:return _i.decode(r.header(new ys),r.version())}throw new Error(`Unrecognized Message type: { name: ${he[t]}, type: ${t} }`)}}xe.encode=VE;xe.decode=$E;xe.fromJSON=OE;Ce.encode=jE;Ce.decode=RE;Ce.fromJSON=TE;Or.encode=GE;Or.decode=NE;Or.fromJSON=__;_i.encode=WE;_i.decode=PE;_i.fromJSON=xE;mn.encode=HE;mn.decode=BE;pi.encode=YE;pi.decode=LE;function RE(r,t=new Map,e=Le.V5){const i=zE(r,t);return new Ce(i,Va(r),t,e)}function NE(r,t=Le.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Or(r.length(),UE(r),kE(r,t))}function PE(r,t=Le.V5){return new _i(Or.decode(r.data(),t),r.id(),r.isDelta())}function LE(r){return new pi(r.offset(),r.length())}function BE(r){return new mn(r.length(),r.nullCount())}function UE(r){const t=[];for(let e,i=-1,n=-1,s=r.nodesLength();++ixe.encode(r,s));ni.startFieldsVector(r,e.length);const i=ni.createFieldsVector(r,e),n=t.metadata&&t.metadata.size>0?ni.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),u=r.createString(`${o}`);return Ve.startKeyValue(r),Ve.addKey(r,a),Ve.addValue(r,u),Ve.endKeyValue(r)})):-1;return ni.startSchema(r),ni.addFields(r,i),ni.addEndianness(r,XE?Ws.Little:Ws.Big),n!==-1&&ni.addCustomMetadata(r,n),ni.endSchema(r)}function VE(r,t){let e=-1,i=-1,n=-1;const s=t.type;let o=t.typeId;At.isDictionary(s)?(o=s.dictionary.typeId,n=Vl.visit(s,r),i=Vl.visit(s.dictionary,r)):i=Vl.visit(s,r);const a=(s.children||[]).map(c=>xe.encode(r,c)),u=Rr.createChildrenVector(r,a),l=t.metadata&&t.metadata.size>0?Rr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const p=r.createString(`${c}`),d=r.createString(`${h}`);return Ve.startKeyValue(r),Ve.addKey(r,p),Ve.addValue(r,d),Ve.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Rr.startField(r),Rr.addType(r,i),Rr.addTypeType(r,o),Rr.addChildren(r,u),Rr.addNullable(r,!!t.nullable),e!==-1&&Rr.addName(r,e),n!==-1&&Rr.addDictionary(r,n),l!==-1&&Rr.addCustomMetadata(r,l),Rr.endField(r)}function GE(r,t){const e=t.nodes||[],i=t.buffers||[];Di.startNodesVector(r,e.length);for(const o of e.slice().reverse())mn.encode(r,o);const n=r.endVector();Di.startBuffersVector(r,i.length);for(const o of i.slice().reverse())pi.encode(r,o);const s=r.endVector();return Di.startRecordBatch(r),Di.addLength(r,BigInt(t.length)),Di.addNodes(r,n),Di.addBuffers(r,s),Di.endRecordBatch(r)}function WE(r,t){const e=Or.encode(r,t.data);return ys.startDictionaryBatch(r),ys.addId(r,BigInt(t.id)),ys.addIsDelta(r,t.isDelta),ys.addData(r,e),ys.endDictionaryBatch(r)}function HE(r,t){return Ug.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function YE(r,t){return Bg.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const XE=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),Fh=r=>`Expected ${he[r]} Message in stream, but was null or length 0.`,Mh=r=>`Header pointer of flatbuffer-encoded ${he[r]} Message is null or length 0.`,S_=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,I_=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class T_{constructor(t){this.source=t instanceof Tu?t:new Tu(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?Me: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(Fh(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=oe(this.source.read(t));if(e.byteLength[...n,...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(Fh(t));return e.value}readSchema(){const t=he.Schema,e=this.readMessage(t),i=e==null?void 0:e.header();if(!e||!i)throw new Error(Mh(t));return i}}const Qu=4,Ac="ARROW1",Yo=new Uint8Array(Ac.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 Lr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Lr.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 $r?t:mc(t)?eA(t):Cg(t)?nA(t):Kn(t)?Zt(this,void 0,void 0,function*(){return yield $r.from(yield t)}):Fg(t)||ph(t)||Mg(t)||Zs(t)?iA(new Ys(t)):rA(new Tu(t))}static readAll(t){return t instanceof $r?t.isSync()?Xf(t):qf(t):mc(t)||ArrayBuffer.isView(t)||ea(t)||Og(t)?Xf(t):qf(t)}}class Eu extends $r{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return dr(this,arguments,function*(){yield Mt(yield*Qn(yi(this[Symbol.iterator]())))})}}class Au extends $r{constructor(t){super(t),this._impl=t}readAll(){return Zt(this,void 0,void 0,function*(){var t,e,i,n;const s=new Array;try{for(var o=!0,a=yi(this),u;u=yield a.next(),t=u.done,!t;o=!0){n=u.value,o=!1;const l=n;s.push(l)}}catch(l){e={error:l}}finally{try{!o&&!t&&(i=a.return)&&(yield i.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 E_ extends Eu{constructor(t){super(t),this._impl=t}}class ZE extends Au{constructor(t){super(t),this._impl=t}}class A_{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 i=this._loadVectors(t,e,this.schema.fields),n=ne({type:new ir(this.schema.fields),length:t.length,children:i});return new hr(this.schema,n)}_loadDictionaryBatch(t,e){const{id:i,isDelta:n}=t,{dictionaries:s,schema:o}=this,a=s.get(i),u=o.dictionaries.get(i),l=this._loadVectors(t.data,e,[u]);return(a&&n?a.concat(new Fe(l)):new Fe(l)).memoize()}_loadVectors(t,e,i){return new m_(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}}class Ou extends A_{constructor(t,e){super(e),this._reader=mc(t)?new QE(this._handle=t):new T_(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=C_(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):Me}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Me}next(){if(this.closed)return Me;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Ch(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Cu extends A_{constructor(t,e){super(e),this._reader=new qE(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Zt(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 Zt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=C_(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Me})}return(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Me})}next(){return Zt(this,void 0,void 0,function*(){if(this.closed)return Me;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 i=t.header(),n=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new Ch(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class O_ extends Ou{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 zf?t:new zf(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 i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(he.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(he.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-x_,i=t.readInt32(e),n=t.readAt(e-i,i);return Ho.decode(n)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Zt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Zt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(he.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Zt(this,void 0,void 0,function*(){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(he.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Zt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-x_,i=yield t.readInt32(e),n=yield t.readAt(e-i,i);return Ho.decode(n)})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Dh(t)?new E_(new O_(r.read())):new Eu(new Ou(r)):new Eu(new Ou(function*(){}()))}function iA(r){return Zt(this,void 0,void 0,function*(){const t=yield r.peek(sa+7&-8);return t&&t.byteLength>=4?Dh(t)?new E_(new O_(yield r.read())):new Au(new Cu(r)):new Au(new Cu(function(){return dr(this,arguments,function*(){})}()))})}function nA(r){return Zt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new xu(r,t);return t>=KE&&Dh(yield e.readAt(0,sa+7&-8))?new ZE(new JE(e)):new Au(new Cu(e))})}class Re extends re{static assemble(...t){const e=n=>n.flatMap(s=>Array.isArray(s)?e(s):s instanceof hr?s.data.children:s.data),i=new Re;return i.visitMany(e(t)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Fe)return this.visitMany(t.data),this;const{type:e}=t;if(!At.isDictionary(e)){const{length:i}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(At.isUnion(e))this.nodes.push(new mn(i,0));else{const{nullCount:n}=t;At.isNull(e)||Qr.call(this,n<=0?new Uint8Array(0):bu(t.offset,i,t.nullBitmap)),this.nodes.push(new mn(i,n))}}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 Qr(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new pi(this._byteLength,t)),this._byteLength+=t,this}function sA(r){var t;const{type:e,length:i,typeIds:n,valueOffsets:s}=r;if(Qr.call(this,n),e.mode===Je.Sparse)return Oc.call(this,r);if(e.mode===Je.Dense){if(r.offset<=0)return Qr.call(this,s),Oc.call(this,r);{const o=new Int32Array(i),a=Object.create(null),u=Object.create(null);for(let l,c,h=-1;++h{const h=e.typeIds[c],p=a[h],d=u[h];return l.slice(p,Math.min(i,d))}))}}return this}function oA(r){let t;return r.nullCount>=r.length?Qr.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?Qr.call(this,bu(r.offset,r.length,t)):Qr.call(this,wu(r.values))}function Vi(r){return Qr.call(this,r.values.subarray(0,r.length*r.stride))}function Ku(r){const{length:t,values:e,valueOffsets:i}=r,n=be(i[0]),s=be(i[t]),o=Math.min(s-n,e.byteLength-n);return Qr.call(this,Rg(-n,t+1,i)),Qr.call(this,e.subarray(n,n+o)),this}function Rh(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:i,[t]:n}=e;return Qr.call(this,Rg(-i,t+1,e)),this.visit(r.children[0].slice(i,n-i))}return this.visit(r.children[0])}function Oc(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}Re.prototype.visitBool=oA;Re.prototype.visitInt=Vi;Re.prototype.visitFloat=Vi;Re.prototype.visitUtf8=Ku;Re.prototype.visitLargeUtf8=Ku;Re.prototype.visitBinary=Ku;Re.prototype.visitLargeBinary=Ku;Re.prototype.visitFixedSizeBinary=Vi;Re.prototype.visitDate=Vi;Re.prototype.visitTimestamp=Vi;Re.prototype.visitTime=Vi;Re.prototype.visitDecimal=Vi;Re.prototype.visitList=Rh;Re.prototype.visitStruct=Oc;Re.prototype.visitUnion=sA;Re.prototype.visitInterval=Vi;Re.prototype.visitDuration=Vi;Re.prototype.visitFixedSizeList=Rh;Re.prototype.visitMap=Rh;class F_ extends Th{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 $a,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,fr(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 Kn(t)?t.then(e=>this.writeAll(e)):Zs(t)?Bh(this,t):Lh(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 $a?this._sink=t:(this._sink=new $a,t&&PT(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&<(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||!Ec(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 pn&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof hr&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!Ec(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof hr?t instanceof Ch||this._writeRecordBatch(t):t instanceof pn?this.writeAll(t.batches):ea(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,n=nr.encode(t),s=n.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,u=a-s-o;return t.headerType===he.RecordBatch?this._recordBatchBlocks.push(new dn(a,t.bodyLength,this._position)):t.headerType===he.DictionaryBatch&&this._dictionaryBlocks.push(new dn(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(n),this._writePadding(u)}_write(t){if(this._started){const e=oe(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(nr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Yo)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:n,buffers:s}=Re.assemble(t),o=new Or(t.numRows,i,n),a=nr.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){const{byteLength:n,nodes:s,bufferRegions:o,buffers:a}=Re.assemble(new Fe([t])),u=new Or(t.length,s,o),l=new _i(u,e,i),c=nr.from(l,n);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,n;for(let s=-1,o=t.length;++s0&&(this._write(e),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(t){var e,i;for(const[n,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(n),u=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!a||a.data[0]!==o[0])for(const[l,c]of o.entries())this._writeDictionaryBatch(c,n,l>0);else if(ui.writeAll(n)):Zs(t)?Bh(i,t):Lh(i,t)}}class Ph extends F_{static writeAll(t){const e=new Ph;return Kn(t)?t.then(i=>e.writeAll(i)):Zs(t)?Bh(e,t):Lh(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,i=!1){if(!i&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,i)}_writeFooter(t){const e=Ho.encode(new Ho(t,Le.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function Lh(r,t){let e=t;t instanceof pn&&(e=t.batches,r.reset(void 0,t.schema));for(const i of e)r.write(i);return r.finish()}function Bh(r,t){return Zt(this,void 0,void 0,function*(){var e,i,n,s,o,a,u;try{for(e=!0,i=yi(t);n=yield i.next(),s=n.done,!s;e=!0){u=n.value,e=!1;const l=u;r.write(l)}}catch(l){o={error:l}}finally{try{!e&&!s&&(a=i.return)&&(yield a.call(i))}finally{if(o)throw o.error}}return r.finish()})}function aA(r,t="stream"){return(t==="stream"?Nh:Ph).writeAll(r).toUint8Array(!0)}var uA=Object.create,M_=Object.defineProperty,lA=Object.getOwnPropertyDescriptor,cA=Object.getOwnPropertyNames,hA=Object.getPrototypeOf,dA=Object.prototype.hasOwnProperty,fA=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),pA=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of cA(t))!dA.call(r,n)&&n!==e&&M_(r,n,{get:()=>t[n],enumerable:!(i=lA(t,n))||i.enumerable});return r},mA=(r,t,e)=>(e=r!=null?uA(hA(r)):{},pA(!r||!r.__esModule?M_(e,"default",{value:r,enumerable:!0}):e,r)),yA=fA((r,t)=>{t.exports=Worker}),D_=(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))(D_||{}),gA=(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))(gA||{}),vA=(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))(vA||{}),_A=(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))(_A||{}),bA=(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))(bA||{}),wA=(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))(wA||{}),SA=class{log(r){}},R_=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},IA=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(IA||{}),TA=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=$r.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new pn(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 i=new N_(this._bindings,this._conn,e),n=await $r.from(i);return console.assert(n.isAsync()),console.assert(n.isStream()),n}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 xA(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=aA(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)}},N_=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}},xA=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=$r.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new pn(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new N_(this.bindings,this.connectionId,t),i=await $r.from(e);return console.assert(i.isAsync()),console.assert(i.isStream()),i}},EA=(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))(EA||{}),AA=(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))(AA||{}),ue=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,i)=>{this.promiseResolver=e,this.promiseRejecter=i})}};function Ga(r){switch(r.typeId){case L.Binary:return{sqlType:"binary"};case L.Bool:return{sqlType:"bool"};case L.Date:return{sqlType:"date"};case L.DateDay:return{sqlType:"date32[d]"};case L.DateMillisecond:return{sqlType:"date64[ms]"};case L.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case L.Float:return{sqlType:"float"};case L.Float16:return{sqlType:"float16"};case L.Float32:return{sqlType:"float32"};case L.Float64:return{sqlType:"float64"};case L.Int:return{sqlType:"int32"};case L.Int16:return{sqlType:"int16"};case L.Int32:return{sqlType:"int32"};case L.Int64:return{sqlType:"int64"};case L.Uint16:return{sqlType:"uint16"};case L.Uint32:return{sqlType:"uint32"};case L.Uint64:return{sqlType:"uint64"};case L.Uint8:return{sqlType:"uint8"};case L.IntervalDayTime:return{sqlType:"interval[dt]"};case L.IntervalYearMonth:return{sqlType:"interval[m]"};case L.List:return{sqlType:"list",valueType:Ga(r.valueType)};case L.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case L.Null:return{sqlType:"null"};case L.Utf8:return{sqlType:"utf8"};case L.Struct:return{sqlType:"struct",fields:r.children.map(t=>Cc(t.name,t.type))};case L.Map:{let t=r;return{sqlType:"map",keyType:Ga(t.keyType),valueType:Ga(t.valueType)}}case L.Time:return{sqlType:"time[s]"};case L.TimeMicrosecond:return{sqlType:"time[us]"};case L.TimeMillisecond:return{sqlType:"time[ms]"};case L.TimeNanosecond:return{sqlType:"time[ns]"};case L.TimeSecond:return{sqlType:"time[s]"};case L.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case L.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case L.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case L.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case L.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function Cc(r,t){let e=Ga(t);return e.name=r,e}var OA=new TextEncoder,CA=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 n of this._onInstantiationProgress)n(e.data);return}}let i=this._pendingRequests.get(e.requestId);if(!i){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let n=new Error(e.data.message);n.name=e.data.name,(t=Object.getOwnPropertyDescriptor(n,"stack"))!=null&&t.writable&&(n.stack=e.data.stack),i.promiseRejecter(n);return}switch(i.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"){i.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){i.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){i.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){i.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){i.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){i.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){i.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){i.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){i.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){i.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){i.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){i.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){i.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){i.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){i.promiseResolver(e.data);return}break}i.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 ue("RESET",null);return await this.postTask(r)}async ping(){let r=new ue("PING",null);await this.postTask(r)}async dropFile(r){let t=new ue("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new ue("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new ue("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=i=>{}){this._onInstantiationProgress.push(e);let i=new ue("INSTANTIATE",[r,t]);return await this.postTask(i)}async getVersion(){let r=new ue("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new ue("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new ue("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new ue("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new ue("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new TA(this,r)}async disconnect(r){let t=new ue("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new ue("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let i=new ue("START_PENDING_QUERY",[r,t,e]);return await this.postTask(i)}async pollPendingQuery(r){let t=new ue("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new ue("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new ue("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new ue("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new ue("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new ue("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let i=new ue("RUN_PREPARED",[r,t,e]);return await this.postTask(i)}async sendPrepared(r,t,e){let i=new ue("SEND_PREPARED",[r,t,e]);return await this.postTask(i)}async globFiles(r){let t=new ue("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=OA.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,i){t===void 0&&(t=r);let n=new ue("REGISTER_FILE_URL",[r,t,e,i]);await this.postTask(n)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new ue("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,i){let n=new ue("REGISTER_FILE_HANDLE",[r,t,e,i]);await this.postTask(n,[])}async registerOPFSFileName(r){let t=new ue("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new ue("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new ue("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new ue("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new ue("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let i=new ue("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(i,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(Cc(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(i)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(Cc(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(i)}};function FA(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}FA();var MA=(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))(MA||{}),DA=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])),RA=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])),NA=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])),PA=()=>(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])),LA={version:"1.29.1-dev68.0"},Uh=LA.version.split(".");Uh[0];Uh[1];Uh[2];var BA=()=>typeof navigator>"u",Gl=null,Wl=null,Hl=null,Yl=null,Xl=null;async function UA(){return Gl==null&&(Gl=typeof BigInt64Array<"u"),Wl==null&&(Wl=await RA()),Hl==null&&(Hl=await PA()),Yl==null&&(Yl=await NA()),Xl==null&&(Xl=await DA()),{bigInt64Array:Gl,crossOriginIsolated:BA()||globalThis.crossOriginIsolated||!1,wasmExceptions:Wl,wasmSIMD:Yl,wasmThreads:Hl,wasmBulkMemory:Xl}}async function Qf(r){let t=await UA();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}}mA(yA());const ql={},Ao={};function Mo(r,t){try{const i=(ql[r]||(ql[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return i in Ao?Ao[i]:Kf(i,i.split(":"))}catch{if(r in Ao)return Ao[r];const e=r==null?void 0:r.match(kA);return e?Kf(r,e.slice(1)):NaN}}const kA=/([+-]\d\d):?(\d\d)?/;function Kf(r,t){const e=+t[0],i=+(t[1]||0);return Ao[r]=e>0?e*60+i:e*60-i}class Tr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Mo(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)),P_(this),Fc(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Tr(...e,t):new Tr(Date.now(),t)}withTimeZone(t){return new Tr(+this,t)}getTimezoneOffset(){return-Mo(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),Fc(this),+this}[Symbol.for("constructDateFrom")](t){return new Tr(+new Date(t),this.timeZone)}}const Zf=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!Zf.test(r))return;const t=r.replace(Zf,"$1UTC");Tr.prototype[t]&&(r.startsWith("get")?Tr.prototype[r]=function(){return this.internal[t]()}:(Tr.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),zA(this),+this},Tr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Fc(this),+this}))});function Fc(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function zA(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()),P_(r)}function P_(r){const t=Mo(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const i=-new Date(+r).getTimezoneOffset(),n=-new Date(+e).getTimezoneOffset(),s=i-n,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=i-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const u=Mo(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-u,h=u!==t,p=c-a;if(h&&p){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+p);const d=Mo(r.timeZone,r),g=u-d;g&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+g),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+g))}}const $A=new TextDecoder("utf-8"),jA=r=>$A.decode(r),VA=new TextEncoder,L_=r=>VA.encode(r),oi=r=>typeof r=="function",oa=r=>r!=null&&Object(r)===r,GA=r=>oa(r)&&oi(r.then),B_=r=>oa(r)&&oi(r[Symbol.iterator]),WA=r=>oa(r)&&oi(r[Symbol.asyncIterator]),HA=r=>oa(r)&&"done"in r&&"value"in r,YA=r=>oa(r)&&oi(r.clear)&&oi(r.bytes)&&oi(r.position)&&oi(r.setPosition)&&oi(r.capacity)&&oi(r.getBufferIdentifier)&&oi(r.createLong),kh=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function XA(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,u=0,l=0,c=r.length;++uc+h.byteLength,0);let n,s,o,a=0,u=-1;const l=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++utr(Int8Array,r),KA=r=>tr(Int16Array,r),ZA=r=>tr(Int32Array,r),JA=r=>tr(BigInt64Array,r),tO=r=>tr(Uint8Array,r),eO=r=>tr(Uint16Array,r),rO=r=>tr(Uint32Array,r),iO=r=>tr(BigUint64Array,r),nO=r=>tr(Float32Array,r),sO=r=>tr(Float64Array,r),oO=r=>tr(Uint8ClampedArray,r),Dc=r=>(r.next(),r);function*Ti(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof kh?e(t):B_(t)?t:e(t);return yield*Dc(function*(n){let s=null;do s=n.next(yield tr(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const aO=r=>Ti(Int8Array,r),uO=r=>Ti(Int16Array,r),lO=r=>Ti(Int32Array,r),cO=r=>Ti(Uint8Array,r),hO=r=>Ti(Uint16Array,r),dO=r=>Ti(Uint32Array,r),fO=r=>Ti(Float32Array,r),pO=r=>Ti(Float64Array,r),mO=r=>Ti(Uint8ClampedArray,r);function Zr(r,t){return dr(this,arguments,function*(){if(GA(t))return yield Mt(yield Mt(yield*Qn(yi(Zr(r,yield Mt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Mt(yield Mt(o))})},n=function(o){return dr(this,arguments,function*(){yield Mt(yield*Qn(yi(Dc(function*(a){let u=null;do u=a.next(yield u==null?void 0:u.value);while(!u.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof kh?i(t):B_(t)?n(t):WA(t)?t:i(t);return yield Mt(yield*Qn(yi(Dc(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Mt(o.next(yield yield Mt(tr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Mt(new r)})}const yO=r=>Zr(Int8Array,r),gO=r=>Zr(Int16Array,r),vO=r=>Zr(Int32Array,r),_O=r=>Zr(Uint8Array,r),bO=r=>Zr(Uint16Array,r),wO=r=>Zr(Uint32Array,r),SO=r=>Zr(Float32Array,r),IO=r=>Zr(Float64Array,r),TO=r=>Zr(Uint8ClampedArray,r);function xO(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++eqs(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const OO=Object.freeze(Object.defineProperty({__proto__:null,valueToString:qs},Symbol.toStringTag,{value:"Module"}));function or(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 k_(r,t){return or(r/t)+or(r%t)/or(t)}const z_=Symbol.for("isArrowBigNum");function Jr(r,...t){return t.length===0?Object.setPrototypeOf(tr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}Jr.prototype[z_]=!0;Jr.prototype.toJSON=function(){return`"${Qs(this)}"`};Jr.prototype.valueOf=function(r){return zh(this,r)};Jr.prototype.toString=function(){return Qs(this)};Jr.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return zh(this);case"string":return Qs(this);case"default":return $_(this)}return Qs(this)};function Us(...r){return Jr.apply(this,r)}function ks(...r){return Jr.apply(this,r)}function Xo(...r){return Jr.apply(this,r)}Object.setPrototypeOf(Us.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(ks.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Xo.prototype,Object.create(Uint32Array.prototype));Object.assign(Us.prototype,Jr.prototype,{constructor:Us,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(ks.prototype,Jr.prototype,{constructor:ks,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Xo.prototype,Jr.prototype,{constructor:Xo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const CO=BigInt(4294967296)*BigInt(4294967296),FO=CO-BigInt(1);function zh(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return Ql(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(xt.prototype);class Jf extends xt{constructor(){super(W.Null)}toString(){return"Null"}}V_=Symbol.toStringTag;Jf[V_]=(r=>r[Symbol.toStringTag]="Null")(Jf.prototype);class tp extends xt{constructor(t,e){super(W.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}`}}G_=Symbol.toStringTag;tp[G_]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(tp.prototype);class ep extends xt{constructor(t){super(W.Float),this.precision=t}get ArrayType(){switch(this.precision){case xr.HALF:return Uint16Array;case xr.SINGLE:return Float32Array;case xr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}W_=Symbol.toStringTag;ep[W_]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(ep.prototype);class rp extends xt{constructor(){super(W.Binary)}toString(){return"Binary"}}H_=Symbol.toStringTag;rp[H_]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(rp.prototype);class ip extends xt{constructor(){super(W.LargeBinary)}toString(){return"LargeBinary"}}Y_=Symbol.toStringTag;ip[Y_]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(ip.prototype);class np extends xt{constructor(){super(W.Utf8)}toString(){return"Utf8"}}X_=Symbol.toStringTag;np[X_]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(np.prototype);class sp extends xt{constructor(){super(W.LargeUtf8)}toString(){return"LargeUtf8"}}q_=Symbol.toStringTag;sp[q_]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(sp.prototype);class op extends xt{constructor(){super(W.Bool)}toString(){return"Bool"}}Q_=Symbol.toStringTag;op[Q_]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(op.prototype);class ap extends xt{constructor(t,e,i=128){super(W.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}K_=Symbol.toStringTag;ap[K_]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(ap.prototype);class up extends xt{constructor(t){super(W.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${yn[this.unit]}>`}get ArrayType(){return this.unit===yn.DAY?Int32Array:BigInt64Array}}Z_=Symbol.toStringTag;up[Z_]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(up.prototype);class lp extends xt{constructor(t,e){super(W.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Jt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}J_=Symbol.toStringTag;lp[J_]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(lp.prototype);class cp extends xt{constructor(t,e){super(W.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Jt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}tb=Symbol.toStringTag;cp[tb]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(cp.prototype);class hp extends xt{constructor(t){super(W.Interval),this.unit=t}toString(){return`Interval<${Jn[this.unit]}>`}}eb=Symbol.toStringTag;hp[eb]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(hp.prototype);class dp extends xt{constructor(t){super(W.Duration),this.unit=t}toString(){return`Duration<${Jt[this.unit]}>`}}rb=Symbol.toStringTag;dp[rb]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(dp.prototype);class fp extends xt{constructor(t){super(W.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}}ib=Symbol.toStringTag;fp[ib]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(fp.prototype);class Rc extends xt{constructor(t){super(W.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}nb=Symbol.toStringTag;Rc[nb]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(Rc.prototype);class pp extends xt{constructor(t,e,i){super(W.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}sb=Symbol.toStringTag;pp[sb]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(pp.prototype);class mp extends xt{constructor(t){super(W.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}ob=Symbol.toStringTag;mp[ob]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(mp.prototype);class yp extends xt{constructor(t,e){super(W.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}>`}}ab=Symbol.toStringTag;yp[ab]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(yp.prototype);class gp extends xt{constructor(t,e=!1){var i,n,s;if(super(W.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.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(", ")}}>`}}ub=Symbol.toStringTag;gp[ub]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(gp.prototype);const DO=(r=>()=>++r)(-1);class vp extends xt{constructor(t,e,i,n){super(W.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?DO():or(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}lb=Symbol.toStringTag;vp[lb]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(vp.prototype);function cb(r){const t=r;switch(r.typeId){case W.Decimal:return r.bitWidth/32;case W.Interval:return 1+t.unit;case W.FixedSizeList:return t.listSize;case W.FixedSizeBinary:return t.byteWidth;default:return 1}}class ae{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return RO(this,t,e)}getVisitFnByTypeId(t,e=!0){return Es(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 RO(r,t,e=!0){return typeof t=="number"?Es(r,t,e):typeof t=="string"&&t in W?Es(r,W[t],e):t&&t instanceof xt?Es(r,_p(t),e):t!=null&&t.type&&t.type instanceof xt?Es(r,_p(t.type),e):Es(r,W.NONE,e)}function Es(r,t,e=!0){let i=null;switch(t){case W.Null:i=r.visitNull;break;case W.Bool:i=r.visitBool;break;case W.Int:i=r.visitInt;break;case W.Int8:i=r.visitInt8||r.visitInt;break;case W.Int16:i=r.visitInt16||r.visitInt;break;case W.Int32:i=r.visitInt32||r.visitInt;break;case W.Int64:i=r.visitInt64||r.visitInt;break;case W.Uint8:i=r.visitUint8||r.visitInt;break;case W.Uint16:i=r.visitUint16||r.visitInt;break;case W.Uint32:i=r.visitUint32||r.visitInt;break;case W.Uint64:i=r.visitUint64||r.visitInt;break;case W.Float:i=r.visitFloat;break;case W.Float16:i=r.visitFloat16||r.visitFloat;break;case W.Float32:i=r.visitFloat32||r.visitFloat;break;case W.Float64:i=r.visitFloat64||r.visitFloat;break;case W.Utf8:i=r.visitUtf8;break;case W.LargeUtf8:i=r.visitLargeUtf8;break;case W.Binary:i=r.visitBinary;break;case W.LargeBinary:i=r.visitLargeBinary;break;case W.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case W.Date:i=r.visitDate;break;case W.DateDay:i=r.visitDateDay||r.visitDate;break;case W.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case W.Timestamp:i=r.visitTimestamp;break;case W.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case W.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case W.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case W.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case W.Time:i=r.visitTime;break;case W.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case W.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case W.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case W.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case W.Decimal:i=r.visitDecimal;break;case W.List:i=r.visitList;break;case W.Struct:i=r.visitStruct;break;case W.Union:i=r.visitUnion;break;case W.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case W.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case W.Dictionary:i=r.visitDictionary;break;case W.Interval:i=r.visitInterval;break;case W.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case W.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case W.Duration:i=r.visitDuration;break;case W.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case W.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case W.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case W.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case W.FixedSizeList:i=r.visitFixedSizeList;break;case W.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${W[t]}'`)}function _p(r){switch(r.typeId){case W.Null:return W.Null;case W.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?W.Int8:W.Uint8;case 16:return e?W.Int16:W.Uint16;case 32:return e?W.Int32:W.Uint32;case 64:return e?W.Int64:W.Uint64}return W.Int}case W.Float:switch(r.precision){case xr.HALF:return W.Float16;case xr.SINGLE:return W.Float32;case xr.DOUBLE:return W.Float64}return W.Float;case W.Binary:return W.Binary;case W.LargeBinary:return W.LargeBinary;case W.Utf8:return W.Utf8;case W.LargeUtf8:return W.LargeUtf8;case W.Bool:return W.Bool;case W.Decimal:return W.Decimal;case W.Time:switch(r.unit){case Jt.SECOND:return W.TimeSecond;case Jt.MILLISECOND:return W.TimeMillisecond;case Jt.MICROSECOND:return W.TimeMicrosecond;case Jt.NANOSECOND:return W.TimeNanosecond}return W.Time;case W.Timestamp:switch(r.unit){case Jt.SECOND:return W.TimestampSecond;case Jt.MILLISECOND:return W.TimestampMillisecond;case Jt.MICROSECOND:return W.TimestampMicrosecond;case Jt.NANOSECOND:return W.TimestampNanosecond}return W.Timestamp;case W.Date:switch(r.unit){case yn.DAY:return W.DateDay;case yn.MILLISECOND:return W.DateMillisecond}return W.Date;case W.Interval:switch(r.unit){case Jn.DAY_TIME:return W.IntervalDayTime;case Jn.YEAR_MONTH:return W.IntervalYearMonth}return W.Interval;case W.Duration:switch(r.unit){case Jt.SECOND:return W.DurationSecond;case Jt.MILLISECOND:return W.DurationMillisecond;case Jt.MICROSECOND:return W.DurationMicrosecond;case Jt.NANOSECOND:return W.DurationNanosecond}return W.Duration;case W.Map:return W.Map;case W.List:return W.List;case W.Struct:return W.Struct;case W.Union:switch(r.mode){case bi.Dense:return W.DenseUnion;case bi.Sparse:return W.SparseUnion}return W.Union;case W.FixedSizeBinary:return W.FixedSizeBinary;case W.FixedSizeList:return W.FixedSizeList;case W.Dictionary:return W.Dictionary}throw new Error(`Unrecognized type '${W[r.typeId]}'`)}ae.prototype.visitInt8=null;ae.prototype.visitInt16=null;ae.prototype.visitInt32=null;ae.prototype.visitInt64=null;ae.prototype.visitUint8=null;ae.prototype.visitUint16=null;ae.prototype.visitUint32=null;ae.prototype.visitUint64=null;ae.prototype.visitFloat16=null;ae.prototype.visitFloat32=null;ae.prototype.visitFloat64=null;ae.prototype.visitDateDay=null;ae.prototype.visitDateMillisecond=null;ae.prototype.visitTimestampSecond=null;ae.prototype.visitTimestampMillisecond=null;ae.prototype.visitTimestampMicrosecond=null;ae.prototype.visitTimestampNanosecond=null;ae.prototype.visitTimeSecond=null;ae.prototype.visitTimeMillisecond=null;ae.prototype.visitTimeMicrosecond=null;ae.prototype.visitTimeNanosecond=null;ae.prototype.visitDenseUnion=null;ae.prototype.visitSparseUnion=null;ae.prototype.visitIntervalDayTime=null;ae.prototype.visitIntervalYearMonth=null;ae.prototype.visitDuration=null;ae.prototype.visitDurationSecond=null;ae.prototype.visitDurationMillisecond=null;ae.prototype.visitDurationMicrosecond=null;ae.prototype.visitDurationNanosecond=null;const hb=new Float64Array(1),fs=new Uint32Array(hb.buffer);function $h(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function db(r){if(r!==r)return 32256;hb[0]=r;const t=(fs[1]&2147483648)>>16&65535;let e=fs[1]&2146435072,i=0;return e>=1089470464?fs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(fs[1]&1048575)>>10):e<=1056964608?(i=1048576+(fs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(fs[1]&1048575)+512>>10),t|e|i&65535}const NO=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:db,uint16ToFloat64:$h},Symbol.toStringTag,{value:"Module"}));class Gt extends ae{}function Xt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const PO=(r,t,e)=>{r[t]=Math.floor(e/864e5)},fb=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},jh=({values:r},t,e)=>{r[t]=e},pb=({values:r},t,e)=>{r[t]=db(e)},BO=(r,t,e)=>{switch(r.type.precision){case xr.HALF:return pb(r,t,e);case xr.SINGLE:case xr.DOUBLE:return jh(r,t,e)}},mb=({values:r},t,e)=>{PO(r,t,e.valueOf())},yb=({values:r},t,e)=>{r[t]=BigInt(e)},UO=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},gb=({values:r,valueOffsets:t},e,i)=>fb(r,t,e,i),vb=({values:r,valueOffsets:t},e,i)=>fb(r,t,e,L_(i)),kO=(r,t,e)=>{r.type.unit===yn.DAY?mb(r,t,e):yb(r,t,e)},_b=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},bb=({values:r},t,e)=>{r[t]=BigInt(e)},wb=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},Sb=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},zO=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return _b(r,t,e);case Jt.MILLISECOND:return bb(r,t,e);case Jt.MICROSECOND:return wb(r,t,e);case Jt.NANOSECOND:return Sb(r,t,e)}},Ib=({values:r},t,e)=>{r[t]=e},Tb=({values:r},t,e)=>{r[t]=e},xb=({values:r},t,e)=>{r[t]=e},Eb=({values:r},t,e)=>{r[t]=e},$O=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return Ib(r,t,e);case Jt.MILLISECOND:return Tb(r,t,e);case Jt.MICROSECOND:return xb(r,t,e);case Jt.NANOSECOND:return Eb(r,t,e)}},jO=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},VO=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=wi.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],u=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=wi.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const u=e instanceof Map?e.entries():Object.entries(e);for(const l of u)if(s(i,o,l),++o>=a)break},WO=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),HO=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),YO=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),XO=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),qO=(r,t,e)=>{const i=r.type.children.map(s=>wi.getVisitFn(s.type)),n=e instanceof Map?YO(t,e):e instanceof Xe?HO(t,e):Array.isArray(e)?WO(t,e):XO(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},QO=(r,t,e)=>{r.type.mode===bi.Dense?Ab(r,t,e):Ob(r,t,e)},Ab=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];wi.visit(n,r.valueOffsets[t],e)},Ob=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];wi.visit(n,t,e)},KO=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},ZO=(r,t,e)=>{r.type.unit===Jn.DAY_TIME?Cb(r,t,e):Fb(r,t,e)},Cb=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},Fb=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Mb=({values:r},t,e)=>{r[t]=e},Db=({values:r},t,e)=>{r[t]=e},Rb=({values:r},t,e)=>{r[t]=e},Nb=({values:r},t,e)=>{r[t]=e},JO=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return Mb(r,t,e);case Jt.MILLISECOND:return Db(r,t,e);case Jt.MICROSECOND:return Rb(r,t,e);case Jt.NANOSECOND:return Nb(r,t,e)}},tC=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=wi.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${qs(t)}: ${qs(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new eC(this[qr],this[zs])}}class eC{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[qr].type.children.some(i=>i.name===e)}getOwnPropertyDescriptor(t,e){if(t[qr].type.children.some(i=>i.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[qr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=Wr.visit(t[qr].children[i],t[zs]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[qr].type.children.findIndex(s=>s.name===e);return n!==-1?(wi.visit(t[qr].children[n],t[zs],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}const iC=new rC;class Lt extends ae{}function Wt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const nC=(r,t)=>864e5*r[t],sC=(r,t)=>null,Pb=(r,t,e)=>{if(e+1>=t.length)return null;const i=or(t[e]),n=or(t[e+1]);return r.subarray(i,n)},oC=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<nC(r,t),Bb=({values:r},t)=>or(r[t]),_n=({stride:r,values:t},e)=>t[r*e],aC=({stride:r,values:t},e)=>$h(t[r*e]),Ub=({values:r},t)=>r[t],uC=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),kb=({values:r,valueOffsets:t},e)=>Pb(r,t,e),zb=({values:r,valueOffsets:t},e)=>{const i=Pb(r,t,e);return i!==null?jA(i):null},lC=({values:r},t)=>r[t],cC=({type:r,values:t},e)=>r.precision!==xr.HALF?t[e]:$h(t[e]),hC=(r,t)=>r.type.unit===yn.DAY?Lb(r,t):Bb(r,t),$b=({values:r},t)=>1e3*or(r[t]),jb=({values:r},t)=>or(r[t]),Vb=({values:r},t)=>k_(r[t],BigInt(1e3)),Gb=({values:r},t)=>k_(r[t],BigInt(1e6)),dC=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return $b(r,t);case Jt.MILLISECOND:return jb(r,t);case Jt.MICROSECOND:return Vb(r,t);case Jt.NANOSECOND:return Gb(r,t)}},Wb=({values:r},t)=>r[t],Hb=({values:r},t)=>r[t],Yb=({values:r},t)=>r[t],Xb=({values:r},t)=>r[t],fC=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Wb(r,t);case Jt.MILLISECOND:return Hb(r,t);case Jt.MICROSECOND:return Yb(r,t);case Jt.NANOSECOND:return Xb(r,t)}},pC=({values:r,stride:t},e)=>Zu.decimal(r.subarray(t*e,t*(e+1))),mC=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,u=n[0].slice(s,o-s);return new Xe([u])},yC=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new Gh(o.slice(n,s-n))},gC=(r,t)=>new Vh(r,t),vC=(r,t)=>r.type.mode===bi.Dense?qb(r,t):Qb(r,t),qb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Wr.visit(i,r.valueOffsets[t])},Qb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Wr.visit(i,t)},_C=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},bC=(r,t)=>r.type.unit===Jn.DAY_TIME?Kb(r,t):Zb(r,t),Kb=({values:r},t)=>r.subarray(2*t,2*(t+1)),Zb=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Jb=({values:r},t)=>r[t],t0=({values:r},t)=>r[t],e0=({values:r},t)=>r[t],r0=({values:r},t)=>r[t],wC=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Jb(r,t);case Jt.MILLISECOND:return t0(r,t);case Jt.MICROSECOND:return e0(r,t);case Jt.NANOSECOND:return r0(r,t)}},SC=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Xe([s])};Lt.prototype.visitNull=Wt(sC);Lt.prototype.visitBool=Wt(oC);Lt.prototype.visitInt=Wt(lC);Lt.prototype.visitInt8=Wt(_n);Lt.prototype.visitInt16=Wt(_n);Lt.prototype.visitInt32=Wt(_n);Lt.prototype.visitInt64=Wt(Ub);Lt.prototype.visitUint8=Wt(_n);Lt.prototype.visitUint16=Wt(_n);Lt.prototype.visitUint32=Wt(_n);Lt.prototype.visitUint64=Wt(Ub);Lt.prototype.visitFloat=Wt(cC);Lt.prototype.visitFloat16=Wt(aC);Lt.prototype.visitFloat32=Wt(_n);Lt.prototype.visitFloat64=Wt(_n);Lt.prototype.visitUtf8=Wt(zb);Lt.prototype.visitLargeUtf8=Wt(zb);Lt.prototype.visitBinary=Wt(kb);Lt.prototype.visitLargeBinary=Wt(kb);Lt.prototype.visitFixedSizeBinary=Wt(uC);Lt.prototype.visitDate=Wt(hC);Lt.prototype.visitDateDay=Wt(Lb);Lt.prototype.visitDateMillisecond=Wt(Bb);Lt.prototype.visitTimestamp=Wt(dC);Lt.prototype.visitTimestampSecond=Wt($b);Lt.prototype.visitTimestampMillisecond=Wt(jb);Lt.prototype.visitTimestampMicrosecond=Wt(Vb);Lt.prototype.visitTimestampNanosecond=Wt(Gb);Lt.prototype.visitTime=Wt(fC);Lt.prototype.visitTimeSecond=Wt(Wb);Lt.prototype.visitTimeMillisecond=Wt(Hb);Lt.prototype.visitTimeMicrosecond=Wt(Yb);Lt.prototype.visitTimeNanosecond=Wt(Xb);Lt.prototype.visitDecimal=Wt(pC);Lt.prototype.visitList=Wt(mC);Lt.prototype.visitStruct=Wt(gC);Lt.prototype.visitUnion=Wt(vC);Lt.prototype.visitDenseUnion=Wt(qb);Lt.prototype.visitSparseUnion=Wt(Qb);Lt.prototype.visitDictionary=Wt(_C);Lt.prototype.visitInterval=Wt(bC);Lt.prototype.visitIntervalDayTime=Wt(Kb);Lt.prototype.visitIntervalYearMonth=Wt(Zb);Lt.prototype.visitDuration=Wt(wC);Lt.prototype.visitDurationSecond=Wt(Jb);Lt.prototype.visitDurationMillisecond=Wt(t0);Lt.prototype.visitDurationMicrosecond=Wt(e0);Lt.prototype.visitDurationNanosecond=Wt(r0);Lt.prototype.visitFixedSizeList=Wt(SC);Lt.prototype.visitMap=Wt(yC);const Wr=new Lt,As=Symbol.for("keys"),$s=Symbol.for("vals"),Os=Symbol.for("kKeysAsStrings"),Nc=Symbol.for("_kKeysAsStrings");class Gh{constructor(t){return this[As]=new Xe([t.children[0]]).memoize(),this[$s]=t.children[1],new Proxy(this,new TC)}get[Os](){return this[Nc]||(this[Nc]=Array.from(this[As].toArray(),String))}[Symbol.iterator](){return new IC(this[As],this[$s])}get size(){return this[As].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[As],e=this[$s],i={};for(let n=-1,s=t.length;++n`${qs(t)}: ${qs(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class IC{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),Wr.visit(this.vals,t)]})}}class TC{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Os]}has(t,e){return t[Os].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Os].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Os].indexOf(e);if(i!==-1){const n=Wr.visit(Reflect.get(t,$s),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Os].indexOf(e);return n!==-1?(wi.visit(Reflect.get(t,$s),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Gh.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[As]:{writable:!0,enumerable:!1,configurable:!1,value:null},[$s]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Nc]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let bp;function i0(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const n0=(r,t)=>r<0?t+r:r,wp=r=>r!==r;function ss(r){if(typeof r!=="object"||r===null)return wp(r)?wp:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?U_(r,e):!1:r instanceof Map?EC(r):Array.isArray(r)?xC(r):r instanceof Xe?AC(r):OC(r,!0)}function xC(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return CC(r,e);case Map:return Sp(r,e,e.keys());case Gh:case Vh:case Object:case void 0:return Sp(r,e,t||Object.keys(e))}return e instanceof Xe?FC(r,e):!1}}function CC(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function DC(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):o0(new tl(e,r,t,null,Wh)).subarray(0,i)),n}return e}function o0(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class tl{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,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,n=t+(t%8===0?0:8-t%8);return Fu(r,t,n)+Fu(r,i,e)+a0(r,n>>3,i-n>>3)}function a0(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=Wa(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=Wa(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=Wa(s.getUint8(n)),n+=1;return i}function Wa(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 RC=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:tl,getBit:s0,getBool:Wh,packBools:o0,popcnt_array:a0,popcnt_bit_range:Fu,popcnt_uint32:Wa,setBool:DC,truncateBitmap:Pc},Symbol.toStringTag,{value:"Module"})),NC=-1;class qo{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 xt.isSparseUnion(t)?this.children.some(e=>e.nullable):xt.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:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(xt.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=NC&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Fu(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,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(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let u;s instanceof qo?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=cb(t),s&&((u=s[0])&&(this.valueOffsets=u),(u=s[1])&&(this.values=u),(u=s[2])&&(this.nullBitmap=u),(u=s[3])&&(this.typeIds=u)))}getValid(t){const{type:e}=this;if(xt.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===bi.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Pc(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&l)!==0,s[c]=e?h|l:h&~l}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new qo(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,u=this._sliceBuffers(t,e,i,n);return this.clone(this.type,this.offset+t,e,o,u,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===W.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(Pc(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[Pi.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[Pi.TYPE])&&(o[Pi.TYPE]=s.subarray(t,t+e)),(s=o[Pi.OFFSET])&&(o[Pi.OFFSET]=s.subarray(t,t+e+1))||(s=o[Pi.DATA])&&(o[Pi.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}}qo.prototype.children=Object.freeze([]);class Ip{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function LC(r){return r.reduce((t,e)=>t+e.nullCount,0)}function BC(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function UC(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=u+l)continue;if(u>=e&&u+l<=i){n.push(a);continue}const c=Math.max(0,e-u),h=Math.min(i-u,l);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function Hh(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function jC(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new tl(e,r.offset+(t||0),r.length,e,Wh)){if(!n)return i;++i}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case W.Union:break;case W.Dictionary:break;default:return jC(r,e)}const i=Wr.getVisitFn(r),n=ss(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new Ip(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new VC(o)})}class VC{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof qo)))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:u,indexOf:l}=h0[o.typeId],c=s[0];this.isValid=h=>u0(c,h),this.get=h=>a(c,h),this.set=(h,p)=>u(c,h,p),this.indexOf=h=>l(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,d0[o.typeId]),this._offsets=BC(s);break}this.data=s,this.type=o,this.stride=cb(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return PC(this.data)}get nullCount(){return LC(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${W[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(n0(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return GC.visit(this)}concat(...t){return new Xe(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Xe(i0(this,t,e,({data:i,_offsets:n},s,o)=>UC(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case W.Int:case W.Float:case W.Decimal:case W.Time:case W.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:u})=>(o.array.set(a.subarray(0,u*n),o.offset),o.offset+=u*n,o),{array:new s(i*n),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(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return xt.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(xt.isDictionary(this.type)){const t=new Mu(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Xe(e)}return new Mu(this)}unmemoize(){if(xt.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Xe(e)}return this}}c0=Symbol.toStringTag;Xe[c0]=(r=>{r.type=xt.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(W).map(e=>W[e]).filter(e=>typeof e=="number"&&e!==W.NONE);for(const e of t){const i=Wr.getVisitFnByTypeId(e),n=wi.getVisitFnByTypeId(e),s=xp.getVisitFnByTypeId(e);h0[e]={get:i,set:n,indexOf:s},d0[e]=Object.create(r,{isValid:{value:Tp(u0)},get:{value:Tp(Wr.getVisitFnByTypeId(e))},set:{value:kC(wi.getVisitFnByTypeId(e))},indexOf:{value:zC(xp.getVisitFnByTypeId(e))}})}return"Vector"})(Xe.prototype);class Mu extends Xe{constructor(t){super(t.data);const e=this.get,i=this.set,n=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const u=e.call(this,o);return s[o]=u,u}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Mu(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Xe(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const WC=65536;function Fs(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const Ks=8,Yh=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Xh{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]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[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`${Fs(this.buffer[3])} ${Fs(this.buffer[2])} ${Fs(this.buffer[1])} ${Fs(this.buffer[0])}`}static multiply(t,e){return new si(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new si(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return si.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return si.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new si(e);for(let o=i?1:0;othis.compareFields(i,e[n]))}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 ur(r,t){return t instanceof r.constructor}function os(r,t){return r===t||ur(r,t)}function Wi(r,t){return r===t||ur(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function el(r,t){return r===t||ur(r,t)&&r.precision===t.precision}function YC(r,t){return r===t||ur(r,t)&&r.byteWidth===t.byteWidth}function qh(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function aa(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function ua(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function XC(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Si.compareManyFields(r.children,t.children)}function qC(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Si.compareManyFields(r.children,t.children)}function Qh(r,t){return r===t||ur(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&Si.compareManyFields(r.children,t.children)}function QC(r,t){return r===t||ur(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Si.visit(r.indices,t.indices)&&Si.visit(r.dictionary,t.dictionary)}function Kh(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function la(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function KC(r,t){return r===t||ur(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Si.compareManyFields(r.children,t.children)}function ZC(r,t){return r===t||ur(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Si.compareManyFields(r.children,t.children)}kt.prototype.visitNull=os;kt.prototype.visitBool=os;kt.prototype.visitInt=Wi;kt.prototype.visitInt8=Wi;kt.prototype.visitInt16=Wi;kt.prototype.visitInt32=Wi;kt.prototype.visitInt64=Wi;kt.prototype.visitUint8=Wi;kt.prototype.visitUint16=Wi;kt.prototype.visitUint32=Wi;kt.prototype.visitUint64=Wi;kt.prototype.visitFloat=el;kt.prototype.visitFloat16=el;kt.prototype.visitFloat32=el;kt.prototype.visitFloat64=el;kt.prototype.visitUtf8=os;kt.prototype.visitLargeUtf8=os;kt.prototype.visitBinary=os;kt.prototype.visitLargeBinary=os;kt.prototype.visitFixedSizeBinary=YC;kt.prototype.visitDate=qh;kt.prototype.visitDateDay=qh;kt.prototype.visitDateMillisecond=qh;kt.prototype.visitTimestamp=aa;kt.prototype.visitTimestampSecond=aa;kt.prototype.visitTimestampMillisecond=aa;kt.prototype.visitTimestampMicrosecond=aa;kt.prototype.visitTimestampNanosecond=aa;kt.prototype.visitTime=ua;kt.prototype.visitTimeSecond=ua;kt.prototype.visitTimeMillisecond=ua;kt.prototype.visitTimeMicrosecond=ua;kt.prototype.visitTimeNanosecond=ua;kt.prototype.visitDecimal=os;kt.prototype.visitList=XC;kt.prototype.visitStruct=qC;kt.prototype.visitUnion=Qh;kt.prototype.visitDenseUnion=Qh;kt.prototype.visitSparseUnion=Qh;kt.prototype.visitDictionary=QC;kt.prototype.visitInterval=Kh;kt.prototype.visitIntervalDayTime=Kh;kt.prototype.visitIntervalYearMonth=Kh;kt.prototype.visitDuration=la;kt.prototype.visitDurationSecond=la;kt.prototype.visitDurationMillisecond=la;kt.prototype.visitDurationMicrosecond=la;kt.prototype.visitDurationNanosecond=la;kt.prototype.visitFixedSizeList=KC;kt.prototype.visitMap=ZC;const Si=new kt;function JC(r,t){return Si.compareSchemas(r,t)}function tF(r,t){return Si.compareFields(r,t)}function eF(r,t){return Si.visit(r,t)}const Ep=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},MO),HC),RC),NO),EO),MC),OO),{compareSchemas:JC,compareFields:tF,compareTypes:eF}),f0=6048e5,rF=864e5,Ap=Symbol.for("constructDateFrom");function ki(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&Ap in r?r[Ap](t):r instanceof Date?new r.constructor(t):new Date(t)}function Hr(r,t){return ki(t||r,r)}let iF={};function rl(){return iF}function Qo(r,t){var a,u,l,c;const e=rl(),i=(t==null?void 0:t.weekStartsOn)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.weekStartsOn)??e.weekStartsOn??((c=(l=e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??0,n=Hr(r,t==null?void 0:t.in),s=n.getDay(),o=(s=s.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Op(r){const t=Hr(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 nF(r,...t){const e=ki.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Cp(r,t){const e=Hr(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function sF(r,t,e){const[i,n]=nF(e==null?void 0:e.in,r,t),s=Cp(i),o=Cp(n),a=+s-Op(s),u=+o-Op(o);return Math.round((a-u)/rF)}function oF(r,t){const e=p0(r,t),i=ki(r,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Du(i)}function aF(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function uF(r){return!(!aF(r)&&typeof r!="number"||isNaN(+Hr(r)))}function lF(r,t){const e=Hr(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const cF={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"}},hF=(r,t,e)=>{let i;const n=cF[r];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Kl(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const dF={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fF={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},pF={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mF={date:Kl({formats:dF,defaultWidth:"full"}),time:Kl({formats:fF,defaultWidth:"full"}),dateTime:Kl({formats:pF,defaultWidth:"full"})},yF={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gF=(r,t,e,i)=>yF[r];function co(r){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;n=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;n=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return n[s]}}const vF={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_F={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bF={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"]},wF={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"]},SF={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"}},IF={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"}},TF=(r,t)=>{const e=Number(r),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},xF={ordinalNumber:TF,era:co({values:vF,defaultWidth:"wide"}),quarter:co({values:_F,defaultWidth:"wide",argumentCallback:r=>r-1}),month:co({values:bF,defaultWidth:"wide"}),day:co({values:wF,defaultWidth:"wide"}),dayPeriod:co({values:SF,defaultWidth:"wide",formattingValues:IF,defaultFormattingWidth:"wide"})};function ho(r){return(t,e={})=>{const i=e.width,n=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],s=t.match(n);if(!s)return null;const o=s[0],a=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],u=Array.isArray(a)?AF(a,h=>h.test(o)):EF(a,h=>h.test(o));let l;l=r.valueCallback?r.valueCallback(u):u,l=e.valueCallback?e.valueCallback(l):l;const c=t.slice(o.length);return{value:l,rest:c}}}function EF(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function AF(r,t){for(let e=0;e{const i=t.match(r.matchPattern);if(!i)return null;const n=i[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(n.length);return{value:o,rest:a}}}const CF=/^(\d+)(th|st|nd|rd)?/i,FF=/\d+/i,MF={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},DF={any:[/^b/i,/^(a|c)/i]},RF={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},NF={any:[/1/i,/2/i,/3/i,/4/i]},PF={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},LF={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]},BF={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},UF={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]},kF={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},zF={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}},$F={ordinalNumber:OF({matchPattern:CF,parsePattern:FF,valueCallback:r=>parseInt(r,10)}),era:ho({matchPatterns:MF,defaultMatchWidth:"wide",parsePatterns:DF,defaultParseWidth:"any"}),quarter:ho({matchPatterns:RF,defaultMatchWidth:"wide",parsePatterns:NF,defaultParseWidth:"any",valueCallback:r=>r+1}),month:ho({matchPatterns:PF,defaultMatchWidth:"wide",parsePatterns:LF,defaultParseWidth:"any"}),day:ho({matchPatterns:BF,defaultMatchWidth:"wide",parsePatterns:UF,defaultParseWidth:"any"}),dayPeriod:ho({matchPatterns:kF,defaultMatchWidth:"any",parsePatterns:zF,defaultParseWidth:"any"})},jF={code:"en-US",formatDistance:hF,formatLong:mF,formatRelative:gF,localize:xF,match:$F,options:{weekStartsOn:0,firstWeekContainsDate:1}};function VF(r,t){const e=Hr(r,t==null?void 0:t.in);return sF(e,lF(e))+1}function GF(r,t){const e=Hr(r,t==null?void 0:t.in),i=+Du(e)-+oF(e);return Math.round(i/f0)+1}function m0(r,t){var c,h,p,d;const e=Hr(r,t==null?void 0:t.in),i=e.getFullYear(),n=rl(),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)??n.firstWeekContainsDate??((d=(p=n.locale)==null?void 0:p.options)==null?void 0:d.firstWeekContainsDate)??1,o=ki((t==null?void 0:t.in)||r,0);o.setFullYear(i+1,0,s),o.setHours(0,0,0,0);const a=Qo(o,t),u=ki((t==null?void 0:t.in)||r,0);u.setFullYear(i,0,s),u.setHours(0,0,0,0);const l=Qo(u,t);return+e>=+a?i+1:+e>=+l?i:i-1}function WF(r,t){var a,u,l,c;const e=rl(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:u.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(l=e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??1,n=m0(r,t),s=ki((t==null?void 0:t.in)||r,0);return s.setFullYear(n,0,i),s.setHours(0,0,0,0),Qo(s,t)}function HF(r,t){const e=Hr(r,t==null?void 0:t.in),i=+Qo(e,t)-+WF(e,t);return Math.round(i/f0)+1}function ge(r,t){const e=r<0?"-":"",i=Math.abs(r).toString().padStart(t,"0");return e+i}const Ki={y(r,t){const e=r.getFullYear(),i=e>0?e:1-e;return ge(t==="yy"?i%100:i,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):ge(e+1,2)},d(r,t){return ge(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 ge(r.getHours()%12||12,t.length)},H(r,t){return ge(r.getHours(),t.length)},m(r,t){return ge(r.getMinutes(),t.length)},s(r,t){return ge(r.getSeconds(),t.length)},S(r,t){const e=t.length,i=r.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return ge(n,t.length)}},ps={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fp={G:function(r,t,e){const i=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const i=r.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return Ki.y(r,t)},Y:function(r,t,e,i){const n=m0(r,i),s=n>0?n:1-n;if(t==="YY"){const o=s%100;return ge(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):ge(s,t.length)},R:function(r,t){const e=p0(r);return ge(e,t.length)},u:function(r,t){const e=r.getFullYear();return ge(e,t.length)},Q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ge(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ge(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,e){const i=r.getMonth();switch(t){case"M":case"MM":return Ki.M(r,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,e){const i=r.getMonth();switch(t){case"L":return String(i+1);case"LL":return ge(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,e,i){const n=HF(r,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):ge(n,t.length)},I:function(r,t,e){const i=GF(r);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ge(i,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):Ki.d(r,t)},D:function(r,t,e){const i=VF(r);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ge(i,t.length)},E:function(r,t,e){const i=r.getDay();switch(t){case"E":case"EE":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"})}},e:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ge(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});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"})}},c:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ge(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(r,t,e){const i=r.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return ge(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,e){const n=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(r,t,e){const i=r.getHours();let n;switch(i===12?n=ps.noon:i===0?n=ps.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(r,t,e){const i=r.getHours();let n;switch(i>=17?n=ps.evening:i>=12?n=ps.afternoon:i>=4?n=ps.morning:n=ps.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let i=r.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Ki.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):Ki.H(r,t)},K:function(r,t,e){const i=r.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ge(i,t.length)},k:function(r,t,e){let i=r.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ge(i,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):Ki.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):Ki.s(r,t)},S:function(r,t){return Ki.S(r,t)},X:function(r,t,e){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Dp(i);case"XXXX":case"XX":return zn(i);case"XXXXX":case"XXX":default:return zn(i,":")}},x:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"x":return Dp(i);case"xxxx":case"xx":return zn(i);case"xxxxx":case"xxx":default:return zn(i,":")}},O:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Mp(i,":");case"OOOO":default:return"GMT"+zn(i,":")}},z:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Mp(i,":");case"zzzz":default:return"GMT"+zn(i,":")}},t:function(r,t,e){const i=Math.trunc(+r/1e3);return ge(i,t.length)},T:function(r,t,e){return ge(+r,t.length)}};function Mp(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=Math.trunc(i/60),s=i%60;return s===0?e+String(n):e+String(n)+t+ge(s,2)}function Dp(r,t){return r%60===0?(r>0?"-":"+")+ge(Math.abs(r)/60,2):zn(r,t)}function zn(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=ge(Math.trunc(i/60),2),s=ge(i%60,2);return e+n+t+s}const Rp=(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"})}},y0=(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"})}},YF=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return Rp(r,t);let s;switch(i){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}}",Rp(i,t)).replace("{{time}}",y0(n,t))},XF={p:y0,P:YF},qF=/^D+$/,QF=/^Y+$/,KF=["D","DD","YY","YYYY"];function ZF(r){return qF.test(r)}function JF(r){return QF.test(r)}function tM(r,t,e){const i=eM(r,t,e);if(console.warn(i),KF.includes(r))throw new RangeError(i)}function eM(r,t,e){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const rM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,iM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nM=/^'([^]*?)'?$/,sM=/''/g,oM=/[a-zA-Z]/;function g0(r,t,e){var c,h,p,d;const i=rl(),n=i.locale??jF,s=i.firstWeekContainsDate??((h=(c=i.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=i.weekStartsOn??((d=(p=i.locale)==null?void 0:p.options)==null?void 0:d.weekStartsOn)??0,a=Hr(r,e==null?void 0:e.in);if(!uF(a))throw new RangeError("Invalid time value");let u=t.match(iM).map(g=>{const y=g[0];if(y==="p"||y==="P"){const f=XF[y];return f(g,n.formatLong)}return g}).join("").match(rM).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const y=g[0];if(y==="'")return{isToken:!1,value:aM(g)};if(Fp[y])return{isToken:!0,value:g};if(y.match(oM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:g}});n.localize.preprocessor&&(u=n.localize.preprocessor(a,u));const l={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return u.map(g=>{if(!g.isToken)return g.value;const y=g.value;(JF(y)||ZF(y))&&tM(y,t,String(r));const f=Fp[y[0]];return f(a,y,n.localize,l)}).join("")}function aM(r){const t=r.match(nM);return t?t[1].replace(sM,"'"):r}function uM(r,t){return Hr(r*1e3,t==null?void 0:t.in)}function lM(r,t){const e=cM(t)?new t(0):ki(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function cM(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function hM(r,t){let e=r.length;switch("string"){case"string":{if(t.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function yr(r){return r==null}function dM(r){return r!=null}async function Lc(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await nn(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function fM(r){return yr(r)?!1:xt.isInt(r.type)&&!v0(r)||pM(r)}function pM(r){return yr(r)?!1:xt.isInt(r.type)&&r.type.isSigned===!1}function mM(r){return yr(r)?!1:xt.isFloat(r.type)??!1}function yM(r){return yr(r)?!1:xt.isDecimal(r.type)}function gM(r){return yr(r)?!1:xt.isBool(r.type)}function vM(r){return yr(r)?!1:xt.isDuration(r.type)}function v0(r){return yr(r)?!1:xt.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function _M(r){return yr(r)?!1:xt.isTimestamp(r.type)}function bM(r){return yr(r)?!1:xt.isDate(r.type)}function wM(r){return yr(r)?!1:xt.isTime(r.type)}function SM(r){return yr(r)?!1:xt.isList(r.type)||xt.isFixedSizeList(r.type)}function IM(r){return yr(r)?!1:xt.isStruct(r.type)||xt.isMap(r.type)}function TM(r){return yr(r)?!1:xt.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||xt.isInterval(r.type)}function xM(r,t){let e;if(t===Jt.MILLISECOND)e=1e3;else if(t===Jt.MICROSECOND)e=1e3*1e3;else if(t===Jt.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 EM(r,t){var i;const e=xM(r,((i=t==null?void 0:t.type)==null?void 0:i.unit)??Jt.SECOND);return uM(e)}function AM(r,t){const e=EM(r,t);return g0(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function OM(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?g0(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function CM(r,t){var n;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const i=(n=t==null?void 0:t.type)==null?void 0:n.timezone;return typeof r=="number"?i?e=new Tr(r,i):e=new Tr(r):i?e=new Tr(r,i):e=new Tr(r),lM(e,Date)}function FM(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let i=Ep.bigNumToString(new Ep.BN(r)).padStart(e,"0");if(e===0)return i;let n="";i.startsWith("-")&&(n="-",i=i.slice(1));const s=i.slice(0,-e)||"0",o=hM(i.slice(-e),"0")||"";return`${n}${s}${o?`.${o}`:""}`}function MM(r){const t=r[0],e=r[1],i=[];return t!==0&&i.push(`${t} year${t>1?"s":""}`),e!==0&&i.push(`${e} month${e>1?"s":""}`),i.length?i.join(" "):"0 months"}function DM(r,t){var i,n,s,o;if(xt.isInterval(t==null?void 0:t.type))return MM(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:u}=a,l=r.toJSON(),c=u==="both"||u==="left"?"[":"(",h=u==="both"||u==="right"?"]":")",p=Bc(l.left,(n=(i=t.type)==null?void 0:i.children)==null?void 0:n[0]),d=Bc(l.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+p}, ${d+h}`}return String(r)}function RM(r,t){return(t==null?void 0:t.type)instanceof Rc?JSON.parse(JSON.stringify(r,(e,i)=>{if(dM(i))return typeof i=="bigint"?Number(i):i})):JSON.parse(JSON.stringify(r,(e,i)=>typeof i=="bigint"?Number(i):i))}function Bc(r,t){if(yr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&bM(t))return OM(r);if(typeof r=="bigint"&&wM(t))return AM(Number(r),t);if(e&&_M(t))return CM(r,t);if(v0(t))throw new Error("Period type is not supported yet");if(TM(t))return DM(r,t);if(vM(t))throw new Error("Duration type is not supported yet");return yM(t)?FM(r,t):mM(t)&&Number.isFinite(r)||fM(t)?r:IM(t)||SM(t)?RM(r,t):gM(t)?!!r:String(r)}function Np(r){return((r.toArray()||[]).map(i=>i.toJSON())||[]).map(i=>(r.schema.fields.forEach(n=>i[n.name]=Bc(i[n.name],n)),i))}var Ko=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(Ko||{});async function _0(r){const t=Pw(r,{logger:!1});let e,i;const n=await Lc();if(n==="browser"){if(typeof t.bundles>"u"){const{getBundles:u}=await nn(async()=>{const{getBundles:l}=await import("./default-browser-BrgSDbLD.js");return{getBundles:l}},[]);t.bundles=await u()}i=await Qf(await t.bundles),e=new Worker(i.mainWorker)}else if(n==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await nn(async()=>{const{getBundles:h}=await import("./default-node-ClwjvsoD.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}i=await Qf(await t.bundles);let u=i.mainWorker;u.startsWith("/@fs/")&&(u=u.replace("/@fs/","file://"));const l=await nn(()=>import("./index-Cp8iQ_hy.js"),[]);e=new l.default(u,{type:"module"})}else throw new Error(`Unsupported environment: ${n}`);let s;t.logger===!0?s=new R_:t.logger===!1?s=new SA:s=t.logger;const o=new CA(s,e);if(await o.instantiate(i.mainModule,i.pthreadWorker),t.storage)switch(t.storage.type){case Ko.ORIGIN_PRIVATE_FS:{try{let u=t.storage.path;u.startsWith("/")&&(u=u.slice(1)),await o.open({path:`opfs://${u}`,accessMode:t.storage.accessMode})}catch(u){throw await o.terminate(),await e.terminate(),u}break}case Ko.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(u){throw await o.terminate(),await e.terminate(),u}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(u,l=[])=>{if(!l||l.length===0){const d=await a.query(u);return Np(d)}const c=await a.prepare(u),h=await c.query(...l),p=Np(h);return c.close(),p},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function NM(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 PM(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const i=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),i}catch(i){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),i}}const St=Symbol.for("drizzle:entityKind");function ut(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 Gp;Gp=St;class qe{constructor(t,e){j(this,"name");j(this,"keyAsName");j(this,"primary");j(this,"notNull");j(this,"default");j(this,"defaultFn");j(this,"onUpdateFn");j(this,"hasDefault");j(this,"isUnique");j(this,"uniqueName");j(this,"uniqueType");j(this,"dataType");j(this,"columnType");j(this,"enumValues");j(this,"generated");j(this,"generatedIdentity");j(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"}}j(qe,Gp,"Column");const js=Symbol.for("drizzle:Name");function LM(r,t){return`${r[js]}_${t.join("_")}_unique`}var Wp,Hp;class Er extends(Hp=qe,Wp=St,Hp){constructor(t,e){e.uniqueName||(e.uniqueName=LM(t,[e.name])),super(t,e),this.table=t}}j(Er,Wp,"PgColumn");const Pp=Symbol.for("drizzle:isPgEnum");function BM(r){return!!r&&typeof r=="function"&&Pp in r&&r[Pp]===!0}var Yp;Yp=St;class Ar{constructor(t,e,i,n=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:i,isWith:n}}}j(Ar,Yp,"Subquery");var Xp,qp;class Zh extends(qp=Ar,Xp=St,qp){}j(Zh,Xp,"WithSubquery");const Cr={startActiveSpan(r,t){return t()}},Ge=Symbol.for("drizzle:ViewBaseConfig"),Ha=Symbol.for("drizzle:Schema"),Uc=Symbol.for("drizzle:Columns"),Lp=Symbol.for("drizzle:ExtraConfigColumns"),Zl=Symbol.for("drizzle:OriginalName"),Jl=Symbol.for("drizzle:BaseName"),Ru=Symbol.for("drizzle:IsAlias"),Bp=Symbol.for("drizzle:ExtraConfigBuilder"),UM=Symbol.for("drizzle:IsDrizzleTable");var Qp,Kp,Zp,Jp,tm,em,rm,im,nm,sm;sm=St,nm=js,im=Zl,rm=Ha,em=Uc,tm=Lp,Jp=Jl,Zp=Ru,Kp=UM,Qp=Bp;class Tt{constructor(t,e,i){j(this,nm);j(this,im);j(this,rm);j(this,em);j(this,tm);j(this,Jp);j(this,Zp,!1);j(this,Kp,!0);j(this,Qp);this[js]=this[Zl]=t,this[Ha]=e,this[Jl]=i}}j(Tt,sm,"Table"),j(Tt,"Symbol",{Name:js,Schema:Ha,OriginalName:Zl,Columns:Uc,ExtraConfigColumns:Lp,BaseName:Jl,IsAlias:Ru,ExtraConfigBuilder:Bp});function Hn(r){return r[js]}function Zo(r){return`${r[Ha]??"public"}.${r[js]}`}function b0(r){return r!=null&&typeof r.getSQL=="function"}function kM(r){var e;const t={sql:"",params:[]};for(const i of r)t.sql+=i.sql,t.params.push(...i.params),(e=i.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...i.typings));return t}var om;om=St;class We{constructor(t){j(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ct([this])}}j(We,om,"StringChunk");var am;am=St;const Vn=class Vn{constructor(t){j(this,"decoder",w0);j(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Cr.startActiveSpan("drizzle.buildSQL",e=>{const i=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(t,e){const i=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:n,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:u,paramStartIndex:l}=i;return kM(t.map(c=>{var h;if(ut(c,We))return{sql:c.value.join(""),params:[]};if(ut(c,Nu))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const p=[new We("(")];for(const[d,g]of c.entries())p.push(g),dr},S0={mapToDriverValue:r=>r};({...w0,...S0});var lm;lm=St;class zi{constructor(t,e=S0){j(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ct([this])}}j(zi,lm,"Param");function H(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new We(r[0]));for(const[i,n]of t.entries())e.push(n,new We(r[i+1]));return new Ct(e)}(r=>{function t(){return new Ct([])}r.empty=t;function e(u){return new Ct(u)}r.fromList=e;function i(u){return new Ct([new We(u)])}r.raw=i;function n(u,l){const c=[];for(const[h,p]of u.entries())h>0&&l!==void 0&&c.push(l),c.push(p);return new Ct(c)}r.join=n;function s(u){return new Nu(u)}r.identifier=s;function o(u){return new ts(u)}r.placeholder=o;function a(u,l){return new zi(u,l)}r.param=a})(H||(H={}));(r=>{var e;e=St;const i=class i{constructor(s,o){j(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}};j(i,e,"SQL.Aliased");let t=i;r.Aliased=t})(Ct||(Ct={}));var cm;cm=St;class ts{constructor(t){this.name=t}getSQL(){return new Ct([this])}}j(ts,cm,"Placeholder");function Up(r,t){return r.map(e=>{if(ut(e,ts)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(ut(e,zi)&&ut(e.value,ts)){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 $M=Symbol.for("drizzle:IsDrizzleView");var hm,dm,fm;fm=St,dm=Ge,hm=$M;class bn{constructor({name:t,schema:e,selectedFields:i,query:n}){j(this,dm);j(this,hm,!0);this[Ge]={name:t,originalName:t,schema:e,selectedFields:i,query:n,isExisting:!n,isAlias:!1}}getSQL(){return new Ct([this])}}j(bn,fm,"View");qe.prototype.getSQL=function(){return new Ct([this])};Tt.prototype.getSQL=function(){return new Ct([this])};Ar.prototype.getSQL=function(){return new Ct([this])};var pm;pm=St;class Jo{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}j(Jo,pm,"ColumnAliasProxyHandler");var mm;mm=St;class il{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===Tt.Symbol.IsAlias)return!0;if(e===Tt.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===Tt.Symbol.OriginalName)return this.alias;if(e===Ge)return{...t[Ge],name:this.alias,isAlias:!0};if(e===Tt.Symbol.Columns){const n=t[Tt.Symbol.Columns];if(!n)return n;const s={};return Object.keys(n).map(o=>{s[o]=new Proxy(n[o],new Jo(new Proxy(t,this)))}),s}const i=t[e];return ut(i,qe)?new Proxy(i,new Jo(new Proxy(t,this))):i}}j(il,mm,"TableAliasProxyHandler");function tc(r,t){return new Proxy(r,new il(t,!1))}function Mi(r,t){return new Proxy(r,new Jo(new Proxy(r.table,new il(t,!1))))}function I0(r,t){return new Ct.Aliased(Pu(r.sql,t),r.fieldAlias)}function Pu(r,t){return H.join(r.queryChunks.map(e=>ut(e,qe)?Mi(e,t):ut(e,Ct)?Pu(e,t):ut(e,Ct.Aliased)?I0(e,t):e))}var ym,gm;class Jh extends(gm=Error,ym=St,gm){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}j(Jh,ym,"DrizzleError");var vm,_m;class T0 extends(_m=Jh,vm=St,_m){constructor(){super({message:"Rollback"})}}j(T0,vm,"TransactionRollbackError");var bm;bm=St;class x0{write(t){console.log(t)}}j(x0,bm,"ConsoleLogWriter");var wm;wm=St;class E0{constructor(t){j(this,"writer");this.writer=(t==null?void 0:t.writer)??new x0}logQuery(t,e){const i=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),n=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${t}${n}`)}}j(E0,wm,"DefaultLogger");var Sm;Sm=St;class A0{logQuery(){}}j(A0,Sm,"NoopLogger");var Im,Tm;Tm=St,Im=Symbol.toStringTag;class wn{constructor(){j(this,Im,"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)}}j(wn,Tm,"QueryPromise");function es(r,t){return Object.entries(r).reduce((e,[i,n])=>{if(typeof i!="string")return e;const s=t?[...t,i]:[i];return ut(n,qe)||ut(n,Ct)||ut(n,Ct.Aliased)?e.push({path:s,field:n}):ut(n,Tt)?e.push(...es(n[Tt.Symbol.Columns],s)):e.push(...es(n,s)),e},[])}function td(r,t){const e=Object.keys(r),i=Object.keys(t);if(e.length!==i.length)return!1;for(const[n,s]of e.entries())if(s!==i[n])return!1;return!0}function O0(r,t){const e=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,n])=>ut(n,Ct)||ut(n,qe)?[i,n]:[i,new zi(n,r[Tt.Symbol.Columns][i])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function jM(r,t){for(const e of t)for(const i of Object.getOwnPropertyNames(e.prototype))i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)||Object.create(null))}function VM(r){return r[Tt.Symbol.Columns]}function jn(r){return ut(r,Ar)?r._.alias:ut(r,bn)?r[Ge].name:ut(r,Ct)?void 0:r[Tt.Symbol.IsAlias]?r[Tt.Symbol.Name]:r[Tt.Symbol.BaseName]}function GM(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 xm,Em;class C0 extends(Em=Er,xm=St,Em){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}j(C0,xm,"PgDate");var Am,Om;class F0 extends(Om=Er,Am=St,Om){getSQLType(){return"date"}}j(F0,Am,"PgDateString");var Cm,Fm;class M0 extends(Fm=Er,Cm=St,Fm){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}}j(M0,Cm,"PgJson");var Mm,Dm;class D0 extends(Dm=Er,Mm=St,Dm){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}}j(D0,Mm,"PgJsonb");var Rm,Nm;class R0 extends(Nm=Er,Rm=St,Nm){constructor(e,i){super(e,i);j(this,"precision");j(this,"scale");this.precision=i.precision,this.scale=i.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})`}}j(R0,Rm,"PgNumeric");var Pm,Lm;class N0 extends(Lm=Er,Pm=St,Lm){constructor(e,i){super(e,i);j(this,"withTimezone");j(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}j(N0,Pm,"PgTime");var Bm,Um;class P0 extends(Um=Er,Bm=St,Um){constructor(e,i){super(e,i);j(this,"withTimezone");j(this,"precision");j(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));j(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}j(P0,Bm,"PgTimestamp");var km,zm;class L0 extends(zm=Er,km=St,zm){constructor(e,i){super(e,i);j(this,"withTimezone");j(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}j(L0,km,"PgTimestampString");var $m,jm;class B0 extends(jm=Er,$m=St,jm){getSQLType(){return"uuid"}}j(B0,$m,"PgUUID");const kp=Symbol.for("drizzle:PgInlineForeignKeys"),zp=Symbol.for("drizzle:EnableRLS");var Vm,Gm,Wm,Hm,Ym,Xm;class Pr extends(Xm=Tt,Ym=St,Hm=kp,Wm=zp,Gm=Tt.Symbol.ExtraConfigBuilder,Vm=Tt.Symbol.ExtraConfigColumns,Xm){constructor(){super(...arguments);j(this,Hm,[]);j(this,Wm,!1);j(this,Gm);j(this,Vm,{})}}j(Pr,Ym,"PgTable"),j(Pr,"Symbol",Object.assign({},Tt.Symbol,{InlineForeignKeys:kp,EnableRLS:zp}));var qm;qm=St;class U0{constructor(t,e){j(this,"columns");j(this,"name");this.columns=t,this.name=e}build(t){return new k0(t,this.columns,this.name)}}j(U0,qm,"PgPrimaryKeyBuilder");var Qm;Qm=St;class k0{constructor(t,e,i){j(this,"columns");j(this,"name");this.table=t,this.columns=e,this.name=i}getName(){return this.name??`${this.table[Pr.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}j(k0,Qm,"PgPrimaryKey");function mr(r,t){return zM(t)&&!b0(r)&&!ut(r,zi)&&!ut(r,ts)&&!ut(r,qe)&&!ut(r,Tt)&&!ut(r,bn)?new zi(r,t):r}const z0=(r,t)=>H`${r} = ${mr(t,r)}`,WM=(r,t)=>H`${r} <> ${mr(t,r)}`;function kc(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ct(t):new Ct([new We("("),H.join(t,new We(" and ")),new We(")")])}function HM(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ct(t):new Ct([new We("("),H.join(t,new We(" or ")),new We(")")])}function YM(r){return H`not ${r}`}const XM=(r,t)=>H`${r} > ${mr(t,r)}`,qM=(r,t)=>H`${r} >= ${mr(t,r)}`,QM=(r,t)=>H`${r} < ${mr(t,r)}`,KM=(r,t)=>H`${r} <= ${mr(t,r)}`;function ZM(r,t){return Array.isArray(t)?t.length===0?H`false`:H`${r} in ${t.map(e=>mr(e,r))}`:H`${r} in ${mr(t,r)}`}function JM(r,t){return Array.isArray(t)?t.length===0?H`true`:H`${r} not in ${t.map(e=>mr(e,r))}`:H`${r} not in ${mr(t,r)}`}function tD(r){return H`${r} is null`}function eD(r){return H`${r} is not null`}function rD(r){return H`exists ${r}`}function iD(r){return H`not exists ${r}`}function nD(r,t,e){return H`${r} between ${mr(t,r)} and ${mr(e,r)}`}function sD(r,t,e){return H`${r} not between ${mr(t,r)} and ${mr(e,r)}`}function oD(r,t){return H`${r} like ${t}`}function aD(r,t){return H`${r} not like ${t}`}function uD(r,t){return H`${r} ilike ${t}`}function lD(r,t){return H`${r} not ilike ${t}`}function cD(r){return H`${r} asc`}function hD(r){return H`${r} desc`}var Km;Km=St;class ed{constructor(t,e,i){j(this,"referencedTableName");j(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=i,this.referencedTableName=e[Tt.Symbol.Name]}}j(ed,Km,"Relation");var Zm;Zm=St;class $0{constructor(t,e){this.table=t,this.config=e}}j($0,Zm,"Relations");var Jm,ty;const Uu=class Uu extends(ty=ed,Jm=St,ty){constructor(t,e,i,n){super(t,e,i==null?void 0:i.relationName),this.config=i,this.isNullable=n}withFieldName(t){const e=new Uu(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};j(Uu,Jm,"One");let rs=Uu;var ey,ry;const ku=class ku extends(ry=ed,ey=St,ry){constructor(t,e,i){super(t,e,i==null?void 0:i.relationName),this.config=i}withFieldName(t){const e=new ku(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};j(ku,ey,"Many");let Lu=ku;function dD(){return{and:kc,between:nD,eq:z0,exists:rD,gt:XM,gte:qM,ilike:uD,inArray:ZM,isNull:tD,isNotNull:eD,like:oD,lt:QM,lte:KM,ne:WM,not:YM,notBetween:sD,notExists:iD,notLike:aD,notIlike:lD,notInArray:JM,or:HM,sql:H}}function fD(){return{sql:H,asc:cD,desc:hD}}function pD(r,t){var s;Object.keys(r).length===1&&"default"in r&&!ut(r.default,Tt)&&(r=r.default);const e={},i={},n={};for(const[o,a]of Object.entries(r))if(ut(a,Tt)){const u=Zo(a),l=i[u];e[u]=o,n[o]={tsName:o,dbName:a[Tt.Symbol.Name],schema:a[Tt.Symbol.Schema],columns:a[Tt.Symbol.Columns],relations:(l==null?void 0:l.relations)??{},primaryKey:(l==null?void 0:l.primaryKey)??[]};for(const h of Object.values(a[Tt.Symbol.Columns]))h.primary&&n[o].primaryKey.push(h);const c=(s=a[Tt.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[Tt.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))ut(h,U0)&&n[o].primaryKey.push(...h.columns)}else if(ut(a,$0)){const u=Zo(a.table),l=e[u],c=a.config(t(a.table));let h;for(const[p,d]of Object.entries(c))if(l){const g=n[l];g.relations[p]=d}else u in i||(i[u]={relations:{},primaryKey:h}),i[u].relations[p]=d}return{tables:n,tableNamesMap:e}}function mD(r){return function(e,i){return new rs(r,e,i,(i==null?void 0:i.fields.reduce((n,s)=>n&&s.notNull,!0))??!1)}}function yD(r){return function(e,i){return new Lu(r,e,i)}}function gD(r,t,e){if(ut(e,rs)&&e.config)return{fields:e.config.fields,references:e.config.references};const i=t[Zo(e.referencedTable)];if(!i)throw new Error(`Table "${e.referencedTable[Tt.Symbol.Name]}" not found in schema`);const n=r[i];if(!n)throw new Error(`Table "${i}" not found in schema`);const s=e.sourceTable,o=t[Zo(s)];if(!o)throw new Error(`Table "${s[Tt.Symbol.Name]}" not found in schema`);const a=[];for(const u of Object.values(n.relations))(e.relationName&&e!==u&&u.relationName===e.relationName||!e.relationName&&u.referencedTable===e.sourceTable)&&a.push(u);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${i}"`):new Error(`There are multiple relations between "${i}" and "${e.sourceTable[Tt.Symbol.Name]}". Please specify relation name`);if(a[0]&&ut(a[0],rs)&&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 vD(r){return{one:mD(r),many:yD(r)}}function zc(r,t,e,i,n=s=>s){const s={};for(const[o,a]of i.entries())if(a.isJson){const u=t.relations[a.tsKey],l=e[o],c=typeof l=="string"?JSON.parse(l):l;s[a.tsKey]=ut(u,rs)?c&&zc(r,r[a.relationTableTsKey],c,a.selection,n):c.map(h=>zc(r,r[a.relationTableTsKey],h,a.selection,n))}else{const u=n(e[o]),l=a.field;let c;ut(l,qe)?c=l:ut(l,Ct)?c=l.decoder:c=l.sql.decoder,s[a.tsKey]=u===null?null:c.mapFromDriverValue(u)}return s}var iy;iy=St;const zu=class zu{constructor(t){j(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===Ge)return{...t[Ge],selectedFields:new Proxy(t[Ge].selectedFields,this)};if(typeof e=="symbol")return t[e];const n=(ut(t,Ar)?t._.selectedFields:ut(t,bn)?t[Ge].selectedFields:t)[e];if(ut(n,Ct.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!n.isSelectionField)return n.sql;const s=n.clone();return s.isSelectionField=!0,s}if(ut(n,Ct)){if(this.config.sqlBehavior==="sql")return n;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 ut(n,qe)?this.config.alias?new Proxy(n,new Jo(new Proxy(n.table,new il(this.config.alias,this.config.replaceOriginalName??!1)))):n:typeof n!="object"||n===null?n:new Proxy(n,new zu(this.config))}};j(zu,iy,"SelectionProxyHandler");let Ke=zu;var ny,sy;class $c extends(sy=wn,ny=St,sy){constructor(e,i,n,s){super();j(this,"config");j(this,"authToken");j(this,"execute",e=>Cr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=es(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Cr.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 Ke({alias:Hn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}j($c,ny,"PgDelete");function _D(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function bD(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,i,n)=>{const s=n===0?i.toLowerCase():`${i[0].toUpperCase()}${i.slice(1)}`;return e+s},"")}function wD(r){return r}var oy;oy=St;class j0{constructor(t){j(this,"cache",{});j(this,"cachedTables",{});j(this,"convert");this.convert=t==="snake_case"?_D:t==="camelCase"?bD:wD}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[Tt.Symbol.Schema]??"public",i=t.table[Tt.Symbol.OriginalName],n=`${e}.${i}.${t.name}`;return this.cache[n]||this.cacheTable(t.table),this.cache[n]}cacheTable(t){const e=t[Tt.Symbol.Schema]??"public",i=t[Tt.Symbol.OriginalName],n=`${e}.${i}`;if(!this.cachedTables[n]){for(const s of Object.values(t[Tt.Symbol.Columns])){const o=`${n}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[n]=!0}}clearCache(){this.cache={},this.cachedTables={}}}j(j0,oy,"CasingCache");var ay,uy;class rd extends(uy=bn,ay=St,uy){}j(rd,ay,"PgViewBase");var ly;ly=St;class Do{constructor(t){j(this,"casing");this.casing=new j0(t==null?void 0:t.casing)}async migrate(t,e,i){const n=typeof i=="string"?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",s=typeof i=="string"?"drizzle":i.migrationsSchema??"drizzle",o=H` - CREATE TABLE IF NOT EXISTS ${H.identifier(s)}.${H.identifier(n)} ( - id SERIAL PRIMARY KEY, - hash text NOT NULL, - created_at bigint - ) - `;await e.execute(H`CREATE SCHEMA IF NOT EXISTS ${H.identifier(s)}`),await e.execute(o);const u=(await e.all(H`select id, hash, created_at from ${H.identifier(s)}.${H.identifier(n)} order by created_at desc limit 1`))[0];await e.transaction(async l=>{for await(const c of t)if(!u||Number(u.created_at){var a;return e[o]!==void 0||((a=i[o])==null?void 0:a.onUpdateFn)!==void 0}),s=n.length;return H.join(n.flatMap((o,a)=>{const u=i[o],l=e[o]??H.param(u.onUpdateFn(),u),c=H`${H.identifier(this.casing.getColumnCasing(u))} = ${l}`;return a{const a=[];if(ut(s,Ct.Aliased)&&s.isSelectionField)a.push(H.identifier(s.fieldAlias));else if(ut(s,Ct.Aliased)||ut(s,Ct)){const u=ut(s,Ct.Aliased)?s.sql:s;e?a.push(new Ct(u.queryChunks.map(l=>ut(l,Er)?H.identifier(this.casing.getColumnCasing(l)):l))):a.push(u),ut(s,Ct.Aliased)&&a.push(H` as ${H.identifier(s.fieldAlias)}`)}else ut(s,qe)&&(e?a.push(H.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:D})=>D===(it[Tt.Symbol.IsAlias]?Hn(it):it[Tt.Symbol.BaseName])))(w.field.table)){const it=Hn(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${it}"."${w.field.name}", but the table "${it}" is not part of the query! Did you forget to join it?`)}const f=!a||a.length===0,m=this.buildWithCTE(t);let _;d&&(_=d===!0?H` distinct`:H` distinct on (${H.join(d.on,H`, `)})`);const I=this.buildSelection(y,{isSingleTable:f}),E=this.buildFromTable(o),b=this.buildJoins(a),F=n?H` where ${n}`:void 0,S=s?H` having ${s}`:void 0;let z;u&&u.length>0&&(z=H` order by ${H.join(u,H`, `)}`);let B;l&&l.length>0&&(B=H` group by ${H.join(l,H`, `)}`);const tt=typeof c=="object"||typeof c=="number"&&c>=0?H` limit ${c}`:void 0,st=h?H` offset ${h}`:void 0,x=H.empty();if(p){const w=H` for ${H.raw(p.strength)}`;p.config.of&&w.append(H` of ${H.join(Array.isArray(p.config.of)?p.config.of:[p.config.of],H`, `)}`),p.config.noWait?w.append(H` nowait`):p.config.skipLocked&&w.append(H` skip locked`),x.append(w)}const Z=H`${m}select${_} ${I} from ${E}${b}${F}${B}${S}${z}${tt}${st}${x}`;return g.length>0?this.buildSetOperations(Z,g):Z}buildSetOperations(t,e){const[i,...n]=e;if(!i)throw new Error("Cannot pass undefined values to any set operator");return n.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:i}),n)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:i,rightSelect:n,limit:s,orderBy:o,offset:a}}){const u=H`(${t.getSQL()}) `,l=H`(${n.getSQL()})`;let c;if(o&&o.length>0){const g=[];for(const y of o)if(ut(y,Er))g.push(H.identifier(y.name));else if(ut(y,Ct)){for(let f=0;f=0?H` limit ${s}`:void 0,p=H.raw(`${e} ${i?"all ":""}`),d=a?H` offset ${a}`:void 0;return H`${u}${p}${l}${c}${h}${d}`}buildInsertQuery({table:t,values:e,onConflict:i,returning:n,withList:s,select:o,overridingSystemValue_:a}){const u=[],l=t[Tt.Symbol.Columns],c=Object.entries(l).filter(([m,_])=>!_.shouldDisableInsert()),h=c.map(([,m])=>H.identifier(this.casing.getColumnCasing(m)));if(o){const m=e;ut(m,Ct)?u.push(m):u.push(m.getSQL())}else{const m=e;u.push(H.raw("values "));for(const[_,I]of m.entries()){const E=[];for(const[b,F]of c){const S=I[b];if(S===void 0||ut(S,zi)&&S.value===void 0)if(F.defaultFn!==void 0){const z=F.defaultFn(),B=ut(z,Ct)?z:H.param(z,F);E.push(B)}else if(!F.default&&F.onUpdateFn!==void 0){const z=F.onUpdateFn(),B=ut(z,Ct)?z:H.param(z,F);E.push(B)}else E.push(H`default`);else E.push(S)}u.push(E),_({dbKey:I.name,tsKey:_,field:Mi(I,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const m=Object.fromEntries(Object.entries(s.columns).map(([S,z])=>[S,Mi(z,a)]));if(o.where){const S=typeof o.where=="function"?o.where(m,dD()):o.where;g=S&&Pu(S,a)}const _=[];let I=[];if(o.columns){let S=!1;for(const[z,B]of Object.entries(o.columns))B!==void 0&&z in s.columns&&(!S&&B===!0&&(S=!0),I.push(z));I.length>0&&(I=S?I.filter(z=>{var B;return((B=o.columns)==null?void 0:B[z])===!0}):Object.keys(s.columns).filter(z=>!I.includes(z)))}else I=Object.keys(s.columns);for(const S of I){const z=s.columns[S];_.push({tsKey:S,value:z})}let E=[];o.with&&(E=Object.entries(o.with).filter(S=>!!S[1]).map(([S,z])=>({tsKey:S,queryConfig:z,relation:s.relations[S]})));let b;if(o.extras){b=typeof o.extras=="function"?o.extras(m,{sql:H}):o.extras;for(const[S,z]of Object.entries(b))_.push({tsKey:S,value:I0(z,a)})}for(const{tsKey:S,value:z}of _)c.push({dbKey:ut(z,Ct.Aliased)?z.fieldAlias:s.columns[S].name,tsKey:S,field:ut(z,qe)?Mi(z,a):z,relationTableTsKey:void 0,isJson:!1,selection:[]});let F=typeof o.orderBy=="function"?o.orderBy(m,fD()):o.orderBy??[];Array.isArray(F)||(F=[F]),d=F.map(S=>ut(S,qe)?Mi(S,a):Pu(S,a)),h=o.limit,p=o.offset;for(const{tsKey:S,queryConfig:z,relation:B}of E){const tt=gD(e,i,B),st=Zo(B.referencedTable),x=i[st],Z=`${a}_${S}`,w=kc(...tt.fields.map((C,R)=>z0(Mi(tt.references[R],Z),Mi(C,a)))),it=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:i,table:t[x],tableConfig:e[x],queryConfig:ut(B,rs)?z===!0?{limit:1}:{...z,limit:1}:z,tableAlias:Z,joinOn:w,nestedQueryRelation:B}),D=H`${H.identifier(Z)}.${H.identifier("data")}`.as(S);y.push({on:H`true`,table:new Ar(it.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:S,tsKey:S,field:D,relationTableTsKey:x,isJson:!0,selection:it.selection})}}if(c.length===0)throw new Jh({message:`No fields selected for table "${s.tsName}" ("${a}")`});let f;if(g=kc(l,g),u){let m=H`json_build_array(${H.join(c.map(({field:E,tsKey:b,isJson:F})=>F?H`${H.identifier(`${a}_${b}`)}.${H.identifier("data")}`:ut(E,Ct.Aliased)?E.sql:E),H`, `)})`;ut(u,Lu)&&(m=H`coalesce(json_agg(${m}${d.length>0?H` order by ${H.join(d,H`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:m.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||p!==void 0||d.length>0?(f=this.buildSelectQuery({table:tc(n,a),fields:{},fieldsFlat:[{path:[],field:H.raw("*")}],where:g,limit:h,offset:p,orderBy:d,setOperators:[]}),g=void 0,h=void 0,p=void 0,d=[]):f=tc(n,a),f=this.buildSelectQuery({table:ut(f,Pr)?f:new Ar(f,{},a),fields:{},fieldsFlat:_.map(({field:E})=>({path:[],field:ut(E,qe)?Mi(E,a):E})),joins:y,where:g,limit:h,offset:p,orderBy:d,setOperators:[]})}else f=this.buildSelectQuery({table:tc(n,a),fields:{},fieldsFlat:c.map(({field:m})=>({path:[],field:ut(m,qe)?Mi(m,a):m})),joins:y,where:g,limit:h,offset:p,orderBy:d,setOperators:[]});return{tableTsKey:s.tsName,sql:f,selection:c}}}j(Do,ly,"PgDialect");var cy;cy=St;class V0{getSelectedFields(){return this._.selectedFields}}j(V0,cy,"TypedQueryBuilder");var hy;hy=St;class Sr{constructor(t){j(this,"fields");j(this,"session");j(this,"dialect");j(this,"withList",[]);j(this,"distinct");j(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,i=t;let n;return this.fields?n=this.fields:ut(i,Ar)?n=Object.fromEntries(Object.keys(i._.selectedFields).map(s=>[s,i[s]])):ut(i,rd)?n=i[Ge].selectedFields:ut(i,Ct)?n={}:n=VM(i),new id({table:i,fields:n,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}j(Sr,hy,"PgSelectBuilder");var dy,fy;class G0 extends(fy=V0,dy=St,fy){constructor({table:e,fields:i,isPartialSelect:n,session:s,dialect:o,withList:a,distinct:u}){super();j(this,"_");j(this,"config");j(this,"joinsNotNullableMap");j(this,"tableName");j(this,"isPartialSelect");j(this,"session");j(this,"dialect");j(this,"leftJoin",this.createJoin("left",!1));j(this,"leftJoinLateral",this.createJoin("left",!0));j(this,"rightJoin",this.createJoin("right",!1));j(this,"innerJoin",this.createJoin("inner",!1));j(this,"innerJoinLateral",this.createJoin("inner",!0));j(this,"fullJoin",this.createJoin("full",!1));j(this,"crossJoin",this.createJoin("cross",!1));j(this,"crossJoinLateral",this.createJoin("cross",!0));j(this,"union",this.createSetOperator("union",!1));j(this,"unionAll",this.createSetOperator("union",!0));j(this,"intersect",this.createSetOperator("intersect",!1));j(this,"intersectAll",this.createSetOperator("intersect",!0));j(this,"except",this.createSetOperator("except",!1));j(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...i},distinct:u,setOperators:[]},this.isPartialSelect=n,this.session=s,this.dialect=o,this._={selectedFields:i},this.tableName=jn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e,i){return(n,s)=>{var u;const o=this.tableName,a=jn(n);if(typeof a=="string"&&((u=this.config.joins)!=null&&u.some(l=>l.alias===a)))throw new Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof o=="string"&&(this.config.fields={[o]:this.config.fields}),typeof a=="string"&&!ut(n,Ct))){const l=ut(n,Ar)?n._.selectedFields:ut(n,bn)?n[Ge].selectedFields:n[Tt.Symbol.Columns];this.config.fields[a]=l}if(typeof s=="function"&&(s=s(new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:s,table:n,joinType:e,alias:a,lateral:i}),typeof a=="string")switch(e){case"left":{this.joinsNotNullableMap[a]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[a]=!0;break}case"cross":case"inner":{this.joinsNotNullableMap[a]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[a]=!1;break}}return this}}createSetOperator(e,i){return n=>{const s=typeof n=="function"?n(SD()):n;if(!td(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:i,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 Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Ke({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),n=Array.isArray(i)?i:[i];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{const i=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}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,i={}){return this.config.lockingClause={strength:e,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(e){return new Proxy(new Ar(this.getSQL(),this.config.fields,e),new Ke({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Ke({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}j(G0,dy,"PgSelectQueryBuilder");var py,my;class id extends(my=G0,py=St,my){constructor(){super(...arguments);j(this,"authToken");j(this,"execute",e=>Cr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:i,config:n,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Cr.startActiveSpan("drizzle.prepareQuery",()=>{const u=es(n.fields),l=i.prepareQuery(s.sqlToQuery(this.getSQL()),u,e,!0);return l.joinsNotNullableMap=o,l.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}j(id,py,"PgSelect");jM(id,[wn]);function to(r,t){return(e,i,...n)=>{const s=[i,...n].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!td(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 SD=()=>({union:ID,unionAll:TD,intersect:xD,intersectAll:ED,except:AD,exceptAll:OD}),ID=to("union",!1),TD=to("union",!0),xD=to("intersect",!1),ED=to("intersect",!0),AD=to("except",!1),OD=to("except",!0);var yy;yy=St;class nd{constructor(t){j(this,"dialect");j(this,"dialectConfig");j(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(i)),new Proxy(new Zh(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Ke({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=ut(t,Do)?t:void 0,this.dialectConfig=ut(t,Do)?void 0:t}with(...t){const e=this;function i(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function n(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Sr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:i,selectDistinct:n,selectDistinctOn:s}}select(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Do(this.dialectConfig)),this.dialect}}j(nd,yy,"PgQueryBuilder");var gy;gy=St;class jc{constructor(t,e,i,n,s){j(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n,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(i=>{const n={},s=this.table[Tt.Symbol.Columns];for(const o of Object.keys(i)){const a=i[o];n[o]=ut(a,Ct)?a:new zi(a,s[o])}return n});return new Vc(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new nd):t;if(!ut(e,Ct)&&!td(this.table[Uc],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 Vc(this.table,e,this.session,this.dialect,this.withList,!0)}}j(jc,gy,"PgInsertBuilder");var vy,_y;class Vc extends(_y=wn,vy=St,_y){constructor(e,i,n,s,o,a,u){super();j(this,"config");j(this,"authToken");j(this,"execute",e=>Cr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=s,this.config={table:e,values:i,withList:o,select:a,overridingSystemValue_:u}}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=es(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=H`do nothing`;else{let i="";i=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 n=e.where?H` where ${e.where}`:void 0;this.config.onConflict=H`(${H.raw(i)})${n} 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 i=e.where?H` where ${e.where}`:void 0,n=e.targetWhere?H` where ${e.targetWhere}`:void 0,s=e.setWhere?H` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,O0(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(u=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(u))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=H`(${H.raw(a)})${n} do update set ${o}${i}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Cr.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 Ke({alias:Hn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}j(Vc,vy,"PgInsert");var by,wy;class W0 extends(wy=wn,by=St,wy){constructor(e,i,n){super();j(this,"config");j(this,"authToken");j(this,"execute",e=>Cr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,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,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Cr.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}}j(W0,by,"PgRefreshMaterializedView");var Sy;Sy=St;class Gc{constructor(t,e,i,n){j(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n}setToken(t){return this.authToken=t,this}set(t){return new H0(this.table,O0(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}j(Gc,Sy,"PgUpdateBuilder");var Iy,Ty;class H0 extends(Ty=wn,Iy=St,Ty){constructor(e,i,n,s,o){super();j(this,"config");j(this,"tableName");j(this,"joinsNotNullableMap");j(this,"leftJoin",this.createJoin("left"));j(this,"rightJoin",this.createJoin("right"));j(this,"innerJoin",this.createJoin("inner"));j(this,"fullJoin",this.createJoin("full"));j(this,"authToken");j(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=n,this.dialect=s,this.config={set:i,table:e,withList:o,joins:[]},this.tableName=jn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const i=e,n=jn(i);return typeof n=="string"&&(this.joinsNotNullableMap[n]=!0),this.config.from=i,this}getTableLikeFields(e){return ut(e,Pr)?e[Tt.Symbol.Columns]:ut(e,Ar)?e._.selectedFields:e[Ge].selectedFields}createJoin(e){return(i,n)=>{const s=jn(i);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 n=="function"){const o=this.config.from&&!ut(this.config.from,Ct)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Tt.Symbol.Columns],new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new Ke({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:n,table:i,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[Tt.Symbol.Columns]),this.config.from)){const i=jn(this.config.from);if(typeof i=="string"&&this.config.from&&!ut(this.config.from,Ct)){const n=this.getTableLikeFields(this.config.from);e[i]=n}for(const n of this.config.joins){const s=jn(n.table);if(typeof s=="string"&&!ut(n.table,Ct)){const o=this.getTableLikeFields(n.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=es(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){const i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Ke({alias:Hn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}j(H0,Iy,"PgUpdate");var xy,Ey,Ay;const No=class No extends(Ay=Ct,Ey=St,xy=Symbol.toStringTag,Ay){constructor(e){super(No.buildEmbeddedCount(e.source,e.filters).queryChunks);j(this,"sql");j(this,"token");j(this,xy,"PgCountBuilder");j(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=No.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,i){return H`(select count(*) from ${e}${H.raw(" where ").if(i)}${i})`}static buildCount(e,i){return H`select count(*) as count from ${e}${H.raw(" where ").if(i)}${i};`}setToken(e){return this.token=e,this}then(e,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,i)}catch(e){return this.then(void 0,e)}finally(e){return this.then(i=>(e==null||e(),i),i=>{throw e==null||e(),i})}};j(No,Ey,"PgCountBuilder");let Wc=No;var Oy;Oy=St;class Y0{constructor(t,e,i,n,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=i,this.table=n,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Hc(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Hc(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}j(Y0,Oy,"PgRelationalQueryBuilder");var Cy,Fy;class Hc extends(Fy=wn,Cy=St,Fy){constructor(e,i,n,s,o,a,u,l,c){super();j(this,"authToken");this.fullSchema=e,this.schema=i,this.tableNamesMap=n,this.table=s,this.tableConfig=o,this.dialect=a,this.session=u,this.config=l,this.mode=c}_prepare(e){return Cr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:i,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(s,o)=>{const a=s.map(u=>zc(this.schema,this.tableConfig,u,i.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(),i=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Cr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}j(Hc,Cy,"PgRelationalQuery");var My,Dy;class X0 extends(Dy=wn,My=St,Dy){constructor(t,e,i,n){super(),this.execute=t,this.sql=e,this.query=i,this.mapBatchResult=n}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}j(X0,My,"PgRaw");var Ry;Ry=St;class sd{constructor(t,e,i){j(this,"query");j(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(new nd(i.dialect))),new Proxy(new Zh(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Ke({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});j(this,"authToken");if(this.dialect=t,this.session=e,this._=i?{schema:i.schema,fullSchema:i.fullSchema,tableNamesMap:i.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[n,s]of Object.entries(this._.schema))this.query[n]=new Y0(i.fullSchema,this._.schema,this._.tableNamesMap,i.fullSchema[n],s,t,e)}$count(t,e){return new Wc({source:t,filters:e,session:this.session})}with(...t){const e=this;function i(l){return new Sr({fields:l??void 0,session:e.session,dialect:e.dialect,withList:t})}function n(l){return new Sr({fields:l??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(l,c){return new Sr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:l}})}function o(l){return new Gc(l,e.session,e.dialect,t)}function a(l){return new jc(l,e.session,e.dialect,t)}function u(l){return new $c(l,e.session,e.dialect,t)}return{select:i,selectDistinct:n,selectDistinctOn:s,update:o,insert:a,delete:u}}select(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new Gc(t,this.session,this.dialect)}insert(t){return new jc(t,this.session,this.dialect)}delete(t){return new $c(t,this.session,this.dialect)}refreshMaterializedView(t){return new W0(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?H.raw(t):t.getSQL(),i=this.dialect.sqlToQuery(e),n=this.session.prepareQuery(i,void 0,void 0,!1);return new X0(()=>n.execute(void 0,this.authToken),e,i,s=>n.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}j(sd,Ry,"PgDatabase");var Ny;Ny=St;class q0{constructor(t){j(this,"authToken");j(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}j(q0,Ny,"PgPreparedQuery");var Py;Py=St;class Q0{constructor(t){this.dialect=t}execute(t,e){return Cr.startActiveSpan("drizzle.operation",()=>Cr.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 i=await this.execute(t,e);return Number(i[0].count)}}j(Q0,Py,"PgSession");var Ly,By;class K0 extends(By=sd,Ly=St,By){constructor(t,e,i,n=0){super(t,e,i),this.schema=i,this.nestedIndex=n}rollback(){throw new T0}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"),H.raw(e.join(" "))}setTransaction(t){return this.session.execute(H`set transaction ${this.getTransactionConfigSQL(t)}`)}}j(K0,Ly,"PgTransaction");function $p(r){return typeof r=="string"&&/^true$/i.test(r)}function CD(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 i=e.searchParams.get("logger");i&&$p(i)&&(t.logger=!0);const n=e.searchParams.get("storage");switch(n){case Ko.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:Ko.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&$p(s)&&{accessMode:D_.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${n}"`);break}return t}var Uy,ky;class Z0 extends(ky=q0,Uy=St,ky){constructor(t,e,i,n,s,o){super({sql:e,params:i}),this.client=t,this.queryString=e,this.params=i,this.logger=n,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=Up(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:i,queryString:n,client:s,customResultMapper:o}=this,a=await s;return a.query(n,e)}async all(t={}){const e=Up(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}j(Z0,Uy,"DuckDBWasmPreparedQuery");var zy,$y;const $u=class $u extends($y=Q0,zy=St,$y){constructor(e,i,n,s={}){super(i);j(this,"logger");this.client=e,this.schema=n,this.options=s,this.logger=s.logger??new A0}prepareQuery(e,i,n,s,o){return new Z0(this.client,e.sql,e.params,this.logger,i,o)}async query(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}async queryObjects(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}transaction(e,i){return NM(this.client,async n=>{const s=new $u(n,this.dialect,this.schema,this.options),o=new Yc(this.dialect,s,this.schema);return i&&await o.setTransaction(i),e(o)})}};j($u,zy,"DuckDBWasmSession");let Bu=$u;var jy,Vy;const ju=class ju extends(Vy=K0,jy=St,Vy){constructor(e,i,n,s=0){super(e,i,n,s);j(this,"dialect");j(this,"session");this.dialect=e,this.session=i}async transaction(e){return PM(this.session.client,"",async i=>{const n=new Bu(i,this.dialect,this.schema,this.session.options),s=new ju(this.dialect,n,this.schema);return e(s)})}};j(ju,jy,"DuckDBWasmTransaction");let Yc=ju;var Gy,Wy;class J0 extends(Wy=sd,Gy=St,Wy){}j(J0,Gy,"DuckDBWasmDatabase");function Ro(r,t={}){const e=new Do({casing:t.casing});let i;t.logger===!0?i=new E0:t.logger!==!1&&(i=t.logger);let n;if(t.schema){const a=pD(t.schema,vD);n={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Bu(r,e,n,{logger:i}),o=new J0(e,s,n);return o.$client=r,o}function jp(r,t){const e=CD(r);let i;return e.bundles==="import-url"?i=(async()=>{const s=await Lc();switch(s){case"browser":return(await nn(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await nn(async()=>{const{getImportUrlBundles:o}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:o}},__vite__mapDeps([5,4]))).getImportUrlBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})():i=(async()=>{const s=await Lc();switch(s){case"browser":return(await nn(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await nn(async()=>{const{getBundles:o}=await import("./default-node-ClwjvsoD.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),Ro(_0({bundles:i,logger:e.logger?new R_:void 0,storage:e.storage}),t)}function Vp(...r){if(typeof r[0]=="string")return jp(r[0],r[1]);if(GM(r[0])){const{connection:t,client:e,...i}=r[0];if(e)return Ro(e,i);if(typeof t=="string")return jp(t,i);if(typeof t>"u")throw new Error("connection option is required");return Ro(_0({bundles:t.bundles,logger:t.logger,storage:t.storage}),i)}return Ro(r[0],r[1])}(r=>{function t(e){return Ro({options:{parsers:{},serializers:{}}},e)}r.mock=t})(Vp||(Vp={}));export{HI as A,PD as I,ET as J,hT as L,dc as M,ND as T,ai as a,De as b,RD as c,Vp as d,ta as e,LD as l}; diff --git a/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js b/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js new file mode 100644 index 0000000000000000000000000000000000000000..f3158f3c2ac9a5ae806e243fef0f9ae0a2d53f21 --- /dev/null +++ b/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js @@ -0,0 +1,3104 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-DqVoet3j.js","assets/index-1_q7hlhr.js","assets/index-C3aYAgU8.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 Ix=Object.defineProperty;var Ex=(r,t,e)=>t in r?Ix(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var $=(r,t,e)=>Ex(r,typeof t!="symbol"?t+"":t,e);import{cX as Nh,d2 as gi,cY as Cx,L as ln}from"./index-1_q7hlhr.js";/*! + * @pixi/constants - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/constants is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + */var Vi;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(Vi||(Vi={}));var zo;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(zo||(zo={}));var Ka;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(Ka||(Ka={}));var qt;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(qt||(qt={}));var jo;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(jo||(jo={}));var wt;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(wt||(wt={}));var Qn;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(Qn||(Qn={}));var ce;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(ce||(ce={}));var Za;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(Za||(Za={}));var Tr;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Tr||(Tr={}));var Ja;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ja||(Ja={}));var wi;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(wi||(wi={}));var hn;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(hn||(hn={}));var Jr;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(Jr||(Jr={}));var tl;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(tl||(tl={}));var Ir;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Ir||(Ir={}));var $e;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})($e||($e={}));var Jf;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(Jf||(Jf={}));var Be;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(Be||(Be={}));var _i;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(_i||(_i={}));/*! + * @pixi/settings - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/settings is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + */var Ax={createCanvas:function(r,t){var e=document.createElement("canvas");return e.width=r,e.height=t,e},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,t){return fetch(r,t)}},yu=/iPhone/i,td=/iPod/i,ed=/iPad/i,rd=/\biOS-universal(?:.+)Mac\b/i,gu=/\bAndroid(?:.+)Mobile\b/i,id=/Android/i,ps=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,va=/Silk/i,Fi=/Windows Phone/i,nd=/\bWindows(?:.+)ARM\b/i,sd=/BlackBerry/i,od=/BB10/i,ad=/Opera Mini/i,ld=/\b(CriOS|Chrome)(?:.+)Mobile/i,ud=/Mobile(?:.+)Firefox\b/i,cd=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function Ox(r){return function(t){return t.test(r)}}function Fx(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var n=Ox(e),s={apple:{phone:n(yu)&&!n(Fi),ipod:n(td),tablet:!n(yu)&&(n(ed)||cd(t))&&!n(Fi),universal:n(rd),device:(n(yu)||n(td)||n(ed)||n(rd)||cd(t))&&!n(Fi)},amazon:{phone:n(ps),tablet:!n(ps)&&n(va),device:n(ps)||n(va)},android:{phone:!n(Fi)&&n(ps)||!n(Fi)&&n(gu),tablet:!n(Fi)&&!n(ps)&&!n(gu)&&(n(va)||n(id)),device:!n(Fi)&&(n(ps)||n(va)||n(gu)||n(id))||n(/\bokhttp\b/i)},windows:{phone:n(Fi),tablet:n(nd),device:n(Fi)||n(nd)},other:{blackberry:n(sd),blackberry10:n(od),opera:n(ad),firefox:n(ud),chrome:n(ld),device:n(sd)||n(od)||n(ad)||n(ud)||n(ld)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}var Xn=Fx(globalThis.navigator);function Px(){return!Xn.apple.device}function Mx(r){var t=!0;if(Xn.tablet||Xn.phone){if(Xn.apple.device){var e=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(e){var i=parseInt(e[1],10);i<11&&(t=!1)}}if(Xn.android.device){var e=navigator.userAgent.match(/Android\s([0-9.]*)/);if(e){var i=parseInt(e[1],10);i<7&&(t=!1)}}}return t?r:4}var It={ADAPTER:Ax,MIPMAP_TEXTURES:wi.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:Be.NONE,SPRITE_MAX_TEXTURES:Mx(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:tl.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Ja.CLAMP,SCALE_MODE:Tr.LINEAR,PRECISION_VERTEX:Ir.HIGH,PRECISION_FRAGMENT:Xn.apple.device?Ir.HIGH:Ir.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Px(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},vu={exports:{}},hd;function Dx(){return hd||(hd=1,function(r){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function n(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function s(l,u,c,h,p){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new n(c,h||l,p),y=e?e+u:u;return l._events[y]?l._events[y].fn?l._events[y]=[l._events[y],f]:l._events[y].push(f):(l._events[y]=f,l._eventsCount++),l}function o(l,u){--l._eventsCount===0?l._events=new i:delete l._events[u]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)t.call(c,h)&&u.push(e?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},a.prototype.listeners=function(u){var c=e?e+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,f=h.length,y=new Array(f);p80*D){V=J=M[0],et=yt=M[1];for(var gt=D;gtJ&&(J=vt),dt>yt&&(yt=dt);_t=Math.max(J-V,yt-et),_t=_t!==0?32767/_t:0}return i(C,A,D,V,et,_t,0),A}function t(M,O,D,U,k){var C,A;if(k===it(M,O,D,U)>0)for(C=O;C=O;C-=U)A=I(C,M[C],M[C+1],A);return A&&E(A,A.next)&&(Z(A),A=A.next),A}function e(M,O){if(!M)return M;O||(O=M);var D=M,U;do if(U=!1,!D.steiner&&(E(D,D.next)||S(D.prev,D,D.next)===0)){if(Z(D),D=O=D.prev,D===D.next)break;U=!0}else D=D.next;while(U||D!==O);return O}function i(M,O,D,U,k,C,A){if(M){!A&&C&&f(M,U,k,C);for(var V=M,et,J;M.prev!==M.next;){if(et=M.prev,J=M.next,C?s(M,U,k,C):n(M)){O.push(et.i/D|0),O.push(M.i/D|0),O.push(J.i/D|0),Z(M),M=J.next,V=J.next;continue}if(M=J,M===V){A?A===1?(M=o(e(M),O,D),i(M,O,D,U,k,C,2)):A===2&&a(M,O,D,U,k,C):i(e(M),O,D,U,k,C,1);break}}}}function n(M){var O=M.prev,D=M,U=M.next;if(S(O,D,U)>=0)return!1;for(var k=O.x,C=D.x,A=U.x,V=O.y,et=D.y,J=U.y,yt=kC?k>A?k:A:C>A?C:A,_t=V>et?V>J?V:J:et>J?et:J,gt=U.next;gt!==O;){if(gt.x>=yt&>.x<=dt&>.y>=vt&>.y<=_t&&m(k,V,C,et,A,J,gt.x,gt.y)&&S(gt.prev,gt,gt.next)>=0)return!1;gt=gt.next}return!0}function s(M,O,D,U){var k=M.prev,C=M,A=M.next;if(S(k,C,A)>=0)return!1;for(var V=k.x,et=C.x,J=A.x,yt=k.y,vt=C.y,dt=A.y,_t=Vet?V>J?V:J:et>J?et:J,ee=yt>vt?yt>dt?yt:dt:vt>dt?vt:dt,he=g(_t,gt,O,D,U),v=g(Ct,ee,O,D,U),K=M.prevZ,q=M.nextZ;K&&K.z>=he&&q&&q.z<=v;){if(K.x>=_t&&K.x<=Ct&&K.y>=gt&&K.y<=ee&&K!==k&&K!==A&&m(V,yt,et,vt,J,dt,K.x,K.y)&&S(K.prev,K,K.next)>=0||(K=K.prevZ,q.x>=_t&&q.x<=Ct&&q.y>=gt&&q.y<=ee&&q!==k&&q!==A&&m(V,yt,et,vt,J,dt,q.x,q.y)&&S(q.prev,q,q.next)>=0))return!1;q=q.nextZ}for(;K&&K.z>=he;){if(K.x>=_t&&K.x<=Ct&&K.y>=gt&&K.y<=ee&&K!==k&&K!==A&&m(V,yt,et,vt,J,dt,K.x,K.y)&&S(K.prev,K,K.next)>=0)return!1;K=K.prevZ}for(;q&&q.z<=v;){if(q.x>=_t&&q.x<=Ct&&q.y>=gt&&q.y<=ee&&q!==k&&q!==A&&m(V,yt,et,vt,J,dt,q.x,q.y)&&S(q.prev,q,q.next)>=0)return!1;q=q.nextZ}return!0}function o(M,O,D){var U=M;do{var k=U.prev,C=U.next.next;!E(k,C)&&b(k,U,U.next,C)&&B(k,C)&&B(C,k)&&(O.push(k.i/D|0),O.push(U.i/D|0),O.push(C.i/D|0),Z(U),Z(U.next),U=M=C),U=U.next}while(U!==M);return e(U)}function a(M,O,D,U,k,C){var A=M;do{for(var V=A.next.next;V!==A.prev;){if(A.i!==V.i&&_(A,V)){var et=st(A,V);A=e(A,A.next),et=e(et,et.next),i(A,O,D,U,k,C,0),i(et,O,D,U,k,C,0);return}V=V.next}A=A.next}while(A!==M)}function l(M,O,D,U){var k=[],C,A,V,et,J;for(C=0,A=O.length;C=D.next.y&&D.next.y!==D.y){var V=D.x+(k-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(V<=U&&V>C&&(C=V,A=D.x=D.x&&D.x>=J&&U!==D.x&&m(kA.x||D.x===A.x&&p(A,D)))&&(A=D,vt=dt)),D=D.next;while(D!==et);return A}function p(M,O){return S(M.prev,M,O.prev)<0&&S(O.next,M,M.next)<0}function f(M,O,D,U){var k=M;do k.z===0&&(k.z=g(k.x,k.y,O,D,U)),k.prevZ=k.prev,k.nextZ=k.next,k=k.next;while(k!==M);k.prevZ.nextZ=null,k.prevZ=null,y(k)}function y(M){var O,D,U,k,C,A,V,et,J=1;do{for(D=M,M=null,C=null,A=0;D;){for(A++,U=D,V=0,O=0;O0||et>0&&U;)V!==0&&(et===0||!U||D.z<=U.z)?(k=D,D=D.nextZ,V--):(k=U,U=U.nextZ,et--),C?C.nextZ=k:M=k,k.prevZ=C,C=k;D=U}C.nextZ=null,J*=2}while(A>1);return M}function g(M,O,D,U,k){return M=(M-D)*k|0,O=(O-U)*k|0,M=(M|M<<8)&16711935,M=(M|M<<4)&252645135,M=(M|M<<2)&858993459,M=(M|M<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,M|O<<1}function d(M){var O=M,D=M;do(O.x=(M-A)*(C-V)&&(M-A)*(U-V)>=(D-A)*(O-V)&&(D-A)*(C-V)>=(k-A)*(U-V)}function _(M,O){return M.next.i!==O.i&&M.prev.i!==O.i&&!z(M,O)&&(B(M,O)&&B(O,M)&&tt(M,O)&&(S(M.prev,M,O.prev)||S(M,O.prev,O))||E(M,O)&&S(M.prev,M,M.next)>0&&S(O.prev,O,O.next)>0)}function S(M,O,D){return(O.y-M.y)*(D.x-O.x)-(O.x-M.x)*(D.y-O.y)}function E(M,O){return M.x===O.x&&M.y===O.y}function b(M,O,D,U){var k=x(S(M,O,D)),C=x(S(M,O,U)),A=x(S(D,U,M)),V=x(S(D,U,O));return!!(k!==C&&A!==V||k===0&&F(M,D,O)||C===0&&F(M,U,O)||A===0&&F(D,M,U)||V===0&&F(D,O,U))}function F(M,O,D){return O.x<=Math.max(M.x,D.x)&&O.x>=Math.min(M.x,D.x)&&O.y<=Math.max(M.y,D.y)&&O.y>=Math.min(M.y,D.y)}function x(M){return M>0?1:M<0?-1:0}function z(M,O){var D=M;do{if(D.i!==M.i&&D.next.i!==M.i&&D.i!==O.i&&D.next.i!==O.i&&b(D,D.next,M,O))return!0;D=D.next}while(D!==M);return!1}function B(M,O){return S(M.prev,M,M.next)<0?S(M,O,M.next)>=0&&S(M,M.prev,O)>=0:S(M,O,M.prev)<0||S(M,M.next,O)<0}function tt(M,O){var D=M,U=!1,k=(M.x+O.x)/2,C=(M.y+O.y)/2;do D.y>C!=D.next.y>C&&D.next.y!==D.y&&k<(D.next.x-D.x)*(C-D.y)/(D.next.y-D.y)+D.x&&(U=!U),D=D.next;while(D!==M);return U}function st(M,O){var D=new w(M.i,M.x,M.y),U=new w(O.i,O.x,O.y),k=M.next,C=O.prev;return M.next=O,O.prev=M,D.next=k,k.prev=D,U.next=D,D.prev=U,C.next=U,U.prev=C,U}function I(M,O,D,U){var k=new w(M,O,D);return U?(k.next=U.next,k.prev=U,U.next.prev=k,U.next=k):(k.prev=k,k.next=k),k}function Z(M){M.next.prev=M.prev,M.prev.next=M.next,M.prevZ&&(M.prevZ.nextZ=M.nextZ),M.nextZ&&(M.nextZ.prevZ=M.prevZ)}function w(M,O,D){this.i=M,this.x=O,this.y=D,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}r.deviation=function(M,O,D,U){var k=O&&O.length,C=k?O[0]*D:M.length,A=Math.abs(it(M,0,C,D));if(k)for(var V=0,et=O.length;V0&&(U+=M[k-1].length,D.holes.push(U))}return D},_a.exports}Nx();var Cn={},_o={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Lx=_o.exports,dd;function Bx(){return dd||(dd=1,function(r,t){(function(e){var i=t&&!t.nodeType&&t,n=r&&!r.nodeType&&r,s=typeof gi=="object"&&gi;(s.global===s||s.window===s||s.self===s)&&(e=s);var o,a=2147483647,l=36,u=1,c=26,h=38,p=700,f=72,y=128,g="-",d=/^xn--/,m=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=l-u,b=Math.floor,F=String.fromCharCode,x;function z(k){throw new RangeError(S[k])}function B(k,C){for(var A=k.length,V=[];A--;)V[A]=C(k[A]);return V}function tt(k,C){var A=k.split("@"),V="";A.length>1&&(V=A[0]+"@",k=A[1]),k=k.replace(_,".");var et=k.split("."),J=B(et,C).join(".");return V+J}function st(k){for(var C=[],A=0,V=k.length,et,J;A=55296&&et<=56319&&A65535&&(C-=65536,A+=F(C>>>10&1023|55296),C=56320|C&1023),A+=F(C),A}).join("")}function Z(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:l}function w(k,C){return k+22+75*(k<26)-((C!=0)<<5)}function it(k,C,A){var V=0;for(k=A?b(k/p):k>>1,k+=b(k/C);k>E*c>>1;V+=l)k=b(k/E);return b(V+(E+1)*k/(k+h))}function M(k){var C=[],A=k.length,V,et=0,J=y,yt=f,vt,dt,_t,gt,Ct,ee,he,v,K;for(vt=k.lastIndexOf(g),vt<0&&(vt=0),dt=0;dt=128&&z("not-basic"),C.push(k.charCodeAt(dt));for(_t=vt>0?vt+1:0;_t=A&&z("invalid-input"),he=Z(k.charCodeAt(_t++)),(he>=l||he>b((a-et)/Ct))&&z("overflow"),et+=he*Ct,v=ee<=yt?u:ee>=yt+c?c:ee-yt,!(heb(a/K)&&z("overflow"),Ct*=K;V=C.length+1,yt=it(et-gt,V,gt==0),b(et/V)>a-J&&z("overflow"),J+=b(et/V),et%=V,C.splice(et++,0,J)}return I(C)}function O(k){var C,A,V,et,J,yt,vt,dt,_t,gt,Ct,ee=[],he,v,K,q;for(k=st(k),he=k.length,C=y,A=0,J=f,yt=0;yt=C&&Ctb((a-A)/v)&&z("overflow"),A+=(vt-C)*v,C=vt,yt=0;yta&&z("overflow"),Ct==C){for(dt=A,_t=l;gt=_t<=J?u:_t>=J+c?c:_t-J,!(dt{if(u&&(typeof u=="object"||typeof u=="function")){if(i)return i.get(u)}else if(n)return n.get(u)},o=(u,c)=>{u&&(typeof u=="object"||typeof u=="function")?(i||(i=new WeakMap),i.set(u,c)):(n||(n=new Map),n.set(u,c))},a=u=>{if(u&&(typeof u=="object"||typeof u=="function")){if(i)return i.has(u)}else if(n)return n.has(u);return!1};return{get:s,set:o,has:a,assert:u=>{if(!a(u))throw new TypeError("Side channel does not contain the given key")}}}t.default=e,(typeof t.default=="object"&&t.default!==null||typeof t.default=="function")&&(Object.assign(t.default,t),r.exports=t.default)}(ba,ba.exports)),ba.exports}var _u,md;function Lh(){if(md)return _u;md=1;var r=String.prototype.replace,t=/%20/g,e={RFC1738:"RFC1738",RFC3986:"RFC3986"};return _u={default:e.RFC3986,formatters:{RFC1738:function(i){return r.call(i,t,"+")},RFC3986:function(i){return String(i)}},RFC1738:e.RFC1738,RFC3986:e.RFC3986},_u}var bu,yd;function Rg(){if(yd)return bu;yd=1;var r=Lh(),t=Object.prototype.hasOwnProperty,e=Array.isArray,i=function(){for(var d=[],m=0;m<256;++m)d.push("%"+((m<16?"0":"")+m.toString(16)).toUpperCase());return d}(),n=function(m){for(;m.length>1;){var _=m.pop(),S=_.obj[_.prop];if(e(S)){for(var E=[],b=0;b=u?F.slice(z,z+u):F,tt=[],st=0;st=48&&I<=57||I>=65&&I<=90||I>=97&&I<=122||b===r.RFC1738&&(I===40||I===41)){tt[tt.length]=B.charAt(st);continue}if(I<128){tt[tt.length]=i[I];continue}if(I<2048){tt[tt.length]=i[192|I>>6]+i[128|I&63];continue}if(I<55296||I>=57344){tt[tt.length]=i[224|I>>12]+i[128|I>>6&63]+i[128|I&63];continue}st+=1,I=65536+((I&1023)<<10|B.charCodeAt(st)&1023),tt[tt.length]=i[240|I>>18]+i[128|I>>12&63]+i[128|I>>6&63]+i[128|I&63]}x+=tt.join("")}return x},h=function(m){for(var _=[{obj:{o:m},prop:"o"}],S=[],E=0;E<_.length;++E)for(var b=_[E],F=b.obj[b.prop],x=Object.keys(F),z=0;z"u"&&(k=0)}if(typeof B=="function"?D=B(m,D):D instanceof Date?D=I(D):_==="comma"&&s(D)&&(D=t.maybeMap(D,function(K){return K instanceof Date?I(K):K})),D===null){if(b)return z&&!it?z(m,c.encoder,M,"key",Z):m;D=""}if(h(D)||t.isBuffer(D)){if(z){var V=it?m:z(m,c.encoder,M,"key",Z);return[w(V)+"="+w(z(D,c.encoder,M,"value",Z))]}return[w(m)+"="+w(String(D))]}var et=[];if(typeof D>"u")return et;var J;if(_==="comma"&&s(D))it&&z&&(D=t.maybeMap(D,z)),J=[{value:D.length>0?D.join(",")||null:void 0}];else if(s(B))J=B;else{var yt=Object.keys(D);J=tt?yt.sort(tt):yt}var vt=x?String(m).replace(/\./g,"%2E"):String(m),dt=S&&s(D)&&D.length===1?vt+"[]":vt;if(E&&s(D)&&D.length===0)return dt+"[]";for(var _t=0;_t"u"?d.encodeDotInKeys===!0?!0:c.allowDots:!!d.allowDots;return{addQueryPrefix:typeof d.addQueryPrefix=="boolean"?d.addQueryPrefix:c.addQueryPrefix,allowDots:F,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:b,charset:m,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:c.charsetSentinel,commaRoundTrip:!!d.commaRoundTrip,delimiter:typeof d.delimiter>"u"?c.delimiter:d.delimiter,encode:typeof d.encode=="boolean"?d.encode:c.encode,encodeDotInKeys:typeof d.encodeDotInKeys=="boolean"?d.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof d.encoder=="function"?d.encoder:c.encoder,encodeValuesOnly:typeof d.encodeValuesOnly=="boolean"?d.encodeValuesOnly:c.encodeValuesOnly,filter:E,format:_,formatter:S,serializeDate:typeof d.serializeDate=="function"?d.serializeDate:c.serializeDate,skipNulls:typeof d.skipNulls=="boolean"?d.skipNulls:c.skipNulls,sort:typeof d.sort=="function"?d.sort:null,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:c.strictNullHandling}};return wu=function(g,d){var m=g,_=y(d),S,E;typeof _.filter=="function"?(E=_.filter,m=E("",m)):s(_.filter)&&(E=_.filter,S=E);var b=[];if(typeof m!="object"||m===null)return"";var F=n[_.arrayFormat],x=F==="comma"&&_.commaRoundTrip;S||(S=Object.keys(m)),_.sort&&S.sort(_.sort);for(var z=r(),B=0;B0?Z+I:""},wu}var xu,vd;function zx(){if(vd)return xu;vd=1;var r=Rg(),t=Object.prototype.hasOwnProperty,e=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},n=function(p){return p.replace(/&#(\d+);/g,function(f,y){return String.fromCharCode(parseInt(y,10))})},s=function(p,f,y){if(p&&typeof p=="string"&&f.comma&&p.indexOf(",")>-1)return p.split(",");if(f.throwOnLimitExceeded&&y>=f.arrayLimit)throw new RangeError("Array limit exceeded. Only "+f.arrayLimit+" element"+(f.arrayLimit===1?"":"s")+" allowed in an array.");return p},o="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",l=function(f,y){var g={__proto__:null},d=y.ignoreQueryPrefix?f.replace(/^\?/,""):f;d=d.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var m=y.parameterLimit===1/0?void 0:y.parameterLimit,_=d.split(y.delimiter,y.throwOnLimitExceeded?m+1:m);if(y.throwOnLimitExceeded&&_.length>m)throw new RangeError("Parameter limit exceeded. Only "+m+" parameter"+(m===1?"":"s")+" allowed.");var S=-1,E,b=y.charset;if(y.charsetSentinel)for(E=0;E<_.length;++E)_[E].indexOf("utf8=")===0&&(_[E]===a?b="utf-8":_[E]===o&&(b="iso-8859-1"),S=E,E=_.length);for(E=0;E<_.length;++E)if(E!==S){var F=_[E],x=F.indexOf("]="),z=x===-1?F.indexOf("="):x+1,B,tt;z===-1?(B=y.decoder(F,i.decoder,b,"key"),tt=y.strictNullHandling?null:""):(B=y.decoder(F.slice(0,z),i.decoder,b,"key"),tt=r.maybeMap(s(F.slice(z+1),y,e(g[B])?g[B].length:0),function(I){return y.decoder(I,i.decoder,b,"value")})),tt&&y.interpretNumericEntities&&b==="iso-8859-1"&&(tt=n(String(tt))),F.indexOf("[]=")>-1&&(tt=e(tt)?[tt]:tt);var st=t.call(g,B);st&&y.duplicates==="combine"?g[B]=r.combine(g[B],tt):(!st||y.duplicates==="last")&&(g[B]=tt)}return g},u=function(p,f,y,g){var d=0;if(p.length>0&&p[p.length-1]==="[]"){var m=p.slice(0,-1).join("");d=Array.isArray(f)&&f[m]?f[m].length:0}for(var _=g?f:s(f,y,d),S=p.length-1;S>=0;--S){var E,b=p[S];if(b==="[]"&&y.parseArrays)E=y.allowEmptyArrays&&(_===""||y.strictNullHandling&&_===null)?[]:r.combine([],_);else{E=y.plainObjects?{__proto__:null}:{};var F=b.charAt(0)==="["&&b.charAt(b.length-1)==="]"?b.slice(1,-1):b,x=y.decodeDotInKeys?F.replace(/%2E/g,"."):F,z=parseInt(x,10);!y.parseArrays&&x===""?E={0:_}:!isNaN(z)&&b!==x&&String(z)===x&&z>=0&&y.parseArrays&&z<=y.arrayLimit?(E=[],E[z]=_):x!=="__proto__"&&(E[x]=_)}_=E}return _},c=function(f,y,g,d){if(f){var m=g.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f,_=/(\[[^[\]]*])/,S=/(\[[^[\]]*])/g,E=g.depth>0&&_.exec(m),b=E?m.slice(0,E.index):m,F=[];if(b){if(!g.plainObjects&&t.call(Object.prototype,b)&&!g.allowPrototypes)return;F.push(b)}for(var x=0;g.depth>0&&(E=S.exec(m))!==null&&x"u"?i.charset:f.charset,g=typeof f.duplicates>"u"?i.duplicates:f.duplicates;if(g!=="combine"&&g!=="first"&&g!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var d=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:i.allowDots:!!f.allowDots;return{allowDots:d,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:i.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:i.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:i.arrayLimit,charset:y,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:i.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:i.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:i.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:i.decoder,delimiter:typeof f.delimiter=="string"||r.isRegExp(f.delimiter)?f.delimiter:i.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:i.depth,duplicates:g,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:i.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:i.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:i.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:typeof f.throwOnLimitExceeded=="boolean"?f.throwOnLimitExceeded:!1}};return xu=function(p,f){var y=h(f);if(p===""||p===null||typeof p>"u")return y.plainObjects?{__proto__:null}:{};for(var g=typeof p=="string"?l(p,y):p,d=y.plainObjects?{__proto__:null}:{},m=Object.keys(g),_=0;_",'"',"`"," ","\r",` +`," "],o=["{","}","|","\\","^","`"].concat(s),a=["'"].concat(o),l=["%","/","?",";","#"].concat(a),u=["/","?","#"],c=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},d=jx();function m(b,F,x){if(b&&typeof b=="object"&&b instanceof t)return b;var z=new t;return z.parse(b,F,x),z}t.prototype.parse=function(b,F,x){if(typeof b!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof b);var z=b.indexOf("?"),B=z!==-1&&z127?yt+="x":yt+=J[vt];if(!yt.match(h)){var _t=V.slice(0,D),gt=V.slice(D+1),Ct=J.match(p);Ct&&(_t.push(Ct[1]),gt.unshift(Ct[2])),gt.length&&(I="/"+gt.join(".")+I),this.hostname=_t.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=r.toASCII(this.hostname));var ee=this.port?":"+this.port:"",he=this.hostname||"";this.host=he+ee,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),I[0]!=="/"&&(I="/"+I))}if(!f[it])for(var D=0,et=a.length;D0?x.host.split("@"):!1;yt&&(x.auth=yt.shift(),x.hostname=yt.shift(),x.host=x.hostname)}return x.search=b.search,x.query=b.query,(x.pathname!==null||x.search!==null)&&(x.path=(x.pathname?x.pathname:"")+(x.search?x.search:"")),x.href=x.format(),x}if(!V.length)return x.pathname=null,x.search?x.path="/"+x.search:x.path=null,x.href=x.format(),x;for(var vt=V.slice(-1)[0],dt=(x.host||b.host||V.length>1)&&(vt==="."||vt==="..")||vt==="",_t=0,gt=V.length;gt>=0;gt--)vt=V[gt],vt==="."?V.splice(gt,1):vt===".."?(V.splice(gt,1),_t++):_t&&(V.splice(gt,1),_t--);if(!C&&!A)for(;_t--;_t)V.unshift("..");C&&V[0]!==""&&(!V[0]||V[0].charAt(0)!=="/")&&V.unshift(""),dt&&V.join("/").substr(-1)!=="/"&&V.push("");var Ct=V[0]===""||V[0]&&V[0].charAt(0)==="/";if(J){x.hostname=Ct?"":V.length?V.shift():"",x.host=x.hostname;var yt=x.host&&x.host.indexOf("@")>0?x.host.split("@"):!1;yt&&(x.auth=yt.shift(),x.hostname=yt.shift(),x.host=x.hostname)}return C=C||x.host&&V.length,C&&!Ct&&V.unshift(""),V.length>0?x.pathname=V.join("/"):(x.pathname=null,x.path=null),(x.pathname!==null||x.search!==null)&&(x.path=(x.pathname?x.pathname:"")+(x.search?x.search:"")),x.auth=b.auth||x.auth,x.slashes=x.slashes||b.slashes,x.href=x.format(),x},t.prototype.parseHost=function(){var b=this.host,F=i.exec(b);F&&(F=F[0],F!==":"&&(this.port=F.substr(1)),b=b.substr(0,b.length-F.length)),b&&(this.hostname=b)},Cn.parse=m,Cn.resolve=S,Cn.resolveObject=E,Cn.format=_,Cn.Url=t,Cn}var Tu=$x();/*! + * @pixi/utils - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/utils is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + */var Ql={parse:Tu.parse,format:Tu.format,resolve:Tu.resolve};It.RETINA_PREFIX=/@([0-9\.]+)x/;It.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var wd=!1,xd="6.5.10";function Vx(r){var t;if(!wd){if(It.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var e=[` + %c %c %c PixiJS `+xd+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ + +`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,e)}else globalThis.console&&globalThis.console.log("PixiJS "+xd+" - "+r+" - http://www.pixijs.com/");wd=!0}}var Iu;function Gx(){return typeof Iu>"u"&&(Iu=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:It.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!It.ADAPTER.getWebGLRenderingContext())return!1;var e=It.ADAPTER.createCanvas(),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!!(i&&i.getContextAttributes().stencil);if(i){var s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,n}catch{return!1}}()),Iu}function Gr(r,t){return t===void 0&&(t=[]),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,t}function Wx(r){var t=r.toString(16);return t="000000".substring(0,6-t.length)+t,"#"+t}function ei(r){return(r[0]*255<<16)+(r[1]*255<<8)+(r[2]*255|0)}function Hx(){for(var r=[],t=[],e=0;e<32;e++)r[e]=e,t[e]=e;r[qt.NORMAL_NPM]=qt.NORMAL,r[qt.ADD_NPM]=qt.ADD,r[qt.SCREEN_NPM]=qt.SCREEN,t[qt.NORMAL]=qt.NORMAL_NPM,t[qt.ADD]=qt.ADD_NPM,t[qt.SCREEN]=qt.SCREEN_NPM;var i=[];return i.push(t),i.push(r),i}var Xx=Hx();function Yx(r,t){if(t===1)return(t*255<<24)+r;if(t===0)return 0;var e=r>>16&255,i=r>>8&255,n=r&255;return e=e*t+.5|0,i=i*t+.5|0,n=n*t+.5|0,(t*255<<24)+(e<<16)+(i<<8)+n}function Ng(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}function el(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Sd(r){return!(r&r-1)&&!!r}function Td(r){var t=(r>65535?1:0)<<4;r>>>=t;var e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}function Ba(r,t,e){var i=r.length,n;if(!(t>=i||e===0)){e=t+e>i?i-t:e;var s=i-e;for(n=t;n"u"?console.warn("PixiJS Deprecation Warning: ",t+` +Deprecated since v`+r):(i=i.split(` +`).splice(e).join(` +`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t+` +Deprecated since v`+r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",t+` +Deprecated since v`+r),console.warn(i))),Id[t]=!0}}var Ed={},Pi=Object.create(null),An=Object.create(null);(function(){function r(t,e,i){this.canvas=It.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=i||It.RESOLUTION,this.resize(t,e)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),r})();var wa;function Qx(r,t){if(t===void 0&&(t=globalThis.location),r.indexOf("data:")===0)return"";t=t||globalThis.location,wa||(wa=document.createElement("a")),wa.href=r;var e=Ql.parse(wa.href),i=!e.port&&t.port===""||e.port===t.port;return e.hostname!==t.hostname||!i||e.protocol!==t.protocol?"anonymous":""}function Cd(r,t){var e=It.RETINA_PREFIX.exec(r);return e?parseFloat(e[1]):t!==void 0?t:1}/*! + * @pixi/extensions - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/extensions is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Do=function(){return Do=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n8)throw new Error("max arguments reached");var u=this,c=u.name,h=u.items;this._aliasCount++;for(var p=0,f=h.length;p0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},r.prototype.remove=function(t){var e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},r.prototype.contains=function(t){return this.items.indexOf(t)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r}();Object.defineProperties(qe.prototype,{dispatch:{value:qe.prototype.emit},run:{value:qe.prototype.emit}});/*! + * @pixi/ticker - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/ticker is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + */It.TARGET_FPMS=.06;var qs;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(qs||(qs={}));var Eu=function(){function r(t,e,i,n){e===void 0&&(e=null),i===void 0&&(i=0),n===void 0&&(n=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=n}return r.prototype.match=function(t,e){return e===void 0&&(e=null),this.fn===t&&this.context===e},r.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},r.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},r.prototype.destroy=function(t){t===void 0&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},r}(),fi=function(){function r(){var t=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Eu(null,null,1/0),this.deltaMS=1/It.TARGET_FPMS,this.elapsedMS=1/It.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&t._requestId===null&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(t,e,i){return i===void 0&&(i=qs.NORMAL),this._addListener(new Eu(t,e,i))},r.prototype.addOnce=function(t,e,i){return i===void 0&&(i=qs.NORMAL),this._addListener(new Eu(t,e,i,!0))},r.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this},r.prototype.remove=function(t,e){for(var i=this._head.next;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(t){t===void 0&&(t=performance.now());var e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i=this.x&&t=this.y&&et.right?t.right:this.right;if(n<=i)return!1;var s=this.yt.bottom?t.bottom:this.bottom;return o>s}var a=this.left,l=this.right,u=this.top,c=this.bottom;if(l<=a||c<=u)return!1;var h=xa[0].set(t.left,t.top),p=xa[1].set(t.left,t.bottom),f=xa[2].set(t.right,t.top),y=xa[3].set(t.right,t.bottom);if(f.x<=h.x||p.y<=h.y)return!1;var g=Math.sign(e.a*e.d-e.b*e.c);if(g===0||(e.apply(h,h),e.apply(p,p),e.apply(f,f),e.apply(y,y),Math.max(h.x,p.x,f.x,y.x)<=a||Math.min(h.x,p.x,f.x,y.x)>=l||Math.max(h.y,p.y,f.y,y.y)<=u||Math.min(h.y,p.y,f.y,y.y)>=c))return!1;var d=g*(p.y-h.y),m=g*(h.x-p.x),_=d*a+m*u,S=d*l+m*u,E=d*a+m*c,b=d*l+m*c;if(Math.max(_,S,E,b)<=d*h.x+m*h.y||Math.min(_,S,E,b)>=d*y.x+m*y.y)return!1;var F=g*(h.y-f.y),x=g*(f.x-h.x),z=F*a+x*u,B=F*l+x*u,tt=F*a+x*c,st=F*l+x*c;return!(Math.max(z,B,tt,st)<=F*h.x+x*h.y||Math.min(z,B,tt,st)>=F*y.x+x*y.y)},r.prototype.pad=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this},r.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(s-n,0),this},r.prototype.ceil=function(t,e){t===void 0&&(t=1),e===void 0&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=n-this.y,this},r.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=s-n,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Rs=function(){function r(t,e,i,n){i===void 0&&(i=0),n===void 0&&(n=0),this._x=i,this._y=n,this.cb=t,this.scope=e}return r.prototype.clone=function(t,e){return t===void 0&&(t=this.cb),e===void 0&&(e=this.scope),new r(t,e,this._x,this._y)},r.prototype.set=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=t),(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(t){return t.set(this._x,this._y),t},r.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r}(),Ze=function(){function r(t,e,i,n,s,o){t===void 0&&(t=1),e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=0),o===void 0&&(o=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o}return r.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},r.prototype.set=function(t,e,i,n,s,o){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o,this},r.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},r.prototype.apply=function(t,e){e=e||new Ee;var i=t.x,n=t.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e},r.prototype.applyInverse=function(t,e){e=e||new Ee;var i=1/(this.a*this.d+this.c*-this.b),n=t.x,s=t.y;return e.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e},r.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},r.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},r.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a,s=this.c,o=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=s*e-this.d*i,this.d=s*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this},r.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,s=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*s,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*s,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this},r.prototype.setTransform=function(t,e,i,n,s,o,a,l,u){return this.a=Math.cos(a+u)*s,this.b=Math.sin(a+u)*s,this.c=-Math.sin(a-l)*o,this.d=Math.cos(a-l)*o,this.tx=t-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this},r.prototype.prepend=function(t){var e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){var i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},r.prototype.decompose=function(t){var e=this.a,i=this.b,n=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-n,s),l=Math.atan2(i,e),u=Math.abs(a+l);return u<1e-5||Math.abs(Kx-u)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=l),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(n*n+s*s),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*i+o.y*s),t},r.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,s=this.tx,o=t*n-e*i;return this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-n*s)/o,this.ty=-(t*this.ty-e*s)/o,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var t=new r;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},r.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r}(),Dn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Rn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Nn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ln=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],uc=[],Lg=[],Sa=Math.sign;function Jx(){for(var r=0;r<16;r++){var t=[];uc.push(t);for(var e=0;e<16;e++)for(var i=Sa(Dn[r]*Dn[e]+Nn[r]*Rn[e]),n=Sa(Rn[r]*Dn[e]+Ln[r]*Rn[e]),s=Sa(Dn[r]*Nn[e]+Nn[r]*Ln[e]),o=Sa(Rn[r]*Nn[e]+Ln[r]*Ln[e]),a=0;a<16;a++)if(Dn[a]===i&&Rn[a]===n&&Nn[a]===s&&Ln[a]===o){t.push(a);break}}for(var r=0;r<16;r++){var l=new Ze;l.set(Dn[r],Rn[r],Nn[r],Ln[r],0,0),Lg.push(l)}}Jx();var Oe={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(r){return Dn[r]},uY:function(r){return Rn[r]},vX:function(r){return Nn[r]},vY:function(r){return Ln[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,t){return uc[r][t]},sub:function(r,t){return uc[r][Oe.inv(t)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,t){return Math.abs(r)*2<=Math.abs(t)?t>=0?Oe.S:Oe.N:Math.abs(t)*2<=Math.abs(r)?r>0?Oe.E:Oe.W:t>0?r>0?Oe.SE:Oe.SW:r>0?Oe.NE:Oe.NW},matrixAppendRotationInv:function(r,t,e,i){e===void 0&&(e=0),i===void 0&&(i=0);var n=Lg[Oe.inv(t)];n.tx=e,n.ty=i,r.append(n)}},Bg=function(){function r(){this.worldTransform=new Ze,this.localTransform=new Ze,this.position=new Rs(this.onChange,this,0,0),this.scale=new Rs(this.onChange,this,1,1),this.pivot=new Rs(this.onChange,this,0,0),this.skew=new Rs(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,n=this.worldTransform;n.a=e.a*i.a+e.b*i.c,n.b=e.a*i.b+e.b*i.d,n.c=e.c*i.a+e.d*i.c,n.d=e.c*i.b+e.d*i.d,n.tx=e.tx*i.a+e.ty*i.c+i.tx,n.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},r.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r}();/*! + * @pixi/core - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/core is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + */It.PREFER_ENV=Xn.any?Vi.WEBGL:Vi.WEBGL2;It.STRICT_TEXTURE_CACHE=!1;var cc=[];function kg(r,t){if(!r)return null;var e="";if(typeof r=="string"){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);i&&(e=i[1].toLowerCase())}for(var n=cc.length-1;n>=0;--n){var s=cc[n];if(s.test&&s.test(r,e))return new s(r,t)}throw new Error("Unrecognized source type to auto-detect Resource")}/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var hc=function(r,t){return hc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},hc(r,t)};function Ie(r,t){hc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var fc=function(){return fc=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n0&&c>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(e),n}return Object.defineProperty(t.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mipmap",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),t.prototype.setStyle=function(e,i){var n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),i!==void 0&&i!==this.mipmap&&(this.mipmap=i,n=!0),n&&this.dirtyStyleId++,this},t.prototype.setSize=function(e,i,n){return n=n||this.resolution,this.setRealSize(e*n,i*n,n)},t.prototype.setRealSize=function(e,i,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(i)/this.resolution,this._refreshPOT(),this.update(),this},t.prototype._refreshPOT=function(){this.isPowerOfTwo=Sd(this.realWidth)&&Sd(this.realHeight)},t.prototype.setResolution=function(e){var i=this.resolution;return i===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*i)/e,this.height=Math.round(this.height*i)/e,this.emit("update",this)),this._refreshPOT(),this)},t.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this},t.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},t.prototype.onError=function(e){this.emit("error",this,e)},t.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete An[this.cacheId],delete Pi[this.cacheId],this.cacheId=null),this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},t.prototype.dispose=function(){this.emit("dispose",this)},t.prototype.castToBaseTexture=function(){return this},t.from=function(e,i,n){n===void 0&&(n=It.STRICT_TEXTURE_CACHE);var s=typeof e=="string",o=null;if(s)o=e;else{if(!e._pixiId){var a=i&&i.pixiIdPrefix||"pixiid";e._pixiId=a+"_"+$o()}o=e._pixiId}var l=An[o];if(s&&n&&!l)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return l||(l=new t(e,i),l.cacheId=o,t.addToCache(l,o)),l},t.fromBuffer=function(e,i,n,s){e=e||new Float32Array(i*n*4);var o=new Bh(e,{width:i,height:n}),a=e instanceof Float32Array?ce.FLOAT:ce.UNSIGNED_BYTE;return new t(o,Object.assign({},eS,s||{width:i,height:n,type:a}))},t.addToCache=function(e,i){i&&(e.textureCacheIds.indexOf(i)===-1&&e.textureCacheIds.push(i),An[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),An[i]=e)},t.removeFromCache=function(e){if(typeof e=="string"){var i=An[e];if(i){var n=i.textureCacheIds.indexOf(e);return n>-1&&i.textureCacheIds.splice(n,1),delete An[e],i}}else if(e&&e.textureCacheIds){for(var s=0;s0)if(e.resource)this.addResourceAt(e.resource,i);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Qn.TEXTURE_CUBE_MAP_POSITIVE_X+i,e.parentTextureArray=this.baseTexture,this.items[i]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[i]=e,this},t.prototype.upload=function(e,i,n){for(var s=this.itemDirtyIds,o=0;o)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,t}(fn),oS=function(r){Ie(t,r);function t(e,i){var n=this;if(i=i||{},!(e instanceof HTMLVideoElement)){var s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),typeof e=="string"&&(e=[e]);var o=e[0].src||e[0];fn.crossOrigin(s,o,i.crossorigin);for(var a=0;a2},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(fi.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(fi.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);var i=this.valid;this.resize(e.videoWidth,e.videoHeight),!i&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(fi.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),r.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(fi.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(fi.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,i){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(i)>-1},t.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],t.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},t}(fn),aS=function(r){Ie(t,r);function t(e){return r.call(this,e)||this}return t.test=function(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap},t}(fn);cc.push(zg,aS,iS,oS,sS,Bh,nS,rS);var lS=function(r){Ie(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.upload=function(e,i,n){var s=e.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===hn.UNPACK);var o=i.realWidth,a=i.realHeight;return n.width===o&&n.height===a?s.texSubImage2D(i.target,0,0,0,o,a,i.format,n.type,this.data):(n.width=o,n.height=a,s.texImage2D(i.target,0,n.internalFormat,o,a,0,i.format,n.type,this.data)),!0},t}(Bh),dc=function(){function r(t,e){this.width=Math.round(t||100),this.height=Math.round(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new qe("disposeFramebuffer"),this.multisample=Be.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(t,e){return t===void 0&&(t=0),this.colorTextures[t]=e||new Ve(null,{scaleMode:Tr.NEAREST,resolution:1,mipmap:wi.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(t){return this.depthTexture=t||new Ve(new lS(null,{width:this.width,height:this.height}),{scaleMode:Tr.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:wi.OFF,format:wt.DEPTH_COMPONENT,type:ce.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i-1&&i.textureCacheIds.splice(n,1),delete Pi[e],i}}else if(e&&e.textureCacheIds){for(var s=0;sthis.baseTexture.width,l=n+o>this.baseTexture.height;if(a||l){var u=a&&l?"and":"or",c="X: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.width,h="Y: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(c+" "+u+" "+h))}this.valid=s&&o&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),t.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(t,"EMPTY",{get:function(){return t._EMPTY||(t._EMPTY=new t(new Ve),Ta(t._EMPTY),Ta(t._EMPTY.baseTexture)),t._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(t,"WHITE",{get:function(){if(!t._WHITE){var e=It.ADAPTER.createCanvas(16,16),i=e.getContext("2d");e.width=16,e.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),t._WHITE=new t(Ve.from(e)),Ta(t._WHITE),Ta(t._WHITE.baseTexture)}return t._WHITE},enumerable:!1,configurable:!0}),t}(bn),kh=function(r){Ie(t,r);function t(e,i){var n=r.call(this,e,i)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return Object.defineProperty(t.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,i,n){n===void 0&&(n=!0);var s=this.baseTexture.resolution,o=Math.round(e*s)/s,a=Math.round(i*s)/s;this.valid=o>0&&a>0,this._frame.width=this.orig.width=o,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(o,a),this.updateUvs()},t.prototype.setResolution=function(e){var i=this.baseTexture;i.resolution!==e&&(i.setResolution(e),this.resize(i.width,i.height,!1))},t.create=function(e){for(var i=arguments,n=[],s=1;s>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);var o=this.texturePool[s].pop();return o||(o=this.createTexture(t,e,n)),o.filterPoolKey=s,o.setResolution(i),o},r.prototype.getFilterTexture=function(t,e,i){var n=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||Be.NONE);return n.filterFrame=t.filterFrame,n},r.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},r.prototype.returnFilterTexture=function(t){this.returnTexture(t)},r.prototype.clear=function(t){if(t=t!==!1,t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var n=0;n0&&t.height>0;for(var e in this.texturePool)if(Number(e)<0){var i=this.texturePool[e];if(i)for(var n=0;n1){for(var c=0;c1&&(h=this.getOptimalFilterTexture(c.width,c.height,e.resolution),h.filterFrame=c.filterFrame),i[p].apply(this,c,h,Jr.CLEAR,e);var f=c;c=h,h=f}i[p].apply(this,c,u.renderTexture,Jr.BLEND,e),p>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(h)}e.clear(),this.statePool.push(e)},r.prototype.bindAndClear=function(t,e){e===void 0&&(e=Jr.CLEAR);var i=this.renderer,n=i.renderTexture,s=i.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,n.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=s.stateId&1||this.forceClear;(e===Jr.CLEAR||e===Jr.BLIT&&a)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(t,e,i,n){var s=this.renderer;s.state.set(t.state),this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(jo.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(jo.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,n=i.sourceFrame,s=i.destinationFrame,o=e._texture.orig,a=t.set(s.width,0,0,s.height,n.x,n.y),l=e.worldTransform.copyTo(Ze.TEMP_MATRIX);return l.invert(),a.prepend(l),a.scale(1/o.width,1/o.height),a.translate(e.anchor.x,e.anchor.y),a},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(t,e,i,n){return i===void 0&&(i=1),n===void 0&&(n=Be.NONE),this.texturePool.getOptimalTexture(t,e,i,n)},r.prototype.getFilterTexture=function(t,e,i){if(typeof t=="number"){var n=t;t=e,e=n}t=t||this.activeState.renderTexture;var s=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||Be.NONE);return s.filterFrame=t.filterFrame,s},r.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(t,e){var i=Ia[0],n=Ia[1],s=Ia[2],o=Ia[3];i.set(e.left,e.top),n.set(e.left,e.bottom),s.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(i,i),t.apply(n,n),t.apply(s,s),t.apply(o,o);var a=Math.min(i.x,n.x,s.x,o.x),l=Math.min(i.y,n.y,s.y,o.y),u=Math.max(i.x,n.x,s.x,o.x),c=Math.max(i.y,n.y,s.y,o.y);e.x=a,e.y=l,e.width=u-a,e.height=c-l},r.prototype.roundFrame=function(t,e,i,n,s){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(s){var o=s.a,a=s.b,l=s.c,u=s.d;if((Math.abs(a)>1e-4||Math.abs(l)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}s=s?Cu.copyFrom(s):Cu.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}},r}(),Vg=function(){function r(t){this.renderer=t}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(t){},r}(),bS=function(){function r(t){this.renderer=t,this.emptyRenderer=new Vg(t),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,n=e-1;n>=0;--n)t[n]=i[n]||null,t[n]&&(t[n]._batchLocation=n)},r.prototype.boundArray=function(t,e,i,n){for(var s=t.elements,o=t.ids,a=t.count,l=0,u=0;u=0&&h=Vi.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(t){var e=this;t.preventDefault(),setTimeout(function(){e.gl.isContextLost()&&e.extensions.loseContext&&e.extensions.loseContext.restoreContext()},0)},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r}(),xS=function(){function r(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Be.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),SS=new Ue,TS=function(){function r(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new dc(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Ue,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;It.PREFER_ENV===Vi.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(n){return e.drawBuffersWEBGL(n)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},r.prototype.bind=function(t,e,i){i===void 0&&(i=0);var n=this.gl;if(t){var s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=i),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o>i,u=e.height>>i,c=l/e.width;this.setViewport(e.x*c,e.y*c,l,u)}else{var l=t.width>>i,u=t.height>>i;this.setViewport(0,0,l,u)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(t,e,i,n){var s=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=i,s.height=n,this.gl.viewport(t,e,i,n))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(t,e,i,n,s){s===void 0&&(s=Ka.COLOR|Ka.DEPTH);var o=this.gl;o.clearColor(t,e,i,n),o.clear(s)},r.prototype.initFramebuffer=function(t){var e=this.gl,i=new xS(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i},r.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height)),i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var n=t.colorTextures,s=n.length;e.drawBuffers||(s=Math.min(s,1));for(var o=0;o1&&this.canMultisampleFramebuffer(t)?(n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA8,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var a=[],l=0;l1&&i.drawBuffers(a),t.depthTexture){var h=this.writeDepthTexture;if(h){var p=t.depthTexture;this.renderer.texture.bind(p,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,p._glTextures[this.CONTEXT_UID].texture,e)}}(t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)},r.prototype.canMultisampleFramebuffer=function(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture},r.prototype.detectSamples=function(t){var e=this.msaaSamples,i=Be.NONE;if(t<=1||e===null)return i;for(var n=0;n=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i=Vi.WEBGL2&&(t=r.getContext("webgl2",{})),t||(t=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),co=t}return co}var Ea;function OS(){if(!Ea){Ea=Ir.MEDIUM;var r=AS();if(r&&r.getShaderPrecisionFormat){var t=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);Ea=t.precision?Ir.HIGH:Ir.MEDIUM}}return Ea}function Nd(r,t,e){if(r.substring(0,9)!=="precision"){var i=t;return t===Ir.HIGH&&e!==Ir.HIGH&&(i=Ir.MEDIUM),"precision "+i+` float; +`+r}else if(e!==Ir.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var FS={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Hg(r){return FS[r]}var Ca=null,Ld={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Xg(r,t){if(!Ca){var e=Object.keys(Ld);Ca={};for(var i=0;i0&&(t+=` +else `),e"u"?.5:e,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(t,e){e===void 0&&(e=t);for(var i=this.mapCoord,n=0;n0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r}(),qg=function(){function r(t){this.renderer=t,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var n=this.getStackLength();n!==i&&(n===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r}(),kd=new Ze,Ud=[],YS=function(r){Ie(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=It.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},t.prototype.calcScissorRect=function(e){var i;if(!e._scissorRectLocal){var n=e._scissorRect,s=e.maskObject,o=this.renderer,a=o.renderTexture,l=s.getBounds(!0,(i=Ud.pop())!==null&&i!==void 0?i:new Ue);this.roundFrameToPixels(l,a.current?a.current.resolution:o.resolution,a.sourceFrame,a.destinationFrame,o.projection.transform),n&&l.fit(n),e._scissorRectLocal=l}},t.isMatrixRotated=function(e){if(!e)return!1;var i=e.a,n=e.b,s=e.c,o=e.d;return(Math.abs(n)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(o)>1e-4)},t.prototype.testScissor=function(e){var i=e.maskObject;if(!i.isFastRect||!i.isFastRect()||t.isMatrixRotated(i.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var n=e._scissorRectLocal;return n.width>0&&n.height>0},t.prototype.roundFrameToPixels=function(e,i,n,s,o){t.isMatrixRotated(o)||(o=o?kd.copyFrom(o):kd.identity(),o.translate(-n.x,-n.y).scale(s.width/n.width,s.height/n.height).translate(s.x,s.y),this.renderer.filter.transformAABB(o,e),e.fit(s),e.x=Math.round(e.x*i),e.y=Math.round(e.y*i),e.width=Math.round(e.width*i),e.height=Math.round(e.height*i))},t.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var i=this.renderer.gl;e._scissorRect||i.enable(i.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},t.prototype.pop=function(e){var i=this.renderer.gl;e&&Ud.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():i.disable(i.SCISSOR_TEST)},t.prototype._useCurrent=function(){var e=this.maskStack[this.maskStack.length-1]._scissorRect,i;this.renderer.renderTexture.current?i=e.y:i=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,i,e.width,e.height)},t}(qg),qS=function(r){Ie(t,r);function t(e){var i=r.call(this,e)||this;return i.glConst=It.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return t.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},t.prototype.push=function(e){var i=e.maskObject,n=this.renderer.gl,s=e._stencilCounter;s===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;var o=e._colorMask;o!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,s,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,o!==0&&(e._colorMask=o,n.colorMask((o&1)!==0,(o&2)!==0,(o&4)!==0,(o&8)!==0)),this._useCurrent()},t.prototype.pop=function(e){var i=this.renderer.gl;if(this.getStackLength()===0)i.disable(i.STENCIL_TEST);else{var n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,s=n?n._colorMask:15;s!==0&&(n._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilOp(i.KEEP,i.KEEP,i.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,s!==0&&(n._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}},t.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},t}(qg),QS=function(){function r(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ze,this.transform=null}return r.prototype.update=function(t,e,i,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(t,e,i,n){var s=this.projectionMatrix,o=n?-1:1;s.identity(),s.a=1/e.width*2,s.d=o*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-o-e.y*s.d},r.prototype.setTransform=function(t){},r.prototype.destroy=function(){this.renderer=null},r}(),On=new Ue,fo=new Ue,KS=function(){function r(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Ue,this.destinationFrame=new Ue,this.viewportFrame=new Ue}return r.prototype.bind=function(t,e,i){t===void 0&&(t=null);var n=this.renderer;this.current=t;var s,o,a;t?(s=t.baseTexture,a=s.resolution,e||(On.width=t.frame.width,On.height=t.frame.height,e=On),i||(fo.x=t.frame.x,fo.y=t.frame.y,fo.width=e.width,fo.height=e.height,i=fo),o=s.framebuffer):(a=n.resolution,e||(On.width=n.screen.width,On.height=n.screen.height,e=On),i||(i=On,i.width=e.width,i.height=e.height));var l=this.viewportFrame;l.x=i.x*a,l.y=i.y*a,l.width=i.width*a,l.height=i.height*a,t||(l.y=n.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(o,l),this.renderer.projection.update(i,e,a,!o),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},r.prototype.clear=function(t,e){this.current?t=t||this.current.baseTexture.clearColor:t=t||this.clearColor;var i=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,s=i.width!==n.width||i.height!==n.height;if(s){var o=this.viewportFrame,a=o.x,l=o.y,u=o.width,c=o.height;a=Math.round(a),l=Math.round(l),u=Math.round(u),c=Math.round(c),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(a,l,u,c)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),s&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r}();function ZS(r,t,e,i,n){e.buffer.update(n)}var JS={float:` + data[offset] = v; + `,vec2:` + data[offset] = v[0]; + data[offset+1] = v[1]; + `,vec3:` + data[offset] = v[0]; + data[offset+1] = v[1]; + data[offset+2] = v[2]; + + `,vec4:` + data[offset] = v[0]; + data[offset+1] = v[1]; + data[offset+2] = v[2]; + data[offset+3] = v[3]; + `,mat2:` + data[offset] = v[0]; + data[offset+1] = v[1]; + + data[offset+4] = v[2]; + data[offset+5] = v[3]; + `,mat3:` + data[offset] = v[0]; + data[offset+1] = v[1]; + data[offset+2] = v[2]; + + data[offset + 4] = v[3]; + data[offset + 5] = v[4]; + data[offset + 6] = v[5]; + + data[offset + 8] = v[6]; + data[offset + 9] = v[7]; + data[offset + 10] = v[8]; + `,mat4:` + for(var i = 0; i < 16; i++) + { + data[offset + i] = v[i]; + } + `},Qg={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function t1(r){for(var t=r.map(function(l){return{data:l,offset:0,dataLen:0,dirty:0}}),e=0,i=0,n=0,s=0;s1&&(e=Math.max(e,16)*o.data.size),o.dataLen=e,i%e!==0&&i<16){var a=i%e%16;i+=a,n+=a}i+e>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=e,i=e):(o.offset=n,i+=e,n+=e)}return n=Math.ceil(n/16)*16,{uboElements:t,size:n}}function e1(r,t){var e=[];for(var i in r)t[i]&&e.push(t[i]);return e.sort(function(n,s){return n.index-s.index}),e}function r1(r,t){if(!r.autoManage)return{size:0,syncFunc:ZS};for(var e=e1(r.uniforms,t),i=t1(e),n=i.uboElements,s=i.size,o=[` + var v = null; + var v2 = null; + var cv = null; + var t = 0; + var gl = renderer.gl + var index = 0; + var data = buffer.data; + `],a=0;a1){var y=Hg(l.data.type),g=Math.max(Qg[l.data.type]/16,1),d=y/g,m=(4-d%4)%4;o.push(` + cv = ud.`+c+`.value; + v = uv.`+c+`; + offset = `+l.offset/4+`; + + t = 0; + + for(var i=0; i < `+l.data.size*g+`; i++) + { + for(var j = 0; j < `+d+`; j++) + { + data[offset++] = v[t++]; + } + offset += `+m+`; + } + + `)}else{var _=JS[l.data.type];o.push(` + cv = ud.`+c+`.value; + v = uv.`+c+`; + offset = `+l.offset/4+`; + `+_+`; + `)}}return o.push(` + renderer.buffer.update(buffer); + `),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join(` +`))}}var i1=function(){function r(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r}();function n1(r,t){for(var e={},i=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),n=0;nh?1:-1});for(var o=0;o>1,i++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,n=0;nthis.maxIdle&&(t.destroyTexture(s,!0),e[n]=null,i=!0)}if(i){for(var o=0,n=0;n=0;n--)this.unload(t.children[n])},r.prototype.destroy=function(){this.renderer=null},r}();function v1(r){var t,e,i,n,s,o,a,l,u,c,h,p,f,y,g,d,m,_,S,E,b,F,x;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?x=(t={},t[ce.UNSIGNED_BYTE]=(e={},e[wt.RGBA]=r.RGBA8,e[wt.RGB]=r.RGB8,e[wt.RG]=r.RG8,e[wt.RED]=r.R8,e[wt.RGBA_INTEGER]=r.RGBA8UI,e[wt.RGB_INTEGER]=r.RGB8UI,e[wt.RG_INTEGER]=r.RG8UI,e[wt.RED_INTEGER]=r.R8UI,e[wt.ALPHA]=r.ALPHA,e[wt.LUMINANCE]=r.LUMINANCE,e[wt.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,e),t[ce.BYTE]=(i={},i[wt.RGBA]=r.RGBA8_SNORM,i[wt.RGB]=r.RGB8_SNORM,i[wt.RG]=r.RG8_SNORM,i[wt.RED]=r.R8_SNORM,i[wt.RGBA_INTEGER]=r.RGBA8I,i[wt.RGB_INTEGER]=r.RGB8I,i[wt.RG_INTEGER]=r.RG8I,i[wt.RED_INTEGER]=r.R8I,i),t[ce.UNSIGNED_SHORT]=(n={},n[wt.RGBA_INTEGER]=r.RGBA16UI,n[wt.RGB_INTEGER]=r.RGB16UI,n[wt.RG_INTEGER]=r.RG16UI,n[wt.RED_INTEGER]=r.R16UI,n[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),t[ce.SHORT]=(s={},s[wt.RGBA_INTEGER]=r.RGBA16I,s[wt.RGB_INTEGER]=r.RGB16I,s[wt.RG_INTEGER]=r.RG16I,s[wt.RED_INTEGER]=r.R16I,s),t[ce.UNSIGNED_INT]=(o={},o[wt.RGBA_INTEGER]=r.RGBA32UI,o[wt.RGB_INTEGER]=r.RGB32UI,o[wt.RG_INTEGER]=r.RG32UI,o[wt.RED_INTEGER]=r.R32UI,o[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,o),t[ce.INT]=(a={},a[wt.RGBA_INTEGER]=r.RGBA32I,a[wt.RGB_INTEGER]=r.RGB32I,a[wt.RG_INTEGER]=r.RG32I,a[wt.RED_INTEGER]=r.R32I,a),t[ce.FLOAT]=(l={},l[wt.RGBA]=r.RGBA32F,l[wt.RGB]=r.RGB32F,l[wt.RG]=r.RG32F,l[wt.RED]=r.R32F,l[wt.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,l),t[ce.HALF_FLOAT]=(u={},u[wt.RGBA]=r.RGBA16F,u[wt.RGB]=r.RGB16F,u[wt.RG]=r.RG16F,u[wt.RED]=r.R16F,u),t[ce.UNSIGNED_SHORT_5_6_5]=(c={},c[wt.RGB]=r.RGB565,c),t[ce.UNSIGNED_SHORT_4_4_4_4]=(h={},h[wt.RGBA]=r.RGBA4,h),t[ce.UNSIGNED_SHORT_5_5_5_1]=(p={},p[wt.RGBA]=r.RGB5_A1,p),t[ce.UNSIGNED_INT_2_10_10_10_REV]=(f={},f[wt.RGBA]=r.RGB10_A2,f[wt.RGBA_INTEGER]=r.RGB10_A2UI,f),t[ce.UNSIGNED_INT_10F_11F_11F_REV]=(y={},y[wt.RGB]=r.R11F_G11F_B10F,y),t[ce.UNSIGNED_INT_5_9_9_9_REV]=(g={},g[wt.RGB]=r.RGB9_E5,g),t[ce.UNSIGNED_INT_24_8]=(d={},d[wt.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,d),t[ce.FLOAT_32_UNSIGNED_INT_24_8_REV]=(m={},m[wt.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,m),t):x=(_={},_[ce.UNSIGNED_BYTE]=(S={},S[wt.RGBA]=r.RGBA,S[wt.RGB]=r.RGB,S[wt.ALPHA]=r.ALPHA,S[wt.LUMINANCE]=r.LUMINANCE,S[wt.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,S),_[ce.UNSIGNED_SHORT_5_6_5]=(E={},E[wt.RGB]=r.RGB,E),_[ce.UNSIGNED_SHORT_4_4_4_4]=(b={},b[wt.RGBA]=r.RGBA,b),_[ce.UNSIGNED_SHORT_5_5_5_1]=(F={},F[wt.RGBA]=r.RGBA,F),_),x}var Lu=function(){function r(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=ce.UNSIGNED_BYTE,this.internalFormat=wt.RGBA,this.samplerType=0}return r}(),_1=function(){function r(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ve,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=v1(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i=0;--o){var a=i[o];if(a){var l=a._glTextures[s];l.samplerType!==Za.FLOAT&&this.renderer.texture.unbind(a)}}},r.prototype.initTexture=function(t){var e=new Lu(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},r.prototype.initTextureType=function(t,e){var i,n;e.internalFormat=(n=(i=this.internalFormats[t.type])===null||i===void 0?void 0:i[t.format])!==null&&n!==void 0?n:t.format,this.webGLVersion===2&&t.type===ce.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},r.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e))e.samplerType!==Za.FLOAT&&(this.hasIntegerTextures=!0);else{var n=t.realWidth,s=t.realHeight,o=i.gl;(e.width!==n||e.height!==s||e.dirtyId<0)&&(e.width=n,e.height=s,o.texImage2D(t.target,0,e.internalFormat,n,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},r.prototype.destroyTexture=function(t,e){var i=this.gl;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(t);n!==-1&&Ba(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===wi.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Ja.CLAMP:e.wrapMode=t.wrapMode,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},r.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&t.mipmap!==wi.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===Tr.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===Tr.LINEAR){var s=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===Tr.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===Tr.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),Bu=new Ze,b1=function(r){Ie(t,r);function t(e,i){e===void 0&&(e=zo.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},It.RENDER_OPTIONS,i),n.options=i,n.type=e,n.screen=new Ue(0,0,i.width,i.height),n.view=i.view||It.ADAPTER.createCanvas(),n.resolution=i.resolution||It.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,i.transparent!==void 0&&(Kn("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return t.prototype.initPlugins=function(e){for(var i in e)this.plugins[i]=new e[i](this)},Object.defineProperty(t.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,i){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(i*this.resolution);var n=this.view.width/this.resolution,s=this.view.height/this.resolution;this.screen.width=n,this.screen.height=s,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=s+"px"),this.emit("resize",n,s)},t.prototype.generateTexture=function(e,i,n,s){i===void 0&&(i={}),typeof i=="number"&&(Kn("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var o=i.region,a=tS(i,["region"]);s=o||e.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var l=kh.create(fc({width:s.width,height:s.height},a));return Bu.tx=-s.x,Bu.ty=-s.y,this.render(e,{renderTexture:l,clear:!1,transform:Bu,skipUpdateTransform:!!e.parent}),l},t.prototype.destroy=function(e){for(var i in this.plugins)this.plugins[i].destroy(),this.plugins[i]=null;e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=zo.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=Wx(e),Gr(e,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(e){this._backgroundColorRgba[3]=e},enumerable:!1,configurable:!0}),t}(bn),w1=function(){function r(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),x1=function(){function r(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,s=t._glBuffers[n]||this.createGLBuffer(t);i.bindBuffer(t.type,s.buffer)},r.prototype.bindBufferBase=function(t,e){var i=this,n=i.gl,s=i.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var o=t._glBuffers[s]||this.createGLBuffer(t);this.boundBufferBases[e]=t,n.bindBufferBase(n.UNIFORM_BUFFER,e,o.buffer)}},r.prototype.bindBufferRange=function(t,e,i){var n=this,s=n.gl,o=n.CONTEXT_UID;i=i||0;var a=t._glBuffers[o]||this.createGLBuffer(t);s.bindBufferRange(s.UNIFORM_BUFFER,e||0,a.buffer,i*256,256)},r.prototype.update=function(t){var e=this,i=e.gl,n=e.CONTEXT_UID,s=t._glBuffers[n];if(t._updateID!==s.updateID)if(s.updateID=t._updateID,i.bindBuffer(t.type,s.buffer),s.byteLength>=t.data.byteLength)i.bufferSubData(t.type,0,t.data);else{var o=t.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;s.byteLength=t.data.byteLength,i.bufferData(t.type,t.data,o)}},r.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),i=0;i=Be.HIGH?this.multisample=Be.HIGH:i>=Be.MEDIUM?this.multisample=Be.MEDIUM:i>=Be.LOW?this.multisample=Be.LOW:this.multisample=Be.NONE},t.prototype.addSystem=function(e,i){var n=new e(this);if(this[i])throw new Error('Whoops! The name "'+i+'" is already in use');this[i]=n;for(var s in this.runners)this.runners[s].add(n);return this},t.prototype.render=function(e,i){var n,s,o,a;if(i&&(i instanceof kh?(Kn("6.0.0","Renderer#render arguments changed, use options instead."),n=i,s=arguments[2],o=arguments[3],a=arguments[4]):(n=i.renderTexture,s=i.clear,o=i.transform,a=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=o,!this.context.isLost){if(n||(this._lastObjectRendered=e),!a){var l=e.enableTempParent();e.updateTransform(),e.disableTempParent(l)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(s!==void 0?s:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},t.prototype.generateTexture=function(e,i,n,s){i===void 0&&(i={});var o=r.prototype.generateTexture.call(this,e,i,n,s);return this.framebuffer.blit(),o},t.prototype.resize=function(e,i){r.prototype.resize.call(this,e,i),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(e){this.runners.destroy.emit();for(var i in this.runners)this.runners[i].destroy();r.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(t.prototype,"extract",{get:function(){return Kn("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,i){Kn("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),sa.add({name:e,type:Wr.RendererPlugin,ref:i})},t.__plugins={},t}(b1);sa.handleByMap(Wr.RendererPlugin,Kg.__plugins);function S1(r){return Kg.create(r)}var T1=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,I1=T1,E1=function(){function r(){this.texArray=null,this.blend=0,this.type=jo.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),C1=function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},t.prototype.buildTexturesAndDrawCalls=function(){var e=this,i=e._bufferedTextures,n=e.MAX_TEXTURES,s=t._textureArrayPool,o=this.renderer.batch,a=this._tempBoundTextures,l=this.renderer.textureGC.count,u=++Ve._globalBatch,c=0,h=s[0],p=0;o.copyBoundTextures(a,n);for(var f=0;f=n&&(o.boundArray(h,a,u,n),this.buildDrawCalls(h,p,f),p=f,h=s[++c],++u),y._batchEnabled=u,y.touched=l,h.elements[h.count++]=y)}h.count>0&&(o.boundArray(h,a,u,n),this.buildDrawCalls(h,p,this._bufferSize),++c,++u);for(var f=0;f0&&(e+=` +else `),ithis.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?Ue.EMPTY:(t=t||new Ue(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},r.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},r.prototype.addPointMatrix=function(t,e){var i=t.a,n=t.b,s=t.c,o=t.d,a=t.tx,l=t.ty,u=i*e.x+s*e.y+a,c=n*e.x+o*e.y+l;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)},r.prototype.addQuad=function(t){var e=this.minX,i=this.minY,n=this.maxX,s=this.maxY,o=t[0],a=t[1];e=on?o:n,s=a>s?a:s,o=t[2],a=t[3],e=on?o:n,s=a>s?a:s,o=t[4],a=t[5],e=on?o:n,s=a>s?a:s,o=t[6],a=t[7],e=on?o:n,s=a>s?a:s,this.minX=e,this.minY=i,this.maxX=n,this.maxY=s},r.prototype.addFrame=function(t,e,i,n,s){this.addFrameMatrix(t.worldTransform,e,i,n,s)},r.prototype.addFrameMatrix=function(t,e,i,n,s){var o=t.a,a=t.b,l=t.c,u=t.d,c=t.tx,h=t.ty,p=this.minX,f=this.minY,y=this.maxX,g=this.maxY,d=o*e+l*i+c,m=a*e+u*i+h;p=dy?d:y,g=m>g?m:g,d=o*n+l*i+c,m=a*n+u*i+h,p=dy?d:y,g=m>g?m:g,d=o*e+l*s+c,m=a*e+u*s+h,p=dy?d:y,g=m>g?m:g,d=o*n+l*s+c,m=a*n+u*s+h,p=dy?d:y,g=m>g?m:g,this.minX=p,this.minY=f,this.maxX=y,this.maxY=g},r.prototype.addVertexData=function(t,e,i){for(var n=this.minX,s=this.minY,o=this.maxX,a=this.maxY,l=e;lo?u:o,a=c>a?c:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a},r.prototype.addVertices=function(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)},r.prototype.addVerticesMatrix=function(t,e,i,n,s,o){s===void 0&&(s=0),o===void 0&&(o=s);for(var a=t.a,l=t.b,u=t.c,c=t.d,h=t.tx,p=t.ty,f=this.minX,y=this.minY,g=this.maxX,d=this.maxY,m=i;mn?t.maxX:n,this.maxY=t.maxY>s?t.maxY:s},r.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,s=t.maxXu?s:u,this.maxY=o>c?o:c}},r.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},r.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,s=t.maxXu?s:u,this.maxY=o>c?o:c}},r.prototype.pad=function(t,e){t===void 0&&(t=0),e===void 0&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},r.prototype.addFramePad=function(t,e,i,n,s,o){t-=s,e-=o,i+=s,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n},r}();/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var pc=function(r,t){return pc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},pc(r,t)};function $h(r,t){pc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Go=function(r){$h(t,r);function t(){var e=r.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new Bg,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new $d,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return t.mixin=function(e){for(var i=Object.keys(e),n=0;n1)for(var s=0;sthis.children.length)throw new Error(e+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(i,0,e),this._boundsID++,this.onChildrenChange(i),e.emit("added",this),this.emit("childAdded",e,this,i),e},t.prototype.swapChildren=function(e,i){if(e!==i){var n=this.getChildIndex(e),s=this.getChildIndex(i);this.children[n]=i,this.children[s]=e,this.onChildrenChange(n=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);Ba(this.children,n,1),this.children.splice(i,0,e),this.onChildrenChange(i)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,i=[],n=0;n1)for(var s=0;s0&&o<=s){a=this.children.splice(n,o);for(var l=0;l1&&this.children.sort(R1),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,i=this.children.length;e0&&i.height>0){var n,s;if(this.cullArea?(n=this.cullArea,s=this.worldTransform):this._render!==t.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,s))this._render(e);else if(this.cullArea)return;for(var o=0,a=this.children.length;onew Promise((i,n)=>{var s=l=>{try{a(e.next(l))}catch(u){n(u)}},o=l=>{try{a(e.throw(l))}catch(u){n(u)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);a((e=e.apply(r,t)).next())});class Vh{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new Vh}setParameters(t){this._breathParameters=t}getParameters(){return this._breathParameters}updateParameters(t,e){this._currentTime+=e;const i=this._currentTime*2*3.14159;for(let n=0;n=1&&(i=1,this._blinkingState=Rr.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),e=1-i;break;case Rr.EyeState_Closed:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,i>=1&&(this._blinkingState=Rr.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),e=0;break;case Rr.EyeState_Opening:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,i>=1&&(i=1,this._blinkingState=Rr.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),e=i;break;case Rr.EyeState_Interval:this._nextBlinkingTime(r[r.EyeState_First=0]="EyeState_First",r[r.EyeState_Interval=1]="EyeState_Interval",r[r.EyeState_Closing=2]="EyeState_Closing",r[r.EyeState_Closed=3]="EyeState_Closed",r[r.EyeState_Opening=4]="EyeState_Opening",r))(Rr||{});const B1=.001,Vd=.5;class Gh{static create(t){const e=new Gh;typeof t.FadeInTime=="number"&&(e._fadeTimeSeconds=t.FadeInTime,e._fadeTimeSeconds<=0&&(e._fadeTimeSeconds=Vd));const i=t.Groups,n=i.length;for(let s=0;sB1){if(s>=0)break;s=u,o=t.getPartOpacityByIndex(c),o+=e/this._fadeTimeSeconds,o>1&&(o=1)}}s<0&&(s=0,o=1);for(let u=i;ul&&(p=1-l/(1-o)),h>p&&(h=p),t.setPartOpacityByIndex(c,h)}}}constructor(){this._fadeTimeSeconds=Vd,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}}class il{constructor(t){this.parameterIndex=0,this.partIndex=0,this.partId="",this.link=[],t!=null&&this.assignment(t)}assignment(t){return this.partId=t.partId,this.link=t.link.map(e=>e.clone()),this}initialize(t){this.parameterIndex=t.getParameterIndex(this.partId),this.partIndex=t.getPartIndex(this.partId),t.setParameterValueByIndex(this.parameterIndex,1)}clone(){const t=new il;return t.partId=this.partId,t.parameterIndex=this.parameterIndex,t.partIndex=this.partIndex,t.link=this.link.map(e=>e.clone()),t}}class te{constructor(t,e){this.x=t||0,this.y=e||0}add(t){const e=new te(0,0);return e.x=this.x+t.x,e.y=this.y+t.y,e}substract(t){const e=new te(0,0);return e.x=this.x-t.x,e.y=this.y-t.y,e}multiply(t){const e=new te(0,0);return e.x=this.x*t.x,e.y=this.y*t.y,e}multiplyByScaler(t){return this.multiply(new te(t,t))}division(t){const e=new te(0,0);return e.x=this.x/t.x,e.y=this.y/t.y,e}divisionByScalar(t){return this.division(new te(t,t))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))}dot(t){return this.x*t.x+this.y*t.y}normalize(){const t=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/t,this.y=this.y/t}isEqual(t){return this.x==t.x&&this.y==t.y}isNotEqual(t){return!this.isEqual(t)}}const ka=class{static range(r,t,e){return re&&(r=e),r}static sin(r){return Math.sin(r)}static cos(r){return Math.cos(r)}static abs(r){return Math.abs(r)}static sqrt(r){return Math.sqrt(r)}static cbrt(r){if(r===0)return r;let t=r;const e=t<0;e&&(t=-t);let i;return t===1/0?i=1/0:(i=Math.exp(Math.log(t)/3),i=(t/(i*i)+2*i)/3),e?-i:i}static getEasingSine(r){return r<0?0:r>1?1:.5-.5*this.cos(r*Math.PI)}static max(r,t){return r>t?r:t}static min(r,t){return r>t?t:r}static degreesToRadian(r){return r/180*Math.PI}static radianToDegrees(r){return r*180/Math.PI}static directionToRadian(r,t){const e=Math.atan2(t.y,t.x),i=Math.atan2(r.y,r.x);let n=e-i;for(;n<-Math.PI;)n+=Math.PI*2;for(;n>Math.PI;)n-=Math.PI*2;return n}static directionToDegrees(r,t){const e=this.directionToRadian(r,t);let i=this.radianToDegrees(e);return t.x-r.x>0&&(i=-i),i}static radianToDirection(r){const t=new te;return t.x=this.sin(r),t.y=this.cos(r),t}static quadraticEquation(r,t,e){return this.abs(r)1&&(t=1),e<0?e=0:e>1&&(e=1),i<0?i=0:i>1&&(i=1),n<0?n=0:n>1&&(n=1),this._modelColor.R=t,this._modelColor.G=e,this._modelColor.B=i,this._modelColor.A=n}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(t){this._isPremultipliedAlpha=t}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(t){this._isCulling=t}isCulling(){return this._isCulling}setAnisotropy(t){this._anisortopy=t}getAnisotropy(){return this._anisortopy}getModel(){return this._model}constructor(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._modelColor=new bo,this._mvpMatrix4x4=new $r,this._mvpMatrix4x4.loadIdentity()}}var cn=(r=>(r[r.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",r[r.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",r[r.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative",r))(cn||{});class bo{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}}let oi=!1,ms=!1,ys;const ku={vertexOffset:0,vertexStep:2};class Wo{static startUp(t){if(oi)return mo("CubismFramework.startUp() is already done."),oi;if(Live2DCubismCore._isStarted)return oi=!0,!0;if(Live2DCubismCore._isStarted=!0,ys=t,ys&&Live2DCubismCore.Logging.csmSetLogFunction(ys.logFunction),oi=!0,oi){const e=Live2DCubismCore.Version.csmGetVersion(),i=(e&4278190080)>>24,n=(e&16711680)>>16,s=e&65535,o=e;mo("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+i).slice(-2),("00"+n).slice(-2),("0000"+s).slice(-4),o)}return mo("CubismFramework.startUp() is complete."),oi}static cleanUp(){oi=!1,ms=!1,ys=void 0}static initialize(){if(!oi){wo("CubismFramework is not started.");return}if(ms){wo("CubismFramework.initialize() skipped, already initialized.");return}ms=!0,mo("CubismFramework.initialize() is complete.")}static dispose(){if(!oi){wo("CubismFramework is not started.");return}if(!ms){wo("CubismFramework.dispose() skipped, not initialized.");return}Wh.staticRelease(),ms=!1,mo("CubismFramework.dispose() is complete.")}static isStarted(){return oi}static isInitialized(){return ms}static coreLogFunction(t){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(t)}static getLoggingLevel(){return ys!=null?ys.loggingLevel:ls.LogLevel_Off}constructor(){}}var ls=(r=>(r[r.LogLevel_Verbose=0]="LogLevel_Verbose",r[r.LogLevel_Debug=1]="LogLevel_Debug",r[r.LogLevel_Info=2]="LogLevel_Info",r[r.LogLevel_Warning=3]="LogLevel_Warning",r[r.LogLevel_Error=4]="LogLevel_Error",r[r.LogLevel_Off=5]="LogLevel_Off",r))(ls||{});const Fa=()=>{};function Gd(r,...t){Kl.print(ls.LogLevel_Debug,"[CSM][D]"+r+` +`,t)}function mo(r,...t){Kl.print(ls.LogLevel_Info,"[CSM][I]"+r+` +`,t)}function wo(r,...t){Kl.print(ls.LogLevel_Warning,"[CSM][W]"+r+` +`,t)}function bs(r,...t){Kl.print(ls.LogLevel_Error,"[CSM][E]"+r+` +`,t)}class Kl{static print(t,e,i){if(ti[a]);n(s)}static dumpBytes(t,e,i){for(let n=0;n0?this.print(t,` +`):n%8==0&&n>0&&this.print(t," "),this.print(t,"{0} ",[e[n]&255]);this.print(t,` +`)}constructor(){}}class k1{update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return this._model==null?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return this._model==null?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){const t=this._model.parameters.count,e=this._savedParameters.length;for(let i=0;ie&&(e=this._model.parameters.minimumValues[t]),this._parameterValues[t]=i==1?e:this._parameterValues[t]=this._parameterValues[t]*(1-i)+e*i}setParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.setParameterValueByIndex(n,e,i)}addParameterValueByIndex(t,e,i=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)+e*i)}addParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.addParameterValueByIndex(n,e,i)}multiplyParameterValueById(t,e,i=1){const n=this.getParameterIndex(t);this.multiplyParameterValueByIndex(n,e,i)}multiplyParameterValueByIndex(t,e,i=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)*(1+(e-1)*i))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(t){const e=this._model.drawables.count;for(let i=0;ie&&(t=e);for(let i=0;i0&&e.getEndTime()(r[r.ExpressionBlendType_Add=0]="ExpressionBlendType_Add",r[r.ExpressionBlendType_Multiply=1]="ExpressionBlendType_Multiply",r[r.ExpressionBlendType_Overwrite=2]="ExpressionBlendType_Overwrite",r))(Bn||{}),Ho;(r=>{r.supportMoreMaskDivisions=!0,r.setOpacityFromMotion=!1})(Ho||(Ho={}));var kn=(r=>(r[r.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",r[r.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",r[r.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity",r))(kn||{}),li=(r=>(r[r.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",r[r.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",r[r.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",r[r.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped",r))(li||{});class nn{constructor(t=0,e=0){this.time=t,this.value=e}}class U1{constructor(){this.basePointIndex=0,this.segmentType=0}}class z1{constructor(){this.id="",this.type=0,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0}}class j1{constructor(){this.fireTime=0,this.value=""}}class $1{constructor(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=[],this.segments=[],this.points=[],this.events=[]}}class ev{constructor(t){this._json=t}release(){this._json=void 0}getMotionDuration(){return this._json.Meta.Duration}isMotionLoop(){return this._json.Meta.Loop||!1}getEvaluationOptionFlag(t){return Yh.EvaluationOptionFlag_AreBeziersRistricted==t?!!this._json.Meta.AreBeziersRestricted:!1}getMotionCurveCount(){return this._json.Meta.CurveCount}getMotionFps(){return this._json.Meta.Fps}getMotionTotalSegmentCount(){return this._json.Meta.TotalSegmentCount}getMotionTotalPointCount(){return this._json.Meta.TotalPointCount}getMotionFadeInTime(){return this._json.Meta.FadeInTime}getMotionFadeOutTime(){return this._json.Meta.FadeOutTime}getMotionCurveTarget(t){return this._json.Curves[t].Target}getMotionCurveId(t){return this._json.Curves[t].Id}getMotionCurveFadeInTime(t){return this._json.Curves[t].FadeInTime}getMotionCurveFadeOutTime(t){return this._json.Curves[t].FadeOutTime}getMotionCurveSegmentCount(t){return this._json.Curves[t].Segments.length}getMotionCurveSegment(t,e){return this._json.Curves[t].Segments[e]}getEventCount(){return this._json.Meta.UserDataCount||0}getTotalEventValueSize(){return this._json.Meta.TotalUserDataSize}getEventTime(t){return this._json.UserData[t].Time}getEventValue(t){return this._json.UserData[t].Value}}var Yh=(r=>(r[r.EvaluationOptionFlag_AreBeziersRistricted=0]="EvaluationOptionFlag_AreBeziersRistricted",r))(Yh||{});const V1="EyeBlink",G1="LipSync",W1="Model",H1="Parameter",X1="PartOpacity",Y1=!1;function Ur(r,t,e){const i=new nn;return i.time=r.time+(t.time-r.time)*e,i.value=r.value+(t.value-r.value)*e,i}function q1(r,t){let e=(t-r[0].time)/(r[1].time-r[0].time);return e<0&&(e=0),r[0].value+(r[1].value-r[0].value)*e}function Q1(r,t){let e=(t-r[0].time)/(r[3].time-r[0].time);e<0&&(e=0);const i=Ur(r[0],r[1],e),n=Ur(r[1],r[2],e),s=Ur(r[2],r[3],e),o=Ur(i,n,e),a=Ur(n,s,e);return Ur(o,a,e).value}function K1(r,t){const e=t,i=r[0].time,n=r[3].time,s=r[1].time,o=r[2].time,a=n-3*o+3*s-i,l=3*o-6*s+3*i,u=3*s-3*i,c=i-e,h=Te.cardanoAlgorithmForBezier(a,l,u,c),p=Ur(r[0],r[1],h),f=Ur(r[1],r[2],h),y=Ur(r[2],r[3],h),g=Ur(p,f,h),d=Ur(f,y,h);return Ur(g,d,h).value}function Z1(r,t){return r[0].value}function J1(r,t){return r[1].value}function Uu(r,t,e){const i=r.curves[t];let n=-1;const s=i.baseSegmentIndex+i.segmentCount;let o=0;for(let l=i.baseSegmentIndex;le){n=l;break}if(n==-1)return r.points[o].value;const a=r.segments[n];return a.evaluate(r.points.slice(a.basePointIndex),e)}class qh extends tv{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(t,e){const i=new qh;return i.parse(t),i._sourceFrameRate=i._motionData.fps,i._loopDurationSeconds=i._motionData.duration,i._onFinishedMotion=e,i}doUpdateParameters(t,e,i,n){this._modelCurveIdEyeBlink==null&&(this._modelCurveIdEyeBlink=V1),this._modelCurveIdLipSync==null&&(this._modelCurveIdLipSync=G1);let s=e-n.getStartTime();s<0&&(s=0);let o=Number.MAX_VALUE,a=Number.MAX_VALUE;const l=64;let u=0,c=0;this._eyeBlinkParameterIds.length>l&&Gd("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>l&&Gd("too many lip sync targets : {0}",this._lipSyncParameterIds.length);const h=this._fadeInSeconds<=0?1:Te.getEasingSine((e-n.getFadeInStartTime())/this._fadeInSeconds),p=this._fadeOutSeconds<=0||n.getEndTime()<0?1:Te.getEasingSine((n.getEndTime()-e)/this._fadeOutSeconds);let f,y,g,d=s;if(this._isLoop)for(;d>this._motionData.duration;)d-=this._motionData.duration;const m=this._motionData.curves;for(y=0;y>_&1)continue;const E=S+(a-S)*i;t.setParameterValueById(this._eyeBlinkParameterIds[_],E)}if(o!=Number.MAX_VALUE)for(let _=0;_>_&1)continue;const E=S+(o-S)*i;t.setParameterValueById(this._lipSyncParameterIds[_],E)}}for(;y=this._motionData.duration&&(this._isLoop?(n.setStartTime(e),this._isLoopFadeIn&&n.setFadeInStartTime(e)):(this._onFinishedMotion&&this._onFinishedMotion(this),n.setIsFinished(!0))),this._lastWeight=i}setIsLoop(t){this._isLoop=t}isLoop(){return this._isLoop}setIsLoopFadeIn(t){this._isLoopFadeIn=t}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(t,e){const i=this._motionData.curves;for(let n=0;nnew z1),this._motionData.segments=Array.from({length:e.getMotionTotalSegmentCount()}).map(()=>new U1),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new j1),this._motionData.points=[];let o=0,a=0;for(let l=0;lt&&this._motionData.events[i].fireTime<=e&&this._firedEventValues.push(this._motionData.events[i].value);return this._firedEventValues}}class tT{constructor(){this._autoDelete=!1,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this,this._fadeOutSeconds=0,this._isTriggeredFadeOut=!1}release(){this._autoDelete&&this._motion&&this._motion.release()}setFadeOut(t){this._fadeOutSeconds=t,this._isTriggeredFadeOut=!0}startFadeOut(t,e){const i=e+t;this._isTriggeredFadeOut=!0,(this._endTimeSeconds<0||ie!=null&&e._motionQueueEntryHandle==t)}setEventCallback(t,e=null){this._eventCallBack=t,this._eventCustomData=e}doUpdateMotion(t,e){let i=!1,n=0;for(;n(r[r.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter",r))(yc||{}),Un=(r=>(r[r.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",r[r.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",r[r.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle",r))(Un||{});class rT{constructor(){this.initialPosition=new te(0,0),this.position=new te(0,0),this.lastPosition=new te(0,0),this.lastGravity=new te(0,0),this.force=new te(0,0),this.velocity=new te(0,0)}}class iT{constructor(){this.normalizationPosition={},this.normalizationAngle={}}}class nT{constructor(){this.source={}}}class sT{constructor(){this.destination={},this.translationScale=new te(0,0)}}class oT{constructor(){this.settings=[],this.inputs=[],this.outputs=[],this.particles=[],this.gravity=new te(0,0),this.wind=new te(0,0)}}class aT{constructor(t){this._json=t}release(){this._json=void 0}getGravity(){const t=new te(0,0);return t.x=this._json.Meta.EffectiveForces.Gravity.X,t.y=this._json.Meta.EffectiveForces.Gravity.Y,t}getWind(){const t=new te(0,0);return t.x=this._json.Meta.EffectiveForces.Wind.X,t.y=this._json.Meta.EffectiveForces.Wind.Y,t}getSubRigCount(){return this._json.Meta.PhysicsSettingCount}getTotalInputCount(){return this._json.Meta.TotalInputCount}getTotalOutputCount(){return this._json.Meta.TotalOutputCount}getVertexCount(){return this._json.Meta.VertexCount}getNormalizationPositionMinimumValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Minimum}getNormalizationPositionMaximumValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Maximum}getNormalizationPositionDefaultValue(t){return this._json.PhysicsSettings[t].Normalization.Position.Default}getNormalizationAngleMinimumValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Minimum}getNormalizationAngleMaximumValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Maximum}getNormalizationAngleDefaultValue(t){return this._json.PhysicsSettings[t].Normalization.Angle.Default}getInputCount(t){return this._json.PhysicsSettings[t].Input.length}getInputWeight(t,e){return this._json.PhysicsSettings[t].Input[e].Weight}getInputReflect(t,e){return this._json.PhysicsSettings[t].Input[e].Reflect}getInputType(t,e){return this._json.PhysicsSettings[t].Input[e].Type}getInputSourceId(t,e){return this._json.PhysicsSettings[t].Input[e].Source.Id}getOutputCount(t){return this._json.PhysicsSettings[t].Output.length}getOutputVertexIndex(t,e){return this._json.PhysicsSettings[t].Output[e].VertexIndex}getOutputAngleScale(t,e){return this._json.PhysicsSettings[t].Output[e].Scale}getOutputWeight(t,e){return this._json.PhysicsSettings[t].Output[e].Weight}getOutputDestinationId(t,e){return this._json.PhysicsSettings[t].Output[e].Destination.Id}getOutputType(t,e){return this._json.PhysicsSettings[t].Output[e].Type}getOutputReflect(t,e){return this._json.PhysicsSettings[t].Output[e].Reflect}getParticleCount(t){return this._json.PhysicsSettings[t].Vertices.length}getParticleMobility(t,e){return this._json.PhysicsSettings[t].Vertices[e].Mobility}getParticleDelay(t,e){return this._json.PhysicsSettings[t].Vertices[e].Delay}getParticleAcceleration(t,e){return this._json.PhysicsSettings[t].Vertices[e].Acceleration}getParticleRadius(t,e){return this._json.PhysicsSettings[t].Vertices[e].Radius}getParticlePosition(t,e){const i=new te(0,0);return i.x=this._json.PhysicsSettings[t].Vertices[e].Position.X,i.y=this._json.PhysicsSettings[t].Vertices[e].Position.Y,i}}const Hd="X",Xd="Y",Yd="Angle",lT=5,iv=100,uT=.001;class Qh{static create(t){const e=new Qh;return e.parse(t),e._physicsRig.gravity.y=0,e}evaluate(t,e){let i,n,s,o;const a=new te;let l,u,c,h,p,f,y,g;p=t.getModel().parameters.values,f=t.getModel().parameters.maximumValues,y=t.getModel().parameters.minimumValues,g=t.getModel().parameters.defaultValues;for(let d=0;d=l.particleCount)break;c[m].destinationParameterIndex==-1&&(c[m].destinationParameterIndex=t.getParameterIndex(c[m].destination.id));const S=new te;S.x=h[_].position.x-h[_-1].position.x,S.y=h[_].position.y-h[_-1].position.y,o=c[m].getValue(S,h,_,c[m].reflect,this._options.gravity);const E=c[m].destinationParameterIndex,b=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(p.subarray(E))):p.slice(E);ST(b,y[E],f[E],o,c[m]);for(let F=E,x=0;F=2?n=t[e-1].position.substract(t[e-2].position):n=n.multiplyByScaler(-1),s=Te.directionToRadian(n,r),i&&(s*=-1),s}function gT(r,t){return Math.abs(Math.max(r,t)-Math.min(r,t))}function vT(r,t){return Math.min(r,t)+gT(r,t)/2}function _T(r,t){return r.x}function bT(r,t){return r.y}function wT(r,t){return t}function xT(r,t,e,i,n,s,o,a){let l,u,c,h,p=new te(0,0),f=new te(0,0),y=new te(0,0),g=new te(0,0);r[0].position=new te(e.x,e.y),l=Te.degreesToRadian(i),h=Te.radianToDirection(l),h.normalize();for(let d=1;de&&(o>n.valueExceededMaximum&&(n.valueExceededMaximum=o),o=e),a=n.weight/iv,a>=1||(o=r[0]*(1-a)+o*a),r[0]=o}function Kh(r,t,e,i,n,s,o,a){let l=0;const u=Te.max(e,t);ur&&(r=c);const h=Te.min(n,s),p=Te.max(n,s),f=o,y=vT(c,u),g=r-y;switch(Math.sign(g)){case 1:{const d=p-f,m=u-y;m!=0&&(l=g*(d/m),l+=f);break}case-1:{const d=h-f,m=c-y;m!=0&&(l=g*(d/m),l+=f);break}case 0:{l=f;break}}return a?l:l*-1}class gc{constructor(t=0,e=0,i=0,n=0){this.x=t,this.y=e,this.width=i,this.height=n}getCenterX(){return this.x+.5*this.width}getCenterY(){return this.y+.5*this.height}getRight(){return this.x+this.width}getBottom(){return this.y+this.height}setRect(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height}expand(t,e){this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2}}const zu=4,TT=10;let Pn,xo,vc;class ju{getChannelFlagAsColor(t){return this._channelColors[t]}getMaskRenderTexture(){let t=0;if(this._maskTexture&&this._maskTexture.texture!=0&&(this._maskTexture.frameNo=this._currentFrameNo,t=this._maskTexture.texture),t==0){const e=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),t=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,vc),this._maskTexture=new IT(this._currentFrameNo,t)}return t}setGL(t){this.gl=t}calcClippedDrawTotalBounds(t,e){let i=Number.MAX_VALUE,n=Number.MAX_VALUE,s=Number.MIN_VALUE,o=Number.MIN_VALUE;const a=e._clippedDrawableIndexList.length;for(let l=0;ly&&(y=_),Sg&&(g=S)}if(p!=Number.MAX_VALUE)if(ps&&(s=y),g>o&&(o=g),i==Number.MAX_VALUE)e._allClippedDrawRect.x=0,e._allClippedDrawRect.y=0,e._allClippedDrawRect.width=0,e._allClippedDrawRect.height=0,e._isUsing=!1;else{e._isUsing=!0;const m=s-i,_=o-n;e._allClippedDrawRect.x=i,e._allClippedDrawRect.y=n,e._allClippedDrawRect.width=m,e._allClippedDrawRect.height=_}}}constructor(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=[],this._clippingContextListForDraw=[],this._channelColors=[],this._tmpBoundsOnModel=new gc,this._tmpMatrix=new $r,this._tmpMatrixForMask=new $r,this._tmpMatrixForDraw=new $r;let t=new bo;t.R=1,t.G=0,t.B=0,t.A=0,this._channelColors.push(t),t=new bo,t.R=0,t.G=1,t.B=0,t.A=0,this._channelColors.push(t),t=new bo,t.R=0,t.G=0,t.B=1,t.A=0,this._channelColors.push(t),t=new bo,t.R=0,t.G=0,t.B=0,t.A=1,this._channelColors.push(t)}release(){var t,e,i;const n=this;for(let s=0;s0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture(),e.getMvpMatrix(),e.preDraw(),this.setupLayoutBounds(i),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let n=0;n(r[r.ShaderNames_SetupMask=0]="ShaderNames_SetupMask",r[r.ShaderNames_NormalPremultipliedAlpha=1]="ShaderNames_NormalPremultipliedAlpha",r[r.ShaderNames_NormalMaskedPremultipliedAlpha=2]="ShaderNames_NormalMaskedPremultipliedAlpha",r[r.ShaderNames_NomralMaskedInvertedPremultipliedAlpha=3]="ShaderNames_NomralMaskedInvertedPremultipliedAlpha",r[r.ShaderNames_AddPremultipliedAlpha=4]="ShaderNames_AddPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlpha=5]="ShaderNames_AddMaskedPremultipliedAlpha",r[r.ShaderNames_AddMaskedPremultipliedAlphaInverted=6]="ShaderNames_AddMaskedPremultipliedAlphaInverted",r[r.ShaderNames_MultPremultipliedAlpha=7]="ShaderNames_MultPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlpha=8]="ShaderNames_MultMaskedPremultipliedAlpha",r[r.ShaderNames_MultMaskedPremultipliedAlphaInverted=9]="ShaderNames_MultMaskedPremultipliedAlphaInverted",r))(So||{});const CT="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_myPos;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_clipMatrix * a_position; v_myPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",AT="precision mediump float;varying vec2 v_texCoord;varying vec4 v_myPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;void main(){ float isInside = step(u_baseColor.x, v_myPos.x/v_myPos.w) * step(u_baseColor.y, v_myPos.y/v_myPos.w) * step(v_myPos.x/v_myPos.w, u_baseColor.z) * step(v_myPos.y/v_myPos.w, u_baseColor.w); gl_FragColor = u_channelFlag * texture2D(s_texture0, v_texCoord).a * isInside;}",OT="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;uniform mat4 u_matrix;void main(){ gl_Position = u_matrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",qd="attribute vec4 a_position;attribute vec2 a_texCoord;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform mat4 u_matrix;uniform mat4 u_clipMatrix;void main(){ gl_Position = u_matrix * a_position; v_clipPos = u_clipMatrix * a_position; v_texCoord = a_texCoord; v_texCoord.y = 1.0 - v_texCoord.y;}",FT="precision mediump float;varying vec2 v_texCoord;uniform vec4 u_baseColor;uniform sampler2D s_texture0;void main(){ gl_FragColor = texture2D(s_texture0 , v_texCoord) * u_baseColor;}",PT="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform vec4 u_baseColor;uniform vec4 u_channelFlag;uniform sampler2D s_texture0;uniform sampler2D s_texture1;void main(){ vec4 col_formask = texture2D(s_texture0 , v_texCoord) * u_baseColor; vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag; float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a; col_formask = col_formask * maskVal; gl_FragColor = col_formask;}",MT="precision mediump float;varying vec2 v_texCoord;varying vec4 v_clipPos;uniform sampler2D s_texture0;uniform sampler2D s_texture1;uniform vec4 u_channelFlag;uniform vec4 u_baseColor;void main(){vec4 col_formask = texture2D(s_texture0, v_texCoord) * u_baseColor;vec4 clipMask = (1.0 - texture2D(s_texture1, v_clipPos.xy / v_clipPos.w)) * u_channelFlag;float maskVal = clipMask.r + clipMask.g + clipMask.b + clipMask.a;col_formask = col_formask * (1.0 - maskVal);gl_FragColor = col_formask;}";class nv extends Wh{constructor(){super(),this._clippingContextBufferForMask=null,this._clippingContextBufferForDraw=null,this._clippingManager=new ju,this.firstDraw=!0,this._textures={},this._sortedDrawableIndexList=[],this._bufferData={vertex:null,uv:null,index:null}}initialize(t){t.isUsingMasking()&&(this._clippingManager=new ju,this._clippingManager.initialize(t,t.getDrawableCount(),t.getDrawableMasks(),t.getDrawableMaskCounts()));for(let e=t.getDrawableCount()-1;e>=0;e--)this._sortedDrawableIndexList[e]=0;super.initialize(t)}bindTexture(t,e){this._textures[t]=e}getBindedTextures(){return this._textures}setClippingMaskBufferSize(t){this._clippingManager.release(),this._clippingManager=new ju,this._clippingManager.setClippingMaskBufferSize(t),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var t,e,i;const n=this;this._clippingManager.release(),n._clippingManager=void 0,(t=this.gl)==null||t.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,(e=this.gl)==null||e.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,(i=this.gl)==null||i.deleteBuffer(this._bufferData.index),this._bufferData.index=null,n._bufferData=void 0,n._textures=void 0}doDrawModel(){this.preDraw(),this._clippingManager!=null&&this._clippingManager.setupClippingContext(this.getModel(),this);const t=this.getModel().getDrawableCount(),e=this.getModel().getDrawableRenderOrders();for(let i=0;i{nv.doStaticRelease()};class sv{constructor(t){this.groups=t.Groups,this.hitAreas=t.HitAreas,this.layout=t.Layout,this.moc=t.FileReferences.Moc,this.expressions=t.FileReferences.Expressions,this.motions=t.FileReferences.Motions,this.textures=t.FileReferences.Textures,this.physics=t.FileReferences.Physics,this.pose=t.FileReferences.Pose}getEyeBlinkParameters(){var t,e;return(e=(t=this.groups)==null?void 0:t.find(i=>i.Name==="EyeBlink"))==null?void 0:e.Ids}getLipSyncParameters(){var t,e;return(e=(t=this.groups)==null?void 0:t.find(i=>i.Name==="LipSync"))==null?void 0:e.Ids}}const DT="ParamAngleX",RT="ParamAngleY",NT="ParamAngleZ",LT="ParamEyeBallX",BT="ParamEyeBallY",kT="ParamBodyAngleX",UT="ParamBreath",Qd=2,Kd=2;var wr;(r=>{r.LOG_LEVEL_VERBOSE=0,r.LOG_LEVEL_WARNING=1,r.LOG_LEVEL_ERROR=2,r.LOG_LEVEL_NONE=999,r.logLevel=r.LOG_LEVEL_WARNING,r.sound=!0,r.motionSync=!0,r.motionFadingDuration=500,r.idleMotionFadingDuration=2e3,r.expressionFadingDuration=500,r.preserveExpressionOnMotion=!0,r.cubism4=Ho})(wr||(wr={}));const be={log(r,...t){wr.logLevel<=wr.LOG_LEVEL_VERBOSE&&console.log(`[${r}]`,...t)},warn(r,...t){wr.logLevel<=wr.LOG_LEVEL_WARNING&&console.warn(`[${r}]`,...t)},error(r,...t){wr.logLevel<=wr.LOG_LEVEL_ERROR&&console.error(`[${r}]`,...t)}};function Zd(r,t,e){return re?e:r}function ov(r,t){t.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i))})})}function zT(r){let t=r.lastIndexOf("/");return t!=-1&&(r=r.slice(0,t)),t=r.lastIndexOf("/"),t!==-1&&(r=r.slice(t+1)),r}function jT(r,t){const e=r.indexOf(t);e!==-1&&r.splice(e,1)}class av extends bn{constructor(t,e){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=t,this.tag=`ExpressionManager(${t.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(t){return Fe(this,null,function*(){if(!this.definitions[t]){be.warn(this.tag,`Undefined expression at [${t}]`);return}if(this.expressions[t]===null){be.warn(this.tag,`Cannot set expression at [${t}] because it's already failed in loading.`);return}if(this.expressions[t])return this.expressions[t];const e=yield this._loadExpression(t);return this.expressions[t]=e,e})}_loadExpression(t){throw new Error("Not implemented.")}setRandomExpression(){return Fe(this,null,function*(){if(this.definitions.length){const t=[];for(let e=0;e-1&&tu&&(o*=u/l,a*=u/l),this.vx+=o,this.vy+=a;const c=Math.sqrt(Fn(this.vx,2)+Fn(this.vy,2)),h=.5*(Math.sqrt(Fn(u,2)+8*u*n)-u);c>h&&(this.vx*=h/c,this.vy*=h/c),this.x+=this.vx,this.y+=this.vy}}class Zh{constructor(t){this.json=t;let e=t.url;if(typeof e!="string")throw new TypeError("The `url` field in settings JSON must be defined as a string.");this.url=e,this.name=zT(this.url)}resolveURL(t){return Ql.resolve(this.url,t)}replaceFiles(t){this.moc=t(this.moc,"moc"),this.pose!==void 0&&(this.pose=t(this.pose,"pose")),this.physics!==void 0&&(this.physics=t(this.physics,"physics"));for(let e=0;e(t.push(e),e)),t}validateFiles(t){const e=(s,o)=>{const a=this.resolveURL(s);if(!t.includes(a)){if(o)throw new Error(`File "${s}" is defined in settings, but doesn't exist in given files`);return!1}return!0};return[this.moc,...this.textures].forEach(s=>e(s,!0)),this.getDefinedFiles().filter(s=>e(s,!1))}}var _c=(r=>(r[r.NONE=0]="NONE",r[r.IDLE=1]="IDLE",r[r.NORMAL=2]="NORMAL",r[r.FORCE=3]="FORCE",r))(_c||{});class WT{constructor(){this.debug=!1,this.currentPriority=0,this.reservePriority=0}reserve(t,e,i){if(i<=0)return be.log(this.tag,"Cannot start a motion with MotionPriority.NONE."),!1;if(t===this.currentGroup&&e===this.currentIndex)return be.log(this.tag,"Motion is already playing.",this.dump(t,e)),!1;if(t===this.reservedGroup&&e===this.reservedIndex||t===this.reservedIdleGroup&&e===this.reservedIdleIndex)return be.log(this.tag,"Motion is already reserved.",this.dump(t,e)),!1;if(i===1){if(this.currentPriority!==0)return be.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(t,e)),!1;if(this.reservedIdleGroup!==void 0)return be.log(this.tag,"Cannot start idle motion because another idle motion has reserved.",this.dump(t,e)),!1;this.setReservedIdle(t,e)}else{if(i<3){if(i<=this.currentPriority)return be.log(this.tag,"Cannot start motion because another motion is playing as an equivalent or higher priority.",this.dump(t,e)),!1;if(i<=this.reservePriority)return be.log(this.tag,"Cannot start motion because another motion has reserved as an equivalent or higher priority.",this.dump(t,e)),!1}this.setReserved(t,e,i)}return!0}start(t,e,i,n){if(n===1){if(this.setReservedIdle(void 0,void 0),this.currentPriority!==0)return be.log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(e,i)),!1}else{if(e!==this.reservedGroup||i!==this.reservedIndex)return be.log(this.tag,"Cannot start motion because another motion has taken the place.",this.dump(e,i)),!1;this.setReserved(void 0,void 0,0)}return t?(this.setCurrent(e,i,n),!0):!1}complete(){this.setCurrent(void 0,void 0,0)}setCurrent(t,e,i){this.currentPriority=i,this.currentGroup=t,this.currentIndex=e}setReserved(t,e,i){this.reservePriority=i,this.reservedGroup=t,this.reservedIndex=e}setReservedIdle(t,e){this.reservedIdleGroup=t,this.reservedIdleIndex=e}isActive(t,e){return t===this.currentGroup&&e===this.currentIndex||t===this.reservedGroup&&e===this.reservedIndex||t===this.reservedIdleGroup&&e===this.reservedIdleIndex}reset(){this.setCurrent(void 0,void 0,0),this.setReserved(void 0,void 0,0),this.setReservedIdle(void 0,void 0)}shouldRequestIdleMotion(){return this.currentGroup===void 0&&this.reservedIdleGroup===void 0}shouldOverrideExpression(){return!wr.preserveExpressionOnMotion&&this.currentPriority>1}dump(t,e){if(this.debug){const i=["currentPriority","reservePriority","currentGroup","currentIndex","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex"];return` + group = "${t}", index = ${e} +`+i.map(n=>"["+n+"] "+this[n]).join(` +`)}return""}}const HT="SoundManager",XT=.5;class Gn{static get volume(){return this._volume}static set volume(t){this._volume=(t>1?1:t<0?0:t)||0,this.audios.forEach(e=>e.volume=this._volume)}static add(t,e,i){const n=new Audio(t);return n.volume=this._volume,n.preload="auto",n.addEventListener("ended",()=>{this.dispose(n),e==null||e()}),n.addEventListener("error",s=>{this.dispose(n),be.warn(HT,`Error occurred on "${t}"`,s.error),i==null||i(s.error)}),this.audios.push(n),n}static play(t){return new Promise((e,i)=>{var n;(n=t.play())==null||n.catch(s=>{t.dispatchEvent(new ErrorEvent("error",{error:s})),i(s)}),t.readyState===t.HAVE_ENOUGH_DATA?e():t.addEventListener("canplaythrough",e)})}static dispose(t){t.pause(),t.removeAttribute("src"),jT(this.audios,t)}static destroy(){for(let t=this.audios.length-1;t>=0;t--)this.dispose(this.audios[t])}}Gn.audios=[];Gn._volume=XT;class Jh extends bn{constructor(t,e){super(),this.motionGroups={},this.state=new WT,this.playing=!1,this.destroyed=!1,this.settings=t,this.tag=`MotionManager(${t.name})`,this.state.tag=this.tag}init(t){t!=null&&t.idleMotionGroup&&(this.groups.idle=t.idleMotionGroup),this.setupMotions(t),this.stopAllMotions()}setupMotions(t){for(const i of Object.keys(this.definitions))this.motionGroups[i]=[];let e;switch(t==null?void 0:t.motionPreload){case"NONE":return;case"ALL":e=Object.keys(this.definitions);break;case"IDLE":default:e=[this.groups.idle];break}for(const i of e)if(this.definitions[i])for(let n=0;nthis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=l}catch(h){be.warn(this.tag,"Failed to create audio",c,h)}}const u=yield this.loadMotion(i,n);if(l){const c=Gn.play(l).catch(h=>be.warn(this.tag,"Failed to play audio",l.src,h));wr.motionSync&&(yield c)}return this.state.start(u,i,n,s)?(be.log(this.tag,"Start motion:",this.getMotionName(a)),this.emit("motionStart",i,n,l),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(u),!0):(l&&(Gn.dispose(l),this.currentAudio=void 0),!1)})}startRandomMotion(t,e){return Fe(this,null,function*(){const i=this.definitions[t];if(i!=null&&i.length){const n=[];for(let s=0;se.index>=0);for(const e of t)this.hitAreas[e.name]=e}hitTest(t,e){return Object.keys(this.hitAreas).filter(i=>this.isHit(i,t,e))}isHit(t,e,i){if(!this.hitAreas[t])return!1;const n=this.hitAreas[t].index,s=this.getDrawableBounds(n,YT);return s.x<=e&&e<=s.x+s.width&&s.y<=i&&i<=s.y+s.height}getDrawableBounds(t,e){const i=this.getDrawableVertices(t);let n=i[0],s=i[0],o=i[1],a=i[1];for(let l=0;l{(s.status===200||s.status===0)&&s.response?i(s.response):s.onerror()},s.onerror=()=>{be.warn(QT,`Failed to load resource as ${s.responseType} (Status ${s.status}): ${t}`),n(new tp("Network error.",t,s.status))},s.onabort=()=>n(new tp("Aborted.",t,s.status,!0)),s.onloadend=()=>{var o;nr.allXhrSet.delete(s),r&&((o=nr.xhrMap.get(r))==null||o.delete(s))},s}static cancelXHRs(){var r;(r=nr.xhrMap.get(this))==null||r.forEach(t=>{t.abort(),nr.allXhrSet.delete(t)}),nr.xhrMap.delete(this)}static release(){nr.allXhrSet.forEach(r=>r.abort()),nr.allXhrSet.clear(),nr.xhrMap=new WeakMap}};let Zl=nr;Zl.xhrMap=new WeakMap;Zl.allXhrSet=new Set;Zl.loader=(r,t)=>new Promise((e,i)=>{nr.createXHR(r.target,r.settings?r.settings.resolveURL(r.url):r.url,r.type,s=>{r.result=s,e()},i).send()});function lv(r,t){let e=-1;return i(0);function i(n,s){if(s)return Promise.reject(s);if(n<=e)return Promise.reject(new Error("next() called multiple times"));e=n;const o=r[n];if(!o)return Promise.resolve();try{return Promise.resolve(o(t,i.bind(null,n+1)))}catch(a){return Promise.reject(a)}}}class dn{static load(t){return lv(this.middlewares,t).then(()=>t.result)}}dn.middlewares=[Zl.loader];function KT(r,t={}){var e;const i={resourceOptions:{crossorigin:t.crossOrigin}};if(Zn.fromURL)return Zn.fromURL(r,i).catch(o=>{if(o instanceof Error)throw o;const a=new Error("Texture loading error");throw a.event=o,a});i.resourceOptions.autoLoad=!1;const n=Zn.from(r,i);if(n.baseTexture.valid)return Promise.resolve(n);const s=n.baseTexture.resource;return(e=s._live2d_load)!=null||(s._live2d_load=new Promise((o,a)=>{const l=u=>{s.source.removeEventListener("error",l);const c=new Error("Texture loading error");c.event=u,a(c)};s.source.addEventListener("error",l),s.load().then(()=>o(n)).catch(l)})),s._live2d_load}const ep="Live2DFactory",uv=(r,t)=>Fe(void 0,null,function*(){if(typeof r.source=="string"){const e=yield dn.load({url:r.source,type:"json",target:r.live2dModel});e.url=r.source,r.source=e,r.live2dModel.emit("settingsJSONLoaded",e)}return t()}),cv=(r,t)=>Fe(void 0,null,function*(){if(r.source instanceof Zh)return r.settings=r.source,t();if(typeof r.source=="object"){const e=Re.findRuntime(r.source);if(e){const i=e.createModelSettings(r.source);return r.settings=i,r.live2dModel.emit("settingsLoaded",i),t()}}throw new TypeError("Unknown settings format.")}),hv=(r,t)=>{if(r.settings){const e=Re.findRuntime(r.settings);if(e)return e.ready().then(t)}return t()},fv=(r,t)=>Fe(void 0,null,function*(){yield t();const e=r.internalModel;if(e){const i=r.settings,n=Re.findRuntime(i);if(n){const s=[];i.pose&&s.push(dn.load({settings:i,url:i.pose,type:"json",target:e}).then(o=>{e.pose=n.createPose(e.coreModel,o),r.live2dModel.emit("poseLoaded",e.pose)}).catch(o=>{r.live2dModel.emit("poseLoadError",o),be.warn(ep,"Failed to load pose.",o)})),i.physics&&s.push(dn.load({settings:i,url:i.physics,type:"json",target:e}).then(o=>{e.physics=n.createPhysics(e.coreModel,o),r.live2dModel.emit("physicsLoaded",e.physics)}).catch(o=>{r.live2dModel.emit("physicsLoadError",o),be.warn(ep,"Failed to load physics.",o)})),s.length&&(yield Promise.all(s))}}}),dv=(r,t)=>Fe(void 0,null,function*(){if(r.settings){const e=r.live2dModel,i=r.settings.textures.map(n=>{const s=r.settings.resolveURL(n);return KT(s,{crossOrigin:r.options.crossOrigin})});if(yield t(),r.internalModel)e.internalModel=r.internalModel,e.emit("modelLoaded",r.internalModel);else throw new TypeError("Missing internal model.");e.textures=yield Promise.all(i),e.emit("textureLoaded",e.textures)}else throw new TypeError("Missing settings.")}),pv=(r,t)=>Fe(void 0,null,function*(){const e=r.settings;if(e instanceof Zh){const i=Re.findRuntime(e);if(!i)throw new TypeError("Unknown model settings.");const n=yield dn.load({settings:e,url:e.moc,type:"arraybuffer",target:r.live2dModel});if(!i.isValidMoc(n))throw new Error("Invalid moc data");const s=i.createCoreModel(n);return r.internalModel=i.createInternalModel(s,e,r.options),t()}throw new TypeError("Missing settings.")}),Ye=class{static registerRuntime(r){Ye.runtimes.push(r),Ye.runtimes.sort((t,e)=>e.version-t.version)}static findRuntime(r){for(const t of Ye.runtimes)if(t.test(r))return t}static setupLive2DModel(r,t,e){return Fe(this,null,function*(){const i=new Promise(o=>r.once("textureLoaded",o)),n=new Promise(o=>r.once("modelLoaded",o)),s=Promise.all([i,n]).then(()=>r.emit("ready"));yield lv(Ye.live2DModelMiddlewares,{live2dModel:r,source:t,options:e||{}}),yield s,r.emit("load")})}static loadMotion(r,t,e){var i,n;const s=o=>r.emit("motionLoadError",t,e,o);try{const o=(i=r.definitions[t])==null?void 0:i[e];if(!o)return Promise.resolve(void 0);r.listeners("destroy").includes(Ye.releaseTasks)||r.once("destroy",Ye.releaseTasks);let a=Ye.motionTasksMap.get(r);a||(a={},Ye.motionTasksMap.set(r,a));let l=a[t];l||(l=[],a[t]=l);const u=r.getMotionFile(o);return(n=l[e])!=null||(l[e]=dn.load({url:u,settings:r.settings,type:r.motionDataType,target:r}).then(c=>{var h;const p=(h=Ye.motionTasksMap.get(r))==null?void 0:h[t];p&&delete p[e];const f=r.createMotion(c,t,o);return r.emit("motionLoaded",t,e,f),f}).catch(c=>{be.warn(r.tag,`Failed to load motion: ${u} +`,c),s(c)})),l[e]}catch(o){be.warn(r.tag,`Failed to load motion at "${t}"[${e}] +`,o),s(o)}return Promise.resolve(void 0)}static loadExpression(r,t){var e;const i=n=>r.emit("expressionLoadError",t,n);try{const n=r.definitions[t];if(!n)return Promise.resolve(void 0);r.listeners("destroy").includes(Ye.releaseTasks)||r.once("destroy",Ye.releaseTasks);let s=Ye.expressionTasksMap.get(r);s||(s=[],Ye.expressionTasksMap.set(r,s));const o=r.getExpressionFile(n);return(e=s[t])!=null||(s[t]=dn.load({url:o,settings:r.settings,type:"json",target:r}).then(a=>{const l=Ye.expressionTasksMap.get(r);l&&delete l[t];const u=r.createExpression(a,n);return r.emit("expressionLoaded",t,u),u}).catch(a=>{be.warn(r.tag,`Failed to load expression: ${o} +`,a),i(a)})),s[t]}catch(n){be.warn(r.tag,`Failed to load expression at [${t}] +`,n),i(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Jh?Ye.motionTasksMap.delete(this):Ye.expressionTasksMap.delete(this)}};let Re=Ye;Re.runtimes=[];Re.urlToJSON=uv;Re.jsonToSettings=cv;Re.waitUntilReady=hv;Re.setupOptionals=fv;Re.setupEssentials=dv;Re.createInternalModel=pv;Re.live2DModelMiddlewares=[uv,cv,hv,fv,dv,pv];Re.motionTasksMap=new WeakMap;Re.expressionTasksMap=new WeakMap;Jh.prototype._loadMotion=function(r,t){return Re.loadMotion(this,r,t)};av.prototype._loadExpression=function(r){return Re.loadExpression(this,r)};class ZT{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(t){t!==this._autoInteract&&(t?this.on("pointertap",rp,this):this.off("pointertap",rp,this),this._autoInteract=t)}registerInteraction(t){t!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&t&&(this.interactionManager=t,t.on("pointermove",ip,this)))}unregisterInteraction(){var t;this.interactionManager&&((t=this.interactionManager)==null||t.off("pointermove",ip,this),this.interactionManager=void 0)}}function rp(r){this.tap(r.data.global.x,r.data.global.y)}function ip(r){this.focus(r.data.global.x,r.data.global.y)}class JT extends Bg{}const Dr=new Ee,tI=new Ze;let tn;class eI extends rl{constructor(t){super(),this.tag="Live2DModel(uninitialized)",this.textures=[],this.transform=new JT,this.anchor=new Rs(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once("modelLoaded",()=>this.init(t))}static from(t,e){const i=new this(e);return Re.setupLive2DModel(i,t,e).then(()=>i)}static fromSync(t,e){const i=new this(e);return Re.setupLive2DModel(i,t,e).then(e==null?void 0:e.onLoad).catch(e==null?void 0:e.onError),i}static registerTicker(t){tn=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){var e;tn||(tn=(e=window.PIXI)==null?void 0:e.Ticker),t?this._destroyed||(tn?(tn.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):be.warn(this.tag,"No Ticker registered, please call Live2DModel.registerTicker(Ticker).")):(tn==null||tn.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(t){this.tag=`Live2DModel(${this.internalModel.settings.name})`;const e=Object.assign({autoUpdate:!0,autoInteract:!0},t);e.autoInteract&&(this.interactive=!0),this.autoInteract=e.autoInteract,this.autoUpdate=e.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(t,e,i){return e===void 0?this.internalModel.motionManager.startRandomMotion(t,i):this.internalModel.motionManager.startMotion(t,e,i)}expression(t){return this.internalModel.motionManager.expressionManager?t===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(t):Promise.resolve(!1)}focus(t,e,i=!1){Dr.x=t,Dr.y=e,this.toModelPosition(Dr,Dr,!0);let n=Dr.x/this.internalModel.originalWidth*2-1,s=Dr.y/this.internalModel.originalHeight*2-1,o=Math.atan2(s,n);this.internalModel.focusController.focus(Math.cos(o),-Math.sin(o),i)}tap(t,e){const i=this.hitTest(t,e);i.length&&(be.log(this.tag,"Hit",i),this.emit("hit",i))}hitTest(t,e){return Dr.x=t,Dr.y=e,this.toModelPosition(Dr,Dr),this.internalModel.hitTest(Dr.x,Dr.y)}toModelPosition(t,e=t.clone(),i){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(t,e),this.internalModel.localTransform.applyInverse(e,e),e}containsPoint(t){return this.getBounds(!0).contains(t.x,t.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(tn.shared.deltaMS)}update(t){this.deltaTime+=t,this.elapsedTime+=t}_render(t){this.registerInteraction(t.plugins.interaction),t.batch.reset(),t.geometry.reset(),t.shader.reset(),t.state.reset();let e=!1;this.glContextID!==t.CONTEXT_UID&&(this.glContextID=t.CONTEXT_UID,this.internalModel.updateWebGLContext(t.gl,this.glContextID),e=!0);for(let s=0;se.destroy(t.baseTexture)),this.internalModel.destroy(),super.destroy(t)}}ov(eI,[ZT]);const di=class{static resolveURL(r,t){var e;const i=(e=di.filesMap[r])==null?void 0:e[t];if(i===void 0)throw new Error("Cannot find this file from uploaded files: "+t);return i}static upload(r,t){return Fe(this,null,function*(){const e={};for(const i of t.getDefinedFiles()){const n=decodeURI(Ql.resolve(t.url,i)),s=r.find(o=>o.webkitRelativePath===n);s&&(e[i]=URL.createObjectURL(s))}di.filesMap[t._objectURL]=e})}static createSettings(r){return Fe(this,null,function*(){const t=r.find(o=>o.name.endsWith("model.json")||o.name.endsWith("model3.json"));if(!t)throw new TypeError("Settings file not found");const e=yield di.readText(t),i=JSON.parse(e);i.url=t.webkitRelativePath;const n=Re.findRuntime(i);if(!n)throw new Error("Unknown settings JSON");const s=n.createModelSettings(i);return s._objectURL=URL.createObjectURL(t),s})}static readText(r){return Fe(this,null,function*(){return new Promise((t,e)=>{const i=new FileReader;i.onload=()=>t(i.result),i.onerror=e,i.readAsText(r,"utf8")})})}};let tf=di;tf.filesMap={};tf.factory=(r,t)=>Fe(void 0,null,function*(){if(Array.isArray(r.source)&&r.source[0]instanceof File){const e=r.source;let i=e.settings;if(!i)i=yield di.createSettings(e);else if(!i._objectURL)throw new Error('"_objectURL" must be specified in ModelSettings');i.validateFiles(e.map(n=>encodeURI(n.webkitRelativePath))),yield di.upload(e,i),i.resolveURL=function(n){return di.resolveURL(this._objectURL,n)},r.source=i,r.live2dModel.once("modelLoaded",n=>{n.once("destroy",function(){const s=this.settings._objectURL;if(URL.revokeObjectURL(s),di.filesMap[s])for(const o of Object.values(di.filesMap[s]))URL.revokeObjectURL(o);delete di.filesMap[s]})})}return t()});Re.live2DModelMiddlewares.unshift(tf.factory);const cr=class{static unzip(r,t){return Fe(this,null,function*(){const e=yield cr.getFilePaths(r),i=[];for(const s of t.getDefinedFiles()){const o=decodeURI(Ql.resolve(t.url,s));e.includes(o)&&i.push(o)}const n=yield cr.getFiles(r,i);for(let s=0;so.endsWith("model.json")||o.endsWith("model3.json"));if(!e)throw new Error("Settings file not found");const i=yield cr.readText(r,e);if(!i)throw new Error("Empty settings file: "+e);const n=JSON.parse(i);n.url=e;const s=Re.findRuntime(n);if(!s)throw new Error("Unknown settings JSON");return s.createModelSettings(n)})}static zipReader(r,t){return Fe(this,null,function*(){throw new Error("Not implemented")})}static getFilePaths(r){return Fe(this,null,function*(){throw new Error("Not implemented")})}static getFiles(r,t){return Fe(this,null,function*(){throw new Error("Not implemented")})}static readText(r,t){return Fe(this,null,function*(){throw new Error("Not implemented")})}static releaseReader(r){}};let Ai=cr;Ai.ZIP_PROTOCOL="zip://";Ai.uid=0;Ai.factory=(r,t)=>Fe(void 0,null,function*(){const e=r.source;let i,n,s;if(typeof e=="string"&&(e.endsWith(".zip")||e.startsWith(cr.ZIP_PROTOCOL))?(e.startsWith(cr.ZIP_PROTOCOL)?i=e.slice(cr.ZIP_PROTOCOL.length):i=e,n=yield dn.load({url:i,type:"blob",target:r.live2dModel})):Array.isArray(e)&&e.length===1&&e[0]instanceof File&&e[0].name.endsWith(".zip")&&(n=e[0],i=URL.createObjectURL(n),s=e.settings),n){if(!n.size)throw new Error("Empty zip file");const o=yield cr.zipReader(n,i);s||(s=yield cr.createSettings(o)),s._objectURL=cr.ZIP_PROTOCOL+cr.uid+"/"+s.url;const a=yield cr.unzip(o,s);a.settings=s,r.source=a,i.startsWith("blob:")&&r.live2dModel.once("modelLoaded",l=>{l.once("destroy",function(){URL.revokeObjectURL(i)})}),cr.releaseReader(o)}return t()});Re.live2DModelMiddlewares.unshift(Ai.factory);if(!window.Live2DCubismCore)throw new Error("Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.");class rI extends av{constructor(t,e){var i;super(t,e),this.queueManager=new rv,this.definitions=(i=t.expressions)!=null?i:[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(t){return this.definitions.findIndex(e=>e.Name===t)}getExpressionFile(t){return t.File}createExpression(t,e){return Xh.create(t)}_setExpression(t){return this.queueManager.startMotion(t,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}}class Jn extends Zh{constructor(t){if(super(t),!Jn.isValidJSON(t))throw new TypeError("Invalid JSON.");Object.assign(this,new sv(t))}static isValidJSON(t){var e;return!!(t!=null&&t.FileReferences)&&typeof t.FileReferences.Moc=="string"&&((e=t.FileReferences.Textures)==null?void 0:e.length)>0&&t.FileReferences.Textures.every(i=>typeof i=="string")}replaceFiles(t){if(super.replaceFiles(t),this.motions)for(const[e,i]of Object.entries(this.motions))for(let n=0;n{this.emit("motion:"+i)})}isFinished(){return this.queueManager.isFinished()}_startMotion(t,e){return t.setFinishedMotionHandler(e),this.queueManager.stopAllMotions(),this.queueManager.startMotion(t,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(t,e,i){const n=qh.create(t),s=new ev(t),o=(e===this.groups.idle?wr.idleMotionFadingDuration:wr.motionFadingDuration)/1e3;return s.getMotionFadeInTime()===void 0&&n.setFadeInTime(i.FadeInTime>0?i.FadeInTime:o),s.getMotionFadeOutTime()===void 0&&n.setFadeOutTime(i.FadeOutTime>0?i.FadeOutTime:o),n.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),n}getMotionFile(t){return t.File}getMotionName(t){return t.File}getSoundFile(t){return t.Sound}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}}const np=new $r;class nI extends qT{constructor(t,e,i){super(),this.lipSync=!0,this.breath=Vh.create(),this.renderer=new nv,this.idParamAngleX=DT,this.idParamAngleY=RT,this.idParamAngleZ=NT,this.idParamEyeBallX=LT,this.idParamEyeBallY=BT,this.idParamBodyAngleX=kT,this.idParamBreath=UT,this.pixelsPerUnit=1,this.centeringTransform=new Ze,this.coreModel=t,this.settings=e,this.motionManager=new iI(e,i),this.init()}init(){var t;super.init(),((t=this.settings.getEyeBlinkParameters())==null?void 0:t.length)>0&&(this.eyeBlink=Jg.create(this.settings)),this.breath.setParameters([new po(this.idParamAngleX,0,15,6.5345,.5),new po(this.idParamAngleY,0,8,3.5345,.5),new po(this.idParamAngleZ,0,10,5.5345,.5),new po(this.idParamBodyAngleX,0,4,15.5345,.5),new po(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){const t={};if(this.settings.layout)for(const e of Object.keys(this.settings.layout)){const i=e.charAt(0).toLowerCase()+e.slice(1);t[i]=this.settings.layout[e]}return t}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(t,e){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(t),this.renderer._clippingManager._currentFrameNo=e,this.renderer._clippingManager._maskTexture=void 0,Us.getInstance()._shaderSets=[]}bindTexture(t,e){this.renderer.bindTexture(t,e)}getHitAreaDefs(){var t,e;return(e=(t=this.settings.hitAreas)==null?void 0:t.map(i=>({id:i.Id,name:i.Name,index:this.coreModel.getDrawableIndex(i.Id)})))!=null?e:[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(t){return this.coreModel.getDrawableIndex(t)}getDrawableVertices(t){if(typeof t=="string"&&(t=this.coreModel.getDrawableIndex(t),t===-1))throw new TypeError("Unable to find drawable ID: "+t);const e=this.coreModel.getDrawableVertices(t).slice();for(let i=0;i{function e(){try{oI(),r()}catch(i){if(sp--,sp<0){const n=new Error("Failed to start up Cubism 4 framework.");n.cause=i,t(n);return}be.log("Cubism4","Startup failed, retrying 10ms later..."),setTimeout(e,10)}}e()})),Pa)}function oI(r){r=Object.assign({logFunction:console.log,loggingLevel:ls.LogLevel_Verbose},r),Wo.startUp(r),Wo.initialize()}Re.registerRuntime({version:4,ready:sI,test(r){return r instanceof Jn||Jn.isValidJSON(r)},isValidMoc(r){if(r.byteLength<4)return!1;const t=new Int8Array(r,0,4);return String.fromCharCode(...t)==="MOC3"},createModelSettings(r){return new Jn(r)},createCoreModel(r){const t=Hh.create(r);try{const e=t.createModel();return e.__moc=t,e}catch(e){try{t.release()}catch{}throw e}},createInternalModel(r,t,e){const i=new nI(r,t,e),n=r;return n.__moc&&(i.__moc=n.__moc,delete n.__moc,i.once("destroy",aI)),i},createPhysics(r,t){return Qh.create(t)},createPose(r,t){return Gh.create(t)}});function aI(){var r;(r=this.__moc)==null||r.release()}/*! + * @pixi/interaction - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/interaction is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + */var op=function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Ee,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(r.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),r.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},r.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},r.prototype.reset=function(){this.isPrimary=!1},r}();/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var bc=function(r,t){return bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},bc(r,t)};function lI(r,t){bc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var uI=function(){function r(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return r.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},r.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},r}(),$u=function(){function r(t){this._pointerId=t,this._flags=r.FLAGS.NONE}return r.prototype._doSet=function(t,e){e?this._flags=this._flags|t:this._flags=this._flags&~t},Object.defineProperty(r.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"none",{get:function(){return this._flags===r.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"over",{get:function(){return(this._flags&r.FLAGS.OVER)!==0},set:function(t){this._doSet(r.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightDown",{get:function(){return(this._flags&r.FLAGS.RIGHT_DOWN)!==0},set:function(t){this._doSet(r.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftDown",{get:function(){return(this._flags&r.FLAGS.LEFT_DOWN)!==0},set:function(t){this._doSet(r.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),r.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),r}(),cI=function(){function r(){this._tempPoint=new Ee}return r.prototype.recursiveFindHit=function(t,e,i,n,s){var o;if(!e||!e.visible)return!1;var a=t.data.global;s=e.interactive||s;var l=!1,u=s,c=!0;if(e.hitArea)n&&(e.worldTransform.applyInverse(a,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?l=!0:(n=!1,c=!1)),u=!1;else if(e._mask&&n){var h=e._mask.isMaskData?e._mask.maskObject:e._mask;h&&!(!((o=h.containsPoint)===null||o===void 0)&&o.call(h,a))&&(n=!1)}if(c&&e.interactiveChildren&&e.children)for(var p=e.children,f=p.length-1;f>=0;f--){var y=p[f],g=this.recursiveFindHit(t,y,i,n,u);if(g){if(!y.parent)continue;u=!1,g&&(t.target&&(n=!1),l=!0)}}return s&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(a)&&(l=!0),e.interactive&&(l&&!t.target&&(t.target=e),i&&i(t,e,!!l))),l},r.prototype.findHit=function(t,e,i,n){this.recursiveFindHit(t,e,i,n,!1)},r}(),hI={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(r){r?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Go.mixin(hI);var Ma=1,Da={target:null,data:{global:null}},xR=function(r){lI(t,r);function t(e,i){var n=r.call(this)||this;return i=i||{},n.renderer=e,n.autoPreventDefault=i.autoPreventDefault!==void 0?i.autoPreventDefault:!0,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new op,n.mouse.identifier=Ma,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[Ma]=n.mouse,n.interactionDataPool=[],n.eventData=new uI,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new cI,n._tempDisplayObject=new Zg,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=i.useSystemTicker!==void 0?i.useSystemTicker:!0,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,i){return Da.target=null,Da.data.global=e,i||(i=this.lastObjectRendered),this.processInteractive(Da,i,null,!0),Da.target},t.prototype.setTargetElement=function(e,i){i===void 0&&(i=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=i,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(fi.system.add(this.tickerUpdate,this,qs.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(fi.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime0&&(a=e.composedPath()[0]);for(var l=a!==this.interactionDOMElement?"outside":"",u=0;u"u"&&(o.button=e.touches.length?1:0),typeof o.buttons>"u"&&(o.buttons=e.touches.length?1:0),typeof o.isPrimary>"u"&&(o.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof o.width>"u"&&(o.width=o.radiusX||1),typeof o.height>"u"&&(o.height=o.radiusY||1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="touch"),typeof o.pointerId>"u"&&(o.pointerId=o.identifier||0),typeof o.pressure>"u"&&(o.pressure=o.force||.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),typeof o.layerX>"u"&&(o.layerX=o.offsetX=o.clientX),typeof o.layerY>"u"&&(o.layerY=o.offsetY=o.clientY),o.isNormalized=!0,i.push(o)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){var a=e;typeof a.isPrimary>"u"&&(a.isPrimary=!0),typeof a.width>"u"&&(a.width=1),typeof a.height>"u"&&(a.height=1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="mouse"),typeof a.pointerId>"u"&&(a.pointerId=Ma),typeof a.pressure>"u"&&(a.pressure=.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),a.isNormalized=!0,i.push(a)}else i.push(e);return i},t.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},t.extension={name:"interaction",type:[Wr.RendererPlugin,Wr.CanvasRendererPlugin]},t}(bn);function un(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Vu={exports:{}};/*! + localForage -- Offline Storage, Improved + Version 1.10.0 + https://localforage.github.io/localForage + (c) 2013-2017 Mozilla, Apache License 2.0 +*/var ap;function fI(){return ap||(ap=1,function(r,t){(function(e){r.exports=e()})(function(){return function e(i,n,s){function o(u,c){if(!n[u]){if(!i[u]){var h=typeof un=="function"&&un;if(!c&&h)return h(u,!0);if(a)return a(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var f=n[u]={exports:{}};i[u][0].call(f.exports,function(y){var g=i[u][1][y];return o(g||y)},f,f.exports,e,i,n,s)}return n[u].exports}for(var a=typeof un=="function"&&un,l=0;l"u"&&e(3);var h=Promise;function p(T,j){j&&T.then(function(P){j(null,P)},function(P){j(P)})}function f(T,j,P){typeof j=="function"&&T.then(j),typeof P=="function"&&T.catch(P)}function y(T){return typeof T!="string"&&(console.warn(T+" used as a key, but it is not a string."),T=String(T)),T}function g(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",m=void 0,_={},S=Object.prototype.toString,E="readonly",b="readwrite";function F(T){for(var j=T.length,P=new ArrayBuffer(j),X=new Uint8Array(P),Q=0;Q=43)}}).catch(function(){return!1})}function z(T){return typeof m=="boolean"?h.resolve(m):x(T).then(function(j){return m=j,m})}function B(T){var j=_[T.name],P={};P.promise=new h(function(X,Q){P.resolve=X,P.reject=Q}),j.deferredOperations.push(P),j.dbReady?j.dbReady=j.dbReady.then(function(){return P.promise}):j.dbReady=P.promise}function tt(T){var j=_[T.name],P=j.deferredOperations.pop();if(P)return P.resolve(),P.promise}function st(T,j){var P=_[T.name],X=P.deferredOperations.pop();if(X)return X.reject(j),X.promise}function I(T,j){return new h(function(P,X){if(_[T.name]=_[T.name]||A(),T.db)if(j)B(T),T.db.close();else return P(T.db);var Q=[T.name];j&&Q.push(T.version);var G=l.open.apply(l,Q);j&&(G.onupgradeneeded=function(nt){var ut=G.result;try{ut.createObjectStore(T.storeName),nt.oldVersion<=1&&ut.createObjectStore(d)}catch(ct){if(ct.name==="ConstraintError")console.warn('The database "'+T.name+'" has been upgraded from version '+nt.oldVersion+" to version "+nt.newVersion+', but the storage "'+T.storeName+'" already exists.');else throw ct}}),G.onerror=function(nt){nt.preventDefault(),X(G.error)},G.onsuccess=function(){var nt=G.result;nt.onversionchange=function(ut){ut.target.close()},P(nt),tt(T)}})}function Z(T){return I(T,!1)}function w(T){return I(T,!0)}function it(T,j){if(!T.db)return!0;var P=!T.db.objectStoreNames.contains(T.storeName),X=T.versionT.db.version;if(X&&(T.version!==j&&console.warn('The database "'+T.name+`" can't be downgraded from version `+T.db.version+" to version "+T.version+"."),T.version=T.db.version),Q||P){if(P){var G=T.db.version+1;G>T.version&&(T.version=G)}return!0}return!1}function M(T){return new h(function(j,P){var X=new FileReader;X.onerror=P,X.onloadend=function(Q){var G=btoa(Q.target.result||"");j({__local_forage_encoded_blob:!0,data:G,type:T.type})},X.readAsBinaryString(T)})}function O(T){var j=F(atob(T.data));return c([j],{type:T.type})}function D(T){return T&&T.__local_forage_encoded_blob}function U(T){var j=this,P=j._initReady().then(function(){var X=_[j._dbInfo.name];if(X&&X.dbReady)return X.dbReady});return f(P,T,T),P}function k(T){B(T);for(var j=_[T.name],P=j.forages,X=0;X0&&(!T.db||G.name==="InvalidStateError"||G.name==="NotFoundError"))return h.resolve().then(function(){if(!T.db||G.name==="NotFoundError"&&!T.db.objectStoreNames.contains(T.storeName)&&T.version<=T.db.version)return T.db&&(T.version=T.db.version+1),w(T)}).then(function(){return k(T).then(function(){C(T,j,P,X-1)})}).catch(P);P(G)}}function A(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function V(T){var j=this,P={db:null};if(T)for(var X in T)P[X]=T[X];var Q=_[P.name];Q||(Q=A(),_[P.name]=Q),Q.forages.push(j),j._initReady||(j._initReady=j.ready,j.ready=U);var G=[];function nt(){return h.resolve()}for(var ut=0;ut>4,mt[Q++]=(nt&15)<<4|ut>>2,mt[Q++]=(ut&3)<<6|ct&63;return ft}function Ji(T){var j=new Uint8Array(T),P="",X;for(X=0;X>2],P+=K[(j[X]&3)<<4|j[X+1]>>4],P+=K[(j[X+1]&15)<<2|j[X+2]>>6],P+=K[j[X+2]&63];return j.length%3===2?P=P.substring(0,P.length-1)+"=":j.length%3===1&&(P=P.substring(0,P.length-2)+"=="),P}function ao(T,j){var P="";if(T&&(P=Zi.call(T)),T&&(P==="[object ArrayBuffer]"||T.buffer&&Zi.call(T.buffer)==="[object ArrayBuffer]")){var X,Q=R;T instanceof ArrayBuffer?(X=T,Q+=ot):(X=T.buffer,P==="[object Int8Array]"?Q+=rt:P==="[object Uint8Array]"?Q+=ht:P==="[object Uint8ClampedArray]"?Q+=bt:P==="[object Int16Array]"?Q+=pt:P==="[object Uint16Array]"?Q+=ye:P==="[object Int32Array]"?Q+=Ot:P==="[object Uint32Array]"?Q+=oe:P==="[object Float32Array]"?Q+=ir:P==="[object Float64Array]"?Q+=Ki:j(new Error("Failed to get type for BinaryArray"))),j(Q+Ji(X))}else if(P==="[object Blob]"){var G=new FileReader;G.onload=function(){var nt=q+T.type+"~"+Ji(this.result);j(R+at+nt)},G.readAsArrayBuffer(T)}else try{j(JSON.stringify(T))}catch(nt){console.error("Couldn't convert value into a JSON string: ",T),j(null,nt)}}function Qr(T){if(T.substring(0,Y)!==R)return JSON.parse(T);var j=T.substring(vr),P=T.substring(Y,vr),X;if(P===at&&N.test(j)){var Q=j.match(N);X=Q[1],j=j.substring(Q[0].length)}var G=Ae(j);switch(P){case ot:return G;case at:return c([G],{type:X});case rt:return new Int8Array(G);case ht:return new Uint8Array(G);case bt:return new Uint8ClampedArray(G);case pt:return new Int16Array(G);case ye:return new Uint16Array(G);case Ot:return new Int32Array(G);case oe:return new Uint32Array(G);case ir:return new Float32Array(G);case Ki:return new Float64Array(G);default:throw new Error("Unkown type: "+P)}}var fs={serialize:ao,deserialize:Qr,stringToBuffer:Ae,bufferToString:Ji};function ma(T,j,P,X){T.executeSql("CREATE TABLE IF NOT EXISTS "+j.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],P,X)}function hu(T){var j=this,P={db:null};if(T)for(var X in T)P[X]=typeof T[X]!="string"?T[X].toString():T[X];var Q=new h(function(G,nt){try{P.db=openDatabase(P.name,String(P.version),P.description,P.size)}catch(ut){return nt(ut)}P.db.transaction(function(ut){ma(ut,P,function(){j._dbInfo=P,G()},function(ct,ft){nt(ft)})},nt)});return P.serializer=fs,Q}function si(T,j,P,X,Q,G){T.executeSql(P,X,Q,function(nt,ut){ut.code===ut.SYNTAX_ERR?nt.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[j.storeName],function(ct,ft){ft.rows.length?G(ct,ut):ma(ct,j,function(){ct.executeSql(P,X,Q,G)},G)},G):G(nt,ut)},G)}function ya(T,j){var P=this;T=y(T);var X=new h(function(Q,G){P.ready().then(function(){var nt=P._dbInfo;nt.db.transaction(function(ut){si(ut,nt,"SELECT * FROM "+nt.storeName+" WHERE key = ? LIMIT 1",[T],function(ct,ft){var mt=ft.rows.length?ft.rows.item(0).value:null;mt&&(mt=nt.serializer.deserialize(mt)),Q(mt)},function(ct,ft){G(ft)})})}).catch(G)});return p(X,j),X}function In(T,j){var P=this,X=new h(function(Q,G){P.ready().then(function(){var nt=P._dbInfo;nt.db.transaction(function(ut){si(ut,nt,"SELECT * FROM "+nt.storeName,[],function(ct,ft){for(var mt=ft.rows,St=mt.length,ne=0;ne0){nt(En.apply(Q,[T,ct,P,X-1]));return}ut(ne)}})})}).catch(ut)});return p(G,P),G}function Hw(T,j,P){return En.apply(this,[T,j,P,1])}function Xw(T,j){var P=this;T=y(T);var X=new h(function(Q,G){P.ready().then(function(){var nt=P._dbInfo;nt.db.transaction(function(ut){si(ut,nt,"DELETE FROM "+nt.storeName+" WHERE key = ?",[T],function(){Q()},function(ct,ft){G(ft)})})}).catch(G)});return p(X,j),X}function Yw(T){var j=this,P=new h(function(X,Q){j.ready().then(function(){var G=j._dbInfo;G.db.transaction(function(nt){si(nt,G,"DELETE FROM "+G.storeName,[],function(){X()},function(ut,ct){Q(ct)})})}).catch(Q)});return p(P,T),P}function qw(T){var j=this,P=new h(function(X,Q){j.ready().then(function(){var G=j._dbInfo;G.db.transaction(function(nt){si(nt,G,"SELECT COUNT(key) as c FROM "+G.storeName,[],function(ut,ct){var ft=ct.rows.item(0).c;X(ft)},function(ut,ct){Q(ct)})})}).catch(Q)});return p(P,T),P}function Qw(T,j){var P=this,X=new h(function(Q,G){P.ready().then(function(){var nt=P._dbInfo;nt.db.transaction(function(ut){si(ut,nt,"SELECT key FROM "+nt.storeName+" WHERE id = ? LIMIT 1",[T+1],function(ct,ft){var mt=ft.rows.length?ft.rows.item(0).key:null;Q(mt)},function(ct,ft){G(ft)})})}).catch(G)});return p(X,j),X}function Kw(T){var j=this,P=new h(function(X,Q){j.ready().then(function(){var G=j._dbInfo;G.db.transaction(function(nt){si(nt,G,"SELECT key FROM "+G.storeName,[],function(ut,ct){for(var ft=[],mt=0;mt '__WebKitDatabaseInfoTable__'",[],function(Q,G){for(var nt=[],ut=0;ut0}function nx(T){var j=this,P={};if(T)for(var X in T)P[X]=T[X];return P.keyPrefix=qf(T,j._defaultConfig),ix()?(j._dbInfo=P,P.serializer=fs,h.resolve()):h.reject()}function sx(T){var j=this,P=j.ready().then(function(){for(var X=j._dbInfo.keyPrefix,Q=localStorage.length-1;Q>=0;Q--){var G=localStorage.key(Q);G.indexOf(X)===0&&localStorage.removeItem(G)}});return p(P,T),P}function ox(T,j){var P=this;T=y(T);var X=P.ready().then(function(){var Q=P._dbInfo,G=localStorage.getItem(Q.keyPrefix+T);return G&&(G=Q.serializer.deserialize(G)),G});return p(X,j),X}function ax(T,j){var P=this,X=P.ready().then(function(){for(var Q=P._dbInfo,G=Q.keyPrefix,nt=G.length,ut=localStorage.length,ct=1,ft=0;ft=0;nt--){var ut=localStorage.key(nt);ut.indexOf(G)===0&&localStorage.removeItem(ut)}}):Q=h.reject("Invalid arguments"),p(Q,j),Q}var px={_driver:"localStorageWrapper",_initStorage:nx,_support:ex(),iterate:ax,getItem:ox,setItem:fx,removeItem:hx,clear:sx,length:cx,key:lx,keys:ux,dropInstance:dx},mx=function(j,P){return j===P||typeof j=="number"&&typeof P=="number"&&isNaN(j)&&isNaN(P)},yx=function(j,P){for(var X=j.length,Q=0;Q"u"?"undefined":s(P))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var X in P){if(X==="storeName"&&(P[X]=P[X].replace(/\W/g,"_")),X==="version"&&typeof P[X]!="number")return new Error("Database version must be a number.");this._config[X]=P[X]}return"driver"in P&&P.driver?this.setDriver(this._config.driver):!0}else return typeof P=="string"?this._config[P]:this._config},T.prototype.defineDriver=function(P,X,Q){var G=new h(function(nt,ut){try{var ct=P._driver,ft=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!P._driver){ut(ft);return}for(var mt=fu.concat("_initStorage"),St=0,ne=mt.length;St 0.0) { + c.rgb /= c.a; + + vec3 rgb = pow(c.rgb, vec3(1. / gamma)); + rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast); + rgb.r *= red; + rgb.g *= green; + rgb.b *= blue; + c.rgb = rgb * brightness; + + c.rgb *= c.a; + } + + gl_FragColor = c * alpha; +} +`;(function(r){pI(t,r);function t(e){var i=r.call(this,mI,yI)||this;return i.gamma=1,i.saturation=1,i.contrast=1,i.brightness=1,i.red=1,i.green=1,i.blue=1,i.alpha=1,Object.assign(i,e),i}return t.prototype.apply=function(e,i,n,s){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,i,n,s)},t})(re);/*! + * @pixi/filter-kawase-blur - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-kawase-blur is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var xc=function(r,t){return xc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},xc(r,t)};function gI(r,t){xc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var vI=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,_I=` +varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec2 uOffset; + +void main(void) +{ + vec4 color = vec4(0.0); + + // Sample top left pixel + color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y)); + + // Sample top right pixel + color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y)); + + // Sample bottom right pixel + color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y)); + + // Sample bottom left pixel + color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y)); + + // Average + color *= 0.25; + + gl_FragColor = color; +}`,bI=` +varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec2 uOffset; +uniform vec4 filterClamp; + +void main(void) +{ + vec4 color = vec4(0.0); + + // Sample top left pixel + color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw)); + + // Sample top right pixel + color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw)); + + // Sample bottom right pixel + color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw)); + + // Sample bottom left pixel + color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw)); + + // Average + color *= 0.25; + + gl_FragColor = color; +} +`,nl=function(r){gI(t,r);function t(e,i,n){e===void 0&&(e=4),i===void 0&&(i=3),n===void 0&&(n=!1);var s=r.call(this,vI,n?bI:_I)||this;return s._kernels=[],s._blur=4,s._quality=3,s.uniforms.uOffset=new Float32Array(2),s._pixelSize=new Ee,s.pixelSize=1,s._clamp=n,Array.isArray(e)?s.kernels=e:(s._blur=e,s.quality=i),s}return t.prototype.apply=function(e,i,n,s){var o=this._pixelSize.x/i._frame.width,a=this._pixelSize.y/i._frame.height,l;if(this._quality===1||this._blur===0)l=this._kernels[0]+.5,this.uniforms.uOffset[0]=l*o,this.uniforms.uOffset[1]=l*a,e.applyFilter(this,i,n,s);else{for(var u=e.getFilterTexture(),c=i,h=u,p=void 0,f=this._quality-1,y=0;y0)for(var s=e,o=e/i,a=1;a0?(this._kernels=e,this._quality=e.length,this._blur=Math.max.apply(Math,e)):(this._kernels=[0],this._quality=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clamp",{get:function(){return this._clamp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pixelSize",{get:function(){return this._pixelSize},set:function(e){typeof e=="number"?(this._pixelSize.x=e,this._pixelSize.y=e):Array.isArray(e)?(this._pixelSize.x=e[0],this._pixelSize.y=e[1]):e instanceof Ee?(this._pixelSize.x=e.x,this._pixelSize.y=e.y):(this._pixelSize.x=1,this._pixelSize.y=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"quality",{get:function(){return this._quality},set:function(e){this._quality=Math.max(1,Math.round(e)),this._generateKernels()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blur",{get:function(){return this._blur},set:function(e){this._blur=e,this._generateKernels()},enumerable:!1,configurable:!0}),t}(re);/*! + * @pixi/filter-advanced-bloom - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-advanced-bloom is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Sc=function(r,t){return Sc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Sc(r,t)};function mv(r,t){Sc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var yv=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,wI=` +uniform sampler2D uSampler; +varying vec2 vTextureCoord; + +uniform float threshold; + +void main() { + vec4 color = texture2D(uSampler, vTextureCoord); + + // A simple & fast algorithm for getting brightness. + // It's inaccuracy , but good enought for this feature. + float _max = max(max(color.r, color.g), color.b); + float _min = min(min(color.r, color.g), color.b); + float brightness = (_max + _min) * 0.5; + + if(brightness > threshold) { + gl_FragColor = color; + } else { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } +} +`,xI=function(r){mv(t,r);function t(e){e===void 0&&(e=.5);var i=r.call(this,yv,wI)||this;return i.threshold=e,i}return Object.defineProperty(t.prototype,"threshold",{get:function(){return this.uniforms.threshold},set:function(e){this.uniforms.threshold=e},enumerable:!1,configurable:!0}),t}(re),SI=`uniform sampler2D uSampler; +varying vec2 vTextureCoord; + +uniform sampler2D bloomTexture; +uniform float bloomScale; +uniform float brightness; + +void main() { + vec4 color = texture2D(uSampler, vTextureCoord); + color.rgb *= brightness; + vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0); + bloomColor.rgb *= bloomScale; + gl_FragColor = color + bloomColor; +} +`;(function(r){mv(t,r);function t(e){var i=r.call(this,yv,SI)||this;i.bloomScale=1,i.brightness=1,i._resolution=It.FILTER_RESOLUTION,typeof e=="number"&&(e={threshold:e});var n=Object.assign(t.defaults,e);i.bloomScale=n.bloomScale,i.brightness=n.brightness;var s=n.kernels,o=n.blur,a=n.quality,l=n.pixelSize,u=n.resolution;return i._extractFilter=new xI(n.threshold),i._extractFilter.resolution=u,i._blurFilter=s?new nl(s):new nl(o,a),i.pixelSize=l,i.resolution=u,i}return t.prototype.apply=function(e,i,n,s,o){var a=e.getFilterTexture();this._extractFilter.apply(e,i,a,1,o);var l=e.getFilterTexture();this._blurFilter.apply(e,a,l,1),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=l,e.applyFilter(this,i,n,s),e.returnFilterTexture(l),e.returnFilterTexture(a)},Object.defineProperty(t.prototype,"resolution",{get:function(){return this._resolution},set:function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"threshold",{get:function(){return this._extractFilter.threshold},set:function(e){this._extractFilter.threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kernels",{get:function(){return this._blurFilter.kernels},set:function(e){this._blurFilter.kernels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blur",{get:function(){return this._blurFilter.blur},set:function(e){this._blurFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"quality",{get:function(){return this._blurFilter.quality},set:function(e){this._blurFilter.quality=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pixelSize",{get:function(){return this._blurFilter.pixelSize},set:function(e){this._blurFilter.pixelSize=e},enumerable:!1,configurable:!0}),t.defaults={threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:It.FILTER_RESOLUTION},t})(re);/*! + * @pixi/filter-ascii - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-ascii is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Tc=function(r,t){return Tc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Tc(r,t)};function TI(r,t){Tc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var II=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,EI=`varying vec2 vTextureCoord; + +uniform vec4 filterArea; +uniform float pixelSize; +uniform sampler2D uSampler; + +vec2 mapCoord( vec2 coord ) +{ + coord *= filterArea.xy; + coord += filterArea.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= filterArea.zw; + coord /= filterArea.xy; + + return coord; +} + +vec2 pixelate(vec2 coord, vec2 size) +{ + return floor( coord / size ) * size; +} + +vec2 getMod(vec2 coord, vec2 size) +{ + return mod( coord , size) / size; +} + +float character(float n, vec2 p) +{ + p = floor(p*vec2(4.0, -4.0) + 2.5); + + if (clamp(p.x, 0.0, 4.0) == p.x) + { + if (clamp(p.y, 0.0, 4.0) == p.y) + { + if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0; + } + } + return 0.0; +} + +void main() +{ + vec2 coord = mapCoord(vTextureCoord); + + // get the rounded color.. + vec2 pixCoord = pixelate(coord, vec2(pixelSize)); + pixCoord = unmapCoord(pixCoord); + + vec4 color = texture2D(uSampler, pixCoord); + + // determine the character to use + float gray = (color.r + color.g + color.b) / 3.0; + + float n = 65536.0; // . + if (gray > 0.2) n = 65600.0; // : + if (gray > 0.3) n = 332772.0; // * + if (gray > 0.4) n = 15255086.0; // o + if (gray > 0.5) n = 23385164.0; // & + if (gray > 0.6) n = 15252014.0; // 8 + if (gray > 0.7) n = 13199452.0; // @ + if (gray > 0.8) n = 11512810.0; // # + + // get the mod.. + vec2 modd = getMod(coord, vec2(pixelSize)); + + gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0); + +} +`;(function(r){TI(t,r);function t(e){e===void 0&&(e=8);var i=r.call(this,II,EI)||this;return i.size=e,i}return Object.defineProperty(t.prototype,"size",{get:function(){return this.uniforms.pixelSize},set:function(e){this.uniforms.pixelSize=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-bevel - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-bevel is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Ic=function(r,t){return Ic=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Ic(r,t)};function CI(r,t){Ic(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var AI=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,OI=`precision mediump float; + +varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec4 filterArea; + +uniform float transformX; +uniform float transformY; +uniform vec3 lightColor; +uniform float lightAlpha; +uniform vec3 shadowColor; +uniform float shadowAlpha; + +void main(void) { + vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY); + vec4 color = texture2D(uSampler, vTextureCoord); + float light = texture2D(uSampler, vTextureCoord - transform).a; + float shadow = texture2D(uSampler, vTextureCoord + transform).a; + + color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0)); + color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0)); + gl_FragColor = vec4(color.rgb * color.a, color.a); +} +`;(function(r){CI(t,r);function t(e){var i=r.call(this,AI,OI)||this;return i._thickness=2,i._angle=0,i.uniforms.lightColor=new Float32Array(3),i.uniforms.shadowColor=new Float32Array(3),Object.assign(i,{rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),i.padding=1,i}return t.prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._angle/es},set:function(e){this._angle=e*es,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness=e,this._updateTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightColor",{get:function(){return ei(this.uniforms.lightColor)},set:function(e){Gr(e,this.uniforms.lightColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lightAlpha",{get:function(){return this.uniforms.lightAlpha},set:function(e){this.uniforms.lightAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowColor",{get:function(){return ei(this.uniforms.shadowColor)},set:function(e){Gr(e,this.uniforms.shadowColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shadowAlpha",{get:function(){return this.uniforms.shadowAlpha},set:function(e){this.uniforms.shadowAlpha=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-alpha - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/filter-alpha is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Ec=function(r,t){return Ec=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Ec(r,t)};function FI(r,t){Ec(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var PI=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform float uAlpha; + +void main(void) +{ + gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha; +} +`,MI=function(r){FI(t,r);function t(e){e===void 0&&(e=1);var i=r.call(this,I1,PI,{uAlpha:1})||this;return i.alpha=e,i}return Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(re);/*! + * @pixi/filter-blur - v6.5.10 + * Compiled Thu, 06 Jul 2023 15:25:11 UTC + * + * @pixi/filter-blur is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Cc=function(r,t){return Cc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Cc(r,t)};function gv(r,t){Cc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var DI=` + attribute vec2 aVertexPosition; + + uniform mat3 projectionMatrix; + + uniform float strength; + + varying vec2 vBlurTexCoords[%size%]; + + uniform vec4 inputSize; + uniform vec4 outputFrame; + + vec4 filterVertexPosition( void ) + { + vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy; + + return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); + } + + vec2 filterTextureCoord( void ) + { + return aVertexPosition * (outputFrame.zw * inputSize.zw); + } + + void main(void) + { + gl_Position = filterVertexPosition(); + + vec2 textureCoord = filterTextureCoord(); + %blur% + }`;function RI(r,t){var e=Math.ceil(r/2),i=DI,n="",s;t?s="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":s="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var o=0;o=e&&(o=r-a-1),l=l.replace("%value%",t[o].toString()),n+=l,n+=` +`}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var sl=function(r){gv(t,r);function t(e,i,n,s,o){i===void 0&&(i=8),n===void 0&&(n=4),s===void 0&&(s=It.FILTER_RESOLUTION),o===void 0&&(o=5);var a=this,l=RI(o,e),u=BI(o);return a=r.call(this,l,u)||this,a.horizontal=e,a.resolution=s,a._quality=0,a.quality=n,a.blur=i,a}return t.prototype.apply=function(e,i,n,s){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/i.width):this.uniforms.strength=1/n.height*(n.height/i.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/i.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/i.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,i,n,s);else{var o=e.getFilterTexture(),a=e.renderer,l=i,u=o;this.state.blend=!1,e.applyFilter(this,l,u,Jr.CLEAR);for(var c=1;c 0.0) { + coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); + } else { + coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent); + } + } + coord += center * dimensions.xy; + coord /= filterArea.xy; + vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); + vec4 color = texture2D(uSampler, clampedCoord); + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + gl_FragColor = color; +} +`;(function(r){UI(t,r);function t(e){var i=r.call(this,zI,jI)||this;return i.uniforms.dimensions=new Float32Array(2),Object.assign(i,t.defaults,e),i}return t.prototype.apply=function(e,i,n,s){var o=i.filterFrame,a=o.width,l=o.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this.uniforms.strength},set:function(e){this.uniforms.strength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return this.uniforms.center},set:function(e){this.uniforms.center=e},enumerable:!1,configurable:!0}),t.defaults={center:[.5,.5],radius:100,strength:1},t})(re);/*! + * @pixi/filter-color-map - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-color-map is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Fc=function(r,t){return Fc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Fc(r,t)};function $I(r,t){Fc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var VI=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,GI=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform sampler2D colorMap; +uniform float _mix; +uniform float _size; +uniform float _sliceSize; +uniform float _slicePixelSize; +uniform float _sliceInnerSize; +void main() { + vec4 color = texture2D(uSampler, vTextureCoord.xy); + + vec4 adjusted; + if (color.a > 0.0) { + color.rgb /= color.a; + float innerWidth = _size - 1.0; + float zSlice0 = min(floor(color.b * innerWidth), innerWidth); + float zSlice1 = min(zSlice0 + 1.0, innerWidth); + float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize; + float s0 = xOffset + (zSlice0 * _sliceSize); + float s1 = xOffset + (zSlice1 * _sliceSize); + float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize); + vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset)); + vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset)); + float zOffset = fract(color.b * innerWidth); + adjusted = mix(slice0Color, slice1Color, zOffset); + + color.rgb *= color.a; + } + gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a); + +}`;(function(r){$I(t,r);function t(e,i,n){i===void 0&&(i=!1),n===void 0&&(n=1);var s=r.call(this,VI,GI)||this;return s.mix=1,s._size=0,s._sliceSize=0,s._slicePixelSize=0,s._sliceInnerSize=0,s._nearest=!1,s._scaleMode=null,s._colorMap=null,s._scaleMode=null,s.nearest=i,s.mix=n,s.colorMap=e,s}return t.prototype.apply=function(e,i,n,s){this.uniforms._mix=this.mix,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"colorSize",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"colorMap",{get:function(){return this._colorMap},set:function(e){var i;e&&(e instanceof Zn||(e=Zn.from(e)),!((i=e)===null||i===void 0)&&i.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=wi.OFF,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nearest",{get:function(){return this._nearest},set:function(e){this._nearest=e,this._scaleMode=e?Tr.NEAREST:Tr.LINEAR;var i=this._colorMap;i&&i.baseTexture&&(i.baseTexture._glTextures={},i.baseTexture.scaleMode=this._scaleMode,i.baseTexture.mipmap=wi.OFF,i._updateID++,i.baseTexture.emit("update",i.baseTexture))},enumerable:!1,configurable:!0}),t.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},t.prototype.destroy=function(e){e===void 0&&(e=!1),this._colorMap&&this._colorMap.destroy(e),r.prototype.destroy.call(this)},t})(re);/*! + * @pixi/filter-color-overlay - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-color-overlay is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Pc=function(r,t){return Pc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Pc(r,t)};function WI(r,t){Pc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var HI=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,XI=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec3 color; +uniform float alpha; + +void main(void) { + vec4 currentColor = texture2D(uSampler, vTextureCoord); + gl_FragColor = vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a); +} +`;(function(r){WI(t,r);function t(e,i){e===void 0&&(e=0),i===void 0&&(i=1);var n=r.call(this,HI,XI)||this;return n._color=0,n._alpha=1,n.uniforms.color=new Float32Array(3),n.color=e,n.alpha=i,n}return Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(e){var i=this.uniforms.color;typeof e=="number"?(Gr(e,i),this._color=e):(i[0]=e[0],i[1]=e[1],i[2]=e[2],this._color=ei(i))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this._alpha},set:function(e){this.uniforms.alpha=e,this._alpha=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-color-replace - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-color-replace is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Mc=function(r,t){return Mc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Mc(r,t)};function YI(r,t){Mc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var qI=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,QI=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec3 originalColor; +uniform vec3 newColor; +uniform float epsilon; +void main(void) { + vec4 currentColor = texture2D(uSampler, vTextureCoord); + vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001)); + float colorDistance = length(colorDiff); + float doReplace = step(colorDistance, epsilon); + gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a); +} +`;(function(r){YI(t,r);function t(e,i,n){e===void 0&&(e=16711680),i===void 0&&(i=0),n===void 0&&(n=.4);var s=r.call(this,qI,QI)||this;return s._originalColor=16711680,s._newColor=0,s.uniforms.originalColor=new Float32Array(3),s.uniforms.newColor=new Float32Array(3),s.originalColor=e,s.newColor=i,s.epsilon=n,s}return Object.defineProperty(t.prototype,"originalColor",{get:function(){return this._originalColor},set:function(e){var i=this.uniforms.originalColor;typeof e=="number"?(Gr(e,i),this._originalColor=e):(i[0]=e[0],i[1]=e[1],i[2]=e[2],this._originalColor=ei(i))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"newColor",{get:function(){return this._newColor},set:function(e){var i=this.uniforms.newColor;typeof e=="number"?(Gr(e,i),this._newColor=e):(i[0]=e[0],i[1]=e[1],i[2]=e[2],this._newColor=ei(i))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"epsilon",{get:function(){return this.uniforms.epsilon},set:function(e){this.uniforms.epsilon=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-convolution - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-convolution is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Dc=function(r,t){return Dc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Dc(r,t)};function KI(r,t){Dc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var ZI=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,JI=`precision mediump float; + +varying mediump vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform vec2 texelSize; +uniform float matrix[9]; + +void main(void) +{ + vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left + vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center + vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right + + vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left + vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center + vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right + + vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left + vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center + vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right + + gl_FragColor = + c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] + + c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] + + c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8]; + + gl_FragColor.a = c22.a; +} +`;(function(r){KI(t,r);function t(e,i,n){i===void 0&&(i=200),n===void 0&&(n=200);var s=r.call(this,ZI,JI)||this;return s.uniforms.texelSize=new Float32Array(2),s.uniforms.matrix=new Float32Array(9),e!==void 0&&(s.matrix=e),s.width=i,s.height=n,s}return Object.defineProperty(t.prototype,"matrix",{get:function(){return this.uniforms.matrix},set:function(e){var i=this;e.forEach(function(n,s){i.uniforms.matrix[s]=n})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1/this.uniforms.texelSize[0]},set:function(e){this.uniforms.texelSize[0]=1/e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return 1/this.uniforms.texelSize[1]},set:function(e){this.uniforms.texelSize[1]=1/e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-cross-hatch - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-cross-hatch is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Rc=function(r,t){return Rc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Rc(r,t)};function tE(r,t){Rc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var eE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,rE=`precision mediump float; + +varying vec2 vTextureCoord; + +uniform sampler2D uSampler; + +void main(void) +{ + float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb); + + gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); + + if (lum < 1.00) + { + if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0) + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.75) + { + if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0) + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.50) + { + if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0) + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } + + if (lum < 0.3) + { + if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0) + { + gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); + } + } +} +`;(function(r){tE(t,r);function t(){return r.call(this,eE,rE)||this}return t})(re);/*! + * @pixi/filter-crt - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-crt is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Nc=function(r,t){return Nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Nc(r,t)};function iE(r,t){Nc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var nE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,sE=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec4 filterArea; +uniform vec2 dimensions; + +const float SQRT_2 = 1.414213; + +const float light = 1.0; + +uniform float curvature; +uniform float lineWidth; +uniform float lineContrast; +uniform bool verticalLine; +uniform float noise; +uniform float noiseSize; + +uniform float vignetting; +uniform float vignettingAlpha; +uniform float vignettingBlur; + +uniform float seed; +uniform float time; + +float rand(vec2 co) { + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; + vec2 dir = vec2(vTextureCoord.xy * filterArea.xy / dimensions - vec2(0.5, 0.5)); + + gl_FragColor = texture2D(uSampler, vTextureCoord); + vec3 rgb = gl_FragColor.rgb; + + if (noise > 0.0 && noiseSize > 0.0) + { + pixelCoord.x = floor(pixelCoord.x / noiseSize); + pixelCoord.y = floor(pixelCoord.y / noiseSize); + float _noise = rand(pixelCoord * noiseSize * seed) - 0.5; + rgb += _noise * noise; + } + + if (lineWidth > 0.0) + { + float _c = curvature > 0. ? curvature : 1.; + float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.; + vec2 uv = dir * k; + + float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c; + float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast; + rgb *= j; + float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.); + rgb *= 0.99 + ceil(segment) * 0.015; + } + + if (vignetting > 0.0) + { + float outter = SQRT_2 - vignetting * SQRT_2; + float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0); + rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha); + } + + gl_FragColor.rgb = rgb; +} +`;(function(r){iE(t,r);function t(e){var i=r.call(this,nE,sE)||this;return i.time=0,i.seed=0,i.uniforms.dimensions=new Float32Array(2),Object.assign(i,t.defaults,e),i}return t.prototype.apply=function(e,i,n,s){var o=i.filterFrame,a=o.width,l=o.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"curvature",{get:function(){return this.uniforms.curvature},set:function(e){this.uniforms.curvature=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineWidth",{get:function(){return this.uniforms.lineWidth},set:function(e){this.uniforms.lineWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineContrast",{get:function(){return this.uniforms.lineContrast},set:function(e){this.uniforms.lineContrast=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticalLine",{get:function(){return this.uniforms.verticalLine},set:function(e){this.uniforms.verticalLine=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.noise},set:function(e){this.uniforms.noise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noiseSize",{get:function(){return this.uniforms.noiseSize},set:function(e){this.uniforms.noiseSize=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetting",{get:function(){return this.uniforms.vignetting},set:function(e){this.uniforms.vignetting=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignettingAlpha",{get:function(){return this.uniforms.vignettingAlpha},set:function(e){this.uniforms.vignettingAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignettingBlur",{get:function(){return this.uniforms.vignettingBlur},set:function(e){this.uniforms.vignettingBlur=e},enumerable:!1,configurable:!0}),t.defaults={curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},t})(re);/*! + * @pixi/filter-dot - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-dot is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Lc=function(r,t){return Lc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Lc(r,t)};function oE(r,t){Lc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var aE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,lE=`precision mediump float; + +varying vec2 vTextureCoord; +varying vec4 vColor; + +uniform vec4 filterArea; +uniform sampler2D uSampler; + +uniform float angle; +uniform float scale; + +float pattern() +{ + float s = sin(angle), c = cos(angle); + vec2 tex = vTextureCoord * filterArea.xy; + vec2 point = vec2( + c * tex.x - s * tex.y, + s * tex.x + c * tex.y + ) * scale; + return (sin(point.x) * sin(point.y)) * 4.0; +} + +void main() +{ + vec4 color = texture2D(uSampler, vTextureCoord); + float average = (color.r + color.g + color.b) / 3.0; + gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a); +} +`;(function(r){oE(t,r);function t(e,i){e===void 0&&(e=1),i===void 0&&(i=5);var n=r.call(this,aE,lE)||this;return n.scale=e,n.angle=i,n}return Object.defineProperty(t.prototype,"scale",{get:function(){return this.uniforms.scale},set:function(e){this.uniforms.scale=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this.uniforms.angle},set:function(e){this.uniforms.angle=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-drop-shadow - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-drop-shadow is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Bc=function(r,t){return Bc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Bc(r,t)};function uE(r,t){Bc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var ol=function(){return ol=Object.assign||function(t){for(var e=arguments,i,n=1,s=arguments.length;n 1.0 || coord.y > 1.0) { + return; + } + + float cx = coord.x - 0.5; + float cy = (coord.y - 0.5) * aspect; + float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5; + + // displacementMap: repeat + // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny); + + // displacementMap: mirror + ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny); + + vec4 dc = texture2D(displacementMap, vec2(0.5, ny)); + + float displacement = (dc.r - dc.g) * (offset / filterArea.x); + + coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect); + + if (fillMode == CLAMP) { + coord = clamp(coord, filterClamp.xy, filterClamp.zw); + } else { + if( coord.x > filterClamp.z ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.x -= filterClamp.z; + } else if (fillMode == MIRROR) { + coord.x = filterClamp.z * 2.0 - coord.x; + } + } else if( coord.x < filterClamp.x ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.x += filterClamp.z; + } else if (fillMode == MIRROR) { + coord.x *= -filterClamp.z; + } + } + + if( coord.y > filterClamp.w ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.y -= filterClamp.w; + } else if (fillMode == MIRROR) { + coord.y = filterClamp.w * 2.0 - coord.y; + } + } else if( coord.y < filterClamp.y ) { + if (fillMode == TRANSPARENT) { + discard; + } else if (fillMode == LOOP) { + coord.y += filterClamp.w; + } else if (fillMode == MIRROR) { + coord.y *= -filterClamp.w; + } + } + } + + gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r; + gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g; + gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b; + gl_FragColor.a = texture2D(uSampler, coord).a; +} +`;(function(r){mE(t,r);function t(e){var i=r.call(this,yE,gE)||this;return i.offset=100,i.fillMode=t.TRANSPARENT,i.average=!1,i.seed=0,i.minSize=8,i.sampleSize=512,i._slices=0,i._offsets=new Float32Array(1),i._sizes=new Float32Array(1),i._direction=-1,i.uniforms.dimensions=new Float32Array(2),i._canvas=document.createElement("canvas"),i._canvas.width=4,i._canvas.height=i.sampleSize,i.texture=Zn.from(i._canvas,{scaleMode:Tr.NEAREST}),Object.assign(i,t.defaults,e),i}return t.prototype.apply=function(e,i,n,s){var o=i.filterFrame,a=o.width,l=o.height;this.uniforms.dimensions[0]=a,this.uniforms.dimensions[1]=l,this.uniforms.aspect=l/a,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,i,n,s)},t.prototype._randomizeSizes=function(){var e=this._sizes,i=this._slices-1,n=this.sampleSize,s=Math.min(this.minSize/n,.9/this._slices);if(this.average){for(var o=this._slices,a=1,l=0;l0;n--){var s=Math.random()*n>>0,o=e[n];e[n]=e[s],e[s]=o}},t.prototype._randomizeOffsets=function(){for(var e=0;e0?s:0,c=s<0?-s:0;n.fillStyle="rgba("+u+", "+c+", 0, 1)",n.fillRect(0,o>>0,e,l+1>>0),o+=l}i.baseTexture.update(),this.uniforms.displacementMap=i},Object.defineProperty(t.prototype,"sizes",{get:function(){return this._sizes},set:function(e){for(var i=Math.min(this._slices,e.length),n=0;n>0)+1},Object.defineProperty(t.prototype,"offset",{get:function(){return this.uniforms.uOffset},set:function(e){this.uniforms.uOffset=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-multi-color-replace - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-multi-color-replace is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Vc=function(r,t){return Vc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Vc(r,t)};function AE(r,t){Vc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var OE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,FE=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform float epsilon; + +const int MAX_COLORS = %maxColors%; + +uniform vec3 originalColors[MAX_COLORS]; +uniform vec3 targetColors[MAX_COLORS]; + +void main(void) +{ + gl_FragColor = texture2D(uSampler, vTextureCoord); + + float alpha = gl_FragColor.a; + if (alpha < 0.0001) + { + return; + } + + vec3 color = gl_FragColor.rgb / alpha; + + for(int i = 0; i < MAX_COLORS; i++) + { + vec3 origColor = originalColors[i]; + if (origColor.r < 0.0) + { + break; + } + vec3 colorDiff = origColor - color; + if (length(colorDiff) < epsilon) + { + vec3 targetColor = targetColors[i]; + gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha); + return; + } + } +} +`;(function(r){AE(t,r);function t(e,i,n){i===void 0&&(i=.05),n===void 0&&(n=e.length);var s=r.call(this,OE,FE.replace(/%maxColors%/g,n.toFixed(0)))||this;return s._replacements=[],s._maxColors=0,s.epsilon=i,s._maxColors=n,s.uniforms.originalColors=new Float32Array(n*3),s.uniforms.targetColors=new Float32Array(n*3),s.replacements=e,s}return Object.defineProperty(t.prototype,"replacements",{get:function(){return this._replacements},set:function(e){var i=this.uniforms.originalColors,n=this.uniforms.targetColors,s=e.length;if(s>this._maxColors)throw new Error("Length of replacements ("+s+") exceeds the maximum colors length ("+this._maxColors+")");i[s*3]=-1;for(var o=0;o 0.5) then: 1 - 2 * (1 - dst) * (1 - src) + return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)), + (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)), + (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z))); +} + + +void main() +{ + gl_FragColor = texture2D(uSampler, vTextureCoord); + vec3 color = gl_FragColor.rgb; + + if (sepia > 0.0) + { + float gray = (color.x + color.y + color.z) / 3.0; + vec3 grayscale = vec3(gray); + + color = Overlay(SEPIA_RGB, grayscale); + + color = grayscale + sepia * (color - grayscale); + } + + vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy; + + if (vignetting > 0.0) + { + float outter = SQRT_2 - vignetting * SQRT_2; + vec2 dir = vec2(vec2(0.5, 0.5) - coord); + dir.y *= dimensions.y / dimensions.x; + float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0); + color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha); + } + + if (scratchDensity > seed && scratch != 0.0) + { + float phase = seed * 256.0; + float s = mod(floor(phase), 2.0); + float dist = 1.0 / scratchDensity; + float d = distance(coord, vec2(seed * dist, abs(s - seed * dist))); + if (d < seed * 0.6 + 0.4) + { + highp float period = scratchDensity * 10.0; + + float xx = coord.x * period + phase; + float aa = abs(mod(xx, 0.5) * 4.0); + float bb = mod(floor(xx / 0.5), 2.0); + float yy = (1.0 - bb) * aa + bb * (2.0 - aa); + + float kk = 2.0 * period; + float dw = scratchWidth / dimensions.x * (0.75 + seed); + float dh = dw * kk; + + float tine = (yy - (2.0 - dh)); + + if (tine > 0.0) { + float _sign = sign(scratch); + + tine = s * tine / period + scratch + 0.1; + tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5); + + color.rgb *= tine; + } + } + } + + if (noise > 0.0 && noiseSize > 0.0) + { + vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; + pixelCoord.x = floor(pixelCoord.x / noiseSize); + pixelCoord.y = floor(pixelCoord.y / noiseSize); + // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0); + // float _noise = snoise(d) * 0.5; + float _noise = rand(pixelCoord * noiseSize * seed) - 0.5; + color += _noise * noise; + } + + gl_FragColor.rgb = color; +} +`;(function(r){PE(t,r);function t(e,i){i===void 0&&(i=0);var n=r.call(this,ME,DE)||this;return n.seed=0,n.uniforms.dimensions=new Float32Array(2),typeof e=="number"?(n.seed=e,e=void 0):n.seed=i,Object.assign(n,t.defaults,e),n}return t.prototype.apply=function(e,i,n,s){var o,a;this.uniforms.dimensions[0]=(o=i.filterFrame)===null||o===void 0?void 0:o.width,this.uniforms.dimensions[1]=(a=i.filterFrame)===null||a===void 0?void 0:a.height,this.uniforms.seed=this.seed,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"sepia",{get:function(){return this.uniforms.sepia},set:function(e){this.uniforms.sepia=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.noise},set:function(e){this.uniforms.noise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noiseSize",{get:function(){return this.uniforms.noiseSize},set:function(e){this.uniforms.noiseSize=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scratch",{get:function(){return this.uniforms.scratch},set:function(e){this.uniforms.scratch=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scratchDensity",{get:function(){return this.uniforms.scratchDensity},set:function(e){this.uniforms.scratchDensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scratchWidth",{get:function(){return this.uniforms.scratchWidth},set:function(e){this.uniforms.scratchWidth=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignetting",{get:function(){return this.uniforms.vignetting},set:function(e){this.uniforms.vignetting=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignettingAlpha",{get:function(){return this.uniforms.vignettingAlpha},set:function(e){this.uniforms.vignettingAlpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vignettingBlur",{get:function(){return this.uniforms.vignettingBlur},set:function(e){this.uniforms.vignettingBlur=e},enumerable:!1,configurable:!0}),t.defaults={sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},t})(re);/*! + * @pixi/filter-outline - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-outline is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Wc=function(r,t){return Wc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Wc(r,t)};function RE(r,t){Wc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var NE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,LE=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec2 thickness; +uniform vec4 outlineColor; +uniform vec4 filterClamp; + +const float DOUBLE_PI = 3.14159265358979323846264 * 2.; + +void main(void) { + vec4 ownColor = texture2D(uSampler, vTextureCoord); + vec4 curColor; + float maxAlpha = 0.; + vec2 displaced; + for (float angle = 0.; angle <= DOUBLE_PI; angle += \${angleStep}) { + displaced.x = vTextureCoord.x + thickness.x * cos(angle); + displaced.y = vTextureCoord.y + thickness.y * sin(angle); + curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw)); + maxAlpha = max(maxAlpha, curColor.a); + } + float resultAlpha = max(maxAlpha, ownColor.a); + gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha); +} +`;(function(r){RE(t,r);function t(e,i,n){e===void 0&&(e=1),i===void 0&&(i=0),n===void 0&&(n=.1);var s=r.call(this,NE,LE.replace(/\$\{angleStep\}/,t.getAngleStep(n)))||this;return s._thickness=1,s.uniforms.thickness=new Float32Array([0,0]),s.uniforms.outlineColor=new Float32Array([0,0,0,1]),Object.assign(s,{thickness:e,color:i,quality:n}),s}return t.getAngleStep=function(e){var i=Math.max(e*t.MAX_SAMPLES,t.MIN_SAMPLES);return(Math.PI*2/i).toFixed(7)},t.prototype.apply=function(e,i,n,s){this.uniforms.thickness[0]=this._thickness/i._frame.width,this.uniforms.thickness[1]=this._thickness/i._frame.height,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"color",{get:function(){return ei(this.uniforms.outlineColor)},set:function(e){Gr(e,this.uniforms.outlineColor)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thickness",{get:function(){return this._thickness},set:function(e){this._thickness=e,this.padding=e},enumerable:!1,configurable:!0}),t.MIN_SAMPLES=1,t.MAX_SAMPLES=100,t})(re);/*! + * @pixi/filter-pixelate - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-pixelate is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Hc=function(r,t){return Hc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Hc(r,t)};function BE(r,t){Hc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var kE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,UE=`precision mediump float; + +varying vec2 vTextureCoord; + +uniform vec2 size; +uniform sampler2D uSampler; + +uniform vec4 filterArea; + +vec2 mapCoord( vec2 coord ) +{ + coord *= filterArea.xy; + coord += filterArea.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= filterArea.zw; + coord /= filterArea.xy; + + return coord; +} + +vec2 pixelate(vec2 coord, vec2 size) +{ + return floor( coord / size ) * size; +} + +void main(void) +{ + vec2 coord = mapCoord(vTextureCoord); + + coord = pixelate(coord, size); + + coord = unmapCoord(coord); + + gl_FragColor = texture2D(uSampler, coord); +} +`;(function(r){BE(t,r);function t(e){e===void 0&&(e=10);var i=r.call(this,kE,UE)||this;return i.size=e,i}return Object.defineProperty(t.prototype,"size",{get:function(){return this.uniforms.size},set:function(e){typeof e=="number"&&(e=[e,e]),this.uniforms.size=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-radial-blur - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-radial-blur is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Xc=function(r,t){return Xc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Xc(r,t)};function zE(r,t){Xc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var jE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,$E=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec4 filterArea; + +uniform float uRadian; +uniform vec2 uCenter; +uniform float uRadius; +uniform int uKernelSize; + +const int MAX_KERNEL_SIZE = 2048; + +void main(void) +{ + vec4 color = texture2D(uSampler, vTextureCoord); + + if (uKernelSize == 0) + { + gl_FragColor = color; + return; + } + + float aspect = filterArea.y / filterArea.x; + vec2 center = uCenter.xy / filterArea.xy; + float gradient = uRadius / filterArea.x * 0.3; + float radius = uRadius / filterArea.x - gradient * 0.5; + int k = uKernelSize - 1; + + vec2 coord = vTextureCoord; + vec2 dir = vec2(center - coord); + float dist = length(vec2(dir.x, dir.y * aspect)); + + float radianStep = uRadian; + if (radius >= 0.0 && dist > radius) { + float delta = dist - radius; + float gap = gradient; + float scale = 1.0 - abs(delta / gap); + if (scale <= 0.0) { + gl_FragColor = color; + return; + } + radianStep *= scale; + } + radianStep /= float(k); + + float s = sin(radianStep); + float c = cos(radianStep); + mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c)); + + for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) { + if (i == k) { + break; + } + + coord -= center; + coord.y *= aspect; + coord = rotationMatrix * coord; + coord.y /= aspect; + coord += center; + + vec4 sample = texture2D(uSampler, coord); + + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + + color += sample; + } + + gl_FragColor = color / float(uKernelSize); +} +`;(function(r){zE(t,r);function t(e,i,n,s){e===void 0&&(e=0),i===void 0&&(i=[0,0]),n===void 0&&(n=5),s===void 0&&(s=-1);var o=r.call(this,jE,$E)||this;return o._angle=0,o.angle=e,o.center=i,o.kernelSize=n,o.radius=s,o}return t.prototype.apply=function(e,i,n,s){this.uniforms.uKernelSize=this._angle!==0?this.kernelSize:0,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-reflection - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-reflection is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Yc=function(r,t){return Yc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Yc(r,t)};function VE(r,t){Yc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var GE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,WE=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; + +uniform vec4 filterArea; +uniform vec4 filterClamp; +uniform vec2 dimensions; + +uniform bool mirror; +uniform float boundary; +uniform vec2 amplitude; +uniform vec2 waveLength; +uniform vec2 alpha; +uniform float time; + +float rand(vec2 co) { + return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void main(void) +{ + vec2 pixelCoord = vTextureCoord.xy * filterArea.xy; + vec2 coord = pixelCoord / dimensions; + + if (coord.y < boundary) { + gl_FragColor = texture2D(uSampler, vTextureCoord); + return; + } + + float k = (coord.y - boundary) / (1. - boundary + 0.0001); + float areaY = boundary * dimensions.y / filterArea.y; + float v = areaY + areaY - vTextureCoord.y; + float y = mirror ? v : vTextureCoord.y; + + float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x; + float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y; + float _alpha = (alpha.y - alpha.x) * k + alpha.x; + + float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude; + x = clamp(x, filterClamp.x, filterClamp.z); + + vec4 color = texture2D(uSampler, vec2(x, y)); + + gl_FragColor = color * _alpha; +} +`;(function(r){VE(t,r);function t(e){var i=r.call(this,GE,WE)||this;return i.time=0,i.uniforms.amplitude=new Float32Array(2),i.uniforms.waveLength=new Float32Array(2),i.uniforms.alpha=new Float32Array(2),i.uniforms.dimensions=new Float32Array(2),Object.assign(i,t.defaults,e),i}return t.prototype.apply=function(e,i,n,s){var o,a;this.uniforms.dimensions[0]=(o=i.filterFrame)===null||o===void 0?void 0:o.width,this.uniforms.dimensions[1]=(a=i.filterFrame)===null||a===void 0?void 0:a.height,this.uniforms.time=this.time,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"mirror",{get:function(){return this.uniforms.mirror},set:function(e){this.uniforms.mirror=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"boundary",{get:function(){return this.uniforms.boundary},set:function(e){this.uniforms.boundary=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"amplitude",{get:function(){return this.uniforms.amplitude},set:function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"waveLength",{get:function(){return this.uniforms.waveLength},set:function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.alpha},set:function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},enumerable:!1,configurable:!0}),t.defaults={mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},t})(re);/*! + * @pixi/filter-rgb-split - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-rgb-split is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var qc=function(r,t){return qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},qc(r,t)};function HE(r,t){qc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var XE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,YE=`precision mediump float; + +varying vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform vec4 filterArea; +uniform vec2 red; +uniform vec2 green; +uniform vec2 blue; + +void main(void) +{ + gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r; + gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g; + gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b; + gl_FragColor.a = texture2D(uSampler, vTextureCoord).a; +} +`;(function(r){HE(t,r);function t(e,i,n){e===void 0&&(e=[-10,0]),i===void 0&&(i=[0,10]),n===void 0&&(n=[0,0]);var s=r.call(this,XE,YE)||this;return s.red=e,s.green=i,s.blue=n,s}return Object.defineProperty(t.prototype,"red",{get:function(){return this.uniforms.red},set:function(e){this.uniforms.red=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"green",{get:function(){return this.uniforms.green},set:function(e){this.uniforms.green=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blue",{get:function(){return this.uniforms.blue},set:function(e){this.uniforms.blue=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-shockwave - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-shockwave is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Qc=function(r,t){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Qc(r,t)};function qE(r,t){Qc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var QE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,KE=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform vec4 filterArea; +uniform vec4 filterClamp; + +uniform vec2 center; + +uniform float amplitude; +uniform float wavelength; +// uniform float power; +uniform float brightness; +uniform float speed; +uniform float radius; + +uniform float time; + +const float PI = 3.14159; + +void main() +{ + float halfWavelength = wavelength * 0.5 / filterArea.x; + float maxRadius = radius / filterArea.x; + float currentRadius = time * speed / filterArea.x; + + float fade = 1.0; + + if (maxRadius > 0.0) { + if (currentRadius > maxRadius) { + gl_FragColor = texture2D(uSampler, vTextureCoord); + return; + } + fade = 1.0 - pow(currentRadius / maxRadius, 2.0); + } + + vec2 dir = vec2(vTextureCoord - center / filterArea.xy); + dir.y *= filterArea.y / filterArea.x; + float dist = length(dir); + + if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) { + gl_FragColor = texture2D(uSampler, vTextureCoord); + return; + } + + vec2 diffUV = normalize(dir); + + float diff = (dist - currentRadius) / halfWavelength; + + float p = 1.0 - pow(abs(diff), 2.0); + + // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade ); + float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade ); + + vec2 offset = diffUV * powDiff / filterArea.xy; + + // Do clamp : + vec2 coord = vTextureCoord + offset; + vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw); + vec4 color = texture2D(uSampler, clampedCoord); + if (coord != clampedCoord) { + color *= max(0.0, 1.0 - length(coord - clampedCoord)); + } + + // No clamp : + // gl_FragColor = texture2D(uSampler, vTextureCoord + offset); + + color.rgb *= 1.0 + (brightness - 1.0) * p * fade; + + gl_FragColor = color; +} +`;(function(r){qE(t,r);function t(e,i,n){e===void 0&&(e=[0,0]),n===void 0&&(n=0);var s=r.call(this,QE,KE)||this;return s.center=e,Object.assign(s,t.defaults,i),s.time=n,s}return t.prototype.apply=function(e,i,n,s){this.uniforms.time=this.time,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"center",{get:function(){return this.uniforms.center},set:function(e){this.uniforms.center=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"amplitude",{get:function(){return this.uniforms.amplitude},set:function(e){this.uniforms.amplitude=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wavelength",{get:function(){return this.uniforms.wavelength},set:function(e){this.uniforms.wavelength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"brightness",{get:function(){return this.uniforms.brightness},set:function(e){this.uniforms.brightness=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this.uniforms.speed},set:function(e){this.uniforms.speed=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),t.defaults={amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t})(re);/*! + * @pixi/filter-simple-lightmap - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-simple-lightmap is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Kc=function(r,t){return Kc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Kc(r,t)};function ZE(r,t){Kc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var JE=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,tC=`varying vec2 vTextureCoord; +uniform sampler2D uSampler; +uniform sampler2D uLightmap; +uniform vec4 filterArea; +uniform vec2 dimensions; +uniform vec4 ambientColor; +void main() { + vec4 diffuseColor = texture2D(uSampler, vTextureCoord); + vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions; + vec4 light = texture2D(uLightmap, lightCoord); + vec3 ambient = ambientColor.rgb * ambientColor.a; + vec3 intensity = ambient + light.rgb; + vec3 finalColor = diffuseColor.rgb * intensity; + gl_FragColor = vec4(finalColor, diffuseColor.a); +} +`;(function(r){ZE(t,r);function t(e,i,n){i===void 0&&(i=0),n===void 0&&(n=1);var s=r.call(this,JE,tC)||this;return s._color=0,s.uniforms.dimensions=new Float32Array(2),s.uniforms.ambientColor=new Float32Array([0,0,0,n]),s.texture=e,s.color=i,s}return t.prototype.apply=function(e,i,n,s){var o,a;this.uniforms.dimensions[0]=(o=i.filterFrame)===null||o===void 0?void 0:o.width,this.uniforms.dimensions[1]=(a=i.filterFrame)===null||a===void 0?void 0:a.height,e.applyFilter(this,i,n,s)},Object.defineProperty(t.prototype,"texture",{get:function(){return this.uniforms.uLightmap},set:function(e){this.uniforms.uLightmap=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._color},set:function(e){var i=this.uniforms.ambientColor;typeof e=="number"?(Gr(e,i),this._color=e):(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],this._color=ei(i))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.ambientColor[3]},set:function(e){this.uniforms.ambientColor[3]=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-tilt-shift - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-tilt-shift is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Zc=function(r,t){return Zc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Zc(r,t)};function Jl(r,t){Zc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var eC=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,rC=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform float blur; +uniform float gradientBlur; +uniform vec2 start; +uniform vec2 end; +uniform vec2 delta; +uniform vec2 texSize; + +float random(vec3 scale, float seed) +{ + return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed); +} + +void main(void) +{ + vec4 color = vec4(0.0); + float total = 0.0; + + float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0); + vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x)); + float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur; + + for (float t = -30.0; t <= 30.0; t++) + { + float percent = (t + offset - 0.5) / 30.0; + float weight = 1.0 - abs(percent); + vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius); + sample.rgb *= sample.a; + color += sample * weight; + total += weight; + } + + color /= total; + color.rgb /= color.a + 0.00001; + + gl_FragColor = color; +} +`,vv=function(r){Jl(t,r);function t(e,i,n,s){e===void 0&&(e=100),i===void 0&&(i=600);var o=r.call(this,eC,rC)||this;return o.uniforms.blur=e,o.uniforms.gradientBlur=i,o.uniforms.start=n||new Ee(0,window.innerHeight/2),o.uniforms.end=s||new Ee(600,window.innerHeight/2),o.uniforms.delta=new Ee(30,30),o.uniforms.texSize=new Ee(window.innerWidth,window.innerHeight),o.updateDelta(),o}return t.prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},Object.defineProperty(t.prototype,"blur",{get:function(){return this.uniforms.blur},set:function(e){this.uniforms.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradientBlur",{get:function(){return this.uniforms.gradientBlur},set:function(e){this.uniforms.gradientBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"start",{get:function(){return this.uniforms.start},set:function(e){this.uniforms.start=e,this.updateDelta()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.uniforms.end},set:function(e){this.uniforms.end=e,this.updateDelta()},enumerable:!1,configurable:!0}),t}(re),iC=function(r){Jl(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,i=this.uniforms.end.y-this.uniforms.start.y,n=Math.sqrt(e*e+i*i);this.uniforms.delta.x=e/n,this.uniforms.delta.y=i/n},t}(vv),nC=function(r){Jl(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,i=this.uniforms.end.y-this.uniforms.start.y,n=Math.sqrt(e*e+i*i);this.uniforms.delta.x=-i/n,this.uniforms.delta.y=e/n},t}(vv);(function(r){Jl(t,r);function t(e,i,n,s){e===void 0&&(e=100),i===void 0&&(i=600);var o=r.call(this)||this;return o.tiltShiftXFilter=new iC(e,i,n,s),o.tiltShiftYFilter=new nC(e,i,n,s),o}return t.prototype.apply=function(e,i,n,s){var o=e.getFilterTexture();this.tiltShiftXFilter.apply(e,i,o,1),this.tiltShiftYFilter.apply(e,o,n,s),e.returnFilterTexture(o)},Object.defineProperty(t.prototype,"blur",{get:function(){return this.tiltShiftXFilter.blur},set:function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gradientBlur",{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"start",{get:function(){return this.tiltShiftXFilter.start},set:function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"end",{get:function(){return this.tiltShiftXFilter.end},set:function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},enumerable:!1,configurable:!0}),t})(re);/*! + * @pixi/filter-twist - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-twist is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Jc=function(r,t){return Jc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},Jc(r,t)};function sC(r,t){Jc(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var oC=`attribute vec2 aVertexPosition; +attribute vec2 aTextureCoord; + +uniform mat3 projectionMatrix; + +varying vec2 vTextureCoord; + +void main(void) +{ + gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); + vTextureCoord = aTextureCoord; +}`,aC=`varying vec2 vTextureCoord; + +uniform sampler2D uSampler; +uniform float radius; +uniform float angle; +uniform vec2 offset; +uniform vec4 filterArea; + +vec2 mapCoord( vec2 coord ) +{ + coord *= filterArea.xy; + coord += filterArea.zw; + + return coord; +} + +vec2 unmapCoord( vec2 coord ) +{ + coord -= filterArea.zw; + coord /= filterArea.xy; + + return coord; +} + +vec2 twist(vec2 coord) +{ + coord -= offset; + + float dist = length(coord); + + if (dist < radius) + { + float ratioDist = (radius - dist) / radius; + float angleMod = ratioDist * ratioDist * angle; + float s = sin(angleMod); + float c = cos(angleMod); + coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c); + } + + coord += offset; + + return coord; +} + +void main(void) +{ + + vec2 coord = mapCoord(vTextureCoord); + + coord = twist(coord); + + coord = unmapCoord(coord); + + gl_FragColor = texture2D(uSampler, coord ); + +} +`;(function(r){sC(t,r);function t(e){var i=r.call(this,oC,aC)||this;return Object.assign(i,t.defaults,e),i}return Object.defineProperty(t.prototype,"offset",{get:function(){return this.uniforms.offset},set:function(e){this.uniforms.offset=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.radius},set:function(e){this.uniforms.radius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this.uniforms.angle},set:function(e){this.uniforms.angle=e},enumerable:!1,configurable:!0}),t.defaults={radius:200,angle:4,padding:20,offset:new Ee},t})(re);/*! + * @pixi/filter-zoom-blur - v4.2.0 + * Compiled Fri, 05 Aug 2022 19:53:35 UTC + * + * @pixi/filter-zoom-blur is licensed under the MIT License. + * http://www.opensource.org/licenses/mit-license + *//*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var th=function(r,t){return th=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},th(r,t)};function lC(r,t){th(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function uC(r,t){var e={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&t.indexOf(i)<0&&(e[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n= 0.0 && dist > radius) { // radius < 0 means it's infinity + delta = dist - radius; + gap = gradient; + } + + if (delta > 0.0) { + float normalCount = gap / filterArea.x; + delta = (normalCount - delta) / normalCount; + countLimit *= delta; + strength *= delta; + if (countLimit < 1.0) + { + gl_FragColor = texture2D(uSampler, vTextureCoord); + return; + } + } + + // randomize the lookup values to hide the fixed number of samples + float offset = rand(vTextureCoord, 0.0); + + float total = 0.0; + vec4 color = vec4(0.0); + + dir *= strength; + + for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) { + float percent = (t + offset) / MAX_KERNEL_SIZE; + float weight = 4.0 * (percent - percent * percent); + vec2 p = vTextureCoord + dir * percent; + vec4 sample = texture2D(uSampler, p); + + // switch to pre-multiplied alpha to correctly blur transparent images + // sample.rgb *= sample.a; + + color += sample * weight; + total += weight; + + if (t > countLimit){ + break; + } + } + + color /= total; + // switch back from pre-multiplied alpha + // color.rgb /= color.a + 0.00001; + + gl_FragColor = color; +} +`;(function(r){lC(t,r);function t(e){var i=this,n=Object.assign(t.defaults,e),s=n.maxKernelSize,o=uC(n,["maxKernelSize"]);return i=r.call(this,cC,hC.replace("${maxKernelSize}",s.toFixed(1)))||this,Object.assign(i,o),i}return Object.defineProperty(t.prototype,"center",{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this.uniforms.uStrength},set:function(e){this.uniforms.uStrength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"innerRadius",{get:function(){return this.uniforms.uInnerRadius},set:function(e){this.uniforms.uInnerRadius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),t.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32},t})(re);var Gu={exports:{}};/*! + +JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/main/LICENSE +*/var lp;function fC(){return lp||(lp=1,function(r,t){(function(e){r.exports=e()})(function(){return function e(i,n,s){function o(u,c){if(!n[u]){if(!i[u]){var h=typeof un=="function"&&un;if(!c&&h)return h(u,!0);if(a)return a(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var f=n[u]={exports:{}};i[u][0].call(f.exports,function(y){var g=i[u][1][y];return o(g||y)},f,f.exports,e,i,n,s)}return n[u].exports}for(var a=typeof un=="function"&&un,l=0;l>2,f=(3&u)<<4|c>>4,y=1>6:64,g=2>4,c=(15&p)<<4|(f=a.indexOf(l.charAt(g++)))>>2,h=(3&f)<<6|(y=a.indexOf(l.charAt(g++))),_[d++]=u,f!==64&&(_[d++]=c),y!==64&&(_[d++]=h);return _}},{"./support":30,"./utils":32}],2:[function(e,i,n){var s=e("./external"),o=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),l=e("./stream/DataLengthProbe");function u(c,h,p,f,y){this.compressedSize=c,this.uncompressedSize=h,this.crc32=p,this.compression=f,this.compressedContent=y}u.prototype={getContentWorker:function(){var c=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return c.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),c},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(c,h,p){return c.pipe(new a).pipe(new l("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},i.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,i,n){var s=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,i,n){var s=e("./utils"),o=function(){for(var a,l=[],u=0;u<256;u++){a=u;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l}();i.exports=function(a,l){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(u,c,h,p){var f=o,y=p+h;u^=-1;for(var g=p;g>>8^f[255&(u^c[g])];return-1^u}(0|l,a,a.length,0):function(u,c,h,p){var f=o,y=p+h;u^=-1;for(var g=p;g>>8^f[255&(u^c.charCodeAt(g))];return-1^u}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(e,i,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,i,n){var s=null;s=typeof Promise<"u"?Promise:e("lie"),i.exports={Promise:s}},{lie:37}],7:[function(e,i,n){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=e("pako"),a=e("./utils"),l=e("./stream/GenericWorker"),u=s?"uint8array":"array";function c(h,p){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}n.magic="\b\0",a.inherits(c,l),c.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,h.data),!1)},c.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},n.compressWorker=function(h){return new c("Deflate",h)},n.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,i,n){function s(f,y){var g,d="";for(g=0;g>>=8;return d}function o(f,y,g,d,m,_){var S,E,b=f.file,F=f.compression,x=_!==u.utf8encode,z=a.transformTo("string",_(b.name)),B=a.transformTo("string",u.utf8encode(b.name)),tt=b.comment,st=a.transformTo("string",_(tt)),I=a.transformTo("string",u.utf8encode(tt)),Z=B.length!==b.name.length,w=I.length!==tt.length,it="",M="",O="",D=b.dir,U=b.date,k={crc32:0,compressedSize:0,uncompressedSize:0};y&&!g||(k.crc32=f.crc32,k.compressedSize=f.compressedSize,k.uncompressedSize=f.uncompressedSize);var C=0;y&&(C|=8),x||!Z&&!w||(C|=2048);var A=0,V=0;D&&(A|=16),m==="UNIX"?(V=798,A|=function(J,yt){var vt=J;return J||(vt=yt?16893:33204),(65535&vt)<<16}(b.unixPermissions,D)):(V=20,A|=function(J){return 63&(J||0)}(b.dosPermissions)),S=U.getUTCHours(),S<<=6,S|=U.getUTCMinutes(),S<<=5,S|=U.getUTCSeconds()/2,E=U.getUTCFullYear()-1980,E<<=4,E|=U.getUTCMonth()+1,E<<=5,E|=U.getUTCDate(),Z&&(M=s(1,1)+s(c(z),4)+B,it+="up"+s(M.length,2)+M),w&&(O=s(1,1)+s(c(st),4)+I,it+="uc"+s(O.length,2)+O);var et="";return et+=` +\0`,et+=s(C,2),et+=F.magic,et+=s(S,2),et+=s(E,2),et+=s(k.crc32,4),et+=s(k.compressedSize,4),et+=s(k.uncompressedSize,4),et+=s(z.length,2),et+=s(it.length,2),{fileRecord:h.LOCAL_FILE_HEADER+et+z+it,dirRecord:h.CENTRAL_FILE_HEADER+s(V,2)+et+s(st.length,2)+"\0\0\0\0"+s(A,4)+s(d,4)+z+it+st}}var a=e("../utils"),l=e("../stream/GenericWorker"),u=e("../utf8"),c=e("../crc32"),h=e("../signature");function p(f,y,g,d){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=g,this.encodeFileName=d,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(f){var y=f.meta.percent||0,g=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(y+100*(g-d-1))/g:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var y=this.streamFiles&&!f.file.dir;if(y){var g=o(f,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(f){this.accumulate=!1;var y=this.streamFiles&&!f.file.dir,g=o(f,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),y)this.push({data:function(d){return h.DATA_DESCRIPTOR+s(d.crc32,4)+s(d.compressedSize,4)+s(d.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var f=this.bytesWritten,y=0;y=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},i.exports=o},{"../utils":32}],19:[function(e,i,n){var s=e("./Uint8ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,i,n){var s=e("./DataReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./DataReader":18}],21:[function(e,i,n){var s=e("./ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(e,i,n){var s=e("../utils"),o=e("../support"),a=e("./ArrayReader"),l=e("./StringReader"),u=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");i.exports=function(h){var p=s.getTypeOf(h);return s.checkSupport(p),p!=="string"||o.uint8array?p==="nodebuffer"?new u(h):o.uint8array?new c(s.transformTo("uint8array",h)):new a(s.transformTo("array",h)):new l(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,i,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,i,n){var s=e("./GenericWorker"),o=e("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},i.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,i,n){var s=e("./GenericWorker"),o=e("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},i.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},i.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(c){u.dataIsReady=!0,u.data=c,u.max=c&&c.length||0,u.type=s.getTypeOf(c),u.isPaused||u._tickAndRepeat()},function(c){u.error(c)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,i,n){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},i.exports=s},{}],29:[function(e,i,n){var s=e("../utils"),o=e("./ConvertWorker"),a=e("./GenericWorker"),l=e("../base64"),u=e("../support"),c=e("../external"),h=null;if(u.nodestream)try{h=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(y,g){return new c.Promise(function(d,m){var _=[],S=y._internalType,E=y._outputType,b=y._mimeType;y.on("data",function(F,x){_.push(F),g&&g(x)}).on("error",function(F){_=[],m(F)}).on("end",function(){try{var F=function(x,z,B){switch(x){case"blob":return s.newBlob(s.transformTo("arraybuffer",z),B);case"base64":return l.encode(z);default:return s.transformTo(x,z)}}(E,function(x,z){var B,tt=0,st=null,I=0;for(B=0;B"u")n.blob=!1;else{var s=new ArrayBuffer(0);try{n.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),n.blob=o.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,i,n){for(var s=e("./utils"),o=e("./support"),a=e("./nodejsUtils"),l=e("./stream/GenericWorker"),u=new Array(256),c=0;c<256;c++)u[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;u[254]=u[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}n.utf8encode=function(f){return o.nodebuffer?a.newBufferFrom(f,"utf-8"):function(y){var g,d,m,_,S,E=y.length,b=0;for(_=0;_>>6:(d<65536?g[S++]=224|d>>>12:(g[S++]=240|d>>>18,g[S++]=128|d>>>12&63),g[S++]=128|d>>>6&63),g[S++]=128|63&d);return g}(f)},n.utf8decode=function(f){return o.nodebuffer?s.transformTo("nodebuffer",f).toString("utf-8"):function(y){var g,d,m,_,S=y.length,E=new Array(2*S);for(g=d=0;g>10&1023,E[d++]=56320|1023&m)}return E.length!==d&&(E.subarray?E=E.subarray(0,d):E.length=d),s.applyFromCharCode(E)}(f=s.transformTo(o.uint8array?"uint8array":"array",f))},s.inherits(h,l),h.prototype.processChunk=function(f){var y=s.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=y;(y=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),y.set(g,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var d=function(_,S){var E;for((S=S||_.length)>_.length&&(S=_.length),E=S-1;0<=E&&(192&_[E])==128;)E--;return E<0||E===0?S:E+u[_[E]]>S?E:S}(y),m=y;d!==y.length&&(o.uint8array?(m=y.subarray(0,d),this.leftOver=y.subarray(d,y.length)):(m=y.slice(0,d),this.leftOver=y.slice(d,y.length))),this.push({data:n.utf8decode(m),meta:f.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=h,s.inherits(p,l),p.prototype.processChunk=function(f){this.push({data:n.utf8encode(f.data),meta:f.meta})},n.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,i,n){var s=e("./support"),o=e("./base64"),a=e("./nodejsUtils"),l=e("./external");function u(g){return g}function c(g,d){for(var m=0;m>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var y,g,d,m=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?p[d++]=224|f>>>12:(p[d++]=240|f>>>18,p[d++]=128|f>>>12&63),p[d++]=128|f>>>6&63),p[d++]=128|63&f);return p},n.buf2binstring=function(h){return c(h,h.length)},n.binstring2buf=function(h){for(var p=new s.Buf8(h.length),f=0,y=p.length;f>10&1023,_[y++]=56320|1023&g)}return c(_,y)},n.utf8border=function(h,p){var f;for((p=p||h.length)>h.length&&(p=h.length),f=p-1;0<=f&&(192&h[f])==128;)f--;return f<0||f===0?p:f+l[h[f]]>p?f:p}},{"./common":41}],43:[function(e,i,n){i.exports=function(s,o,a,l){for(var u=65535&s|0,c=s>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3>>1:o>>>1;a[l]=o}return a}();i.exports=function(o,a,l,u){var c=s,h=u+l;o^=-1;for(var p=u;p>>8^c[255&(o^a[p])];return-1^o}},{}],46:[function(e,i,n){var s,o=e("../utils/common"),a=e("./trees"),l=e("./adler32"),u=e("./crc32"),c=e("./messages"),h=0,p=4,f=0,y=-2,g=-1,d=4,m=2,_=8,S=9,E=286,b=30,F=19,x=2*E+1,z=15,B=3,tt=258,st=tt+B+1,I=42,Z=113,w=1,it=2,M=3,O=4;function D(v,K){return v.msg=c[K],K}function U(v){return(v<<1)-(4v.avail_out&&(q=v.avail_out),q!==0&&(o.arraySet(v.output,K.pending_buf,K.pending_out,q,v.next_out),v.next_out+=q,K.pending_out+=q,v.total_out+=q,v.avail_out-=q,K.pending-=q,K.pending===0&&(K.pending_out=0))}function A(v,K){a._tr_flush_block(v,0<=v.block_start?v.block_start:-1,v.strstart-v.block_start,K),v.block_start=v.strstart,C(v.strm)}function V(v,K){v.pending_buf[v.pending++]=K}function et(v,K){v.pending_buf[v.pending++]=K>>>8&255,v.pending_buf[v.pending++]=255&K}function J(v,K){var q,N,R=v.max_chain_length,Y=v.strstart,ot=v.prev_length,at=v.nice_match,rt=v.strstart>v.w_size-st?v.strstart-(v.w_size-st):0,ht=v.window,bt=v.w_mask,pt=v.prev,Ot=v.strstart+tt,ye=ht[Y+ot-1],oe=ht[Y+ot];v.prev_length>=v.good_match&&(R>>=2),at>v.lookahead&&(at=v.lookahead);do if(ht[(q=K)+ot]===oe&&ht[q+ot-1]===ye&&ht[q]===ht[Y]&&ht[++q]===ht[Y+1]){Y+=2,q++;do;while(ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&Yrt&&--R!=0);return ot<=v.lookahead?ot:v.lookahead}function yt(v){var K,q,N,R,Y,ot,at,rt,ht,bt,pt=v.w_size;do{if(R=v.window_size-v.lookahead-v.strstart,v.strstart>=pt+(pt-st)){for(o.arraySet(v.window,v.window,pt,pt,0),v.match_start-=pt,v.strstart-=pt,v.block_start-=pt,K=q=v.hash_size;N=v.head[--K],v.head[K]=pt<=N?N-pt:0,--q;);for(K=q=pt;N=v.prev[--K],v.prev[K]=pt<=N?N-pt:0,--q;);R+=pt}if(v.strm.avail_in===0)break;if(ot=v.strm,at=v.window,rt=v.strstart+v.lookahead,ht=R,bt=void 0,bt=ot.avail_in,ht=B)for(Y=v.strstart-v.insert,v.ins_h=v.window[Y],v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B)if(N=a._tr_tally(v,v.strstart-v.match_start,v.match_length-B),v.lookahead-=v.match_length,v.match_length<=v.max_lazy_match&&v.lookahead>=B){for(v.match_length--;v.strstart++,v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B&&v.match_length<=v.prev_length){for(R=v.strstart+v.lookahead-B,N=a._tr_tally(v,v.strstart-1-v.prev_match,v.prev_length-B),v.lookahead-=v.prev_length-1,v.prev_length-=2;++v.strstart<=R&&(v.ins_h=(v.ins_h<v.pending_buf_size-5&&(q=v.pending_buf_size-5);;){if(v.lookahead<=1){if(yt(v),v.lookahead===0&&K===h)return w;if(v.lookahead===0)break}v.strstart+=v.lookahead,v.lookahead=0;var N=v.block_start+q;if((v.strstart===0||v.strstart>=N)&&(v.lookahead=v.strstart-N,v.strstart=N,A(v,!1),v.strm.avail_out===0)||v.strstart-v.block_start>=v.w_size-st&&(A(v,!1),v.strm.avail_out===0))return w}return v.insert=0,K===p?(A(v,!0),v.strm.avail_out===0?M:O):(v.strstart>v.block_start&&(A(v,!1),v.strm.avail_out),w)}),new _t(4,4,8,4,vt),new _t(4,5,16,8,vt),new _t(4,6,32,32,vt),new _t(4,4,16,16,dt),new _t(8,16,32,32,dt),new _t(8,16,128,128,dt),new _t(8,32,128,256,dt),new _t(32,128,258,1024,dt),new _t(32,258,258,4096,dt)],n.deflateInit=function(v,K){return he(v,K,_,15,8,0)},n.deflateInit2=he,n.deflateReset=ee,n.deflateResetKeep=Ct,n.deflateSetHeader=function(v,K){return v&&v.state?v.state.wrap!==2?y:(v.state.gzhead=K,f):y},n.deflate=function(v,K){var q,N,R,Y;if(!v||!v.state||5>8&255),V(N,N.gzhead.time>>16&255),V(N,N.gzhead.time>>24&255),V(N,N.level===9?2:2<=N.strategy||N.level<2?4:0),V(N,255&N.gzhead.os),N.gzhead.extra&&N.gzhead.extra.length&&(V(N,255&N.gzhead.extra.length),V(N,N.gzhead.extra.length>>8&255)),N.gzhead.hcrc&&(v.adler=u(v.adler,N.pending_buf,N.pending,0)),N.gzindex=0,N.status=69):(V(N,0),V(N,0),V(N,0),V(N,0),V(N,0),V(N,N.level===9?2:2<=N.strategy||N.level<2?4:0),V(N,3),N.status=Z);else{var ot=_+(N.w_bits-8<<4)<<8;ot|=(2<=N.strategy||N.level<2?0:N.level<6?1:N.level===6?2:3)<<6,N.strstart!==0&&(ot|=32),ot+=31-ot%31,N.status=Z,et(N,ot),N.strstart!==0&&(et(N,v.adler>>>16),et(N,65535&v.adler)),v.adler=1}if(N.status===69)if(N.gzhead.extra){for(R=N.pending;N.gzindex<(65535&N.gzhead.extra.length)&&(N.pending!==N.pending_buf_size||(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending!==N.pending_buf_size));)V(N,255&N.gzhead.extra[N.gzindex]),N.gzindex++;N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),N.gzindex===N.gzhead.extra.length&&(N.gzindex=0,N.status=73)}else N.status=73;if(N.status===73)if(N.gzhead.name){R=N.pending;do{if(N.pending===N.pending_buf_size&&(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending===N.pending_buf_size)){Y=1;break}Y=N.gzindexR&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),Y===0&&(N.gzindex=0,N.status=91)}else N.status=91;if(N.status===91)if(N.gzhead.comment){R=N.pending;do{if(N.pending===N.pending_buf_size&&(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending===N.pending_buf_size)){Y=1;break}Y=N.gzindexR&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),Y===0&&(N.status=103)}else N.status=103;if(N.status===103&&(N.gzhead.hcrc?(N.pending+2>N.pending_buf_size&&C(v),N.pending+2<=N.pending_buf_size&&(V(N,255&v.adler),V(N,v.adler>>8&255),v.adler=0,N.status=Z)):N.status=Z),N.pending!==0){if(C(v),v.avail_out===0)return N.last_flush=-1,f}else if(v.avail_in===0&&U(K)<=U(q)&&K!==p)return D(v,-5);if(N.status===666&&v.avail_in!==0)return D(v,-5);if(v.avail_in!==0||N.lookahead!==0||K!==h&&N.status!==666){var at=N.strategy===2?function(rt,ht){for(var bt;;){if(rt.lookahead===0&&(yt(rt),rt.lookahead===0)){if(ht===h)return w;break}if(rt.match_length=0,bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++,bt&&(A(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(A(rt,!0),rt.strm.avail_out===0?M:O):rt.last_lit&&(A(rt,!1),rt.strm.avail_out===0)?w:it}(N,K):N.strategy===3?function(rt,ht){for(var bt,pt,Ot,ye,oe=rt.window;;){if(rt.lookahead<=tt){if(yt(rt),rt.lookahead<=tt&&ht===h)return w;if(rt.lookahead===0)break}if(rt.match_length=0,rt.lookahead>=B&&0rt.lookahead&&(rt.match_length=rt.lookahead)}if(rt.match_length>=B?(bt=a._tr_tally(rt,1,rt.match_length-B),rt.lookahead-=rt.match_length,rt.strstart+=rt.match_length,rt.match_length=0):(bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++),bt&&(A(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(A(rt,!0),rt.strm.avail_out===0?M:O):rt.last_lit&&(A(rt,!1),rt.strm.avail_out===0)?w:it}(N,K):s[N.level].func(N,K);if(at!==M&&at!==O||(N.status=666),at===w||at===M)return v.avail_out===0&&(N.last_flush=-1),f;if(at===it&&(K===1?a._tr_align(N):K!==5&&(a._tr_stored_block(N,0,0,!1),K===3&&(k(N.head),N.lookahead===0&&(N.strstart=0,N.block_start=0,N.insert=0))),C(v),v.avail_out===0))return N.last_flush=-1,f}return K!==p?f:N.wrap<=0?1:(N.wrap===2?(V(N,255&v.adler),V(N,v.adler>>8&255),V(N,v.adler>>16&255),V(N,v.adler>>24&255),V(N,255&v.total_in),V(N,v.total_in>>8&255),V(N,v.total_in>>16&255),V(N,v.total_in>>24&255)):(et(N,v.adler>>>16),et(N,65535&v.adler)),C(v),0=q.w_size&&(Y===0&&(k(q.head),q.strstart=0,q.block_start=0,q.insert=0),ht=new o.Buf8(q.w_size),o.arraySet(ht,K,bt-q.w_size,q.w_size,0),K=ht,bt=q.w_size),ot=v.avail_in,at=v.next_in,rt=v.input,v.avail_in=bt,v.next_in=0,v.input=K,yt(q);q.lookahead>=B;){for(N=q.strstart,R=q.lookahead-(B-1);q.ins_h=(q.ins_h<>>=B=z>>>24,S-=B,(B=z>>>16&255)===0)it[c++]=65535&z;else{if(!(16&B)){if((64&B)==0){z=E[(65535&z)+(_&(1<>>=B,S-=B),S<15&&(_+=w[l++]<>>=B=z>>>24,S-=B,!(16&(B=z>>>16&255))){if((64&B)==0){z=b[(65535&z)+(_&(1<>>=B,S-=B,(B=c-h)>3,_&=(1<<(S-=tt<<3))-1,s.next_in=l,s.next_out=c,s.avail_in=l>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(I){var Z;return I&&I.state?(Z=I.state,I.total_in=I.total_out=Z.total=0,I.msg="",Z.wrap&&(I.adler=1&Z.wrap),Z.mode=y,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new s.Buf32(g),Z.distcode=Z.distdyn=new s.Buf32(d),Z.sane=1,Z.back=-1,p):f}function E(I){var Z;return I&&I.state?((Z=I.state).wsize=0,Z.whave=0,Z.wnext=0,S(I)):f}function b(I,Z){var w,it;return I&&I.state?(it=I.state,Z<0?(w=0,Z=-Z):(w=1+(Z>>4),Z<48&&(Z&=15)),Z&&(Z<8||15=O.wsize?(s.arraySet(O.window,Z,w-O.wsize,O.wsize,0),O.wnext=0,O.whave=O.wsize):(it<(M=O.wsize-O.wnext)&&(M=it),s.arraySet(O.window,Z,w-it,M,O.wnext),(it-=M)?(s.arraySet(O.window,Z,w-it,it,0),O.wnext=it,O.whave=O.wsize):(O.wnext+=M,O.wnext===O.wsize&&(O.wnext=0),O.whave>>8&255,w.check=a(w.check,Y,2,0),A=C=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&C)<<8)+(C>>8))%31){I.msg="incorrect header check",w.mode=30;break}if((15&C)!=8){I.msg="unknown compression method",w.mode=30;break}if(A-=4,v=8+(15&(C>>>=4)),w.wbits===0)w.wbits=v;else if(v>w.wbits){I.msg="invalid window size",w.mode=30;break}w.dmax=1<>8&1),512&w.flags&&(Y[0]=255&C,Y[1]=C>>>8&255,w.check=a(w.check,Y,2,0)),A=C=0,w.mode=3;case 3:for(;A<32;){if(U===0)break t;U--,C+=it[O++]<>>8&255,Y[2]=C>>>16&255,Y[3]=C>>>24&255,w.check=a(w.check,Y,4,0)),A=C=0,w.mode=4;case 4:for(;A<16;){if(U===0)break t;U--,C+=it[O++]<>8),512&w.flags&&(Y[0]=255&C,Y[1]=C>>>8&255,w.check=a(w.check,Y,2,0)),A=C=0,w.mode=5;case 5:if(1024&w.flags){for(;A<16;){if(U===0)break t;U--,C+=it[O++]<>>8&255,w.check=a(w.check,Y,2,0)),A=C=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(U<(J=w.length)&&(J=U),J&&(w.head&&(v=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),s.arraySet(w.head.extra,it,O,J,v)),512&w.flags&&(w.check=a(w.check,it,J,O)),U-=J,O+=J,w.length-=J),w.length))break t;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(U===0)break t;for(J=0;v=it[O+J++],w.head&&v&&w.length<65536&&(w.head.name+=String.fromCharCode(v)),v&&J>9&1,w.head.done=!0),I.adler=w.check=0,w.mode=12;break;case 10:for(;A<32;){if(U===0)break t;U--,C+=it[O++]<>>=7&A,A-=7&A,w.mode=27;break}for(;A<3;){if(U===0)break t;U--,C+=it[O++]<>>=1)){case 0:w.mode=14;break;case 1:if(tt(w),w.mode=20,Z!==6)break;C>>>=2,A-=2;break t;case 2:w.mode=17;break;case 3:I.msg="invalid block type",w.mode=30}C>>>=2,A-=2;break;case 14:for(C>>>=7&A,A-=7&A;A<32;){if(U===0)break t;U--,C+=it[O++]<>>16^65535)){I.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&C,A=C=0,w.mode=15,Z===6)break t;case 15:w.mode=16;case 16:if(J=w.length){if(U>>=5,A-=5,w.ndist=1+(31&C),C>>>=5,A-=5,w.ncode=4+(15&C),C>>>=4,A-=4,286>>=3,A-=3}for(;w.have<19;)w.lens[ot[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,q={bits:w.lenbits},K=u(0,w.lens,0,19,w.lencode,0,w.work,q),w.lenbits=q.bits,K){I.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=dt,A-=dt,w.lens[w.have++]=gt;else{if(gt===16){for(N=dt+2;A>>=dt,A-=dt,w.have===0){I.msg="invalid bit length repeat",w.mode=30;break}v=w.lens[w.have-1],J=3+(3&C),C>>>=2,A-=2}else if(gt===17){for(N=dt+3;A>>=dt)),C>>>=3,A-=3}else{for(N=dt+7;A>>=dt)),C>>>=7,A-=7}if(w.have+J>w.nlen+w.ndist){I.msg="invalid bit length repeat",w.mode=30;break}for(;J--;)w.lens[w.have++]=v}}if(w.mode===30)break;if(w.lens[256]===0){I.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,q={bits:w.lenbits},K=u(c,w.lens,0,w.nlen,w.lencode,0,w.work,q),w.lenbits=q.bits,K){I.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,q={bits:w.distbits},K=u(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,q),w.distbits=q.bits,K){I.msg="invalid distances set",w.mode=30;break}if(w.mode=20,Z===6)break t;case 20:w.mode=21;case 21:if(6<=U&&258<=k){I.next_out=D,I.avail_out=k,I.next_in=O,I.avail_in=U,w.hold=C,w.bits=A,l(I,et),D=I.next_out,M=I.output,k=I.avail_out,O=I.next_in,it=I.input,U=I.avail_in,C=w.hold,A=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;_t=(R=w.lencode[C&(1<>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>Ct)])>>>16&255,gt=65535&R,!(Ct+(dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=Ct,A-=Ct,w.back+=Ct}if(C>>>=dt,A-=dt,w.back+=dt,w.length=gt,_t===0){w.mode=26;break}if(32&_t){w.back=-1,w.mode=12;break}if(64&_t){I.msg="invalid literal/length code",w.mode=30;break}w.extra=15&_t,w.mode=22;case 22:if(w.extra){for(N=w.extra;A>>=w.extra,A-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;_t=(R=w.distcode[C&(1<>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>Ct)])>>>16&255,gt=65535&R,!(Ct+(dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=Ct,A-=Ct,w.back+=Ct}if(C>>>=dt,A-=dt,w.back+=dt,64&_t){I.msg="invalid distance code",w.mode=30;break}w.offset=gt,w.extra=15&_t,w.mode=24;case 24:if(w.extra){for(N=w.extra;A>>=w.extra,A-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){I.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(k===0)break t;if(J=et-k,w.offset>J){if((J=w.offset-J)>w.whave&&w.sane){I.msg="invalid distance too far back",w.mode=30;break}yt=J>w.wnext?(J-=w.wnext,w.wsize-J):w.wnext-J,J>w.length&&(J=w.length),vt=w.window}else vt=M,yt=D-w.offset,J=w.length;for(kx?(B=yt[vt+d[Z]],A[V+d[Z]]):(B=96,0),_=1<>D)+(S-=_)]=z<<24|B<<16|tt|0,S!==0;);for(_=1<>=1;if(_!==0?(C&=_-1,C+=_):C=0,Z++,--et[I]==0){if(I===it)break;I=h[p+d[Z]]}if(M>>7)]}function V(R,Y){R.pending_buf[R.pending++]=255&Y,R.pending_buf[R.pending++]=Y>>>8&255}function et(R,Y,ot){R.bi_valid>m-ot?(R.bi_buf|=Y<>m-R.bi_valid,R.bi_valid+=ot-m):(R.bi_buf|=Y<>>=1,ot<<=1,0<--Y;);return ot>>>1}function vt(R,Y,ot){var at,rt,ht=new Array(d+1),bt=0;for(at=1;at<=d;at++)ht[at]=bt=bt+ot[at-1]<<1;for(rt=0;rt<=Y;rt++){var pt=R[2*rt+1];pt!==0&&(R[2*rt]=yt(ht[pt]++,pt))}}function dt(R){var Y;for(Y=0;Y>1;1<=ot;ot--)Ct(R,ht,ot);for(rt=Ot;ot=R.heap[1],R.heap[1]=R.heap[R.heap_len--],Ct(R,ht,1),at=R.heap[1],R.heap[--R.heap_max]=ot,R.heap[--R.heap_max]=at,ht[2*rt]=ht[2*ot]+ht[2*at],R.depth[rt]=(R.depth[ot]>=R.depth[at]?R.depth[ot]:R.depth[at])+1,ht[2*ot+1]=ht[2*at+1]=rt,R.heap[1]=rt++,Ct(R,ht,1),2<=R.heap_len;);R.heap[--R.heap_max]=R.heap[1],function(oe,ir){var Ki,vr,Zi,Ae,Ji,ao,Qr=ir.dyn_tree,fs=ir.max_code,ma=ir.stat_desc.static_tree,hu=ir.stat_desc.has_stree,si=ir.stat_desc.extra_bits,ya=ir.stat_desc.extra_base,In=ir.stat_desc.max_length,En=0;for(Ae=0;Ae<=d;Ae++)oe.bl_count[Ae]=0;for(Qr[2*oe.heap[oe.heap_max]+1]=0,Ki=oe.heap_max+1;Ki>=7;rt>>=1)if(1&ye&&pt.dyn_ltree[2*Ot]!==0)return o;if(pt.dyn_ltree[18]!==0||pt.dyn_ltree[20]!==0||pt.dyn_ltree[26]!==0)return a;for(Ot=32;Ot>>3,(ht=R.static_len+3+7>>>3)<=rt&&(rt=ht)):rt=ht=ot+5,ot+4<=rt&&Y!==-1?N(R,Y,ot,at):R.strategy===4||ht===rt?(et(R,2+(at?1:0),3),ee(R,st,I)):(et(R,4+(at?1:0),3),function(pt,Ot,ye,oe){var ir;for(et(pt,Ot-257,5),et(pt,ye-1,5),et(pt,oe-4,4),ir=0;ir>>8&255,R.pending_buf[R.d_buf+2*R.last_lit+1]=255&Y,R.pending_buf[R.l_buf+R.last_lit]=255&ot,R.last_lit++,Y===0?R.dyn_ltree[2*ot]++:(R.matches++,Y--,R.dyn_ltree[2*(w[ot]+h+1)]++,R.dyn_dtree[2*A(Y)]++),R.last_lit===R.lit_bufsize-1},n._tr_align=function(R){et(R,2,3),J(R,S,st),function(Y){Y.bi_valid===16?(V(Y,Y.bi_buf),Y.bi_buf=0,Y.bi_valid=0):8<=Y.bi_valid&&(Y.pending_buf[Y.pending++]=255&Y.bi_buf,Y.bi_buf>>=8,Y.bi_valid-=8)}(R)}},{"../utils/common":41}],53:[function(e,i,n){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,i,n){(function(s){(function(o,a){if(!o.setImmediate){var l,u,c,h,p=1,f={},y=!1,g=o.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(o);d=d&&d.setTimeout?d:o,l={}.toString.call(o.process)==="[object process]"?function(E){process.nextTick(function(){_(E)})}:function(){if(o.postMessage&&!o.importScripts){var E=!0,b=o.onmessage;return o.onmessage=function(){E=!1},o.postMessage("","*"),o.onmessage=b,E}}()?(h="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",S,!1):o.attachEvent("onmessage",S),function(E){o.postMessage(h+E,"*")}):o.MessageChannel?((c=new MessageChannel).port1.onmessage=function(E){_(E.data)},function(E){c.port2.postMessage(E)}):g&&"onreadystatechange"in g.createElement("script")?(u=g.documentElement,function(E){var b=g.createElement("script");b.onreadystatechange=function(){_(E),b.onreadystatechange=null,u.removeChild(b),b=null},u.appendChild(b)}):function(E){setTimeout(_,0,E)},d.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var b=new Array(arguments.length-1),F=0;F"u"?s===void 0?this:s:self)}).call(this,typeof gi<"u"?gi:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(Gu)),Gu.exports}var dC=fC();const pC=Nh(dC);Ai.zipReader=(r,t)=>pC.loadAsync(r);const mC=Ai.createSettings;Ai.createSettings=async r=>{const t=Object.keys(r.files);return t.find(e=>yC(e))?mC(r):_C(t)};function yC(r){return r.endsWith("model3.json")}function gC(r){return r.endsWith(".moc3")}function vC(r){return r.split(/[\\/]/).pop()}function _C(r){const t=r.filter(u=>gC(u));if(t.length!==1){const u=t.length?`(${t.map(c=>`"${c}"`).join(",")})`:"";throw new Error(`Expected exactly one moc file, got ${t.length} ${u}`)}const e=t[0],i=vC(e).replace(/\.moc3?/,""),n=r.filter(u=>u.endsWith(".png"));if(!n.length)throw new Error("Textures not found");const s=r.filter(u=>u.endsWith(".mtn")||u.endsWith(".motion3.json")),o=r.find(u=>u.includes("physics")),a=r.find(u=>u.includes("pose")),l=new Jn({url:`${i}.model3.json`,Version:3,FileReferences:{Moc:e,Textures:n,Physics:o,Pose:a,Motions:s.length?{"":s.map(u=>({File:u}))}:void 0}});return l.name=i,l._objectURL=`example://${l.url}`,l}Ai.readText=(r,t)=>{const e=r.file(t);if(!e)throw new Error(`Cannot find file: ${t}`);return e.async("text")};Ai.getFilePaths=r=>{const t=[];return r.forEach(e=>t.push(e)),Promise.resolve(t)};Ai.getFiles=(r,t)=>Promise.all(t.map(async e=>{const i=e.slice(e.lastIndexOf("/")+1),n=await r.file(e).async("blob");return new File([n],i)}));function Zt(r,t,e,i){function n(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(i.next(c))}catch(h){o(h)}}function l(c){try{u(i.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(r,t||[])).next())})}function up(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pt(r){return this instanceof Pt?(this.v=r,this):new Pt(r)}function dr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(r,t||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(f){return function(y){return Promise.resolve(y).then(f,h)}}function a(f,y){i[f]&&(n[f]=function(g){return new Promise(function(d,m){s.push([f,g,d,m])>1||l(f,g)})},y&&(n[f]=y(n[f])))}function l(f,y){try{u(i[f](y))}catch(g){p(s[0][3],g)}}function u(f){f.value instanceof Pt?Promise.resolve(f.value.v).then(c,h):p(s[0][2],f)}function c(f){l("next",f)}function h(f){l("throw",f)}function p(f,y){f(y),s.shift(),s.length&&l(s[0][0],s[0][1])}}function ts(r){var t,e;return t={},i("next"),i("throw",function(n){throw n}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(n,s){t[n]=r[n]?function(o){return(e=!e)?{value:Pt(r[n](o)),done:!1}:s?s(o):o}:s}}function bi(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 up=="function"?up(r):r[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=r[s]&&function(o){return new Promise(function(a,l){o=r[s](o),n(a,l,o.done,o.value)})}}function n(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}const bC=new TextDecoder("utf-8"),eh=r=>bC.decode(r),wC=new TextEncoder,ef=r=>wC.encode(r),xC=r=>typeof r=="number",_v=r=>typeof r=="boolean",Ge=r=>typeof r=="function",pr=r=>r!=null&&Object(r)===r,rs=r=>pr(r)&&Ge(r.then),oa=r=>pr(r)&&Ge(r[Symbol.iterator]),no=r=>pr(r)&&Ge(r[Symbol.asyncIterator]),rh=r=>pr(r)&&pr(r.schema),bv=r=>pr(r)&&"done"in r&&"value"in r,wv=r=>pr(r)&&Ge(r.stat)&&xC(r.fd),xv=r=>pr(r)&&rf(r.body),tu=r=>"_getDOMStream"in r&&"_getNodeStream"in r,SC=r=>pr(r)&&Ge(r.abort)&&Ge(r.getWriter)&&!tu(r),rf=r=>pr(r)&&Ge(r.cancel)&&Ge(r.getReader)&&!tu(r),TC=r=>pr(r)&&Ge(r.end)&&Ge(r.write)&&_v(r.writable)&&!tu(r),Sv=r=>pr(r)&&Ge(r.read)&&Ge(r.pipe)&&_v(r.readable)&&!tu(r),IC=r=>pr(r)&&Ge(r.clear)&&Ge(r.bytes)&&Ge(r.position)&&Ge(r.setPosition)&&Ge(r.capacity)&&Ge(r.getBufferIdentifier)&&Ge(r.createLong),nf=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function EC(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++l_e(Int32Array,r),hp=r=>_e(BigInt64Array,r),ae=r=>_e(Uint8Array,r),ih=r=>(r.next(),r);function*CC(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof nf?e(t):oa(t)?t:e(t);return yield*ih(function*(n){let s=null;do s=n.next(yield _e(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const AC=r=>CC(Uint8Array,r);function Tv(r,t){return dr(this,arguments,function*(){if(rs(t))return yield Pt(yield Pt(yield*ts(bi(Tv(r,yield Pt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Pt(yield Pt(o))})},n=function(o){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(ih(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 nf?i(t):oa(t)?n(t):no(t)?t:i(t);return yield Pt(yield*ts(bi(ih(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Pt(o.next(yield yield Pt(_e(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Pt(new r)})}const OC=r=>Tv(Uint8Array,r);function Iv(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++e(r.next(),r);function*PC(r){let t,e=!1,i=[],n,s,o,a=0;function l(){return s==="peek"?xi(i,o)[0]:([n,i,a]=xi(i,o),n)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const u=AC(r)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&n.byteLength>0&&(i.push(n),a+=n.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o0&&(n.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Pt(u()));while(a0&&(n.push(ae(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Pt(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 Zt(this,void 0,void 0,function*(){const{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return Zt(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=ae(e)),e})}}const Wu=(r,t)=>{const e=n=>i([t,n]);let i;return[t,e,new Promise(n=>(i=n)&&r.once(t,e))]};function NC(r){return dr(this,arguments,function*(){const e=[];let i="error",n=!1,s=null,o,a,l=0,u=[],c;function h(){return o==="peek"?xi(u,a)[0]:([c,u,l]=xi(u,a),c)}if({cmd:o,size:a}=(yield yield Pt(null))||{cmd:"read",size:0},r.isTTY)return yield yield Pt(new Uint8Array(0)),yield Pt(null);try{e[0]=Wu(r,"end"),e[1]=Wu(r,"error");do{if(e[2]=Wu(r,"readable"),[i,s]=yield Pt(Promise.race(e.map(f=>f[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(a-l)?(c=ae(r.read(a-l)),c.byteLength0&&(u.push(c),l+=c.byteLength)),n||a<=l)do({cmd:o,size:a}=yield yield Pt(h()));while(a{for(const[m,_]of f)r.off(m,_);try{const m=r.destroy;m&&m.call(r,y),y=void 0}catch(m){y=m||y}finally{y!=null?d(y):g()}})}})}var ke;(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"})(ke||(ke={}));var er;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(er||(er={}));var tr;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(tr||(tr={}));var Hr;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Hr||(Hr={}));var zt;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(zt||(zt={}));var Si;(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"})(Si||(Si={}));const Hu=2,pi=4,ji=4,me=4,on=new Int32Array(2),fp=new Float32Array(on.buffer),dp=new Float64Array(on.buffer),Na=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var nh;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(nh||(nh={}));let Qs=class Ev{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Ev(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){fp[0]=e,this.writeInt32(t,on[0])}writeFloat64(t,e){dp[0]=e,this.writeInt32(t,on[Na?0:1]),this.writeInt32(t+4,on[Na?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*Hu;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,pi+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(e=0;i--)t.addInt32(e[i]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,i){return hr.startUnion(t),hr.addMode(t,e),hr.addTypeIds(t,i),hr.endUnion(t)}}let bp=class Fo{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 Fo).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+me),(e||new Fo).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Fo.startUtf8(t),Fo.endUtf8(t)}};var xe;(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"})(xe||(xe={}));let Nr=class Ga{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 Ga).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+me),(e||new Ga).__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):xe.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 $i).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const i=this.bb.__offset(this.bb_pos,14);return i?(e||new Ga).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,16);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,xe.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},ui=class Mi{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 Mi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+me),(e||new Mi).__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):Ks.Little}fields(t,e){const i=this.bb.__offset(this.bb_pos,6);return i?(e||new Nr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,8);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,Ks.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addInt64(e[i]);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,i,n,s){return Mi.startSchema(t),Mi.addEndianness(t,e),Mi.addFields(t,i),Mi.addCustomMetadata(t,n),Mi.addFeatures(t,s),Mi.endSchema(t)}};var fe;(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"})(fe||(fe={}));var L;(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"})(L||(L={}));var ki;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(ki||(ki={}));const LC=void 0;function Xo(r){if(r===null)return"null";if(r===LC)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=>Xo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}function we(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 Pv(r,t){return we(r/t)+we(r%t)/we(t)}const BC=Symbol.for("isArrowBigNum");function ri(r,...t){return t.length===0?Object.setPrototypeOf(_e(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ri.prototype[BC]=!0;ri.prototype.toJSON=function(){return`"${qo(this)}"`};ri.prototype.valueOf=function(r){return Mv(this,r)};ri.prototype.toString=function(){return qo(this)};ri.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Mv(this);case"string":return qo(this);case"default":return zC(this)}return qo(this)};function zs(...r){return ri.apply(this,r)}function js(...r){return ri.apply(this,r)}function Yo(...r){return ri.apply(this,r)}Object.setPrototypeOf(zs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(js.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Yo.prototype,Object.create(Uint32Array.prototype));Object.assign(zs.prototype,ri.prototype,{constructor:zs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(js.prototype,ri.prototype,{constructor:js,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Yo.prototype,ri.prototype,{constructor:Yo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const kC=BigInt(4294967296)*BigInt(4294967296),UC=kC-BigInt(1);function Mv(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return Xu(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(At.prototype);let pn=class extends At{constructor(){super(L.Null)}toString(){return"Null"}};Nv=Symbol.toStringTag;pn[Nv]=(r=>r[Symbol.toStringTag]="Null")(pn.prototype);let is=class extends At{constructor(t,e){super(L.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}`}};Lv=Symbol.toStringTag;is[Lv]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(is.prototype);class Qo extends is{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Qo.prototype,"ArrayType",{value:Int32Array});let cl=class extends At{constructor(t){super(L.Float),this.precision=t}get ArrayType(){switch(this.precision){case tr.HALF:return Uint16Array;case tr.SINGLE:return Float32Array;case tr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Bv=Symbol.toStringTag;cl[Bv]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(cl.prototype);let hl=class extends At{constructor(){super(L.Binary)}toString(){return"Binary"}};kv=Symbol.toStringTag;hl[kv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(hl.prototype);let fl=class extends At{constructor(){super(L.LargeBinary)}toString(){return"LargeBinary"}};Uv=Symbol.toStringTag;fl[Uv]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(fl.prototype);let dl=class extends At{constructor(){super(L.Utf8)}toString(){return"Utf8"}};zv=Symbol.toStringTag;dl[zv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(dl.prototype);let pl=class extends At{constructor(){super(L.LargeUtf8)}toString(){return"LargeUtf8"}};jv=Symbol.toStringTag;pl[jv]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(pl.prototype);let ml=class extends At{constructor(){super(L.Bool)}toString(){return"Bool"}};$v=Symbol.toStringTag;ml[$v]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(ml.prototype);let yl=class extends At{constructor(t,e,i=128){super(L.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Vv=Symbol.toStringTag;yl[Vv]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(yl.prototype);let gl=class extends At{constructor(t){super(L.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Hr[this.unit]}>`}get ArrayType(){return this.unit===Hr.DAY?Int32Array:BigInt64Array}};Gv=Symbol.toStringTag;gl[Gv]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(gl.prototype);let vl=class extends At{constructor(t,e){super(L.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${zt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Wv=Symbol.toStringTag;vl[Wv]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(vl.prototype);let _l=class extends At{constructor(t,e){super(L.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${zt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Hv=Symbol.toStringTag;_l[Hv]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(_l.prototype);let bl=class extends At{constructor(t){super(L.Interval),this.unit=t}toString(){return`Interval<${Si[this.unit]}>`}};Xv=Symbol.toStringTag;bl[Xv]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(bl.prototype);let wl=class extends At{constructor(t){super(L.Duration),this.unit=t}toString(){return`Duration<${zt[this.unit]}>`}};Yv=Symbol.toStringTag;wl[Yv]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(wl.prototype);let xl=class extends At{constructor(t){super(L.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}};qv=Symbol.toStringTag;xl[qv]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(xl.prototype);let sr=class extends At{constructor(t){super(L.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};Qv=Symbol.toStringTag;sr[Qv]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(sr.prototype);let Sl=class extends At{constructor(t,e,i){super(L.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};Kv=Symbol.toStringTag;Sl[Kv]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Sl.prototype);let Tl=class extends At{constructor(t){super(L.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Zv=Symbol.toStringTag;Tl[Zv]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Tl.prototype);let Il=class extends At{constructor(t,e){super(L.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}>`}};Jv=Symbol.toStringTag;Il[Jv]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Il.prototype);let El=class extends At{constructor(t,e=!1){var i,n,s;if(super(L.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.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(", ")}}>`}};t_=Symbol.toStringTag;El[t_]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(El.prototype);const $C=(r=>()=>++r)(-1);let Zs=class extends At{constructor(t,e,i,n){super(L.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?$C():we(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};e_=Symbol.toStringTag;Zs[e_]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Zs.prototype);function Ui(r){const t=r;switch(r.typeId){case L.Decimal:return r.bitWidth/32;case L.Interval:return 1+t.unit;case L.FixedSizeList:return t.listSize;case L.FixedSizeBinary:return t.byteWidth;default:return 1}}let ie=class{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return VC(this,t,e)}getVisitFnByTypeId(t,e=!0){return As(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 VC(r,t,e=!0){return typeof t=="number"?As(r,t,e):typeof t=="string"&&t in L?As(r,L[t],e):t&&t instanceof At?As(r,wp(t),e):t!=null&&t.type&&t.type instanceof At?As(r,wp(t.type),e):As(r,L.NONE,e)}function As(r,t,e=!0){let i=null;switch(t){case L.Null:i=r.visitNull;break;case L.Bool:i=r.visitBool;break;case L.Int:i=r.visitInt;break;case L.Int8:i=r.visitInt8||r.visitInt;break;case L.Int16:i=r.visitInt16||r.visitInt;break;case L.Int32:i=r.visitInt32||r.visitInt;break;case L.Int64:i=r.visitInt64||r.visitInt;break;case L.Uint8:i=r.visitUint8||r.visitInt;break;case L.Uint16:i=r.visitUint16||r.visitInt;break;case L.Uint32:i=r.visitUint32||r.visitInt;break;case L.Uint64:i=r.visitUint64||r.visitInt;break;case L.Float:i=r.visitFloat;break;case L.Float16:i=r.visitFloat16||r.visitFloat;break;case L.Float32:i=r.visitFloat32||r.visitFloat;break;case L.Float64:i=r.visitFloat64||r.visitFloat;break;case L.Utf8:i=r.visitUtf8;break;case L.LargeUtf8:i=r.visitLargeUtf8;break;case L.Binary:i=r.visitBinary;break;case L.LargeBinary:i=r.visitLargeBinary;break;case L.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case L.Date:i=r.visitDate;break;case L.DateDay:i=r.visitDateDay||r.visitDate;break;case L.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case L.Timestamp:i=r.visitTimestamp;break;case L.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case L.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case L.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case L.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case L.Time:i=r.visitTime;break;case L.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case L.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case L.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case L.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case L.Decimal:i=r.visitDecimal;break;case L.List:i=r.visitList;break;case L.Struct:i=r.visitStruct;break;case L.Union:i=r.visitUnion;break;case L.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case L.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case L.Dictionary:i=r.visitDictionary;break;case L.Interval:i=r.visitInterval;break;case L.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case L.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case L.Duration:i=r.visitDuration;break;case L.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case L.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case L.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case L.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case L.FixedSizeList:i=r.visitFixedSizeList;break;case L.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${L[t]}'`)}function wp(r){switch(r.typeId){case L.Null:return L.Null;case L.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?L.Int8:L.Uint8;case 16:return e?L.Int16:L.Uint16;case 32:return e?L.Int32:L.Uint32;case 64:return e?L.Int64:L.Uint64}return L.Int}case L.Float:switch(r.precision){case tr.HALF:return L.Float16;case tr.SINGLE:return L.Float32;case tr.DOUBLE:return L.Float64}return L.Float;case L.Binary:return L.Binary;case L.LargeBinary:return L.LargeBinary;case L.Utf8:return L.Utf8;case L.LargeUtf8:return L.LargeUtf8;case L.Bool:return L.Bool;case L.Decimal:return L.Decimal;case L.Time:switch(r.unit){case zt.SECOND:return L.TimeSecond;case zt.MILLISECOND:return L.TimeMillisecond;case zt.MICROSECOND:return L.TimeMicrosecond;case zt.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(r.unit){case zt.SECOND:return L.TimestampSecond;case zt.MILLISECOND:return L.TimestampMillisecond;case zt.MICROSECOND:return L.TimestampMicrosecond;case zt.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(r.unit){case Hr.DAY:return L.DateDay;case Hr.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(r.unit){case Si.DAY_TIME:return L.IntervalDayTime;case Si.YEAR_MONTH:return L.IntervalYearMonth}return L.Interval;case L.Duration:switch(r.unit){case zt.SECOND:return L.DurationSecond;case zt.MILLISECOND:return L.DurationMillisecond;case zt.MICROSECOND:return L.DurationMicrosecond;case zt.NANOSECOND:return L.DurationNanosecond}return L.Duration;case L.Map:return L.Map;case L.List:return L.List;case L.Struct:return L.Struct;case L.Union:switch(r.mode){case er.Dense:return L.DenseUnion;case er.Sparse:return L.SparseUnion}return L.Union;case L.FixedSizeBinary:return L.FixedSizeBinary;case L.FixedSizeList:return L.FixedSizeList;case L.Dictionary:return L.Dictionary}throw new Error(`Unrecognized type '${L[r.typeId]}'`)}ie.prototype.visitInt8=null;ie.prototype.visitInt16=null;ie.prototype.visitInt32=null;ie.prototype.visitInt64=null;ie.prototype.visitUint8=null;ie.prototype.visitUint16=null;ie.prototype.visitUint32=null;ie.prototype.visitUint64=null;ie.prototype.visitFloat16=null;ie.prototype.visitFloat32=null;ie.prototype.visitFloat64=null;ie.prototype.visitDateDay=null;ie.prototype.visitDateMillisecond=null;ie.prototype.visitTimestampSecond=null;ie.prototype.visitTimestampMillisecond=null;ie.prototype.visitTimestampMicrosecond=null;ie.prototype.visitTimestampNanosecond=null;ie.prototype.visitTimeSecond=null;ie.prototype.visitTimeMillisecond=null;ie.prototype.visitTimeMicrosecond=null;ie.prototype.visitTimeNanosecond=null;ie.prototype.visitDenseUnion=null;ie.prototype.visitSparseUnion=null;ie.prototype.visitIntervalDayTime=null;ie.prototype.visitIntervalYearMonth=null;ie.prototype.visitDuration=null;ie.prototype.visitDurationSecond=null;ie.prototype.visitDurationMillisecond=null;ie.prototype.visitDurationMicrosecond=null;ie.prototype.visitDurationNanosecond=null;const r_=new Float64Array(1),gs=new Uint32Array(r_.buffer);function i_(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function GC(r){if(r!==r)return 32256;r_[0]=r;const t=(gs[1]&2147483648)>>16&65535;let e=gs[1]&2146435072,i=0;return e>=1089470464?gs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(gs[1]&1048575)>>10):e<=1056964608?(i=1048576+(gs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(gs[1]&1048575)+512>>10),t|e|i&65535}let jt=class extends ie{};function Xt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const WC=(r,t,e)=>{r[t]=Math.floor(e/864e5)},n_=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},sf=({values:r},t,e)=>{r[t]=e},s_=({values:r},t,e)=>{r[t]=GC(e)},XC=(r,t,e)=>{switch(r.type.precision){case tr.HALF:return s_(r,t,e);case tr.SINGLE:case tr.DOUBLE:return sf(r,t,e)}},o_=({values:r},t,e)=>{WC(r,t,e.valueOf())},a_=({values:r},t,e)=>{r[t]=BigInt(e)},YC=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},l_=({values:r,valueOffsets:t},e,i)=>n_(r,t,e,i),u_=({values:r,valueOffsets:t},e,i)=>n_(r,t,e,ef(i)),qC=(r,t,e)=>{r.type.unit===Hr.DAY?o_(r,t,e):a_(r,t,e)},c_=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},h_=({values:r},t,e)=>{r[t]=BigInt(e)},f_=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},d_=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},QC=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return c_(r,t,e);case zt.MILLISECOND:return h_(r,t,e);case zt.MICROSECOND:return f_(r,t,e);case zt.NANOSECOND:return d_(r,t,e)}},p_=({values:r},t,e)=>{r[t]=e},m_=({values:r},t,e)=>{r[t]=e},y_=({values:r},t,e)=>{r[t]=e},g_=({values:r},t,e)=>{r[t]=e},KC=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return p_(r,t,e);case zt.MILLISECOND:return m_(r,t,e);case zt.MICROSECOND:return y_(r,t,e);case zt.NANOSECOND:return g_(r,t,e)}},ZC=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},JC=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Xr.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Xr.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},eA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),rA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),iA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),nA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),sA=(r,t,e)=>{const i=r.type.children.map(s=>Xr.getVisitFn(s.type)),n=e instanceof Map?iA(t,e):e instanceof Me?rA(t,e):Array.isArray(e)?eA(t,e):nA(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},oA=(r,t,e)=>{r.type.mode===er.Dense?v_(r,t,e):__(r,t,e)},v_=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Xr.visit(n,r.valueOffsets[t],e)},__=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Xr.visit(n,t,e)},aA=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},lA=(r,t,e)=>{r.type.unit===Si.DAY_TIME?b_(r,t,e):w_(r,t,e)},b_=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},w_=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},x_=({values:r},t,e)=>{r[t]=e},S_=({values:r},t,e)=>{r[t]=e},T_=({values:r},t,e)=>{r[t]=e},I_=({values:r},t,e)=>{r[t]=e},uA=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return x_(r,t,e);case zt.MILLISECOND:return S_(r,t,e);case zt.MICROSECOND:return T_(r,t,e);case zt.NANOSECOND:return I_(r,t,e)}},cA=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Xr.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${Xo(t)}: ${Xo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new hA(this[Kr],this[$s])}},hA=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[Kr].type.children.findIndex(i=>i.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Kr].type.children.findIndex(i=>i.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Kr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=mr.visit(t[Kr].children[i],t[$s]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Kr].type.children.findIndex(s=>s.name===e);return n!==-1?(Xr.visit(t[Kr].children[n],t[$s],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}},Mt=class extends ie{};function $t(r){return(t,e)=>t.getValid(e)?r(t,e):null}const dA=(r,t)=>864e5*r[t],pA=(r,t)=>null,E_=(r,t,e)=>{if(e+1>=t.length)return null;const i=we(t[e]),n=we(t[e+1]);return r.subarray(i,n)},mA=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<dA(r,t),A_=({values:r},t)=>we(r[t]),wn=({stride:r,values:t},e)=>t[r*e],yA=({stride:r,values:t},e)=>i_(t[r*e]),O_=({values:r},t)=>r[t],gA=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),F_=({values:r,valueOffsets:t},e)=>E_(r,t,e),P_=({values:r,valueOffsets:t},e)=>{const i=E_(r,t,e);return i!==null?eh(i):null},vA=({values:r},t)=>r[t],_A=({type:r,values:t},e)=>r.precision!==tr.HALF?t[e]:i_(t[e]),bA=(r,t)=>r.type.unit===Hr.DAY?C_(r,t):A_(r,t),M_=({values:r},t)=>1e3*we(r[t]),D_=({values:r},t)=>we(r[t]),R_=({values:r},t)=>Pv(r[t],BigInt(1e3)),N_=({values:r},t)=>Pv(r[t],BigInt(1e6)),wA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return M_(r,t);case zt.MILLISECOND:return D_(r,t);case zt.MICROSECOND:return R_(r,t);case zt.NANOSECOND:return N_(r,t)}},L_=({values:r},t)=>r[t],B_=({values:r},t)=>r[t],k_=({values:r},t)=>r[t],U_=({values:r},t)=>r[t],xA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return L_(r,t);case zt.MILLISECOND:return B_(r,t);case zt.MICROSECOND:return k_(r,t);case zt.NANOSECOND:return U_(r,t)}},SA=({values:r,stride:t},e)=>jC.decimal(r.subarray(t*e,t*(e+1))),TA=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Me([l])},IA=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new af(o.slice(n,s-n))},EA=(r,t)=>new of(r,t),CA=(r,t)=>r.type.mode===er.Dense?z_(r,t):j_(r,t),z_=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return mr.visit(i,r.valueOffsets[t])},j_=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return mr.visit(i,t)},AA=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},OA=(r,t)=>r.type.unit===Si.DAY_TIME?$_(r,t):V_(r,t),$_=({values:r},t)=>r.subarray(2*t,2*(t+1)),V_=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},G_=({values:r},t)=>r[t],W_=({values:r},t)=>r[t],H_=({values:r},t)=>r[t],X_=({values:r},t)=>r[t],FA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return G_(r,t);case zt.MILLISECOND:return W_(r,t);case zt.MICROSECOND:return H_(r,t);case zt.NANOSECOND:return X_(r,t)}},PA=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Me([s])};Mt.prototype.visitNull=$t(pA);Mt.prototype.visitBool=$t(mA);Mt.prototype.visitInt=$t(vA);Mt.prototype.visitInt8=$t(wn);Mt.prototype.visitInt16=$t(wn);Mt.prototype.visitInt32=$t(wn);Mt.prototype.visitInt64=$t(O_);Mt.prototype.visitUint8=$t(wn);Mt.prototype.visitUint16=$t(wn);Mt.prototype.visitUint32=$t(wn);Mt.prototype.visitUint64=$t(O_);Mt.prototype.visitFloat=$t(_A);Mt.prototype.visitFloat16=$t(yA);Mt.prototype.visitFloat32=$t(wn);Mt.prototype.visitFloat64=$t(wn);Mt.prototype.visitUtf8=$t(P_);Mt.prototype.visitLargeUtf8=$t(P_);Mt.prototype.visitBinary=$t(F_);Mt.prototype.visitLargeBinary=$t(F_);Mt.prototype.visitFixedSizeBinary=$t(gA);Mt.prototype.visitDate=$t(bA);Mt.prototype.visitDateDay=$t(C_);Mt.prototype.visitDateMillisecond=$t(A_);Mt.prototype.visitTimestamp=$t(wA);Mt.prototype.visitTimestampSecond=$t(M_);Mt.prototype.visitTimestampMillisecond=$t(D_);Mt.prototype.visitTimestampMicrosecond=$t(R_);Mt.prototype.visitTimestampNanosecond=$t(N_);Mt.prototype.visitTime=$t(xA);Mt.prototype.visitTimeSecond=$t(L_);Mt.prototype.visitTimeMillisecond=$t(B_);Mt.prototype.visitTimeMicrosecond=$t(k_);Mt.prototype.visitTimeNanosecond=$t(U_);Mt.prototype.visitDecimal=$t(SA);Mt.prototype.visitList=$t(TA);Mt.prototype.visitStruct=$t(EA);Mt.prototype.visitUnion=$t(CA);Mt.prototype.visitDenseUnion=$t(z_);Mt.prototype.visitSparseUnion=$t(j_);Mt.prototype.visitDictionary=$t(AA);Mt.prototype.visitInterval=$t(OA);Mt.prototype.visitIntervalDayTime=$t($_);Mt.prototype.visitIntervalYearMonth=$t(V_);Mt.prototype.visitDuration=$t(FA);Mt.prototype.visitDurationSecond=$t(G_);Mt.prototype.visitDurationMillisecond=$t(W_);Mt.prototype.visitDurationMicrosecond=$t(H_);Mt.prototype.visitDurationNanosecond=$t(X_);Mt.prototype.visitFixedSizeList=$t(PA);Mt.prototype.visitMap=$t(IA);const mr=new Mt,Os=Symbol.for("keys"),Vs=Symbol.for("vals"),Fs=Symbol.for("kKeysAsStrings"),lh=Symbol.for("_kKeysAsStrings");let af=class{constructor(t){return this[Os]=new Me([t.children[0]]).memoize(),this[Vs]=t.children[1],new Proxy(this,new DA)}get[Fs](){return this[lh]||(this[lh]=Array.from(this[Os].toArray(),String))}[Symbol.iterator](){return new MA(this[Os],this[Vs])}get size(){return this[Os].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Os],e=this[Vs],i={};for(let n=-1,s=t.length;++n`${Xo(t)}: ${Xo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},MA=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),mr.visit(this.vals,t)]})}},DA=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Fs]}has(t,e){return t[Fs].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Fs].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Fs].indexOf(e);if(i!==-1){const n=mr.visit(Reflect.get(t,Vs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Fs].indexOf(e);return n!==-1?(Xr.visit(Reflect.get(t,Vs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}};Object.defineProperties(af.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Os]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Vs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[lh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let xp;function Y_(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const lf=(r,t)=>r<0?t+r:r,Sp=r=>r!==r;function so(r){if(typeof r!=="object"||r===null)return Sp(r)?Sp:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?FC(r,e):!1:r instanceof Map?NA(r):Array.isArray(r)?RA(r):r instanceof Me?LA(r):BA(r,!0)}function RA(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return kA(r,e);case Map:return Tp(r,e,e.keys());case af:case of:case Object:case void 0:return Tp(r,e,t||Object.keys(e))}return e instanceof Me?UA(r,e):!1}}function kA(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function Cl(r,t,e){const i=e.byteLength+7&-8;if(r>0||e.byteLength>3):Al(new uf(e,r,t,null,q_)).subarray(0,i)),n}return e}function Al(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}let uf=class{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,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,n=t+(t%8===0?0:8-t%8);return uh(r,t,n)+uh(r,i,e)+jA(r,n>>3,i-n>>3)}function jA(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=Yu(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=Yu(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=Yu(s.getUint8(n)),n+=1;return i}function Yu(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 $A=-1;let Se=class ch{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 At.isSparseUnion(t)?this.children.some(e=>e.nullable):At.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:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(At.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=$A&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-uh(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,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(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ch?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Ui(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(At.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===er.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Cl(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ch(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);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===L.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(Cl(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[ki.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[ki.TYPE])&&(o[ki.TYPE]=s.subarray(t,t+e)),(s=o[ki.OFFSET])&&(o[ki.OFFSET]=s.subarray(t,t+e+1))||(s=o[ki.DATA])&&(o[ki.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}};Se.prototype.children=Object.freeze([]);class Ro extends ie{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:i=0,["length"]:n=0}=t;return new Se(e,i,n,n)}visitBool(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitInt(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFloat(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitLargeUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=hp(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitLargeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=hp(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDate(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTimestamp(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTime(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDecimal(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitList(t){const{["type"]:e,["offset"]:i=0,["child"]:n}=t,s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,void 0,s],[n])}visitStruct(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=ae(t.nullBitmap),{length:o=n.reduce((l,{length:u})=>Math.max(l,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],n)}visitUnion(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=_e(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(At.isSparseUnion(e))return new Se(e,i,o,a,[void 0,void 0,void 0,s],n);const l=yo(t.valueOffsets);return new Se(e,i,o,a,[l,void 0,void 0,s],n)}visitDictionary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.indices.ArrayType,t.data),{["dictionary"]:o=new Me([new Ro().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[void 0,s,n],[],o)}visitInterval(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDuration(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFixedSizeList(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Ro().visit({type:e.valueType})}=t,s=ae(t.nullBitmap),{["length"]:o=n.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],[n])}visitMap(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Ro().visit({type:e.childType})}=t,s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,void 0,s],[n])}}const VA=new Ro;function se(r){return VA.visit(r)}let Ip=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 Q_(r){return r.reduce((t,e)=>t+e.nullCount,0)}function K_(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function Z_(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function cf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function HA(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new uf(e,r.offset+(t||0),r.length,e,q_)){if(!n)return i;++i}return-1}function Qt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case L.Union:break;case L.Dictionary:break;default:return HA(r,e)}const i=mr.getVisitFn(r),n=so(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new Ip(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new XA(o)})}let XA=class{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Se)))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}=i0[o.typeId],c=s[0];this.isValid=h=>hf(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,n0[o.typeId]),this._offsets=K_(s);break}this.data=s,this.type=o,this.stride=Ui(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return GA(this.data)}get nullCount(){return Q_(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${L[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(lf(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return ff.visit(this)}concat(...t){return new zn(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new zn(Y_(this,t,e,({data:i,_offsets:n},s,o)=>Z_(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case L.Int:case L.Float:case L.Decimal:case L.Time:case L.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),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(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return At.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(At.isDictionary(this.type)){const t=new Ep(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new zn(e)}return new Ep(this)}unmemoize(){if(At.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new zn(e)}return this}};r0=Symbol.toStringTag;Me[r0]=(r=>{r.type=At.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(L).map(e=>L[e]).filter(e=>typeof e=="number"&&e!==L.NONE);for(const e of t){const i=mr.getVisitFnByTypeId(e),n=Xr.getVisitFnByTypeId(e),s=Fl.getVisitFnByTypeId(e);i0[e]={get:i,set:n,indexOf:s},n0[e]=Object.create(r,{isValid:{value:Ol(hf)},get:{value:Ol(mr.getVisitFnByTypeId(e))},set:{value:J_(Xr.getVisitFnByTypeId(e))},indexOf:{value:t0(Fl.getVisitFnByTypeId(e))}})}return"Vector"})(Me.prototype);let Ep=class s0 extends Me{constructor(t){super(t.data);const e=this.get,i=this.set,n=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){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new s0(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Me(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};class hh{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,i,n){return t.prep(8,24),t.writeInt64(BigInt(n??0)),t.pad(4),t.writeInt32(i),t.writeInt64(BigInt(e??0)),t.offset()}}class _r{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 _r).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+me),(e||new _r).__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):ke.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new ui).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new hh).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,10);return i?(e||new hh).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,ke.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 Pe=class jn{constructor(t=[],e,i,n=ke.V5){this.fields=t||[],this.metadata=e||new Map,i||(i=fh(this.fields)),this.dictionaries=i,this.metadataVersion=n}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),i=this.fields.filter(n=>e.has(n.name));return new jn(i,this.metadata)}selectAt(t){const e=t.map(i=>this.fields[i]).filter(Boolean);return new jn(e,this.metadata)}assign(...t){const e=t[0]instanceof jn?t[0]:Array.isArray(t[0])?new jn(t[0]):new jn(t),i=[...this.fields],n=La(La(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const l=i.findIndex(u=>u.name===a.name);return~l?(i[l]=a.clone({metadata:La(La(new Map,i[l].metadata),a.metadata)}))&&!1:!0}),o=fh(s,new Map);return new jn([...i,...s],n,new Map([...this.dictionaries,...o]))}};Pe.prototype.fields=null;Pe.prototype.metadata=null;Pe.prototype.dictionaries=null;class Ce{static new(...t){let[e,i,n,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],i===void 0&&(i=t[0].type),n===void 0&&(n=t[0].nullable),s===void 0&&(s=t[0].metadata)),new Ce(`${e}`,i,n,s)}constructor(t,e,i=!1,n){this.name=t,this.type=e,this.nullable=i,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,i,n,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,i=this.type,n=this.nullable,s=this.metadata]=t:{name:e=this.name,type:i=this.type,nullable:n=this.nullable,metadata:s=this.metadata}=t[0],Ce.new(e,i,n,s)}}Ce.prototype.type=null;Ce.prototype.name=null;Ce.prototype.nullable=null;Ce.prototype.metadata=null;function La(r,t){return new Map([...r||new Map,...t||new Map])}function fh(r,t=new Map){for(let e=-1,i=r.length;++e0&&fh(s.children,t)}return t}var YA=Cv,qA=Qs;class Ko{static decode(t){t=new qA(ae(t));const e=_r.getRootAsFooter(t),i=Pe.decode(e.schema(),new Map,e.version());return new QA(i,e)}static encode(t){const e=new YA,i=Pe.encode(e,t.schema);_r.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())mn.encode(e,o);const n=e.endVector();_r.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())mn.encode(e,o);const s=e.endVector();return _r.startFooter(e),_r.addSchema(e,i),_r.addVersion(e,ke.V5),_r.addRecordBatches(e,n),_r.addDictionaries(e,s),_r.finishFooterBuffer(e,_r.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=ke.V5,i,n){this.schema=t,this.version=e,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let t,e=-1,i=this.numRecordBatches;++e=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Zt(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(De);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return kr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return kr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Zt(this,void 0,void 0,function*(){return yield this.abort(t),De})}return(t){return Zt(this,void 0,void 0,function*(){return yield this.close(),De})}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(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,i)=>{this.resolvers.push({resolve:e,reject:i})}):Promise.resolve(De)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Wa extends KA{write(t){if((t=ae(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?eh(this.toUint8Array(!0)):this.toUint8Array(!1).then(eh)}toUint8Array(t=!1){return t?xi(this._values)[0]:Zt(this,void 0,void 0,function*(){var e,i,n,s;const o=[];let a=0;try{for(var l=!0,u=bi(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){i={error:h}}finally{try{!l&&!e&&(n=u.return)&&(yield n.call(u))}finally{if(i)throw i.error}}return xi(o,a)[0]})}}class Pl{constructor(t){t&&(this.source=new ZA(kr.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 Js{constructor(t){t instanceof Js?this.source=t.source:t instanceof Wa?this.source=new Mn(kr.fromAsyncIterable(t)):Sv(t)?this.source=new Mn(kr.fromNodeStream(t)):rf(t)?this.source=new Mn(kr.fromDOMStream(t)):xv(t)?this.source=new Mn(kr.fromDOMStream(t.body)):oa(t)?this.source=new Mn(kr.fromIterable(t)):rs(t)?this.source=new Mn(kr.fromAsyncIterable(t)):no(t)&&(this.source=new Mn(kr.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 ZA{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)||De)}return(t){return Object.create(this.source.return&&this.source.return(t)||De)}}class Mn{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return Zt(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return Zt(this,arguments,void 0,function*(e,i="read"){return yield this.source.next({cmd:i,size:e})})}throw(t){return Zt(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||De;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return Zt(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||De;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class Ap extends Pl{constructor(t,e){super(),this.position=0,this.buffer=ae(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:i}=this.readAt(t,4);return new DataView(e,i).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]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[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`${Ns(this.buffer[3])} ${Ns(this.buffer[2])} ${Ns(this.buffer[1])} ${Ns(this.buffer[0])}`}static multiply(t,e){return new Ni(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ni(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Ni.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Ni.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new Ni(e);for(let o=i?1:0;o0&&this.readData(t,i)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class eO extends a0{constructor(t,e,i,n,s){super(new Uint8Array(0),e,i,n,s),this.sources=t}readNullBitmap(t,e,{offset:i}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Al(this.sources[i])}readOffsets(t,{offset:e}=this.nextBufferRange()){return _e(Uint8Array,_e(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return _e(Uint8Array,_e(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:i}=this;return At.isTimestamp(t)||(At.isInt(t)||At.isTime(t))&&t.bitWidth===64||At.isDuration(t)||At.isDate(t)&&t.unit===Hr.MILLISECOND?_e(Uint8Array,No.convertArray(i[e])):At.isDecimal(t)?_e(Uint8Array,tO.convertArray(i[e])):At.isBinary(t)||At.isLargeBinary(t)||At.isFixedSizeBinary(t)?rO(i[e]):At.isBool(t)?Al(i[e]):At.isUtf8(t)||At.isLargeUtf8(t)?ef(i[e].join("")):_e(Uint8Array,_e(t.ArrayType,i[e].map(n=>+n)))}}function rO(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let i=0;i>1]=Number.parseInt(t.slice(i,i+2),16);return e}let Nt=class extends ie{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((i,n)=>this.compareFields(i,e[n]))}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 lr(r,t){return t instanceof r.constructor}function us(r,t){return r===t||lr(r,t)}function Xi(r,t){return r===t||lr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function ru(r,t){return r===t||lr(r,t)&&r.precision===t.precision}function iO(r,t){return r===t||lr(r,t)&&r.byteWidth===t.byteWidth}function mf(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function aa(r,t){return r===t||lr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function la(r,t){return r===t||lr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function nO(r,t){return r===t||lr(r,t)&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function sO(r,t){return r===t||lr(r,t)&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function yf(r,t){return r===t||lr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&yn.compareManyFields(r.children,t.children)}function oO(r,t){return r===t||lr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&yn.visit(r.indices,t.indices)&&yn.visit(r.dictionary,t.dictionary)}function gf(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function ua(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function aO(r,t){return r===t||lr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function lO(r,t){return r===t||lr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}Nt.prototype.visitNull=us;Nt.prototype.visitBool=us;Nt.prototype.visitInt=Xi;Nt.prototype.visitInt8=Xi;Nt.prototype.visitInt16=Xi;Nt.prototype.visitInt32=Xi;Nt.prototype.visitInt64=Xi;Nt.prototype.visitUint8=Xi;Nt.prototype.visitUint16=Xi;Nt.prototype.visitUint32=Xi;Nt.prototype.visitUint64=Xi;Nt.prototype.visitFloat=ru;Nt.prototype.visitFloat16=ru;Nt.prototype.visitFloat32=ru;Nt.prototype.visitFloat64=ru;Nt.prototype.visitUtf8=us;Nt.prototype.visitLargeUtf8=us;Nt.prototype.visitBinary=us;Nt.prototype.visitLargeBinary=us;Nt.prototype.visitFixedSizeBinary=iO;Nt.prototype.visitDate=mf;Nt.prototype.visitDateDay=mf;Nt.prototype.visitDateMillisecond=mf;Nt.prototype.visitTimestamp=aa;Nt.prototype.visitTimestampSecond=aa;Nt.prototype.visitTimestampMillisecond=aa;Nt.prototype.visitTimestampMicrosecond=aa;Nt.prototype.visitTimestampNanosecond=aa;Nt.prototype.visitTime=la;Nt.prototype.visitTimeSecond=la;Nt.prototype.visitTimeMillisecond=la;Nt.prototype.visitTimeMicrosecond=la;Nt.prototype.visitTimeNanosecond=la;Nt.prototype.visitDecimal=us;Nt.prototype.visitList=nO;Nt.prototype.visitStruct=sO;Nt.prototype.visitUnion=yf;Nt.prototype.visitDenseUnion=yf;Nt.prototype.visitSparseUnion=yf;Nt.prototype.visitDictionary=oO;Nt.prototype.visitInterval=gf;Nt.prototype.visitIntervalDayTime=gf;Nt.prototype.visitIntervalYearMonth=gf;Nt.prototype.visitDuration=ua;Nt.prototype.visitDurationSecond=ua;Nt.prototype.visitDurationMillisecond=ua;Nt.prototype.visitDurationMicrosecond=ua;Nt.prototype.visitDurationNanosecond=ua;Nt.prototype.visitFixedSizeList=aO;Nt.prototype.visitMap=lO;const yn=new Nt;function dh(r,t){return yn.compareSchemas(r,t)}function qu(r,t){return uO(r,t.map(e=>e.data.concat()))}function uO(r,t){const e=[...r.fields],i=[],n={numBatches:t.reduce((h,p)=>Math.max(h,p.length),0)};let s=0,o=0,a=-1;const l=t.length;let u,c=[];for(;n.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(i[s++]=se({type:new sr(e),length:o,nullCount:0,children:c.slice()})))}return[r=r.assign(e),i.map(h=>new fr(r,h))]}function cO(r,t,e,i,n){var s;const o=(t+63&-64)>>3;for(let a=-1,l=i.length;++a=t)c===t?e[a]=u:(e[a]=u.slice(0,t),n.numBatches=Math.max(n.numBatches,i[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:se({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var l0;let gn=class $n{constructor(...t){var e,i;if(t.length===0)return this.batches=[],this.schema=new Pe([]),this._offsets=[0],this;let n,s;t[0]instanceof Pe&&(n=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=l=>{if(l){if(l instanceof fr)return[l];if(l instanceof $n)return l.batches;if(l instanceof Se){if(l.type instanceof sr)return[new fr(new Pe(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(f=>new Me([l[f]])),h=n??new Pe(u.map((f,y)=>new Ce(String(f),c[y].type,c[y].nullable))),[,p]=qu(h,c);return p.length===0?[new fr(l)]:p}}}return[]},a=t.flatMap(l=>o(l));if(n=(i=n??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&i!==void 0?i:new Pe([]),!(n instanceof Pe))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof fr))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!dh(n,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=a,this._offsets=s??K_(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=Q_(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(lf(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?ff.visit(new Me(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ + ${this.toArray().join(`, + `)} +]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:n})=>n));return new $n(e,i.map(n=>new fr(e,n)))}slice(t,e){const i=this.schema;[t,e]=Y_({length:this.numRows},t,e);const n=Z_(this.data,this._offsets,t,e);return new $n(i,n.map(s=>new fr(i,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&ti.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],n=se({type:i,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Me(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),e)}setChildAt(t,e){let i=this.schema,n=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[i,n]=qu(i,a)}return new $n(i,n)}select(t){const e=this.schema.fields.reduce((i,n,s)=>i.set(n.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(n=>n.selectAt(t));return new $n(e,i)}assign(t){const e=this.schema.fields,[i,n]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,p=e.findIndex(f=>f.name===l.name);return~p?h[p]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,n[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new $n(...qu(s,o))}};l0=Symbol.toStringTag;gn[l0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Ol(hf),r.get=Ol(mr.getVisitFn(L.Struct)),r.set=J_(Xr.getVisitFn(L.Struct)),r.indexOf=t0(Fl.getVisitFn(L.Struct)),"Table"))(gn.prototype);var u0;let fr=class Po{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Pe))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=se({nullCount:0,type:new sr(this.schema.fields),children:this.schema.fields.map(e=>se({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Op(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:n,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]=Ce.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Pe(i),a=se({type:new sr(i),length:s,children:n,nullCount:0});[this.schema,this.data]=Op(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=c0(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 mr.visit(this.data,t)}at(t){return this.get(lf(t,this.numRows))}set(t,e){return Xr.visit(this.data,t,e)}indexOf(t,e){return Fl.visit(this.data,t,e)}[Symbol.iterator](){return ff.visit(new Me([this.data]))}toArray(){return[...this]}concat(...t){return new gn(this.schema,[this,...t])}slice(t,e){const[i]=new Me([this.data]).slice(t,e).data;return new Po(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&tn.name===t),e)}setChildAt(t,e){let i=this.schema,n=this.data;if(t>-1&&ta.name===s);~o&&(n[o]=this.data.children[o])}return new Po(e,se({type:i,length:this.numRows,children:n}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),n=se({type:new sr(e.fields),length:this.numRows,children:i});return new Po(e,n)}};u0=Symbol.toStringTag;fr[u0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(fr.prototype);function Op(r,t,e=t.reduce((i,n)=>Math.max(i,n.length),0)){var i;const n=[...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)&&(n[a]=l.clone({nullable:!0}),s[a]=(i=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:se({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(n),se({type:new sr(n),length:e,children:s})]}function c0(r,t,e=new Map){var i,n;if(((i=r==null?void 0:r.length)!==null&&i!==void 0?i:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sse({type:n.type})),i=se({type:new sr(t.fields),nullCount:0,children:e});super(t,i)}}let en=class ai{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 ai).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+me),(e||new ai).__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):ke.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):fe.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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,ke.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,fe.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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,i,n,s,o){return ai.startMessage(t),ai.addVersion(t,e),ai.addHeaderType(t,i),ai.addHeader(t,n),ai.addBodyLength(t,s),ai.addCustomMetadata(t,o),ai.endMessage(t)}};class hO extends ie{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return _p.startNull(e),_p.endNull(e)}visitInt(t,e){return xr.startInt(e),xr.addBitWidth(e,t.bitWidth),xr.addIsSigned(e,t.isSigned),xr.endInt(e)}visitFloat(t,e){return mi.startFloatingPoint(e),mi.addPrecision(e,t.precision),mi.endFloatingPoint(e)}visitBinary(t,e){return pp.startBinary(e),pp.endBinary(e)}visitLargeBinary(t,e){return yp.startLargeBinary(e),yp.endLargeBinary(e)}visitBool(t,e){return mp.startBool(e),mp.endBool(e)}visitUtf8(t,e){return bp.startUtf8(e),bp.endUtf8(e)}visitLargeUtf8(t,e){return gp.startLargeUtf8(e),gp.endLargeUtf8(e)}visitDecimal(t,e){return Ss.startDecimal(e),Ss.addScale(e,t.scale),Ss.addPrecision(e,t.precision),Ss.addBitWidth(e,t.bitWidth),Ss.endDecimal(e)}visitDate(t,e){return Ua.startDate(e),Ua.addUnit(e,t.unit),Ua.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 i=t.timezone&&e.createString(t.timezone)||void 0;return jr.startTimestamp(e),jr.addUnit(e,t.unit),i!==void 0&&jr.addTimezone(e,i),jr.endTimestamp(e)}visitInterval(t,e){return yi.startInterval(e),yi.addUnit(e,t.unit),yi.endInterval(e)}visitDuration(t,e){return za.startDuration(e),za.addUnit(e,t.unit),za.endDuration(e)}visitList(t,e){return vp.startList(e),vp.endList(e)}visitStruct(t,e){return Yn.startStruct_(e),Yn.endStruct_(e)}visitUnion(t,e){hr.startTypeIdsVector(e,t.typeIds.length);const i=hr.createTypeIdsVector(e,t.typeIds);return hr.startUnion(e),hr.addMode(e,t.mode),hr.addTypeIds(e,i),hr.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return $i.startDictionaryEncoding(e),$i.addId(e,BigInt(t.id)),$i.addIsOrdered(e,t.isOrdered),i!==void 0&&$i.addIndexType(e,i),$i.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ja.startFixedSizeBinary(e),ja.addByteWidth(e,t.byteWidth),ja.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return $a.startFixedSizeList(e),$a.addListSize(e,t.listSize),$a.endFixedSizeList(e)}visitMap(t,e){return Va.startMap(e),Va.addKeysSorted(e,t.keysSorted),Va.endMap(e)}}const Qu=new hO;function fO(r,t=new Map){return new Pe(pO(r,t),Ha(r.metadata),t)}function h0(r){return new Fr(r.count,f0(r.columns),d0(r.columns))}function dO(r){return new Ti(h0(r.data),r.id,r.isDelta)}function pO(r,t){return(r.fields||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function Fp(r,t){return(r.children||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function f0(r){return(r||[]).reduce((t,e)=>[...t,new vn(e.count,mO(e.VALIDITY)),...f0(e.children)],[])}function d0(r,t=[]){for(let e=-1,i=(r||[]).length;++et+ +(e===0),0)}function yO(r,t){let e,i,n,s,o,a;return!t||!(s=r.dictionary)?(o=Mp(r,Fp(r,t)),n=new Ce(r.name,o,r.nullable,Ha(r.metadata))):t.has(e=s.id)?(i=(i=s.indexType)?Pp(i):new Qo,a=new Zs(t.get(e),i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))):(i=(i=s.indexType)?Pp(i):new Qo,t.set(e,o=Mp(r,Fp(r,t))),a=new Zs(o,i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))),n||null}function Ha(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function Pp(r){return new is(r.isSigned,r.bitWidth)}function Mp(r,t){const e=r.type.name;switch(e){case"NONE":return new pn;case"null":return new pn;case"binary":return new hl;case"largebinary":return new fl;case"utf8":return new dl;case"largeutf8":return new pl;case"bool":return new ml;case"list":return new xl((t||[])[0]);case"struct":return new sr(t||[]);case"struct_":return new sr(t||[])}switch(e){case"int":{const i=r.type;return new is(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=r.type;return new cl(tr[i.precision])}case"decimal":{const i=r.type;return new yl(i.scale,i.precision,i.bitWidth)}case"date":{const i=r.type;return new gl(Hr[i.unit])}case"time":{const i=r.type;return new vl(zt[i.unit],i.bitWidth)}case"timestamp":{const i=r.type;return new _l(zt[i.unit],i.timezone)}case"interval":{const i=r.type;return new bl(Si[i.unit])}case"duration":{const i=r.type;return new wl(zt[i.unit])}case"union":{const i=r.type,[n,...s]=(i.mode+"").toLowerCase(),o=n.toUpperCase()+s.join("");return new Sl(er[o],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=r.type;return new Tl(i.byteWidth)}case"fixedsizelist":{const i=r.type;return new Il(i.listSize,(t||[])[0])}case"map":{const i=r.type;return new El((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var gO=Cv,vO=Qs;class or{static fromJSON(t,e){const i=new or(0,ke.V5,e);return i._createHeader=_O(t,e),i}static decode(t){t=new vO(ae(t));const e=en.getRootAsMessage(t),i=e.bodyLength(),n=e.version(),s=e.headerType(),o=new or(i,n,s);return o._createHeader=bO(e,s),o}static encode(t){const e=new gO;let i=-1;return t.isSchema()?i=Pe.encode(e,t.header()):t.isRecordBatch()?i=Fr.encode(e,t.header()):t.isDictionaryBatch()&&(i=Ti.encode(e,t.header())),en.startMessage(e),en.addVersion(e,ke.V5),en.addHeader(e,i),en.addHeaderType(e,t.headerType),en.addBodyLength(e,BigInt(t.bodyLength)),en.finishMessageBuffer(e,en.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Pe)return new or(0,ke.V5,fe.Schema,t);if(t instanceof Fr)return new or(e,ke.V5,fe.RecordBatch,t);if(t instanceof Ti)return new or(e,ke.V5,fe.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===fe.Schema}isRecordBatch(){return this.headerType===fe.RecordBatch}isDictionaryBatch(){return this.headerType===fe.DictionaryBatch}constructor(t,e,i,n){this._version=e,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=we(t)}}class Fr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=we(t)}}class Ti{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,i=!1){this._data=t,this._isDelta=i,this._id=we(e)}}class vi{constructor(t,e){this.offset=we(t),this.length=we(e)}}class vn{constructor(t,e){this.length=we(t),this.nullCount=we(e)}}function _O(r,t){return()=>{switch(t){case fe.Schema:return Pe.fromJSON(r);case fe.RecordBatch:return Fr.fromJSON(r);case fe.DictionaryBatch:return Ti.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}function bO(r,t){return()=>{switch(t){case fe.Schema:return Pe.decode(r.header(new ui),new Map,r.version());case fe.RecordBatch:return Fr.decode(r.header(new Bi),r.version());case fe.DictionaryBatch:return Ti.decode(r.header(new ws),r.version())}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}Ce.encode=PO;Ce.decode=OO;Ce.fromJSON=yO;Pe.encode=FO;Pe.decode=wO;Pe.fromJSON=fO;Fr.encode=MO;Fr.decode=xO;Fr.fromJSON=h0;Ti.encode=DO;Ti.decode=SO;Ti.fromJSON=dO;vn.encode=RO;vn.decode=IO;vi.encode=NO;vi.decode=TO;function wO(r,t=new Map,e=ke.V5){const i=AO(r,t);return new Pe(i,Xa(r),t,e)}function xO(r,t=ke.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Fr(r.length(),EO(r),CO(r,t))}function SO(r,t=ke.V5){return new Ti(Fr.decode(r.data(),t),r.id(),r.isDelta())}function TO(r){return new vi(r.offset(),r.length())}function IO(r){return new vn(r.length(),r.nullCount())}function EO(r){const t=[];for(let e,i=-1,n=-1,s=r.nodesLength();++iCe.encode(r,s));ui.startFieldsVector(r,e.length);const i=ui.createFieldsVector(r,e),n=t.metadata&&t.metadata.size>0?ui.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return We.startKeyValue(r),We.addKey(r,a),We.addValue(r,l),We.endKeyValue(r)})):-1;return ui.startSchema(r),ui.addFields(r,i),ui.addEndianness(r,LO?Ks.Little:Ks.Big),n!==-1&&ui.addCustomMetadata(r,n),ui.endSchema(r)}function PO(r,t){let e=-1,i=-1,n=-1;const s=t.type;let o=t.typeId;At.isDictionary(s)?(o=s.dictionary.typeId,n=Qu.visit(s,r),i=Qu.visit(s.dictionary,r)):i=Qu.visit(s,r);const a=(s.children||[]).map(c=>Ce.encode(r,c)),l=Nr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Nr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const p=r.createString(`${c}`),f=r.createString(`${h}`);return We.startKeyValue(r),We.addKey(r,p),We.addValue(r,f),We.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Nr.startField(r),Nr.addType(r,i),Nr.addTypeType(r,o),Nr.addChildren(r,l),Nr.addNullable(r,!!t.nullable),e!==-1&&Nr.addName(r,e),n!==-1&&Nr.addDictionary(r,n),u!==-1&&Nr.addCustomMetadata(r,u),Nr.endField(r)}function MO(r,t){const e=t.nodes||[],i=t.buffers||[];Bi.startNodesVector(r,e.length);for(const o of e.slice().reverse())vn.encode(r,o);const n=r.endVector();Bi.startBuffersVector(r,i.length);for(const o of i.slice().reverse())vi.encode(r,o);const s=r.endVector();return Bi.startRecordBatch(r),Bi.addLength(r,BigInt(t.length)),Bi.addNodes(r,n),Bi.addBuffers(r,s),Bi.endRecordBatch(r)}function DO(r,t){const e=Fr.encode(r,t.data);return ws.startDictionaryBatch(r),ws.addId(r,BigInt(t.id)),ws.addIsDelta(r,t.isDelta),ws.addData(r,e),ws.endDictionaryBatch(r)}function RO(r,t){return Fv.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function NO(r,t){return Ov.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const LO=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),_f=r=>`Expected ${fe[r]} Message in stream, but was null or length 0.`,bf=r=>`Header pointer of flatbuffer-encoded ${fe[r]} Message is null or length 0.`,p0=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,m0=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class y0{constructor(t){this.source=t instanceof Pl?t:new Pl(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?De: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(_f(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ae(this.source.read(t));if(e.byteLength[...n,...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(_f(t));return e.value}readSchema(){const t=fe.Schema,e=this.readMessage(t),i=e==null?void 0:e.header();if(!e||!i)throw new Error(bf(t));return i}}const iu=4,ph="ARROW1",Zo=new Uint8Array(ph.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 kr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return kr.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 Vr?t:rh(t)?VO(t):wv(t)?HO(t):rs(t)?Zt(this,void 0,void 0,function*(){return yield Vr.from(yield t)}):xv(t)||rf(t)||Sv(t)||no(t)?WO(new Js(t)):GO(new Pl(t))}static readAll(t){return t instanceof Vr?t.isSync()?Lp(t):Bp(t):rh(t)||ArrayBuffer.isView(t)||oa(t)||bv(t)?Lp(t):Bp(t)}}class Dl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(this[Symbol.iterator]())))})}}class Rl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return Zt(this,void 0,void 0,function*(){var t,e,i,n;const s=new Array;try{for(var o=!0,a=bi(this),l;l=yield a.next(),t=l.done,!t;o=!0){n=l.value,o=!1;const u=n;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.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 v0 extends Dl{constructor(t){super(t),this._impl=t}}class zO extends Rl{constructor(t){super(t),this._impl=t}}class _0{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 i=this._loadVectors(t,e,this.schema.fields),n=se({type:new sr(this.schema.fields),length:t.length,children:i});return new fr(this.schema,n)}_loadDictionaryBatch(t,e){const{id:i,isDelta:n}=t,{dictionaries:s,schema:o}=this,a=s.get(i),l=o.dictionaries.get(i),u=this._loadVectors(t.data,e,[l]);return(a&&n?a.concat(new Me(u)):new Me(u)).memoize()}_loadVectors(t,e,i){return new a0(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}}class Nl extends _0{constructor(t,e){super(e),this._reader=rh(t)?new kO(this._handle=t):new y0(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=w0(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):De}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):De}next(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ll extends _0{constructor(t,e){super(e),this._reader=new BO(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Zt(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 Zt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=w0(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):De})}return(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):De})}next(){return Zt(this,void 0,void 0,function*(){if(this.closed)return De;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 i=t.header(),n=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class b0 extends Nl{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 Ap?t:new Ap(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 i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-g0,i=t.readInt32(e),n=t.readAt(e-i,i);return Ko.decode(n)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Zt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Zt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Zt(this,void 0,void 0,function*(){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Zt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-g0,i=yield t.readInt32(e),n=yield t.readAt(e-i,i);return Ko.decode(n)})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?wf(t)?new v0(new b0(r.read())):new Dl(new Nl(r)):new Dl(new Nl(function*(){}()))}function WO(r){return Zt(this,void 0,void 0,function*(){const t=yield r.peek(ca+7&-8);return t&&t.byteLength>=4?wf(t)?new v0(new b0(yield r.read())):new Rl(new Ll(r)):new Rl(new Ll(function(){return dr(this,arguments,function*(){})}()))})}function HO(r){return Zt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Ml(r,t);return t>=UO&&wf(yield e.readAt(0,ca+7&-8))?new zO(new jO(e)):new Rl(new Ll(e))})}class Ne extends ie{static assemble(...t){const e=n=>n.flatMap(s=>Array.isArray(s)?e(s):s instanceof fr?s.data.children:s.data),i=new Ne;return i.visitMany(e(t)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Me)return this.visitMany(t.data),this;const{type:e}=t;if(!At.isDictionary(e)){const{length:i}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(At.isUnion(e))this.nodes.push(new vn(i,0));else{const{nullCount:n}=t;At.isNull(e)||ti.call(this,n<=0?new Uint8Array(0):Cl(t.offset,i,t.nullBitmap)),this.nodes.push(new vn(i,n))}}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 ti(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new vi(this._byteLength,t)),this._byteLength+=t,this}function XO(r){var t;const{type:e,length:i,typeIds:n,valueOffsets:s}=r;if(ti.call(this,n),e.mode===er.Sparse)return mh.call(this,r);if(e.mode===er.Dense){if(r.offset<=0)return ti.call(this,s),mh.call(this,r);{const o=new Int32Array(i),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],p=a[h],f=l[h];return u.slice(p,Math.min(i,f))}))}}return this}function YO(r){let t;return r.nullCount>=r.length?ti.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?ti.call(this,Cl(r.offset,r.length,t)):ti.call(this,Al(r.values))}function Yi(r){return ti.call(this,r.values.subarray(0,r.length*r.stride))}function nu(r){const{length:t,values:e,valueOffsets:i}=r,n=we(i[0]),s=we(i[t]),o=Math.min(s-n,e.byteLength-n);return ti.call(this,Iv(-n,t+1,i)),ti.call(this,e.subarray(n,n+o)),this}function xf(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:i,[t]:n}=e;return ti.call(this,Iv(-i,t+1,e)),this.visit(r.children[0].slice(i,n-i))}return this.visit(r.children[0])}function mh(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}Ne.prototype.visitBool=YO;Ne.prototype.visitInt=Yi;Ne.prototype.visitFloat=Yi;Ne.prototype.visitUtf8=nu;Ne.prototype.visitLargeUtf8=nu;Ne.prototype.visitBinary=nu;Ne.prototype.visitLargeBinary=nu;Ne.prototype.visitFixedSizeBinary=Yi;Ne.prototype.visitDate=Yi;Ne.prototype.visitTimestamp=Yi;Ne.prototype.visitTime=Yi;Ne.prototype.visitDecimal=Yi;Ne.prototype.visitList=xf;Ne.prototype.visitStruct=mh;Ne.prototype.visitUnion=XO;Ne.prototype.visitInterval=Yi;Ne.prototype.visitDuration=Yi;Ne.prototype.visitFixedSizeList=xf;Ne.prototype.visitMap=xf;class x0 extends df{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 Wa,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,pr(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 rs(t)?t.then(e=>this.writeAll(e)):no(t)?Ef(this,t):If(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 Wa?this._sink=t:(this._sink=new Wa,t&&SC(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&TC(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||!dh(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 gn&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof fr&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!dh(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof fr?t instanceof vf||this._writeRecordBatch(t):t instanceof gn?this.writeAll(t.batches):oa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,n=or.encode(t),s=n.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,l=a-s-o;return t.headerType===fe.RecordBatch?this._recordBatchBlocks.push(new mn(a,t.bodyLength,this._position)):t.headerType===fe.DictionaryBatch&&this._dictionaryBlocks.push(new mn(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(n),this._writePadding(l)}_write(t){if(this._started){const e=ae(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(or.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Zo)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:n,buffers:s}=Ne.assemble(t),o=new Fr(t.numRows,i,n),a=or.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){const{byteLength:n,nodes:s,bufferRegions:o,buffers:a}=Ne.assemble(new Me([t])),l=new Fr(t.length,s,o),u=new Ti(l,e,i),c=or.from(u,n);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,n;for(let s=-1,o=t.length;++s0&&(this._write(e),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(t){var e,i;for(const[n,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(n),l=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,n,u>0);else if(li.writeAll(n)):no(t)?Ef(i,t):If(i,t)}}class Tf extends x0{static writeAll(t){const e=new Tf;return rs(t)?t.then(i=>e.writeAll(i)):no(t)?Ef(e,t):If(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,i=!1){if(!i&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,i)}_writeFooter(t){const e=Ko.encode(new Ko(t,ke.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function If(r,t){let e=t;t instanceof gn&&(e=t.batches,r.reset(void 0,t.schema));for(const i of e)r.write(i);return r.finish()}function Ef(r,t){return Zt(this,void 0,void 0,function*(){var e,i,n,s,o,a,l;try{for(e=!0,i=bi(t);n=yield i.next(),s=n.done,!s;e=!0){l=n.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=i.return)&&(yield a.call(i))}finally{if(o)throw o.error}}return r.finish()})}function qO(r,t="stream"){return(t==="stream"?Sf:Tf).writeAll(r).toUint8Array(!0)}var QO=Object.create,S0=Object.defineProperty,KO=Object.getOwnPropertyDescriptor,ZO=Object.getOwnPropertyNames,JO=Object.getPrototypeOf,t2=Object.prototype.hasOwnProperty,e2=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),r2=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ZO(t))!t2.call(r,n)&&n!==e&&S0(r,n,{get:()=>t[n],enumerable:!(i=KO(t,n))||i.enumerable});return r},i2=(r,t,e)=>(e=r!=null?QO(JO(r)):{},r2(!r||!r.__esModule?S0(e,"default",{value:r,enumerable:!0}):e,r)),n2=e2((r,t)=>{t.exports=Worker}),T0=(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))(T0||{}),s2=(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))(s2||{}),o2=(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))(o2||{}),a2=(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))(a2||{}),l2=(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))(l2||{}),u2=(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))(u2||{}),c2=class{log(r){}},I0=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},h2=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(h2||{}),f2=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=Vr.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new gn(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 i=new E0(this._bindings,this._conn,e),n=await Vr.from(i);return console.assert(n.isAsync()),console.assert(n.isStream()),n}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 d2(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=qO(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)}},E0=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}},d2=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=Vr.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new gn(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new E0(this.bindings,this.connectionId,t),i=await Vr.from(e);return console.assert(i.isAsync()),console.assert(i.isStream()),i}},p2=(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))(p2||{}),m2=(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))(m2||{}),ue=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,i)=>{this.promiseResolver=e,this.promiseRejecter=i})}};function Ya(r){switch(r.typeId){case L.Binary:return{sqlType:"binary"};case L.Bool:return{sqlType:"bool"};case L.Date:return{sqlType:"date"};case L.DateDay:return{sqlType:"date32[d]"};case L.DateMillisecond:return{sqlType:"date64[ms]"};case L.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case L.Float:return{sqlType:"float"};case L.Float16:return{sqlType:"float16"};case L.Float32:return{sqlType:"float32"};case L.Float64:return{sqlType:"float64"};case L.Int:return{sqlType:"int32"};case L.Int16:return{sqlType:"int16"};case L.Int32:return{sqlType:"int32"};case L.Int64:return{sqlType:"int64"};case L.Uint16:return{sqlType:"uint16"};case L.Uint32:return{sqlType:"uint32"};case L.Uint64:return{sqlType:"uint64"};case L.Uint8:return{sqlType:"uint8"};case L.IntervalDayTime:return{sqlType:"interval[dt]"};case L.IntervalYearMonth:return{sqlType:"interval[m]"};case L.List:return{sqlType:"list",valueType:Ya(r.valueType)};case L.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case L.Null:return{sqlType:"null"};case L.Utf8:return{sqlType:"utf8"};case L.Struct:return{sqlType:"struct",fields:r.children.map(t=>yh(t.name,t.type))};case L.Map:{let t=r;return{sqlType:"map",keyType:Ya(t.keyType),valueType:Ya(t.valueType)}}case L.Time:return{sqlType:"time[s]"};case L.TimeMicrosecond:return{sqlType:"time[us]"};case L.TimeMillisecond:return{sqlType:"time[ms]"};case L.TimeNanosecond:return{sqlType:"time[ns]"};case L.TimeSecond:return{sqlType:"time[s]"};case L.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case L.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case L.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case L.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case L.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function yh(r,t){let e=Ya(t);return e.name=r,e}var y2=new TextEncoder,g2=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 n of this._onInstantiationProgress)n(e.data);return}}let i=this._pendingRequests.get(e.requestId);if(!i){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let n=new Error(e.data.message);n.name=e.data.name,(t=Object.getOwnPropertyDescriptor(n,"stack"))!=null&&t.writable&&(n.stack=e.data.stack),i.promiseRejecter(n);return}switch(i.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"){i.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){i.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){i.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){i.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){i.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){i.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){i.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){i.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){i.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){i.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){i.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){i.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){i.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){i.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){i.promiseResolver(e.data);return}break}i.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 ue("RESET",null);return await this.postTask(r)}async ping(){let r=new ue("PING",null);await this.postTask(r)}async dropFile(r){let t=new ue("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new ue("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new ue("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=i=>{}){this._onInstantiationProgress.push(e);let i=new ue("INSTANTIATE",[r,t]);return await this.postTask(i)}async getVersion(){let r=new ue("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new ue("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new ue("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new ue("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new ue("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new f2(this,r)}async disconnect(r){let t=new ue("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new ue("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let i=new ue("START_PENDING_QUERY",[r,t,e]);return await this.postTask(i)}async pollPendingQuery(r){let t=new ue("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new ue("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new ue("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new ue("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new ue("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new ue("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let i=new ue("RUN_PREPARED",[r,t,e]);return await this.postTask(i)}async sendPrepared(r,t,e){let i=new ue("SEND_PREPARED",[r,t,e]);return await this.postTask(i)}async globFiles(r){let t=new ue("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=y2.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,i){t===void 0&&(t=r);let n=new ue("REGISTER_FILE_URL",[r,t,e,i]);await this.postTask(n)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new ue("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,i){let n=new ue("REGISTER_FILE_HANDLE",[r,t,e,i]);await this.postTask(n,[])}async registerOPFSFileName(r){let t=new ue("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new ue("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new ue("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new ue("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new ue("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let i=new ue("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(i,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(i)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(i)}};function v2(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}v2();var _2=(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))(_2||{}),b2=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])),w2=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])),x2=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])),S2=()=>(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])),T2={version:"1.29.1-dev68.0"},Cf=T2.version.split(".");Cf[0];Cf[1];Cf[2];var I2=()=>typeof navigator>"u",Ku=null,Zu=null,Ju=null,tc=null,ec=null;async function E2(){return Ku==null&&(Ku=typeof BigInt64Array<"u"),Zu==null&&(Zu=await w2()),Ju==null&&(Ju=await S2()),tc==null&&(tc=await x2()),ec==null&&(ec=await b2()),{bigInt64Array:Ku,crossOriginIsolated:I2()||globalThis.crossOriginIsolated||!1,wasmExceptions:Zu,wasmSIMD:tc,wasmThreads:Ju,wasmBulkMemory:ec}}async function kp(r){let t=await E2();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}}i2(n2());const rc={},Mo={};function Lo(r,t){try{const i=(rc[r]||(rc[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return i in Mo?Mo[i]:Up(i,i.split(":"))}catch{if(r in Mo)return Mo[r];const e=r==null?void 0:r.match(C2);return e?Up(r,e.slice(1)):NaN}}const C2=/([+-]\d\d):?(\d\d)?/;function Up(r,t){const e=+t[0],i=+(t[1]||0);return Mo[r]=e>0?e*60+i:e*60-i}class Er extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Lo(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)),C0(this),gh(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Er(...e,t):new Er(Date.now(),t)}withTimeZone(t){return new Er(+this,t)}getTimezoneOffset(){return-Lo(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),gh(this),+this}[Symbol.for("constructDateFrom")](t){return new Er(+new Date(t),this.timeZone)}}const zp=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!zp.test(r))return;const t=r.replace(zp,"$1UTC");Er.prototype[t]&&(r.startsWith("get")?Er.prototype[r]=function(){return this.internal[t]()}:(Er.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),A2(this),+this},Er.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),gh(this),+this}))});function gh(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function A2(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()),C0(r)}function C0(r){const t=Lo(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const i=-new Date(+r).getTimezoneOffset(),n=-new Date(+e).getTimezoneOffset(),s=i-n,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=i-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Lo(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,p=c-a;if(h&&p){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+p);const f=Lo(r.timeZone,r),y=l-f;y&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+y))}}const O2=new TextDecoder("utf-8"),F2=r=>O2.decode(r),P2=new TextEncoder,A0=r=>P2.encode(r),hi=r=>typeof r=="function",ha=r=>r!=null&&Object(r)===r,M2=r=>ha(r)&&hi(r.then),O0=r=>ha(r)&&hi(r[Symbol.iterator]),D2=r=>ha(r)&&hi(r[Symbol.asyncIterator]),R2=r=>ha(r)&&"done"in r&&"value"in r,N2=r=>ha(r)&&hi(r.clear)&&hi(r.bytes)&&hi(r.position)&&hi(r.setPosition)&&hi(r.capacity)&&hi(r.getBufferIdentifier)&&hi(r.createLong),Af=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function L2(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++lrr(Int8Array,r),U2=r=>rr(Int16Array,r),z2=r=>rr(Int32Array,r),j2=r=>rr(BigInt64Array,r),$2=r=>rr(Uint8Array,r),V2=r=>rr(Uint16Array,r),G2=r=>rr(Uint32Array,r),W2=r=>rr(BigUint64Array,r),H2=r=>rr(Float32Array,r),X2=r=>rr(Float64Array,r),Y2=r=>rr(Uint8ClampedArray,r),_h=r=>(r.next(),r);function*Oi(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Af?e(t):O0(t)?t:e(t);return yield*_h(function*(n){let s=null;do s=n.next(yield rr(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const q2=r=>Oi(Int8Array,r),Q2=r=>Oi(Int16Array,r),K2=r=>Oi(Int32Array,r),Z2=r=>Oi(Uint8Array,r),J2=r=>Oi(Uint16Array,r),tF=r=>Oi(Uint32Array,r),eF=r=>Oi(Float32Array,r),rF=r=>Oi(Float64Array,r),iF=r=>Oi(Uint8ClampedArray,r);function ii(r,t){return dr(this,arguments,function*(){if(M2(t))return yield Pt(yield Pt(yield*ts(bi(ii(r,yield Pt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Pt(yield Pt(o))})},n=function(o){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(_h(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 Af?i(t):O0(t)?n(t):D2(t)?t:i(t);return yield Pt(yield*ts(bi(_h(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Pt(o.next(yield yield Pt(rr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Pt(new r)})}const nF=r=>ii(Int8Array,r),sF=r=>ii(Int16Array,r),oF=r=>ii(Int32Array,r),aF=r=>ii(Uint8Array,r),lF=r=>ii(Uint16Array,r),uF=r=>ii(Uint32Array,r),cF=r=>ii(Float32Array,r),hF=r=>ii(Float64Array,r),fF=r=>ii(Uint8ClampedArray,r);function dF(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++eeo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const yF=Object.freeze(Object.defineProperty({__proto__:null,valueToString:eo},Symbol.toStringTag,{value:"Module"}));function ar(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 P0(r,t){return ar(r/t)+ar(r%t)/ar(t)}const M0=Symbol.for("isArrowBigNum");function ni(r,...t){return t.length===0?Object.setPrototypeOf(rr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ni.prototype[M0]=!0;ni.prototype.toJSON=function(){return`"${ro(this)}"`};ni.prototype.valueOf=function(r){return Of(this,r)};ni.prototype.toString=function(){return ro(this)};ni.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Of(this);case"string":return ro(this);case"default":return D0(this)}return ro(this)};function Gs(...r){return ni.apply(this,r)}function Ws(...r){return ni.apply(this,r)}function Jo(...r){return ni.apply(this,r)}Object.setPrototypeOf(Gs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ws.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Jo.prototype,Object.create(Uint32Array.prototype));Object.assign(Gs.prototype,ni.prototype,{constructor:Gs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ws.prototype,ni.prototype,{constructor:Ws,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Jo.prototype,ni.prototype,{constructor:Jo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const gF=BigInt(4294967296)*BigInt(4294967296),vF=gF-BigInt(1);function Of(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return ic(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Et.prototype);class jp extends Et{constructor(){super(W.Null)}toString(){return"Null"}}N0=Symbol.toStringTag;jp[N0]=(r=>r[Symbol.toStringTag]="Null")(jp.prototype);class $p extends Et{constructor(t,e){super(W.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}`}}L0=Symbol.toStringTag;$p[L0]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))($p.prototype);class Vp extends Et{constructor(t){super(W.Float),this.precision=t}get ArrayType(){switch(this.precision){case Cr.HALF:return Uint16Array;case Cr.SINGLE:return Float32Array;case Cr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}B0=Symbol.toStringTag;Vp[B0]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Vp.prototype);class Gp extends Et{constructor(){super(W.Binary)}toString(){return"Binary"}}k0=Symbol.toStringTag;Gp[k0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Gp.prototype);class Wp extends Et{constructor(){super(W.LargeBinary)}toString(){return"LargeBinary"}}U0=Symbol.toStringTag;Wp[U0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Wp.prototype);class Hp extends Et{constructor(){super(W.Utf8)}toString(){return"Utf8"}}z0=Symbol.toStringTag;Hp[z0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Hp.prototype);class Xp extends Et{constructor(){super(W.LargeUtf8)}toString(){return"LargeUtf8"}}j0=Symbol.toStringTag;Xp[j0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Xp.prototype);class Yp extends Et{constructor(){super(W.Bool)}toString(){return"Bool"}}$0=Symbol.toStringTag;Yp[$0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Yp.prototype);class qp extends Et{constructor(t,e,i=128){super(W.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}V0=Symbol.toStringTag;qp[V0]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(qp.prototype);class Qp extends Et{constructor(t){super(W.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${_n[this.unit]}>`}get ArrayType(){return this.unit===_n.DAY?Int32Array:BigInt64Array}}G0=Symbol.toStringTag;Qp[G0]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Qp.prototype);class Kp extends Et{constructor(t,e){super(W.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Jt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}W0=Symbol.toStringTag;Kp[W0]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Kp.prototype);class Zp extends Et{constructor(t,e){super(W.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Jt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}H0=Symbol.toStringTag;Zp[H0]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(Zp.prototype);class Jp extends Et{constructor(t){super(W.Interval),this.unit=t}toString(){return`Interval<${ns[this.unit]}>`}}X0=Symbol.toStringTag;Jp[X0]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Jp.prototype);class tm extends Et{constructor(t){super(W.Duration),this.unit=t}toString(){return`Duration<${Jt[this.unit]}>`}}Y0=Symbol.toStringTag;tm[Y0]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(tm.prototype);class em extends Et{constructor(t){super(W.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}}q0=Symbol.toStringTag;em[q0]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(em.prototype);class bh extends Et{constructor(t){super(W.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Q0=Symbol.toStringTag;bh[Q0]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(bh.prototype);class rm extends Et{constructor(t,e,i){super(W.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}K0=Symbol.toStringTag;rm[K0]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(rm.prototype);class im extends Et{constructor(t){super(W.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Z0=Symbol.toStringTag;im[Z0]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(im.prototype);class nm extends Et{constructor(t,e){super(W.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}>`}}J0=Symbol.toStringTag;nm[J0]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(nm.prototype);class sm extends Et{constructor(t,e=!1){var i,n,s;if(super(W.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.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(", ")}}>`}}tb=Symbol.toStringTag;sm[tb]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(sm.prototype);const bF=(r=>()=>++r)(-1);class om extends Et{constructor(t,e,i,n){super(W.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?bF():ar(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}eb=Symbol.toStringTag;om[eb]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(om.prototype);function rb(r){const t=r;switch(r.typeId){case W.Decimal:return r.bitWidth/32;case W.Interval:return 1+t.unit;case W.FixedSizeList:return t.listSize;case W.FixedSizeBinary:return t.byteWidth;default:return 1}}class le{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return wF(this,t,e)}getVisitFnByTypeId(t,e=!0){return Ps(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 wF(r,t,e=!0){return typeof t=="number"?Ps(r,t,e):typeof t=="string"&&t in W?Ps(r,W[t],e):t&&t instanceof Et?Ps(r,am(t),e):t!=null&&t.type&&t.type instanceof Et?Ps(r,am(t.type),e):Ps(r,W.NONE,e)}function Ps(r,t,e=!0){let i=null;switch(t){case W.Null:i=r.visitNull;break;case W.Bool:i=r.visitBool;break;case W.Int:i=r.visitInt;break;case W.Int8:i=r.visitInt8||r.visitInt;break;case W.Int16:i=r.visitInt16||r.visitInt;break;case W.Int32:i=r.visitInt32||r.visitInt;break;case W.Int64:i=r.visitInt64||r.visitInt;break;case W.Uint8:i=r.visitUint8||r.visitInt;break;case W.Uint16:i=r.visitUint16||r.visitInt;break;case W.Uint32:i=r.visitUint32||r.visitInt;break;case W.Uint64:i=r.visitUint64||r.visitInt;break;case W.Float:i=r.visitFloat;break;case W.Float16:i=r.visitFloat16||r.visitFloat;break;case W.Float32:i=r.visitFloat32||r.visitFloat;break;case W.Float64:i=r.visitFloat64||r.visitFloat;break;case W.Utf8:i=r.visitUtf8;break;case W.LargeUtf8:i=r.visitLargeUtf8;break;case W.Binary:i=r.visitBinary;break;case W.LargeBinary:i=r.visitLargeBinary;break;case W.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case W.Date:i=r.visitDate;break;case W.DateDay:i=r.visitDateDay||r.visitDate;break;case W.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case W.Timestamp:i=r.visitTimestamp;break;case W.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case W.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case W.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case W.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case W.Time:i=r.visitTime;break;case W.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case W.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case W.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case W.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case W.Decimal:i=r.visitDecimal;break;case W.List:i=r.visitList;break;case W.Struct:i=r.visitStruct;break;case W.Union:i=r.visitUnion;break;case W.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case W.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case W.Dictionary:i=r.visitDictionary;break;case W.Interval:i=r.visitInterval;break;case W.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case W.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case W.Duration:i=r.visitDuration;break;case W.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case W.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case W.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case W.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case W.FixedSizeList:i=r.visitFixedSizeList;break;case W.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${W[t]}'`)}function am(r){switch(r.typeId){case W.Null:return W.Null;case W.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?W.Int8:W.Uint8;case 16:return e?W.Int16:W.Uint16;case 32:return e?W.Int32:W.Uint32;case 64:return e?W.Int64:W.Uint64}return W.Int}case W.Float:switch(r.precision){case Cr.HALF:return W.Float16;case Cr.SINGLE:return W.Float32;case Cr.DOUBLE:return W.Float64}return W.Float;case W.Binary:return W.Binary;case W.LargeBinary:return W.LargeBinary;case W.Utf8:return W.Utf8;case W.LargeUtf8:return W.LargeUtf8;case W.Bool:return W.Bool;case W.Decimal:return W.Decimal;case W.Time:switch(r.unit){case Jt.SECOND:return W.TimeSecond;case Jt.MILLISECOND:return W.TimeMillisecond;case Jt.MICROSECOND:return W.TimeMicrosecond;case Jt.NANOSECOND:return W.TimeNanosecond}return W.Time;case W.Timestamp:switch(r.unit){case Jt.SECOND:return W.TimestampSecond;case Jt.MILLISECOND:return W.TimestampMillisecond;case Jt.MICROSECOND:return W.TimestampMicrosecond;case Jt.NANOSECOND:return W.TimestampNanosecond}return W.Timestamp;case W.Date:switch(r.unit){case _n.DAY:return W.DateDay;case _n.MILLISECOND:return W.DateMillisecond}return W.Date;case W.Interval:switch(r.unit){case ns.DAY_TIME:return W.IntervalDayTime;case ns.YEAR_MONTH:return W.IntervalYearMonth}return W.Interval;case W.Duration:switch(r.unit){case Jt.SECOND:return W.DurationSecond;case Jt.MILLISECOND:return W.DurationMillisecond;case Jt.MICROSECOND:return W.DurationMicrosecond;case Jt.NANOSECOND:return W.DurationNanosecond}return W.Duration;case W.Map:return W.Map;case W.List:return W.List;case W.Struct:return W.Struct;case W.Union:switch(r.mode){case Ii.Dense:return W.DenseUnion;case Ii.Sparse:return W.SparseUnion}return W.Union;case W.FixedSizeBinary:return W.FixedSizeBinary;case W.FixedSizeList:return W.FixedSizeList;case W.Dictionary:return W.Dictionary}throw new Error(`Unrecognized type '${W[r.typeId]}'`)}le.prototype.visitInt8=null;le.prototype.visitInt16=null;le.prototype.visitInt32=null;le.prototype.visitInt64=null;le.prototype.visitUint8=null;le.prototype.visitUint16=null;le.prototype.visitUint32=null;le.prototype.visitUint64=null;le.prototype.visitFloat16=null;le.prototype.visitFloat32=null;le.prototype.visitFloat64=null;le.prototype.visitDateDay=null;le.prototype.visitDateMillisecond=null;le.prototype.visitTimestampSecond=null;le.prototype.visitTimestampMillisecond=null;le.prototype.visitTimestampMicrosecond=null;le.prototype.visitTimestampNanosecond=null;le.prototype.visitTimeSecond=null;le.prototype.visitTimeMillisecond=null;le.prototype.visitTimeMicrosecond=null;le.prototype.visitTimeNanosecond=null;le.prototype.visitDenseUnion=null;le.prototype.visitSparseUnion=null;le.prototype.visitIntervalDayTime=null;le.prototype.visitIntervalYearMonth=null;le.prototype.visitDuration=null;le.prototype.visitDurationSecond=null;le.prototype.visitDurationMillisecond=null;le.prototype.visitDurationMicrosecond=null;le.prototype.visitDurationNanosecond=null;const ib=new Float64Array(1),vs=new Uint32Array(ib.buffer);function Ff(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function nb(r){if(r!==r)return 32256;ib[0]=r;const t=(vs[1]&2147483648)>>16&65535;let e=vs[1]&2146435072,i=0;return e>=1089470464?vs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(vs[1]&1048575)>>10):e<=1056964608?(i=1048576+(vs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(vs[1]&1048575)+512>>10),t|e|i&65535}const xF=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:nb,uint16ToFloat64:Ff},Symbol.toStringTag,{value:"Module"}));class Gt extends le{}function Yt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const SF=(r,t,e)=>{r[t]=Math.floor(e/864e5)},sb=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},Pf=({values:r},t,e)=>{r[t]=e},ob=({values:r},t,e)=>{r[t]=nb(e)},IF=(r,t,e)=>{switch(r.type.precision){case Cr.HALF:return ob(r,t,e);case Cr.SINGLE:case Cr.DOUBLE:return Pf(r,t,e)}},ab=({values:r},t,e)=>{SF(r,t,e.valueOf())},lb=({values:r},t,e)=>{r[t]=BigInt(e)},EF=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},ub=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,i),cb=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,A0(i)),CF=(r,t,e)=>{r.type.unit===_n.DAY?ab(r,t,e):lb(r,t,e)},hb=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},fb=({values:r},t,e)=>{r[t]=BigInt(e)},db=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},pb=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},AF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return hb(r,t,e);case Jt.MILLISECOND:return fb(r,t,e);case Jt.MICROSECOND:return db(r,t,e);case Jt.NANOSECOND:return pb(r,t,e)}},mb=({values:r},t,e)=>{r[t]=e},yb=({values:r},t,e)=>{r[t]=e},gb=({values:r},t,e)=>{r[t]=e},vb=({values:r},t,e)=>{r[t]=e},OF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return mb(r,t,e);case Jt.MILLISECOND:return yb(r,t,e);case Jt.MICROSECOND:return gb(r,t,e);case Jt.NANOSECOND:return vb(r,t,e)}},FF=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},PF=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Ei.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Ei.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},DF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),RF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),NF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),LF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),BF=(r,t,e)=>{const i=r.type.children.map(s=>Ei.getVisitFn(s.type)),n=e instanceof Map?NF(t,e):e instanceof Qe?RF(t,e):Array.isArray(e)?DF(t,e):LF(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},kF=(r,t,e)=>{r.type.mode===Ii.Dense?_b(r,t,e):bb(r,t,e)},_b=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,r.valueOffsets[t],e)},bb=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,t,e)},UF=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},zF=(r,t,e)=>{r.type.unit===ns.DAY_TIME?wb(r,t,e):xb(r,t,e)},wb=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},xb=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Sb=({values:r},t,e)=>{r[t]=e},Tb=({values:r},t,e)=>{r[t]=e},Ib=({values:r},t,e)=>{r[t]=e},Eb=({values:r},t,e)=>{r[t]=e},jF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return Sb(r,t,e);case Jt.MILLISECOND:return Tb(r,t,e);case Jt.MICROSECOND:return Ib(r,t,e);case Jt.NANOSECOND:return Eb(r,t,e)}},$F=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Ei.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new VF(this[Zr],this[Hs])}}class VF{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[Zr].type.children.some(i=>i.name===e)}getOwnPropertyDescriptor(t,e){if(t[Zr].type.children.some(i=>i.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Zr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=Yr.visit(t[Zr].children[i],t[Hs]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Zr].type.children.findIndex(s=>s.name===e);return n!==-1?(Ei.visit(t[Zr].children[n],t[Hs],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}const WF=new GF;class Lt extends le{}function Wt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const HF=(r,t)=>864e5*r[t],XF=(r,t)=>null,Cb=(r,t,e)=>{if(e+1>=t.length)return null;const i=ar(t[e]),n=ar(t[e+1]);return r.subarray(i,n)},YF=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<HF(r,t),Ob=({values:r},t)=>ar(r[t]),xn=({stride:r,values:t},e)=>t[r*e],qF=({stride:r,values:t},e)=>Ff(t[r*e]),Fb=({values:r},t)=>r[t],QF=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),Pb=({values:r,valueOffsets:t},e)=>Cb(r,t,e),Mb=({values:r,valueOffsets:t},e)=>{const i=Cb(r,t,e);return i!==null?F2(i):null},KF=({values:r},t)=>r[t],ZF=({type:r,values:t},e)=>r.precision!==Cr.HALF?t[e]:Ff(t[e]),JF=(r,t)=>r.type.unit===_n.DAY?Ab(r,t):Ob(r,t),Db=({values:r},t)=>1e3*ar(r[t]),Rb=({values:r},t)=>ar(r[t]),Nb=({values:r},t)=>P0(r[t],BigInt(1e3)),Lb=({values:r},t)=>P0(r[t],BigInt(1e6)),tP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Db(r,t);case Jt.MILLISECOND:return Rb(r,t);case Jt.MICROSECOND:return Nb(r,t);case Jt.NANOSECOND:return Lb(r,t)}},Bb=({values:r},t)=>r[t],kb=({values:r},t)=>r[t],Ub=({values:r},t)=>r[t],zb=({values:r},t)=>r[t],eP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Bb(r,t);case Jt.MILLISECOND:return kb(r,t);case Jt.MICROSECOND:return Ub(r,t);case Jt.NANOSECOND:return zb(r,t)}},rP=({values:r,stride:t},e)=>su.decimal(r.subarray(t*e,t*(e+1))),iP=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Qe([l])},nP=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new Df(o.slice(n,s-n))},sP=(r,t)=>new Mf(r,t),oP=(r,t)=>r.type.mode===Ii.Dense?jb(r,t):$b(r,t),jb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,r.valueOffsets[t])},$b=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,t)},aP=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},lP=(r,t)=>r.type.unit===ns.DAY_TIME?Vb(r,t):Gb(r,t),Vb=({values:r},t)=>r.subarray(2*t,2*(t+1)),Gb=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Wb=({values:r},t)=>r[t],Hb=({values:r},t)=>r[t],Xb=({values:r},t)=>r[t],Yb=({values:r},t)=>r[t],uP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Wb(r,t);case Jt.MILLISECOND:return Hb(r,t);case Jt.MICROSECOND:return Xb(r,t);case Jt.NANOSECOND:return Yb(r,t)}},cP=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Qe([s])};Lt.prototype.visitNull=Wt(XF);Lt.prototype.visitBool=Wt(YF);Lt.prototype.visitInt=Wt(KF);Lt.prototype.visitInt8=Wt(xn);Lt.prototype.visitInt16=Wt(xn);Lt.prototype.visitInt32=Wt(xn);Lt.prototype.visitInt64=Wt(Fb);Lt.prototype.visitUint8=Wt(xn);Lt.prototype.visitUint16=Wt(xn);Lt.prototype.visitUint32=Wt(xn);Lt.prototype.visitUint64=Wt(Fb);Lt.prototype.visitFloat=Wt(ZF);Lt.prototype.visitFloat16=Wt(qF);Lt.prototype.visitFloat32=Wt(xn);Lt.prototype.visitFloat64=Wt(xn);Lt.prototype.visitUtf8=Wt(Mb);Lt.prototype.visitLargeUtf8=Wt(Mb);Lt.prototype.visitBinary=Wt(Pb);Lt.prototype.visitLargeBinary=Wt(Pb);Lt.prototype.visitFixedSizeBinary=Wt(QF);Lt.prototype.visitDate=Wt(JF);Lt.prototype.visitDateDay=Wt(Ab);Lt.prototype.visitDateMillisecond=Wt(Ob);Lt.prototype.visitTimestamp=Wt(tP);Lt.prototype.visitTimestampSecond=Wt(Db);Lt.prototype.visitTimestampMillisecond=Wt(Rb);Lt.prototype.visitTimestampMicrosecond=Wt(Nb);Lt.prototype.visitTimestampNanosecond=Wt(Lb);Lt.prototype.visitTime=Wt(eP);Lt.prototype.visitTimeSecond=Wt(Bb);Lt.prototype.visitTimeMillisecond=Wt(kb);Lt.prototype.visitTimeMicrosecond=Wt(Ub);Lt.prototype.visitTimeNanosecond=Wt(zb);Lt.prototype.visitDecimal=Wt(rP);Lt.prototype.visitList=Wt(iP);Lt.prototype.visitStruct=Wt(sP);Lt.prototype.visitUnion=Wt(oP);Lt.prototype.visitDenseUnion=Wt(jb);Lt.prototype.visitSparseUnion=Wt($b);Lt.prototype.visitDictionary=Wt(aP);Lt.prototype.visitInterval=Wt(lP);Lt.prototype.visitIntervalDayTime=Wt(Vb);Lt.prototype.visitIntervalYearMonth=Wt(Gb);Lt.prototype.visitDuration=Wt(uP);Lt.prototype.visitDurationSecond=Wt(Wb);Lt.prototype.visitDurationMillisecond=Wt(Hb);Lt.prototype.visitDurationMicrosecond=Wt(Xb);Lt.prototype.visitDurationNanosecond=Wt(Yb);Lt.prototype.visitFixedSizeList=Wt(cP);Lt.prototype.visitMap=Wt(nP);const Yr=new Lt,Ms=Symbol.for("keys"),Xs=Symbol.for("vals"),Ds=Symbol.for("kKeysAsStrings"),wh=Symbol.for("_kKeysAsStrings");class Df{constructor(t){return this[Ms]=new Qe([t.children[0]]).memoize(),this[Xs]=t.children[1],new Proxy(this,new fP)}get[Ds](){return this[wh]||(this[wh]=Array.from(this[Ms].toArray(),String))}[Symbol.iterator](){return new hP(this[Ms],this[Xs])}get size(){return this[Ms].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ms],e=this[Xs],i={};for(let n=-1,s=t.length;++n`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class hP{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),Yr.visit(this.vals,t)]})}}class fP{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ds]}has(t,e){return t[Ds].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ds].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Ds].indexOf(e);if(i!==-1){const n=Yr.visit(Reflect.get(t,Xs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Ds].indexOf(e);return n!==-1?(Ei.visit(Reflect.get(t,Xs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Df.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ms]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let lm;function qb(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const Qb=(r,t)=>r<0?t+r:r,um=r=>r!==r;function cs(r){if(typeof r!=="object"||r===null)return um(r)?um:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?F0(r,e):!1:r instanceof Map?pP(r):Array.isArray(r)?dP(r):r instanceof Qe?mP(r):yP(r,!0)}function dP(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return gP(r,e);case Map:return cm(r,e,e.keys());case Df:case Mf:case Object:case void 0:return cm(r,e,t||Object.keys(e))}return e instanceof Qe?vP(r,e):!1}}function gP(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function bP(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):Zb(new au(e,r,t,null,Rf)).subarray(0,i)),n}return e}function Zb(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class au{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,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,n=t+(t%8===0?0:8-t%8);return Bl(r,t,n)+Bl(r,i,e)+Jb(r,n>>3,i-n>>3)}function Jb(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=qa(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=qa(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=qa(s.getUint8(n)),n+=1;return i}function qa(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 wP=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:au,getBit:Kb,getBool:Rf,packBools:Zb,popcnt_array:Jb,popcnt_bit_range:Bl,popcnt_uint32:qa,setBool:bP,truncateBitmap:xh},Symbol.toStringTag,{value:"Module"})),xP=-1;class ta{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 Et.isSparseUnion(t)?this.children.some(e=>e.nullable):Et.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:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Et.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=xP&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Bl(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,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(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ta?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=rb(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(Et.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===Ii.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(xh(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ta(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);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===W.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(xh(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[zi.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[zi.TYPE])&&(o[zi.TYPE]=s.subarray(t,t+e)),(s=o[zi.OFFSET])&&(o[zi.OFFSET]=s.subarray(t,t+e+1))||(s=o[zi.DATA])&&(o[zi.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}}ta.prototype.children=Object.freeze([]);class hm{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function TP(r){return r.reduce((t,e)=>t+e.nullCount,0)}function IP(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function EP(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function Nf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function FP(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new au(e,r.offset+(t||0),r.length,e,Rf)){if(!n)return i;++i}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case W.Union:break;case W.Dictionary:break;default:return FP(r,e)}const i=Yr.getVisitFn(r),n=cs(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new hm(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new PP(o)})}class PP{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof ta)))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}=iw[o.typeId],c=s[0];this.isValid=h=>tw(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,nw[o.typeId]),this._offsets=IP(s);break}this.data=s,this.type=o,this.stride=rb(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return SP(this.data)}get nullCount(){return TP(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${W[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Qb(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return MP.visit(this)}concat(...t){return new Qe(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Qe(qb(this,t,e,({data:i,_offsets:n},s,o)=>EP(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case W.Int:case W.Float:case W.Decimal:case W.Time:case W.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),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(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Et.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Et.isDictionary(this.type)){const t=new kl(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return new kl(this)}unmemoize(){if(Et.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return this}}rw=Symbol.toStringTag;Qe[rw]=(r=>{r.type=Et.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(W).map(e=>W[e]).filter(e=>typeof e=="number"&&e!==W.NONE);for(const e of t){const i=Yr.getVisitFnByTypeId(e),n=Ei.getVisitFnByTypeId(e),s=dm.getVisitFnByTypeId(e);iw[e]={get:i,set:n,indexOf:s},nw[e]=Object.create(r,{isValid:{value:fm(tw)},get:{value:fm(Yr.getVisitFnByTypeId(e))},set:{value:CP(Ei.getVisitFnByTypeId(e))},indexOf:{value:AP(dm.getVisitFnByTypeId(e))}})}return"Vector"})(Qe.prototype);class kl extends Qe{constructor(t){super(t.data);const e=this.get,i=this.set,n=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){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new kl(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Qe(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const DP=65536;function Ls(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const io=8,Lf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Bf{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]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[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`${Ls(this.buffer[3])} ${Ls(this.buffer[2])} ${Ls(this.buffer[1])} ${Ls(this.buffer[0])}`}static multiply(t,e){return new ci(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ci(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ci.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ci.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new ci(e);for(let o=i?1:0;othis.compareFields(i,e[n]))}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 ur(r,t){return t instanceof r.constructor}function hs(r,t){return r===t||ur(r,t)}function Qi(r,t){return r===t||ur(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function lu(r,t){return r===t||ur(r,t)&&r.precision===t.precision}function NP(r,t){return r===t||ur(r,t)&&r.byteWidth===t.byteWidth}function kf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function fa(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function da(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function LP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function BP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function Uf(r,t){return r===t||ur(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&Ci.compareManyFields(r.children,t.children)}function kP(r,t){return r===t||ur(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Ci.visit(r.indices,t.indices)&&Ci.visit(r.dictionary,t.dictionary)}function zf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function pa(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function UP(r,t){return r===t||ur(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function zP(r,t){return r===t||ur(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}Ut.prototype.visitNull=hs;Ut.prototype.visitBool=hs;Ut.prototype.visitInt=Qi;Ut.prototype.visitInt8=Qi;Ut.prototype.visitInt16=Qi;Ut.prototype.visitInt32=Qi;Ut.prototype.visitInt64=Qi;Ut.prototype.visitUint8=Qi;Ut.prototype.visitUint16=Qi;Ut.prototype.visitUint32=Qi;Ut.prototype.visitUint64=Qi;Ut.prototype.visitFloat=lu;Ut.prototype.visitFloat16=lu;Ut.prototype.visitFloat32=lu;Ut.prototype.visitFloat64=lu;Ut.prototype.visitUtf8=hs;Ut.prototype.visitLargeUtf8=hs;Ut.prototype.visitBinary=hs;Ut.prototype.visitLargeBinary=hs;Ut.prototype.visitFixedSizeBinary=NP;Ut.prototype.visitDate=kf;Ut.prototype.visitDateDay=kf;Ut.prototype.visitDateMillisecond=kf;Ut.prototype.visitTimestamp=fa;Ut.prototype.visitTimestampSecond=fa;Ut.prototype.visitTimestampMillisecond=fa;Ut.prototype.visitTimestampMicrosecond=fa;Ut.prototype.visitTimestampNanosecond=fa;Ut.prototype.visitTime=da;Ut.prototype.visitTimeSecond=da;Ut.prototype.visitTimeMillisecond=da;Ut.prototype.visitTimeMicrosecond=da;Ut.prototype.visitTimeNanosecond=da;Ut.prototype.visitDecimal=hs;Ut.prototype.visitList=LP;Ut.prototype.visitStruct=BP;Ut.prototype.visitUnion=Uf;Ut.prototype.visitDenseUnion=Uf;Ut.prototype.visitSparseUnion=Uf;Ut.prototype.visitDictionary=kP;Ut.prototype.visitInterval=zf;Ut.prototype.visitIntervalDayTime=zf;Ut.prototype.visitIntervalYearMonth=zf;Ut.prototype.visitDuration=pa;Ut.prototype.visitDurationSecond=pa;Ut.prototype.visitDurationMillisecond=pa;Ut.prototype.visitDurationMicrosecond=pa;Ut.prototype.visitDurationNanosecond=pa;Ut.prototype.visitFixedSizeList=UP;Ut.prototype.visitMap=zP;const Ci=new Ut;function jP(r,t){return Ci.compareSchemas(r,t)}function $P(r,t){return Ci.compareFields(r,t)}function VP(r,t){return Ci.visit(r,t)}const pm=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},_F),RP),wP),xF),pF),_P),yF),{compareSchemas:jP,compareFields:$P,compareTypes:VP}),sw=6048e5,GP=864e5,mm=Symbol.for("constructDateFrom");function Gi(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&mm in r?r[mm](t):r instanceof Date?new r.constructor(t):new Date(t)}function qr(r,t){return Gi(t||r,r)}let WP={};function uu(){return WP}function ea(r,t){var a,l,u,c;const e=uu(),i=(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,n=qr(r,t==null?void 0:t.in),s=n.getDay(),o=(s=s.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function ym(r){const t=qr(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 HP(r,...t){const e=Gi.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function gm(r,t){const e=qr(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function XP(r,t,e){const[i,n]=HP(e==null?void 0:e.in,r,t),s=gm(i),o=gm(n),a=+s-ym(s),l=+o-ym(o);return Math.round((a-l)/GP)}function YP(r,t){const e=ow(r,t),i=Gi(r,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Ul(i)}function qP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!qP(r)&&typeof r!="number"||isNaN(+qr(r)))}function KP(r,t){const e=qr(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ZP={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"}},JP=(r,t,e)=>{let i;const n=ZP[r];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function nc(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const tM={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rM={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iM={date:nc({formats:tM,defaultWidth:"full"}),time:nc({formats:eM,defaultWidth:"full"}),dateTime:nc({formats:rM,defaultWidth:"full"})},nM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sM=(r,t,e,i)=>nM[r];function go(r){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;n=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;n=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return n[s]}}const oM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},aM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lM={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"]},uM={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"]},cM={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"}},hM={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"}},fM=(r,t)=>{const e=Number(r),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},dM={ordinalNumber:fM,era:go({values:oM,defaultWidth:"wide"}),quarter:go({values:aM,defaultWidth:"wide",argumentCallback:r=>r-1}),month:go({values:lM,defaultWidth:"wide"}),day:go({values:uM,defaultWidth:"wide"}),dayPeriod:go({values:cM,defaultWidth:"wide",formattingValues:hM,defaultFormattingWidth:"wide"})};function vo(r){return(t,e={})=>{const i=e.width,n=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],s=t.match(n);if(!s)return null;const o=s[0],a=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?mM(a,h=>h.test(o)):pM(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 pM(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function mM(r,t){for(let e=0;e{const i=t.match(r.matchPattern);if(!i)return null;const n=i[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(n.length);return{value:o,rest:a}}}const gM=/^(\d+)(th|st|nd|rd)?/i,vM=/\d+/i,_M={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},bM={any:[/^b/i,/^(a|c)/i]},wM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xM={any:[/1/i,/2/i,/3/i,/4/i]},SM={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},TM={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]},IM={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},EM={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]},CM={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},AM={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}},OM={ordinalNumber:yM({matchPattern:gM,parsePattern:vM,valueCallback:r=>parseInt(r,10)}),era:vo({matchPatterns:_M,defaultMatchWidth:"wide",parsePatterns:bM,defaultParseWidth:"any"}),quarter:vo({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:xM,defaultParseWidth:"any",valueCallback:r=>r+1}),month:vo({matchPatterns:SM,defaultMatchWidth:"wide",parsePatterns:TM,defaultParseWidth:"any"}),day:vo({matchPatterns:IM,defaultMatchWidth:"wide",parsePatterns:EM,defaultParseWidth:"any"}),dayPeriod:vo({matchPatterns:CM,defaultMatchWidth:"any",parsePatterns:AM,defaultParseWidth:"any"})},FM={code:"en-US",formatDistance:JP,formatLong:iM,formatRelative:sM,localize:dM,match:OM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PM(r,t){const e=qr(r,t==null?void 0:t.in);return XP(e,KP(e))+1}function MM(r,t){const e=qr(r,t==null?void 0:t.in),i=+Ul(e)-+YP(e);return Math.round(i/sw)+1}function aw(r,t){var c,h,p,f;const e=qr(r,t==null?void 0:t.in),i=e.getFullYear(),n=uu(),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)??n.firstWeekContainsDate??((f=(p=n.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??1,o=Gi((t==null?void 0:t.in)||r,0);o.setFullYear(i+1,0,s),o.setHours(0,0,0,0);const a=ea(o,t),l=Gi((t==null?void 0:t.in)||r,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const u=ea(l,t);return+e>=+a?i+1:+e>=+u?i:i-1}function DM(r,t){var a,l,u,c;const e=uu(),i=(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,n=aw(r,t),s=Gi((t==null?void 0:t.in)||r,0);return s.setFullYear(n,0,i),s.setHours(0,0,0,0),ea(s,t)}function RM(r,t){const e=qr(r,t==null?void 0:t.in),i=+ea(e,t)-+DM(e,t);return Math.round(i/sw)+1}function ve(r,t){const e=r<0?"-":"",i=Math.abs(r).toString().padStart(t,"0");return e+i}const rn={y(r,t){const e=r.getFullYear(),i=e>0?e:1-e;return ve(t==="yy"?i%100:i,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):ve(e+1,2)},d(r,t){return ve(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 ve(r.getHours()%12||12,t.length)},H(r,t){return ve(r.getHours(),t.length)},m(r,t){return ve(r.getMinutes(),t.length)},s(r,t){return ve(r.getSeconds(),t.length)},S(r,t){const e=t.length,i=r.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return ve(n,t.length)}},_s={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vm={G:function(r,t,e){const i=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const i=r.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return rn.y(r,t)},Y:function(r,t,e,i){const n=aw(r,i),s=n>0?n:1-n;if(t==="YY"){const o=s%100;return ve(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):ve(s,t.length)},R:function(r,t){const e=ow(r);return ve(e,t.length)},u:function(r,t){const e=r.getFullYear();return ve(e,t.length)},Q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ve(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ve(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,e){const i=r.getMonth();switch(t){case"M":case"MM":return rn.M(r,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,e){const i=r.getMonth();switch(t){case"L":return String(i+1);case"LL":return ve(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,e,i){const n=RM(r,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):ve(n,t.length)},I:function(r,t,e){const i=MM(r);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ve(i,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):rn.d(r,t)},D:function(r,t,e){const i=PM(r);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ve(i,t.length)},E:function(r,t,e){const i=r.getDay();switch(t){case"E":case"EE":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"})}},e:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ve(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});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"})}},c:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ve(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(r,t,e){const i=r.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return ve(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,e){const n=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(r,t,e){const i=r.getHours();let n;switch(i===12?n=_s.noon:i===0?n=_s.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(r,t,e){const i=r.getHours();let n;switch(i>=17?n=_s.evening:i>=12?n=_s.afternoon:i>=4?n=_s.morning:n=_s.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let i=r.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return rn.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):rn.H(r,t)},K:function(r,t,e){const i=r.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},k:function(r,t,e){let i=r.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):rn.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):rn.s(r,t)},S:function(r,t){return rn.S(r,t)},X:function(r,t,e){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return bm(i);case"XXXX":case"XX":return Vn(i);case"XXXXX":case"XXX":default:return Vn(i,":")}},x:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"x":return bm(i);case"xxxx":case"xx":return Vn(i);case"xxxxx":case"xxx":default:return Vn(i,":")}},O:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_m(i,":");case"OOOO":default:return"GMT"+Vn(i,":")}},z:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_m(i,":");case"zzzz":default:return"GMT"+Vn(i,":")}},t:function(r,t,e){const i=Math.trunc(+r/1e3);return ve(i,t.length)},T:function(r,t,e){return ve(+r,t.length)}};function _m(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=Math.trunc(i/60),s=i%60;return s===0?e+String(n):e+String(n)+t+ve(s,2)}function bm(r,t){return r%60===0?(r>0?"-":"+")+ve(Math.abs(r)/60,2):Vn(r,t)}function Vn(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=ve(Math.trunc(i/60),2),s=ve(i%60,2);return e+n+t+s}const wm=(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"})}},lw=(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"})}},NM=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return wm(r,t);let s;switch(i){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}}",wm(i,t)).replace("{{time}}",lw(n,t))},LM={p:lw,P:NM},BM=/^D+$/,kM=/^Y+$/,UM=["D","DD","YY","YYYY"];function zM(r){return BM.test(r)}function jM(r){return kM.test(r)}function $M(r,t,e){const i=VM(r,t,e);if(console.warn(i),UM.includes(r))throw new RangeError(i)}function VM(r,t,e){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HM=/^'([^]*?)'?$/,XM=/''/g,YM=/[a-zA-Z]/;function uw(r,t,e){var c,h,p,f;const i=uu(),n=i.locale??FM,s=i.firstWeekContainsDate??((h=(c=i.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=i.weekStartsOn??((f=(p=i.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,a=qr(r,e==null?void 0:e.in);if(!QP(a))throw new RangeError("Invalid time value");let l=t.match(WM).map(y=>{const g=y[0];if(g==="p"||g==="P"){const d=LM[g];return d(y,n.formatLong)}return y}).join("").match(GM).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:qM(y)};if(vm[g])return{isToken:!0,value:y};if(g.match(YM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return l.map(y=>{if(!y.isToken)return y.value;const g=y.value;(jM(g)||zM(g))&&$M(g,t,String(r));const d=vm[g[0]];return d(a,g,n.localize,u)}).join("")}function qM(r){const t=r.match(HM);return t?t[1].replace(XM,"'"):r}function QM(r,t){return qr(r*1e3,t==null?void 0:t.in)}function KM(r,t){const e=ZM(t)?new t(0):Gi(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function ZM(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function JM(r,t){let e=r.length;switch("string"){case"string":{if(t.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function gr(r){return r==null}function tD(r){return r!=null}async function Sh(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await ln(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function eD(r){return gr(r)?!1:Et.isInt(r.type)&&!cw(r)||rD(r)}function rD(r){return gr(r)?!1:Et.isInt(r.type)&&r.type.isSigned===!1}function iD(r){return gr(r)?!1:Et.isFloat(r.type)??!1}function nD(r){return gr(r)?!1:Et.isDecimal(r.type)}function sD(r){return gr(r)?!1:Et.isBool(r.type)}function oD(r){return gr(r)?!1:Et.isDuration(r.type)}function cw(r){return gr(r)?!1:Et.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function aD(r){return gr(r)?!1:Et.isTimestamp(r.type)}function lD(r){return gr(r)?!1:Et.isDate(r.type)}function uD(r){return gr(r)?!1:Et.isTime(r.type)}function cD(r){return gr(r)?!1:Et.isList(r.type)||Et.isFixedSizeList(r.type)}function hD(r){return gr(r)?!1:Et.isStruct(r.type)||Et.isMap(r.type)}function fD(r){return gr(r)?!1:Et.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Et.isInterval(r.type)}function dD(r,t){let e;if(t===Jt.MILLISECOND)e=1e3;else if(t===Jt.MICROSECOND)e=1e3*1e3;else if(t===Jt.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 pD(r,t){var i;const e=dD(r,((i=t==null?void 0:t.type)==null?void 0:i.unit)??Jt.SECOND);return QM(e)}function mD(r,t){const e=pD(r,t);return uw(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function yD(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?uw(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function gD(r,t){var n;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const i=(n=t==null?void 0:t.type)==null?void 0:n.timezone;return typeof r=="number"?i?e=new Er(r,i):e=new Er(r):i?e=new Er(r,i):e=new Er(r),KM(e,Date)}function vD(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let i=pm.bigNumToString(new pm.BN(r)).padStart(e,"0");if(e===0)return i;let n="";i.startsWith("-")&&(n="-",i=i.slice(1));const s=i.slice(0,-e)||"0",o=JM(i.slice(-e),"0")||"";return`${n}${s}${o?`.${o}`:""}`}function _D(r){const t=r[0],e=r[1],i=[];return t!==0&&i.push(`${t} year${t>1?"s":""}`),e!==0&&i.push(`${e} month${e>1?"s":""}`),i.length?i.join(" "):"0 months"}function bD(r,t){var i,n,s,o;if(Et.isInterval(t==null?void 0:t.type))return _D(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"?"]":")",p=Th(u.left,(n=(i=t.type)==null?void 0:i.children)==null?void 0:n[0]),f=Th(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+p}, ${f+h}`}return String(r)}function wD(r,t){return(t==null?void 0:t.type)instanceof bh?JSON.parse(JSON.stringify(r,(e,i)=>{if(tD(i))return typeof i=="bigint"?Number(i):i})):JSON.parse(JSON.stringify(r,(e,i)=>typeof i=="bigint"?Number(i):i))}function Th(r,t){if(gr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&lD(t))return yD(r);if(typeof r=="bigint"&&uD(t))return mD(Number(r),t);if(e&&aD(t))return gD(r,t);if(cw(t))throw new Error("Period type is not supported yet");if(fD(t))return bD(r,t);if(oD(t))throw new Error("Duration type is not supported yet");return nD(t)?vD(r,t):iD(t)&&Number.isFinite(r)||eD(t)?r:hD(t)||cD(t)?wD(r,t):sD(t)?!!r:String(r)}function xm(r){return((r.toArray()||[]).map(i=>i.toJSON())||[]).map(i=>(r.schema.fields.forEach(n=>i[n.name]=Th(i[n.name],n)),i))}var ra=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(ra||{});async function hw(r){const t=Cx(r,{logger:!1});let e,i;const n=await Sh();if(n==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await ln(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}i=await kp(await t.bundles),e=new Worker(i.mainWorker)}else if(n==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await ln(async()=>{const{getBundles:h}=await import("./default-node-DqVoet3j.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}i=await kp(await t.bundles);let l=i.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await ln(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${n}`);let s;t.logger===!0?s=new I0:t.logger===!1?s=new c2:s=t.logger;const o=new g2(s,e);if(await o.instantiate(i.mainModule,i.pthreadWorker),t.storage)switch(t.storage.type){case ra.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 ra.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 f=await a.query(l);return xm(f)}const c=await a.prepare(l),h=await c.query(...u),p=xm(h);return c.close(),p},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function xD(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 SD(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const i=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),i}catch(i){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),i}}const xt=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,xt))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(xt in e&&e[xt]===t[xt])return!0;e=Object.getPrototypeOf(e)}return!1}var Mm;Mm=xt;class Ke{constructor(t,e){$(this,"name");$(this,"keyAsName");$(this,"primary");$(this,"notNull");$(this,"default");$(this,"defaultFn");$(this,"onUpdateFn");$(this,"hasDefault");$(this,"isUnique");$(this,"uniqueName");$(this,"uniqueType");$(this,"dataType");$(this,"columnType");$(this,"enumValues");$(this,"generated");$(this,"generatedIdentity");$(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"}}$(Ke,Mm,"Column");const Ys=Symbol.for("drizzle:Name");function TD(r,t){return`${r[Ys]}_${t.join("_")}_unique`}var Dm,Rm;class Ar extends(Rm=Ke,Dm=xt,Rm){constructor(t,e){e.uniqueName||(e.uniqueName=TD(t,[e.name])),super(t,e),this.table=t}}$(Ar,Dm,"PgColumn");const Sm=Symbol.for("drizzle:isPgEnum");function ID(r){return!!r&&typeof r=="function"&&Sm in r&&r[Sm]===!0}var Nm;Nm=xt;class Or{constructor(t,e,i,n=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:i,isWith:n}}}$(Or,Nm,"Subquery");var Lm,Bm;class jf extends(Bm=Or,Lm=xt,Bm){}$(jf,Lm,"WithSubquery");const Pr={startActiveSpan(r,t){return t()}},He=Symbol.for("drizzle:ViewBaseConfig"),Qa=Symbol.for("drizzle:Schema"),Ih=Symbol.for("drizzle:Columns"),Tm=Symbol.for("drizzle:ExtraConfigColumns"),sc=Symbol.for("drizzle:OriginalName"),oc=Symbol.for("drizzle:BaseName"),zl=Symbol.for("drizzle:IsAlias"),Im=Symbol.for("drizzle:ExtraConfigBuilder"),ED=Symbol.for("drizzle:IsDrizzleTable");var km,Um,zm,jm,$m,Vm,Gm,Wm,Hm,Xm;Xm=xt,Hm=Ys,Wm=sc,Gm=Qa,Vm=Ih,$m=Tm,jm=oc,zm=zl,Um=ED,km=Im;class Tt{constructor(t,e,i){$(this,Hm);$(this,Wm);$(this,Gm);$(this,Vm);$(this,$m);$(this,jm);$(this,zm,!1);$(this,Um,!0);$(this,km);this[Ys]=this[sc]=t,this[Qa]=e,this[oc]=i}}$(Tt,Xm,"Table"),$(Tt,"Symbol",{Name:Ys,Schema:Qa,OriginalName:sc,Columns:Ih,ExtraConfigColumns:Tm,BaseName:oc,IsAlias:zl,ExtraConfigBuilder:Im});function qn(r){return r[Ys]}function ia(r){return`${r[Qa]??"public"}.${r[Ys]}`}function fw(r){return r!=null&&typeof r.getSQL=="function"}function CD(r){var e;const t={sql:"",params:[]};for(const i of r)t.sql+=i.sql,t.params.push(...i.params),(e=i.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...i.typings));return t}var Ym;Ym=xt;class Xe{constructor(t){$(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ft([this])}}$(Xe,Ym,"StringChunk");var qm;qm=xt;const Hn=class Hn{constructor(t){$(this,"decoder",dw);$(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Pr.startActiveSpan("drizzle.buildSQL",e=>{const i=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(t,e){const i=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:n,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=i;return CD(t.map(c=>{var h;if(lt(c,Xe))return{sql:c.value.join(""),params:[]};if(lt(c,jl))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const p=[new Xe("(")];for(const[f,y]of c.entries())p.push(y),fr},pw={mapToDriverValue:r=>r};({...dw,...pw});var Km;Km=xt;class Wi{constructor(t,e=pw){$(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ft([this])}}$(Wi,Km,"Param");function H(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Xe(r[0]));for(const[i,n]of t.entries())e.push(n,new Xe(r[i+1]));return new Ft(e)}(r=>{function t(){return new Ft([])}r.empty=t;function e(l){return new Ft(l)}r.fromList=e;function i(l){return new Ft([new Xe(l)])}r.raw=i;function n(l,u){const c=[];for(const[h,p]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(p);return new Ft(c)}r.join=n;function s(l){return new jl(l)}r.identifier=s;function o(l){return new ss(l)}r.placeholder=o;function a(l,u){return new Wi(l,u)}r.param=a})(H||(H={}));(r=>{var e;e=xt;const i=class i{constructor(s,o){$(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}};$(i,e,"SQL.Aliased");let t=i;r.Aliased=t})(Ft||(Ft={}));var Zm;Zm=xt;class ss{constructor(t){this.name=t}getSQL(){return new Ft([this])}}$(ss,Zm,"Placeholder");function Em(r,t){return r.map(e=>{if(lt(e,ss)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,Wi)&<(e.value,ss)){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 OD=Symbol.for("drizzle:IsDrizzleView");var Jm,ty,ey;ey=xt,ty=He,Jm=OD;class Sn{constructor({name:t,schema:e,selectedFields:i,query:n}){$(this,ty);$(this,Jm,!0);this[He]={name:t,originalName:t,schema:e,selectedFields:i,query:n,isExisting:!n,isAlias:!1}}getSQL(){return new Ft([this])}}$(Sn,ey,"View");Ke.prototype.getSQL=function(){return new Ft([this])};Tt.prototype.getSQL=function(){return new Ft([this])};Or.prototype.getSQL=function(){return new Ft([this])};var ry;ry=xt;class na{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}$(na,ry,"ColumnAliasProxyHandler");var iy;iy=xt;class cu{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===Tt.Symbol.IsAlias)return!0;if(e===Tt.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===Tt.Symbol.OriginalName)return this.alias;if(e===He)return{...t[He],name:this.alias,isAlias:!0};if(e===Tt.Symbol.Columns){const n=t[Tt.Symbol.Columns];if(!n)return n;const s={};return Object.keys(n).map(o=>{s[o]=new Proxy(n[o],new na(new Proxy(t,this)))}),s}const i=t[e];return lt(i,Ke)?new Proxy(i,new na(new Proxy(t,this))):i}}$(cu,iy,"TableAliasProxyHandler");function ac(r,t){return new Proxy(r,new cu(t,!1))}function Li(r,t){return new Proxy(r,new na(new Proxy(r.table,new cu(t,!1))))}function mw(r,t){return new Ft.Aliased($l(r.sql,t),r.fieldAlias)}function $l(r,t){return H.join(r.queryChunks.map(e=>lt(e,Ke)?Li(e,t):lt(e,Ft)?$l(e,t):lt(e,Ft.Aliased)?mw(e,t):e))}var ny,sy;class $f extends(sy=Error,ny=xt,sy){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}$($f,ny,"DrizzleError");var oy,ay;class yw extends(ay=$f,oy=xt,ay){constructor(){super({message:"Rollback"})}}$(yw,oy,"TransactionRollbackError");var ly;ly=xt;class gw{write(t){console.log(t)}}$(gw,ly,"ConsoleLogWriter");var uy;uy=xt;class vw{constructor(t){$(this,"writer");this.writer=(t==null?void 0:t.writer)??new gw}logQuery(t,e){const i=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),n=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${t}${n}`)}}$(vw,uy,"DefaultLogger");var cy;cy=xt;class _w{logQuery(){}}$(_w,cy,"NoopLogger");var hy,fy;fy=xt,hy=Symbol.toStringTag;class Tn{constructor(){$(this,hy,"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)}}$(Tn,fy,"QueryPromise");function os(r,t){return Object.entries(r).reduce((e,[i,n])=>{if(typeof i!="string")return e;const s=t?[...t,i]:[i];return lt(n,Ke)||lt(n,Ft)||lt(n,Ft.Aliased)?e.push({path:s,field:n}):lt(n,Tt)?e.push(...os(n[Tt.Symbol.Columns],s)):e.push(...os(n,s)),e},[])}function Vf(r,t){const e=Object.keys(r),i=Object.keys(t);if(e.length!==i.length)return!1;for(const[n,s]of e.entries())if(s!==i[n])return!1;return!0}function bw(r,t){const e=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,n])=>lt(n,Ft)||lt(n,Ke)?[i,n]:[i,new Wi(n,r[Tt.Symbol.Columns][i])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function FD(r,t){for(const e of t)for(const i of Object.getOwnPropertyNames(e.prototype))i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)||Object.create(null))}function PD(r){return r[Tt.Symbol.Columns]}function Wn(r){return lt(r,Or)?r._.alias:lt(r,Sn)?r[He].name:lt(r,Ft)?void 0:r[Tt.Symbol.IsAlias]?r[Tt.Symbol.Name]:r[Tt.Symbol.BaseName]}function MD(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 dy,py;class ww extends(py=Ar,dy=xt,py){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}$(ww,dy,"PgDate");var my,yy;class xw extends(yy=Ar,my=xt,yy){getSQLType(){return"date"}}$(xw,my,"PgDateString");var gy,vy;class Sw extends(vy=Ar,gy=xt,vy){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}}$(Sw,gy,"PgJson");var _y,by;class Tw extends(by=Ar,_y=xt,by){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}}$(Tw,_y,"PgJsonb");var wy,xy;class Iw extends(xy=Ar,wy=xt,xy){constructor(e,i){super(e,i);$(this,"precision");$(this,"scale");this.precision=i.precision,this.scale=i.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})`}}$(Iw,wy,"PgNumeric");var Sy,Ty;class Ew extends(Ty=Ar,Sy=xt,Ty){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Ew,Sy,"PgTime");var Iy,Ey;class Cw extends(Ey=Ar,Iy=xt,Ey){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");$(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));$(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Cw,Iy,"PgTimestamp");var Cy,Ay;class Aw extends(Ay=Ar,Cy=xt,Ay){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Aw,Cy,"PgTimestampString");var Oy,Fy;class Ow extends(Fy=Ar,Oy=xt,Fy){getSQLType(){return"uuid"}}$(Ow,Oy,"PgUUID");const Cm=Symbol.for("drizzle:PgInlineForeignKeys"),Am=Symbol.for("drizzle:EnableRLS");var Py,My,Dy,Ry,Ny,Ly;class Br extends(Ly=Tt,Ny=xt,Ry=Cm,Dy=Am,My=Tt.Symbol.ExtraConfigBuilder,Py=Tt.Symbol.ExtraConfigColumns,Ly){constructor(){super(...arguments);$(this,Ry,[]);$(this,Dy,!1);$(this,My);$(this,Py,{})}}$(Br,Ny,"PgTable"),$(Br,"Symbol",Object.assign({},Tt.Symbol,{InlineForeignKeys:Cm,EnableRLS:Am}));var By;By=xt;class Fw{constructor(t,e){$(this,"columns");$(this,"name");this.columns=t,this.name=e}build(t){return new Pw(t,this.columns,this.name)}}$(Fw,By,"PgPrimaryKeyBuilder");var ky;ky=xt;class Pw{constructor(t,e,i){$(this,"columns");$(this,"name");this.table=t,this.columns=e,this.name=i}getName(){return this.name??`${this.table[Br.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}$(Pw,ky,"PgPrimaryKey");function yr(r,t){return AD(t)&&!fw(r)&&!lt(r,Wi)&&!lt(r,ss)&&!lt(r,Ke)&&!lt(r,Tt)&&!lt(r,Sn)?new Wi(r,t):r}const Mw=(r,t)=>H`${r} = ${yr(t,r)}`,DD=(r,t)=>H`${r} <> ${yr(t,r)}`;function Eh(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),H.join(t,new Xe(" and ")),new Xe(")")])}function RD(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),H.join(t,new Xe(" or ")),new Xe(")")])}function ND(r){return H`not ${r}`}const LD=(r,t)=>H`${r} > ${yr(t,r)}`,BD=(r,t)=>H`${r} >= ${yr(t,r)}`,kD=(r,t)=>H`${r} < ${yr(t,r)}`,UD=(r,t)=>H`${r} <= ${yr(t,r)}`;function zD(r,t){return Array.isArray(t)?t.length===0?H`false`:H`${r} in ${t.map(e=>yr(e,r))}`:H`${r} in ${yr(t,r)}`}function jD(r,t){return Array.isArray(t)?t.length===0?H`true`:H`${r} not in ${t.map(e=>yr(e,r))}`:H`${r} not in ${yr(t,r)}`}function $D(r){return H`${r} is null`}function VD(r){return H`${r} is not null`}function GD(r){return H`exists ${r}`}function WD(r){return H`not exists ${r}`}function HD(r,t,e){return H`${r} between ${yr(t,r)} and ${yr(e,r)}`}function XD(r,t,e){return H`${r} not between ${yr(t,r)} and ${yr(e,r)}`}function YD(r,t){return H`${r} like ${t}`}function qD(r,t){return H`${r} not like ${t}`}function QD(r,t){return H`${r} ilike ${t}`}function KD(r,t){return H`${r} not ilike ${t}`}function ZD(r){return H`${r} asc`}function JD(r){return H`${r} desc`}var Uy;Uy=xt;class Gf{constructor(t,e,i){$(this,"referencedTableName");$(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=i,this.referencedTableName=e[Tt.Symbol.Name]}}$(Gf,Uy,"Relation");var zy;zy=xt;class Dw{constructor(t,e){this.table=t,this.config=e}}$(Dw,zy,"Relations");var jy,$y;const Wl=class Wl extends($y=Gf,jy=xt,$y){constructor(t,e,i,n){super(t,e,i==null?void 0:i.relationName),this.config=i,this.isNullable=n}withFieldName(t){const e=new Wl(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};$(Wl,jy,"One");let as=Wl;var Vy,Gy;const Hl=class Hl extends(Gy=Gf,Vy=xt,Gy){constructor(t,e,i){super(t,e,i==null?void 0:i.relationName),this.config=i}withFieldName(t){const e=new Hl(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};$(Hl,Vy,"Many");let Vl=Hl;function tR(){return{and:Eh,between:HD,eq:Mw,exists:GD,gt:LD,gte:BD,ilike:QD,inArray:zD,isNull:$D,isNotNull:VD,like:YD,lt:kD,lte:UD,ne:DD,not:ND,notBetween:XD,notExists:WD,notLike:qD,notIlike:KD,notInArray:jD,or:RD,sql:H}}function eR(){return{sql:H,asc:ZD,desc:JD}}function rR(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,Tt)&&(r=r.default);const e={},i={},n={};for(const[o,a]of Object.entries(r))if(lt(a,Tt)){const l=ia(a),u=i[l];e[l]=o,n[o]={tsName:o,dbName:a[Tt.Symbol.Name],schema:a[Tt.Symbol.Schema],columns:a[Tt.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[Tt.Symbol.Columns]))h.primary&&n[o].primaryKey.push(h);const c=(s=a[Tt.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[Tt.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,Fw)&&n[o].primaryKey.push(...h.columns)}else if(lt(a,Dw)){const l=ia(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[p,f]of Object.entries(c))if(u){const y=n[u];y.relations[p]=f}else l in i||(i[l]={relations:{},primaryKey:h}),i[l].relations[p]=f}return{tables:n,tableNamesMap:e}}function iR(r){return function(e,i){return new as(r,e,i,(i==null?void 0:i.fields.reduce((n,s)=>n&&s.notNull,!0))??!1)}}function nR(r){return function(e,i){return new Vl(r,e,i)}}function sR(r,t,e){if(lt(e,as)&&e.config)return{fields:e.config.fields,references:e.config.references};const i=t[ia(e.referencedTable)];if(!i)throw new Error(`Table "${e.referencedTable[Tt.Symbol.Name]}" not found in schema`);const n=r[i];if(!n)throw new Error(`Table "${i}" not found in schema`);const s=e.sourceTable,o=t[ia(s)];if(!o)throw new Error(`Table "${s[Tt.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(n.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 "${i}"`):new Error(`There are multiple relations between "${i}" and "${e.sourceTable[Tt.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],as)&&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 oR(r){return{one:iR(r),many:nR(r)}}function Ch(r,t,e,i,n=s=>s){const s={};for(const[o,a]of i.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,as)?c&&Ch(r,r[a.relationTableTsKey],c,a.selection,n):c.map(h=>Ch(r,r[a.relationTableTsKey],h,a.selection,n))}else{const l=n(e[o]),u=a.field;let c;lt(u,Ke)?c=u:lt(u,Ft)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var Wy;Wy=xt;const Xl=class Xl{constructor(t){$(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===He)return{...t[He],selectedFields:new Proxy(t[He].selectedFields,this)};if(typeof e=="symbol")return t[e];const n=(lt(t,Or)?t._.selectedFields:lt(t,Sn)?t[He].selectedFields:t)[e];if(lt(n,Ft.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!n.isSelectionField)return n.sql;const s=n.clone();return s.isSelectionField=!0,s}if(lt(n,Ft)){if(this.config.sqlBehavior==="sql")return n;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(n,Ke)?this.config.alias?new Proxy(n,new na(new Proxy(n.table,new cu(this.config.alias,this.config.replaceOriginalName??!1)))):n:typeof n!="object"||n===null?n:new Proxy(n,new Xl(this.config))}};$(Xl,Wy,"SelectionProxyHandler");let Je=Xl;var Hy,Xy;class Ah extends(Xy=Tn,Hy=xt,Xy){constructor(e,i,n,s){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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 Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Ah,Hy,"PgDelete");function aR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function lR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,i,n)=>{const s=n===0?i.toLowerCase():`${i[0].toUpperCase()}${i.slice(1)}`;return e+s},"")}function uR(r){return r}var Yy;Yy=xt;class Rw{constructor(t){$(this,"cache",{});$(this,"cachedTables",{});$(this,"convert");this.convert=t==="snake_case"?aR:t==="camelCase"?lR:uR}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[Tt.Symbol.Schema]??"public",i=t.table[Tt.Symbol.OriginalName],n=`${e}.${i}.${t.name}`;return this.cache[n]||this.cacheTable(t.table),this.cache[n]}cacheTable(t){const e=t[Tt.Symbol.Schema]??"public",i=t[Tt.Symbol.OriginalName],n=`${e}.${i}`;if(!this.cachedTables[n]){for(const s of Object.values(t[Tt.Symbol.Columns])){const o=`${n}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[n]=!0}}clearCache(){this.cache={},this.cachedTables={}}}$(Rw,Yy,"CasingCache");var qy,Qy;class Wf extends(Qy=Sn,qy=xt,Qy){}$(Wf,qy,"PgViewBase");var Ky;Ky=xt;class Bo{constructor(t){$(this,"casing");this.casing=new Rw(t==null?void 0:t.casing)}async migrate(t,e,i){const n=typeof i=="string"?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",s=typeof i=="string"?"drizzle":i.migrationsSchema??"drizzle",o=H` + CREATE TABLE IF NOT EXISTS ${H.identifier(s)}.${H.identifier(n)} ( + id SERIAL PRIMARY KEY, + hash text NOT NULL, + created_at bigint + ) + `;await e.execute(H`CREATE SCHEMA IF NOT EXISTS ${H.identifier(s)}`),await e.execute(o);const l=(await e.all(H`select id, hash, created_at from ${H.identifier(s)}.${H.identifier(n)} 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=i[o])==null?void 0:a.onUpdateFn)!==void 0}),s=n.length;return H.join(n.flatMap((o,a)=>{const l=i[o],u=e[o]??H.param(l.onUpdateFn(),l),c=H`${H.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Ft.Aliased)&&s.isSelectionField)a.push(H.identifier(s.fieldAlias));else if(lt(s,Ft.Aliased)||lt(s,Ft)){const l=lt(s,Ft.Aliased)?s.sql:s;e?a.push(new Ft(l.queryChunks.map(u=>lt(u,Ar)?H.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Ft.Aliased)&&a.push(H` as ${H.identifier(s.fieldAlias)}`)}else lt(s,Ke)&&(e?a.push(H.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:M})=>M===(it[Tt.Symbol.IsAlias]?qn(it):it[Tt.Symbol.BaseName])))(w.field.table)){const it=qn(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${it}"."${w.field.name}", but the table "${it}" is not part of the query! Did you forget to join it?`)}const d=!a||a.length===0,m=this.buildWithCTE(t);let _;f&&(_=f===!0?H` distinct`:H` distinct on (${H.join(f.on,H`, `)})`);const S=this.buildSelection(g,{isSingleTable:d}),E=this.buildFromTable(o),b=this.buildJoins(a),F=n?H` where ${n}`:void 0,x=s?H` having ${s}`:void 0;let z;l&&l.length>0&&(z=H` order by ${H.join(l,H`, `)}`);let B;u&&u.length>0&&(B=H` group by ${H.join(u,H`, `)}`);const tt=typeof c=="object"||typeof c=="number"&&c>=0?H` limit ${c}`:void 0,st=h?H` offset ${h}`:void 0,I=H.empty();if(p){const w=H` for ${H.raw(p.strength)}`;p.config.of&&w.append(H` of ${H.join(Array.isArray(p.config.of)?p.config.of:[p.config.of],H`, `)}`),p.config.noWait?w.append(H` nowait`):p.config.skipLocked&&w.append(H` skip locked`),I.append(w)}const Z=H`${m}select${_} ${S} from ${E}${b}${F}${B}${x}${z}${tt}${st}${I}`;return y.length>0?this.buildSetOperations(Z,y):Z}buildSetOperations(t,e){const[i,...n]=e;if(!i)throw new Error("Cannot pass undefined values to any set operator");return n.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:i}),n)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:i,rightSelect:n,limit:s,orderBy:o,offset:a}}){const l=H`(${t.getSQL()}) `,u=H`(${n.getSQL()})`;let c;if(o&&o.length>0){const y=[];for(const g of o)if(lt(g,Ar))y.push(H.identifier(g.name));else if(lt(g,Ft)){for(let d=0;d=0?H` limit ${s}`:void 0,p=H.raw(`${e} ${i?"all ":""}`),f=a?H` offset ${a}`:void 0;return H`${l}${p}${u}${c}${h}${f}`}buildInsertQuery({table:t,values:e,onConflict:i,returning:n,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[Tt.Symbol.Columns],c=Object.entries(u).filter(([m,_])=>!_.shouldDisableInsert()),h=c.map(([,m])=>H.identifier(this.casing.getColumnCasing(m)));if(o){const m=e;lt(m,Ft)?l.push(m):l.push(m.getSQL())}else{const m=e;l.push(H.raw("values "));for(const[_,S]of m.entries()){const E=[];for(const[b,F]of c){const x=S[b];if(x===void 0||lt(x,Wi)&&x.value===void 0)if(F.defaultFn!==void 0){const z=F.defaultFn(),B=lt(z,Ft)?z:H.param(z,F);E.push(B)}else if(!F.default&&F.onUpdateFn!==void 0){const z=F.onUpdateFn(),B=lt(z,Ft)?z:H.param(z,F);E.push(B)}else E.push(H`default`);else E.push(x)}l.push(E),_({dbKey:S.name,tsKey:_,field:Li(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const m=Object.fromEntries(Object.entries(s.columns).map(([x,z])=>[x,Li(z,a)]));if(o.where){const x=typeof o.where=="function"?o.where(m,tR()):o.where;y=x&&$l(x,a)}const _=[];let S=[];if(o.columns){let x=!1;for(const[z,B]of Object.entries(o.columns))B!==void 0&&z in s.columns&&(!x&&B===!0&&(x=!0),S.push(z));S.length>0&&(S=x?S.filter(z=>{var B;return((B=o.columns)==null?void 0:B[z])===!0}):Object.keys(s.columns).filter(z=>!S.includes(z)))}else S=Object.keys(s.columns);for(const x of S){const z=s.columns[x];_.push({tsKey:x,value:z})}let E=[];o.with&&(E=Object.entries(o.with).filter(x=>!!x[1]).map(([x,z])=>({tsKey:x,queryConfig:z,relation:s.relations[x]})));let b;if(o.extras){b=typeof o.extras=="function"?o.extras(m,{sql:H}):o.extras;for(const[x,z]of Object.entries(b))_.push({tsKey:x,value:mw(z,a)})}for(const{tsKey:x,value:z}of _)c.push({dbKey:lt(z,Ft.Aliased)?z.fieldAlias:s.columns[x].name,tsKey:x,field:lt(z,Ke)?Li(z,a):z,relationTableTsKey:void 0,isJson:!1,selection:[]});let F=typeof o.orderBy=="function"?o.orderBy(m,eR()):o.orderBy??[];Array.isArray(F)||(F=[F]),f=F.map(x=>lt(x,Ke)?Li(x,a):$l(x,a)),h=o.limit,p=o.offset;for(const{tsKey:x,queryConfig:z,relation:B}of E){const tt=sR(e,i,B),st=ia(B.referencedTable),I=i[st],Z=`${a}_${x}`,w=Eh(...tt.fields.map((O,D)=>Mw(Li(tt.references[D],Z),Li(O,a)))),it=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:i,table:t[I],tableConfig:e[I],queryConfig:lt(B,as)?z===!0?{limit:1}:{...z,limit:1}:z,tableAlias:Z,joinOn:w,nestedQueryRelation:B}),M=H`${H.identifier(Z)}.${H.identifier("data")}`.as(x);g.push({on:H`true`,table:new Or(it.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:x,tsKey:x,field:M,relationTableTsKey:I,isJson:!0,selection:it.selection})}}if(c.length===0)throw new $f({message:`No fields selected for table "${s.tsName}" ("${a}")`});let d;if(y=Eh(u,y),l){let m=H`json_build_array(${H.join(c.map(({field:E,tsKey:b,isJson:F})=>F?H`${H.identifier(`${a}_${b}`)}.${H.identifier("data")}`:lt(E,Ft.Aliased)?E.sql:E),H`, `)})`;lt(l,Vl)&&(m=H`coalesce(json_agg(${m}${f.length>0?H` order by ${H.join(f,H`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:m.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||p!==void 0||f.length>0?(d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:[{path:[],field:H.raw("*")}],where:y,limit:h,offset:p,orderBy:f,setOperators:[]}),y=void 0,h=void 0,p=void 0,f=[]):d=ac(n,a),d=this.buildSelectQuery({table:lt(d,Br)?d:new Or(d,{},a),fields:{},fieldsFlat:_.map(({field:E})=>({path:[],field:lt(E,Ke)?Li(E,a):E})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]})}else d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:c.map(({field:m})=>({path:[],field:lt(m,Ke)?Li(m,a):m})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]});return{tableTsKey:s.tsName,sql:d,selection:c}}}$(Bo,Ky,"PgDialect");var Zy;Zy=xt;class Nw{getSelectedFields(){return this._.selectedFields}}$(Nw,Zy,"TypedQueryBuilder");var Jy;Jy=xt;class Sr{constructor(t){$(this,"fields");$(this,"session");$(this,"dialect");$(this,"withList",[]);$(this,"distinct");$(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,i=t;let n;return this.fields?n=this.fields:lt(i,Or)?n=Object.fromEntries(Object.keys(i._.selectedFields).map(s=>[s,i[s]])):lt(i,Wf)?n=i[He].selectedFields:lt(i,Ft)?n={}:n=PD(i),new Hf({table:i,fields:n,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}$(Sr,Jy,"PgSelectBuilder");var tg,eg;class Lw extends(eg=Nw,tg=xt,eg){constructor({table:e,fields:i,isPartialSelect:n,session:s,dialect:o,withList:a,distinct:l}){super();$(this,"_");$(this,"config");$(this,"joinsNotNullableMap");$(this,"tableName");$(this,"isPartialSelect");$(this,"session");$(this,"dialect");$(this,"leftJoin",this.createJoin("left",!1));$(this,"leftJoinLateral",this.createJoin("left",!0));$(this,"rightJoin",this.createJoin("right",!1));$(this,"innerJoin",this.createJoin("inner",!1));$(this,"innerJoinLateral",this.createJoin("inner",!0));$(this,"fullJoin",this.createJoin("full",!1));$(this,"crossJoin",this.createJoin("cross",!1));$(this,"crossJoinLateral",this.createJoin("cross",!0));$(this,"union",this.createSetOperator("union",!1));$(this,"unionAll",this.createSetOperator("union",!0));$(this,"intersect",this.createSetOperator("intersect",!1));$(this,"intersectAll",this.createSetOperator("intersect",!0));$(this,"except",this.createSetOperator("except",!1));$(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...i},distinct:l,setOperators:[]},this.isPartialSelect=n,this.session=s,this.dialect=o,this._={selectedFields:i},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e,i){return(n,s)=>{var l;const o=this.tableName,a=Wn(n);if(typeof a=="string"&&((l=this.config.joins)!=null&&l.some(u=>u.alias===a)))throw new Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof o=="string"&&(this.config.fields={[o]:this.config.fields}),typeof a=="string"&&!lt(n,Ft))){const u=lt(n,Or)?n._.selectedFields:lt(n,Sn)?n[He].selectedFields:n[Tt.Symbol.Columns];this.config.fields[a]=u}if(typeof s=="function"&&(s=s(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:s,table:n,joinType:e,alias:a,lateral:i}),typeof a=="string")switch(e){case"left":{this.joinsNotNullableMap[a]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([u])=>[u,!1])),this.joinsNotNullableMap[a]=!0;break}case"cross":case"inner":{this.joinsNotNullableMap[a]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([u])=>[u,!1])),this.joinsNotNullableMap[a]=!1;break}}return this}}createSetOperator(e,i){return n=>{const s=typeof n=="function"?n(cR()):n;if(!Vf(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:i,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 Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),n=Array.isArray(i)?i:[i];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{const i=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}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,i={}){return this.config.lockingClause={strength:e,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(e){return new Proxy(new Or(this.getSQL(),this.config.fields,e),new Je({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Je({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}$(Lw,tg,"PgSelectQueryBuilder");var rg,ig;class Hf extends(ig=Lw,rg=xt,ig){constructor(){super(...arguments);$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:i,config:n,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const l=os(n.fields),u=i.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}}$(Hf,rg,"PgSelect");FD(Hf,[Tn]);function oo(r,t){return(e,i,...n)=>{const s=[i,...n].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Vf(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 cR=()=>({union:hR,unionAll:fR,intersect:dR,intersectAll:pR,except:mR,exceptAll:yR}),hR=oo("union",!1),fR=oo("union",!0),dR=oo("intersect",!1),pR=oo("intersect",!0),mR=oo("except",!1),yR=oo("except",!0);var ng;ng=xt;class Xf{constructor(t){$(this,"dialect");$(this,"dialectConfig");$(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(i)),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Bo)?t:void 0,this.dialectConfig=lt(t,Bo)?void 0:t}with(...t){const e=this;function i(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function n(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Sr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:i,selectDistinct:n,selectDistinctOn:s}}select(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Bo(this.dialectConfig)),this.dialect}}$(Xf,ng,"PgQueryBuilder");var sg;sg=xt;class Oh{constructor(t,e,i,n,s){$(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n,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(i=>{const n={},s=this.table[Tt.Symbol.Columns];for(const o of Object.keys(i)){const a=i[o];n[o]=lt(a,Ft)?a:new Wi(a,s[o])}return n});return new Fh(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new Xf):t;if(!lt(e,Ft)&&!Vf(this.table[Ih],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 Fh(this.table,e,this.session,this.dialect,this.withList,!0)}}$(Oh,sg,"PgInsertBuilder");var og,ag;class Fh extends(ag=Tn,og=xt,ag){constructor(e,i,n,s,o,a,l){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=s,this.config={table:e,values:i,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=H`do nothing`;else{let i="";i=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 n=e.where?H` where ${e.where}`:void 0;this.config.onConflict=H`(${H.raw(i)})${n} 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 i=e.where?H` where ${e.where}`:void 0,n=e.targetWhere?H` where ${e.targetWhere}`:void 0,s=e.setWhere?H` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,bw(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=H`(${H.raw(a)})${n} do update set ${o}${i}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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 Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Fh,og,"PgInsert");var lg,ug;class Bw extends(ug=Tn,lg=xt,ug){constructor(e,i,n){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,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,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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}}$(Bw,lg,"PgRefreshMaterializedView");var cg;cg=xt;class Ph{constructor(t,e,i,n){$(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n}setToken(t){return this.authToken=t,this}set(t){return new kw(this.table,bw(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}$(Ph,cg,"PgUpdateBuilder");var hg,fg;class kw extends(fg=Tn,hg=xt,fg){constructor(e,i,n,s,o){super();$(this,"config");$(this,"tableName");$(this,"joinsNotNullableMap");$(this,"leftJoin",this.createJoin("left"));$(this,"rightJoin",this.createJoin("right"));$(this,"innerJoin",this.createJoin("inner"));$(this,"fullJoin",this.createJoin("full"));$(this,"authToken");$(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=n,this.dialect=s,this.config={set:i,table:e,withList:o,joins:[]},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const i=e,n=Wn(i);return typeof n=="string"&&(this.joinsNotNullableMap[n]=!0),this.config.from=i,this}getTableLikeFields(e){return lt(e,Br)?e[Tt.Symbol.Columns]:lt(e,Or)?e._.selectedFields:e[He].selectedFields}createJoin(e){return(i,n)=>{const s=Wn(i);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 n=="function"){const o=this.config.from&&!lt(this.config.from,Ft)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Tt.Symbol.Columns],new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:n,table:i,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[Tt.Symbol.Columns]),this.config.from)){const i=Wn(this.config.from);if(typeof i=="string"&&this.config.from&&!lt(this.config.from,Ft)){const n=this.getTableLikeFields(this.config.from);e[i]=n}for(const n of this.config.joins){const s=Wn(n.table);if(typeof s=="string"&&!lt(n.table,Ft)){const o=this.getTableLikeFields(n.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){const i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(kw,hg,"PgUpdate");var dg,pg,mg;const Uo=class Uo extends(mg=Ft,pg=xt,dg=Symbol.toStringTag,mg){constructor(e){super(Uo.buildEmbeddedCount(e.source,e.filters).queryChunks);$(this,"sql");$(this,"token");$(this,dg,"PgCountBuilder");$(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Uo.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,i){return H`(select count(*) from ${e}${H.raw(" where ").if(i)}${i})`}static buildCount(e,i){return H`select count(*) as count from ${e}${H.raw(" where ").if(i)}${i};`}setToken(e){return this.token=e,this}then(e,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,i)}catch(e){return this.then(void 0,e)}finally(e){return this.then(i=>(e==null||e(),i),i=>{throw e==null||e(),i})}};$(Uo,pg,"PgCountBuilder");let Mh=Uo;var yg;yg=xt;class Uw{constructor(t,e,i,n,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=i,this.table=n,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}$(Uw,yg,"PgRelationalQueryBuilder");var gg,vg;class Dh extends(vg=Tn,gg=xt,vg){constructor(e,i,n,s,o,a,l,u,c){super();$(this,"authToken");this.fullSchema=e,this.schema=i,this.tableNamesMap=n,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:i,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(s,o)=>{const a=s.map(l=>Ch(this.schema,this.tableConfig,l,i.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(),i=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}$(Dh,gg,"PgRelationalQuery");var _g,bg;class zw extends(bg=Tn,_g=xt,bg){constructor(t,e,i,n){super(),this.execute=t,this.sql=e,this.query=i,this.mapBatchResult=n}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}$(zw,_g,"PgRaw");var wg;wg=xt;class Yf{constructor(t,e,i){$(this,"query");$(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(new Xf(i.dialect))),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});$(this,"authToken");if(this.dialect=t,this.session=e,this._=i?{schema:i.schema,fullSchema:i.fullSchema,tableNamesMap:i.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[n,s]of Object.entries(this._.schema))this.query[n]=new Uw(i.fullSchema,this._.schema,this._.tableNamesMap,i.fullSchema[n],s,t,e)}$count(t,e){return new Mh({source:t,filters:e,session:this.session})}with(...t){const e=this;function i(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function n(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Sr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new Ph(u,e.session,e.dialect,t)}function a(u){return new Oh(u,e.session,e.dialect,t)}function l(u){return new Ah(u,e.session,e.dialect,t)}return{select:i,selectDistinct:n,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new Ph(t,this.session,this.dialect)}insert(t){return new Oh(t,this.session,this.dialect)}delete(t){return new Ah(t,this.session,this.dialect)}refreshMaterializedView(t){return new Bw(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?H.raw(t):t.getSQL(),i=this.dialect.sqlToQuery(e),n=this.session.prepareQuery(i,void 0,void 0,!1);return new zw(()=>n.execute(void 0,this.authToken),e,i,s=>n.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}$(Yf,wg,"PgDatabase");var xg;xg=xt;class jw{constructor(t){$(this,"authToken");$(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}$(jw,xg,"PgPreparedQuery");var Sg;Sg=xt;class $w{constructor(t){this.dialect=t}execute(t,e){return Pr.startActiveSpan("drizzle.operation",()=>Pr.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 i=await this.execute(t,e);return Number(i[0].count)}}$($w,Sg,"PgSession");var Tg,Ig;class Vw extends(Ig=Yf,Tg=xt,Ig){constructor(t,e,i,n=0){super(t,e,i),this.schema=i,this.nestedIndex=n}rollback(){throw new yw}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"),H.raw(e.join(" "))}setTransaction(t){return this.session.execute(H`set transaction ${this.getTransactionConfigSQL(t)}`)}}$(Vw,Tg,"PgTransaction");function Om(r){return typeof r=="string"&&/^true$/i.test(r)}function gR(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 i=e.searchParams.get("logger");i&&Om(i)&&(t.logger=!0);const n=e.searchParams.get("storage");switch(n){case ra.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:ra.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&Om(s)&&{accessMode:T0.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${n}"`);break}return t}var Eg,Cg;class Gw extends(Cg=jw,Eg=xt,Cg){constructor(t,e,i,n,s,o){super({sql:e,params:i}),this.client=t,this.queryString=e,this.params=i,this.logger=n,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=Em(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:i,queryString:n,client:s,customResultMapper:o}=this,a=await s;return a.query(n,e)}async all(t={}){const e=Em(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}$(Gw,Eg,"DuckDBWasmPreparedQuery");var Ag,Og;const Yl=class Yl extends(Og=$w,Ag=xt,Og){constructor(e,i,n,s={}){super(i);$(this,"logger");this.client=e,this.schema=n,this.options=s,this.logger=s.logger??new _w}prepareQuery(e,i,n,s,o){return new Gw(this.client,e.sql,e.params,this.logger,i,o)}async query(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}async queryObjects(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}transaction(e,i){return xD(this.client,async n=>{const s=new Yl(n,this.dialect,this.schema,this.options),o=new Rh(this.dialect,s,this.schema);return i&&await o.setTransaction(i),e(o)})}};$(Yl,Ag,"DuckDBWasmSession");let Gl=Yl;var Fg,Pg;const ql=class ql extends(Pg=Vw,Fg=xt,Pg){constructor(e,i,n,s=0){super(e,i,n,s);$(this,"dialect");$(this,"session");this.dialect=e,this.session=i}async transaction(e){return SD(this.session.client,"",async i=>{const n=new Gl(i,this.dialect,this.schema,this.session.options),s=new ql(this.dialect,n,this.schema);return e(s)})}};$(ql,Fg,"DuckDBWasmTransaction");let Rh=ql;var Mg,Dg;class Ww extends(Dg=Yf,Mg=xt,Dg){}$(Ww,Mg,"DuckDBWasmDatabase");function ko(r,t={}){const e=new Bo({casing:t.casing});let i;t.logger===!0?i=new vw:t.logger!==!1&&(i=t.logger);let n;if(t.schema){const a=rR(t.schema,oR);n={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Gl(r,e,n,{logger:i}),o=new Ww(e,s,n);return o.$client=r,o}function Fm(r,t){const e=gR(r);let i;return e.bundles==="import-url"?i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await ln(async()=>{const{getImportUrlBundles:o}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:o}},__vite__mapDeps([5,4]))).getImportUrlBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})():i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await ln(async()=>{const{getBundles:o}=await import("./default-node-DqVoet3j.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),ko(hw({bundles:i,logger:e.logger?new I0:void 0,storage:e.storage}),t)}function Pm(...r){if(typeof r[0]=="string")return Fm(r[0],r[1]);if(MD(r[0])){const{connection:t,client:e,...i}=r[0];if(e)return ko(e,i);if(typeof t=="string")return Fm(t,i);if(typeof t>"u")throw new Error("connection option is required");return ko(hw({bundles:t.bundles,logger:t.logger,storage:t.storage}),i)}return ko(r[0],r[1])}(r=>{function t(e){return ko({options:{parsers:{},serializers:{}}},e)}r.mock=t})(Pm||(Pm={}));export{L1 as A,TR as D,xR as I,pC as J,eI as L,_c as M,wR as T,fi as a,Re as b,Pm as d,sa as e,SR as l}; diff --git a/assets/Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js b/assets/Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js similarity index 75% rename from assets/Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js rename to assets/Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js index bbfd751965ed2bd0429e5bb6922b6a791057c674..38f24433d189dfcb6716b6046e45a501ac0dce90 100644 --- a/assets/Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js +++ b/assets/Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js @@ -1 +1 @@ -import{_ as r}from"./Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js";import{d as u,u as t,A as d,o as n}from"./index-Bo-ykojl.js";const p=u({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(l){const e=t(l,"modelValue");return(s,a)=>(n(),d(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,["modelValue"]))}});export{p as _}; +import{_ as r}from"./Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js";import{d as u,u as t,A as d,o as n}from"./index-1_q7hlhr.js";const p=u({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(l){const e=t(l,"modelValue");return(s,a)=>(n(),d(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,["modelValue"]))}});export{p as _}; diff --git a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js similarity index 93% rename from assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js rename to assets/TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js index 06fa8218467389a3bb032337f06af0f16978b182..d8fa0e6c63146735ba72ea256722830e205f4d95 100644 --- a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js +++ b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js @@ -1 +1 @@ -import{d as T,A as l,o as m,T as B,w as b,f as v}from"./index-Bo-ykojl.js";const n="0px",W=T({__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)=>(m(),l(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; +import{d as T,A as l,o as m,T as B,w as b,f as v}from"./index-1_q7hlhr.js";const n="0px",W=T({__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)=>(m(),l(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; diff --git a/assets/_...all_-CXzmHUmr.js b/assets/_...all_-DGe7yWRr.js similarity index 64% rename from assets/_...all_-CXzmHUmr.js rename to assets/_...all_-DGe7yWRr.js index 7ef005cd42e8fe5dfff8c1ec6957d7e230bd22af..e60e314e260620131fcf307ee54ea6095ee4b88f 100644 --- a/assets/_...all_-CXzmHUmr.js +++ b/assets/_...all_-DGe7yWRr.js @@ -1 +1 @@ -import{_ as e,c as _,o as c}from"./index-Bo-ykojl.js";const n={};function o(t,r){return c(),_("div",null," 404 - Page not found ")}const s=e(n,[["render",o]]);export{s as default}; +import{_ as e,c as _,o as c}from"./index-1_q7hlhr.js";const n={};function o(t,r){return c(),_("div",null," 404 - Page not found ")}const s=e(n,[["render",o]]);export{s as default}; diff --git a/assets/airi-card-Vf6km3w_.js b/assets/airi-card-CFCqiAzX.js similarity index 94% rename from assets/airi-card-Vf6km3w_.js rename to assets/airi-card-CFCqiAzX.js index 8641254608b366023054867713df785dd0786d50..ee988da881f41175e1ca8ae1619f8fa6e8a7841d 100644 --- a/assets/airi-card-Vf6km3w_.js +++ b/assets/airi-card-CFCqiAzX.js @@ -1,4 +1,4 @@ -import{v as W,x as L,h as g,s as O,H as $,g as D,p as G}from"./index-Bo-ykojl.js";import{E as N}from"./mini_xsschema-f5xAZ6yD.js";import{u as b}from"./consciousness-DjkUTNrC.js";import{u as k}from"./speech-Br7XDY4_.js";function q(a,u){return{role:"system",content:[a,N.map(n=>`- ${n}`).join(` +import{v as W,x as L,h as g,s as O,H as $,g as D,p as G}from"./index-1_q7hlhr.js";import{E as N}from"./mini_xsschema-f5xAZ6yD.js";import{u as b}from"./consciousness-esOkXpB1.js";import{u as k}from"./speech-Bdg784LP.js";function q(a,u){return{role:"system",content:[a,N.map(n=>`- ${n}`).join(` `),u].join(` `)}}const Q=W("airi-card",()=>{const a=L("airi-cards",new Map),u=L("airi-card-active-id","default"),n=g(()=>a.value.get(u.value)),P=b(),R=k(),{activeModel:l}=O(P),{activeSpeechVoiceId:m,activeSpeechModel:p}=O(R),B=s=>{const e=crypto.randomUUID();return a.value.set(e,h(s)),e},H=s=>{a.value.delete(s)},V=s=>a.value.get(s);function v(s){var t,r,i,c,d,f,_,y,x,S,C,M,I,E,w,A,T,U,j;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:((x=(y=e.modules)==null?void 0:y.speech)==null?void 0:x.voice_id)??o.speech.voice_id,pitch:(C=(S=e.modules)==null?void 0:S.speech)==null?void 0:C.pitch,rate:(I=(M=e.modules)==null?void 0:M.speech)==null?void 0:I.rate,ssml:(w=(E=e.modules)==null?void 0:E.speech)==null?void 0:w.ssml,language:(T=(A=e.modules)==null?void 0:A.speech)==null?void 0:T.language},vrm:(U=e.modules)==null?void 0:U.vrm,live2d:(j=e.modules)==null?void 0:j.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/alibaba-cloud-model-studio-CL38yAmK.js b/assets/alibaba-cloud-model-studio-Cro6QMhw.js similarity index 71% rename from assets/alibaba-cloud-model-studio-CL38yAmK.js rename to assets/alibaba-cloud-model-studio-Cro6QMhw.js index 5a3ed0c378fd4ef89f31640f9266f89e4b17990d..bbd1dd63c8f39bb88cd811c2ad33ae2704d512c4 100644 --- a/assets/alibaba-cloud-model-studio-CL38yAmK.js +++ b/assets/alibaba-cloud-model-studio-Cro6QMhw.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as x,r as m,s as k,g as F,h as V,H as $,p as v,A as B,o as I,w as h,i as c,b as i,e as U}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as E}from"./providers-B3p38pBl.js";import{u as H}from"./speech-Br7XDY4_.js";import{_ as f}from"./FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BoWb4lIe.js";import{b as y}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";const N={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",P="cosyvoice-v1",T=x({__name:"alibaba-cloud-model-studio",setup(z){const u={speed:1},d=m(0),l=m(1),n=m(0),p=H(),r=E(),{providers:g}=k(r),{t:s}=F(),_=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),w=V(()=>p.availableVoices[o]||[]);async function M(e,t,a){const b=r.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=r.getProviderConfig(o),S=C.model||P;return await p.speech(b,S,e,t,{...C,...u})}return $(async()=>{const e=r.getProviderConfig(o);await r.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),v(d,async()=>{const e=r.getProviderConfig(o);e.pitch=d.value}),v(l,async()=>{const e=r.getProviderConfig(o);e.speed=l.value}),v(n,async()=>{const e=r.getProviderConfig(o);e.volume=n.value}),v(g,async()=>{const e=r.getProviderConfig(o);await r.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,t)=>(I(),B(i(L),{"provider-id":o,"default-model":P,"additional-settings":u},{"voice-settings":h(()=>[U("div",N,[c(i(f),{modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=a=>d.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":a=>`${a}%`},null,8,["modelValue","label","description","format-value"]),c(i(f),{modelValue:l.value,"onUpdate:modelValue":t[1]||(t[1]=a=>l.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.speed.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),c(i(f),{modelValue:n.value,"onUpdate:modelValue":t[2]||(t[2]=a=>n.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.volume.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":a=>`${a}%`},null,8,["modelValue","label","description","format-value"])])]),playground:h(()=>[c(i(K),{"available-voices":w.value,"generate-speech":M,"api-key-configured":_.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof y=="function"&&y(T);export{T as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as x,r as m,s as k,g as F,h as V,H as $,p as v,A as B,o as I,w as h,i as c,b as i,e as U}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as E}from"./providers-BQORs1wj.js";import{u as H}from"./speech-Bdg784LP.js";import{_ as f}from"./FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BWViBS8t.js";import{b as y}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";const N={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",P="cosyvoice-v1",T=x({__name:"alibaba-cloud-model-studio",setup(z){const u={speed:1},d=m(0),l=m(1),n=m(0),p=H(),r=E(),{providers:g}=k(r),{t:s}=F(),_=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),w=V(()=>p.availableVoices[o]||[]);async function M(e,t,a){const b=r.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=r.getProviderConfig(o),S=C.model||P;return await p.speech(b,S,e,t,{...C,...u})}return $(async()=>{const e=r.getProviderConfig(o);await r.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),v(d,async()=>{const e=r.getProviderConfig(o);e.pitch=d.value}),v(l,async()=>{const e=r.getProviderConfig(o);e.speed=l.value}),v(n,async()=>{const e=r.getProviderConfig(o);e.volume=n.value}),v(g,async()=>{const e=r.getProviderConfig(o);await r.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,t)=>(I(),B(i(L),{"provider-id":o,"default-model":P,"additional-settings":u},{"voice-settings":h(()=>[U("div",N,[c(i(f),{modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=a=>d.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":a=>`${a}%`},null,8,["modelValue","label","description","format-value"]),c(i(f),{modelValue:l.value,"onUpdate:modelValue":t[1]||(t[1]=a=>l.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.speed.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),c(i(f),{modelValue:n.value,"onUpdate:modelValue":t[2]||(t[2]=a=>n.value=a),label:i(s)("settings.pages.providers.provider.common.fields.field.volume.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":a=>`${a}%`},null,8,["modelValue","label","description","format-value"])])]),playground:h(()=>[c(i(K),{"available-voices":w.value,"generate-speech":M,"api-key-configured":_.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof y=="function"&&y(T);export{T as default}; diff --git a/assets/anthropic-amGUxRCV.js b/assets/anthropic-Cbc4_CUj.js similarity index 74% rename from assets/anthropic-amGUxRCV.js rename to assets/anthropic-Cbc4_CUj.js index 208360f9242779cb31e32784bf8c947fadd08682..76f5e7fbd0714a91dfcd8cd0eeedf57b5f7f5517 100644 --- a/assets/anthropic-amGUxRCV.js +++ b/assets/anthropic-Cbc4_CUj.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as S,g as x,S as U,s as w,h as v,H as V,p as C,A as K,o as R,w as c,e as i,i as l,k as p,b as a}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as A}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as O,a as $}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as I}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as N,a as B}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as T}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const e="anthropic",z=S({__name:"anthropic",setup(M){const{t:u}=x(),g=U(),h=A(),{providers:o}=w(h),m=v(()=>h.getProviderMetadata(e)),s=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.apiKey)||""},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].apiKey=t}}),n=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.baseUrl)||"https://api.anthropic.com/v1/"},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].baseUrl=t}});V(()=>{var t,r;o.value[e]||(o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((t=o.value[e])==null?void 0:t.apiKey)||"",n.value=((r=o.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),C([s,n],()=>{o.value[e]={...o.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function y(){o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(t,r)=>{var f,b;return R(),K(a(T),{"provider-name":((f=m.value)==null?void 0:f.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>a(g).back()},{default:c(()=>[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(a(N),null,{default:c(()=>[l(a(B),{title:a(u)("settings.pages.providers.common.section.basic.title"),description:a(u)("settings.pages.providers.common.section.basic.description"),"on-reset":y},{default:c(()=>{var d;return[l(a(I),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=k=>s.value=k),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(a(O),{title:a(u)("settings.pages.providers.common.section.advanced.title")},{default:c(()=>[l(a($),{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,__:[2]},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(z);export{z as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as S,g as x,S as U,s as w,h as v,H as V,p as C,A as K,o as R,w as c,e as i,i as l,k as p,b as a}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as A}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as O,a as $}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as I}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as N,a as B}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as T}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const e="anthropic",z=S({__name:"anthropic",setup(M){const{t:u}=x(),g=U(),h=A(),{providers:o}=w(h),m=v(()=>h.getProviderMetadata(e)),s=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.apiKey)||""},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].apiKey=t}}),n=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.baseUrl)||"https://api.anthropic.com/v1/"},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].baseUrl=t}});V(()=>{var t,r;o.value[e]||(o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((t=o.value[e])==null?void 0:t.apiKey)||"",n.value=((r=o.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),C([s,n],()=>{o.value[e]={...o.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function y(){o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(t,r)=>{var f,b;return R(),K(a(T),{"provider-name":((f=m.value)==null?void 0:f.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>a(g).back()},{default:c(()=>[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(a(N),null,{default:c(()=>[l(a(B),{title:a(u)("settings.pages.providers.common.section.basic.title"),description:a(u)("settings.pages.providers.common.section.basic.description"),"on-reset":y},{default:c(()=>{var d;return[l(a(I),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=k=>s.value=k),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(a(O),{title:a(u)("settings.pages.providers.common.section.advanced.title")},{default:c(()=>[l(a($),{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,__:[2]},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(z);export{z as default}; diff --git a/assets/audio-CbuXl7xe.js b/assets/audio-DFCkLcc2.js similarity index 88% rename from assets/audio-CbuXl7xe.js rename to assets/audio-DFCkLcc2.js index f24602accb76534eaf8dd61a39599bc92d560942..27f1b54ac04db8e4f5ef580ae71139acc84ac2c2 100644 --- a/assets/audio-CbuXl7xe.js +++ b/assets/audio-DFCkLcc2.js @@ -1 +1 @@ -import{d as s,r as f,c as d,o as p,e as t}from"./index-Bo-ykojl.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,r as f,c as d,o as p,e as t}from"./index-1_q7hlhr.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/background-remove-Z6_DGmnH.js b/assets/background-remove-D0LHHV4b.js similarity index 99% rename from assets/background-remove-Z6_DGmnH.js rename to assets/background-remove-D0LHHV4b.js index 55e65be17a190b3d9d0094791f89cf738190ddc7..f75c611eea2a67947512f5ecccc2b30650aab5a4 100644 --- a/assets/background-remove-Z6_DGmnH.js +++ b/assets/background-remove-D0LHHV4b.js @@ -1,4 +1,4 @@ -var _v=Object.defineProperty;var gv=(e,r,t)=>r in e?_v(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Y=(e,r,t)=>gv(e,typeof r!="symbol"?r+"":r,t);import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as wv}from"./InputFile.vue_vue_type_script_setup_true_lang-CWw-Ysae.js";import{d as bv,r as zs,h as Mv,H as yv,c as Tn,o as En,e as Vr,i as vv,t as Ef,F as Pf,l as Cf,j as Sf,q as xv,b as Tv}from"./index-Bo-ykojl.js";import"./floating-ui.core-CgBsuaUc.js";const la=new Map,kn=[],Ev=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=la.get(e);if(s===void 0)la.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 o=kn.indexOf(e);o!==-1&&kn.splice(o,1);for(let n=0;n{const r=la.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}}},Cv=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?kn:t;let o;const n=[],i=new Set;for(const l of s){const u=await Pv(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);const a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]},Sv="1.22.0";let $f="warning";const Ts={wasm:{},webgl:{},webgpu:{},versions:{common:Sv},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}`);$f=e}},get logLevel(){return $f}};Object.defineProperty(Ts,"logLevel",{enumerable:!0});const $v=Ts,kv=(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 o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);const i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,u;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?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));const p=n*o;let c=0,d=p,_=p*2,f=-1;i==="RGBA"?(c=0,d=p,_=p*2,f=p*3):i==="RGB"?(c=0,d=p,_=p*2):i==="RBG"&&(c=0,_=p,d=p*2);for(let v=0;v{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[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 c=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const d=4;let _=0,f=1,v=2,$=3,g=0,w=c,C=c*2,E=-1;a==="RGBA"?(g=0,w=c,C=c*2,E=c*3):a==="RGB"?(g=0,w=c,C=c*2):a==="RBG"&&(g=0,C=c,w=c*2),s=t.createImageData(o,n);for(let x=0;x{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,o=r.norm??{mean:255,bias:0};let n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3);let c=4,d=0,_=1,f=2,v=3,$=0,g=u,w=u*2,C=-1;a==="RGB"&&(c=3,d=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,w=u,g=u*2):l==="BGR"&&(w=0,g=u,$=u*2);for(let x=0;x{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let i,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")},u=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 c=u(p);if(c!=null){let d=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=r.resizedHeight,_=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=d,a.width=_}else a.tensorFormat="RGBA",a.height=d,a.width=_;c.drawImage(e,0,0),i=c.getImageData(0,0,_,d).data}else throw new Error("Can not access image data")}else if(s){let p,c;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,c=r.resizedWidth):(p=e.height,c=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=c,r!==void 0){const d=l();d.width=c,d.height=p;const _=u(d);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,c,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){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 c=u(p);if(c!=null){const d=e.height,_=e.width;return c.drawImage(e,0,0,_,d),i=c.getImageData(0,0,_,d).data,a.height=d,a.width=_,Al(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,c)=>{const d=l(),_=u(d);if(!e||!_)return c();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{d.width=f.width,d.height=f.height,_.drawImage(f,0,0,d.width,d.height);const v=_.getImageData(0,0,d.width,d.height);a.height=d.height,a.width=d.width,p(Al(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return Al(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Fv=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new us({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Ov=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Dv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},Lv=(e,r,t)=>new us({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),ro=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ua=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let kf=!1;const zv=()=>{if(!kf){kf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(ro.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(ro.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(ro.set("float16",t),ua.set(t,"float16")):ro.set("float16",Uint16Array)}},Bv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new us(e.type,e.data,r);case"cpu-pinned":return new us({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new us({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new us({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new us({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let us=class{constructor(r,t,s){zv();let o,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,o=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=ro.get(o);if(!a)throw new TypeError(`unsupported type "${o}" 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(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" 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(o=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 u=ro.get(r);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&u===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${u.name} as data.`);r==="uint64"||r==="int64"?a=u.from(t,BigInt):a=u.from(t)}else if(t instanceof u)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&&u!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${o} tensor's data must be type of ${u}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const u=typeof r[0];if(u==="string")o="string",a=r;else if(u==="boolean")o="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(r instanceof Uint8ClampedArray)o="uint8",a=Uint8Array.from(r);else{const u=ua.get(r.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);o=u,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 i=Bv(n);if(this.cpuData&&i!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=n,this.size=i}static async fromImage(r,t){return Av(r,t)}static fromTexture(r,t){return Fv(r,t)}static fromGpuBuffer(r,t){return Ov(r,t)}static fromMLTensor(r,t){return Dv(r,t)}static fromPinnedBuffer(r,t,s){return Lv(r,t,s)}toDataURL(r){return kv(this,r)}toImageData(r){return Iv(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 Rv(this,r)}};const eo=us,db=(e,r)=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||console.timeStamp(`${e}::ORT::${r}`)},pb=(e,r)=>{var o;const t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("BEGIN",e)},Fu=e=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("END",e)};let jv=class hb{constructor(r){this.handler=r}async run(r,t,s){Au();const o={};let n={};if(typeof r!="object"||r===null||r instanceof eo||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof eo)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.");i=!1;for(const u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1;const p=Object.getOwnPropertyNames(t);for(const c of this.outputNames)if(p.indexOf(c)!==-1){const d=t[c];(d===null||d instanceof eo)&&(u=!0,i=!1,o[c]=d)}if(u){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 u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(const u of this.outputNames)o[u]=null;const a=await this.handler.run(r,o,n),l={};for(const u in a)if(Object.hasOwnProperty.call(a,u)){const p=a[u];p instanceof eo?l[u]=p:l[u]=new eo(p.type,p.data,p.dims)}return Fu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){Au();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=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)i=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 c=0,d=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(c=t,!Number.isSafeInteger(c))throw new RangeError("'byteOffset' must be an integer.");if(c<0||c>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(d=r.byteLength-c,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||c+d>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-c}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"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,c,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Cv(i),u=await a.createInferenceSessionHandler(n,l);return Fu(),new hb(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const Nv=jv,Vv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Nv,TRACE:db,TRACE_FUNC_BEGIN:Au,TRACE_FUNC_END:Fu,Tensor:eo,env:$v,registerBackend:Ev},Symbol.toStringTag,{value:"Module"}));/*! +var _v=Object.defineProperty;var gv=(e,r,t)=>r in e?_v(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Y=(e,r,t)=>gv(e,typeof r!="symbol"?r+"":r,t);import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as wv}from"./InputFile.vue_vue_type_script_setup_true_lang-DsrPsbsJ.js";import{d as bv,r as zs,h as Mv,H as yv,c as Tn,o as En,e as Vr,i as vv,t as Ef,F as Pf,l as Cf,j as Sf,q as xv,b as Tv}from"./index-1_q7hlhr.js";import"./floating-ui.core-CgBsuaUc.js";const la=new Map,kn=[],Ev=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=la.get(e);if(s===void 0)la.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 o=kn.indexOf(e);o!==-1&&kn.splice(o,1);for(let n=0;n{const r=la.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}}},Cv=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?kn:t;let o;const n=[],i=new Set;for(const l of s){const u=await Pv(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);const a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]},Sv="1.22.0";let $f="warning";const Ts={wasm:{},webgl:{},webgpu:{},versions:{common:Sv},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}`);$f=e}},get logLevel(){return $f}};Object.defineProperty(Ts,"logLevel",{enumerable:!0});const $v=Ts,kv=(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 o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);const i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,u;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?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));const p=n*o;let c=0,d=p,_=p*2,f=-1;i==="RGBA"?(c=0,d=p,_=p*2,f=p*3):i==="RGB"?(c=0,d=p,_=p*2):i==="RBG"&&(c=0,_=p,d=p*2);for(let v=0;v{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[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 c=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const d=4;let _=0,f=1,v=2,$=3,g=0,w=c,C=c*2,E=-1;a==="RGBA"?(g=0,w=c,C=c*2,E=c*3):a==="RGB"?(g=0,w=c,C=c*2):a==="RBG"&&(g=0,C=c,w=c*2),s=t.createImageData(o,n);for(let x=0;x{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,o=r.norm??{mean:255,bias:0};let n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3);let c=4,d=0,_=1,f=2,v=3,$=0,g=u,w=u*2,C=-1;a==="RGB"&&(c=3,d=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,w=u,g=u*2):l==="BGR"&&(w=0,g=u,$=u*2);for(let x=0;x{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let i,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")},u=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 c=u(p);if(c!=null){let d=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=r.resizedHeight,_=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=d,a.width=_}else a.tensorFormat="RGBA",a.height=d,a.width=_;c.drawImage(e,0,0),i=c.getImageData(0,0,_,d).data}else throw new Error("Can not access image data")}else if(s){let p,c;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,c=r.resizedWidth):(p=e.height,c=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=c,r!==void 0){const d=l();d.width=c,d.height=p;const _=u(d);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,c,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){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 c=u(p);if(c!=null){const d=e.height,_=e.width;return c.drawImage(e,0,0,_,d),i=c.getImageData(0,0,_,d).data,a.height=d,a.width=_,Al(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,c)=>{const d=l(),_=u(d);if(!e||!_)return c();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{d.width=f.width,d.height=f.height,_.drawImage(f,0,0,d.width,d.height);const v=_.getImageData(0,0,d.width,d.height);a.height=d.height,a.width=d.width,p(Al(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return Al(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Fv=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new us({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Ov=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Dv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},Lv=(e,r,t)=>new us({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),ro=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ua=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let kf=!1;const zv=()=>{if(!kf){kf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(ro.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(ro.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(ro.set("float16",t),ua.set(t,"float16")):ro.set("float16",Uint16Array)}},Bv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new us(e.type,e.data,r);case"cpu-pinned":return new us({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new us({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new us({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new us({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let us=class{constructor(r,t,s){zv();let o,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,o=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=ro.get(o);if(!a)throw new TypeError(`unsupported type "${o}" 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(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" 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(o=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 u=ro.get(r);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&u===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${u.name} as data.`);r==="uint64"||r==="int64"?a=u.from(t,BigInt):a=u.from(t)}else if(t instanceof u)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&&u!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${o} tensor's data must be type of ${u}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const u=typeof r[0];if(u==="string")o="string",a=r;else if(u==="boolean")o="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(r instanceof Uint8ClampedArray)o="uint8",a=Uint8Array.from(r);else{const u=ua.get(r.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);o=u,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 i=Bv(n);if(this.cpuData&&i!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=n,this.size=i}static async fromImage(r,t){return Av(r,t)}static fromTexture(r,t){return Fv(r,t)}static fromGpuBuffer(r,t){return Ov(r,t)}static fromMLTensor(r,t){return Dv(r,t)}static fromPinnedBuffer(r,t,s){return Lv(r,t,s)}toDataURL(r){return kv(this,r)}toImageData(r){return Iv(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 Rv(this,r)}};const eo=us,db=(e,r)=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||console.timeStamp(`${e}::ORT::${r}`)},pb=(e,r)=>{var o;const t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("BEGIN",e)},Fu=e=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("END",e)};let jv=class hb{constructor(r){this.handler=r}async run(r,t,s){Au();const o={};let n={};if(typeof r!="object"||r===null||r instanceof eo||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof eo)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.");i=!1;for(const u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1;const p=Object.getOwnPropertyNames(t);for(const c of this.outputNames)if(p.indexOf(c)!==-1){const d=t[c];(d===null||d instanceof eo)&&(u=!0,i=!1,o[c]=d)}if(u){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 u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(const u of this.outputNames)o[u]=null;const a=await this.handler.run(r,o,n),l={};for(const u in a)if(Object.hasOwnProperty.call(a,u)){const p=a[u];p instanceof eo?l[u]=p:l[u]=new eo(p.type,p.data,p.dims)}return Fu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){Au();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=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)i=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 c=0,d=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(c=t,!Number.isSafeInteger(c))throw new RangeError("'byteOffset' must be an integer.");if(c<0||c>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(d=r.byteLength-c,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||c+d>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-c}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"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,c,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Cv(i),u=await a.createInferenceSessionHandler(n,l);return Fu(),new hb(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const Nv=jv,Vv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Nv,TRACE:db,TRACE_FUNC_BEGIN:Au,TRACE_FUNC_END:Fu,Tensor:eo,env:$v,registerBackend:Ev},Symbol.toStringTag,{value:"Module"}));/*! * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. diff --git a/assets/browserAll-DRzxklRU.js b/assets/browserAll-DRzxklRU.js deleted file mode 100644 index c61cee4930dcf2938c40c908faf38cf0b11bd090..0000000000000000000000000000000000000000 --- a/assets/browserAll-DRzxklRU.js +++ /dev/null @@ -1,14 +0,0 @@ -import{P as g,r as Q,E as b,T as C,U as ee,b as te,w as y,e as w,C as Z}from"./Model.vue_vue_type_script_setup_true_lang-6CsRcxL-.js";import"./webworkerAll-CcKPzOrL.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";class M{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=M.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new g,this.page=new g,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var I=/iPhone/i,S=/iPod/i,U=/iPad/i,R=/\biOS-universal(?:.+)Mac\b/i,x=/\bAndroid(?:.+)Mobile\b/i,$=/Android/i,E=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,A=/Silk/i,m=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,N=/BlackBerry/i,F=/BB10/i,Y=/Opera Mini/i,H=/\b(CriOS|Chrome)(?:.+)Mobile/i,K=/Mobile(?:.+)Firefox\b/i,j=function(a){return typeof a<"u"&&a.platform==="MacIntel"&&typeof a.maxTouchPoints=="number"&&a.maxTouchPoints>1&&typeof MSStream>"u"};function ie(a){return function(e){return e.test(a)}}function G(a){var e={userAgent:"",platform:"",maxTouchPoints:0};!a&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof a=="string"?e.userAgent=a:a&&a.userAgent&&(e={userAgent:a.userAgent,platform:a.platform,maxTouchPoints:a.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ie(t),s={apple:{phone:n(I)&&!n(m),ipod:n(S),tablet:!n(I)&&(n(U)||j(e))&&!n(m),universal:n(R),device:(n(I)||n(S)||n(U)||n(R)||j(e))&&!n(m)},amazon:{phone:n(E),tablet:!n(E)&&n(A),device:n(E)||n(A)},android:{phone:!n(m)&&n(E)||!n(m)&&n(x),tablet:!n(m)&&!n(E)&&!n(x)&&(n(A)||n($)),device:!n(m)&&(n(E)||n(A)||n(x)||n($))||n(/\bokhttp\b/i)},windows:{phone:n(m),tablet:n(X),device:n(m)||n(X)},other:{blackberry:n(N),blackberry10:n(F),opera:n(Y),firefox:n(K),chrome:n(H),device:n(N)||n(F)||n(Y)||n(K)||n(H)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ne=G.default??G,se=ne(globalThis.navigator),oe=9,D=100,re=0,ae=0,W=2,z=1,le=-1e3,he=-1e3,de=2,B=class V{constructor(e,t=se){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${z}px`,e.style.height=`${z}px`,e.style.position="absolute",e.style.top=`${le}px`,e.style.left=`${he}px`,e.style.zIndex=de.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.width=`${D}px`,this._div.style.height=`${D}px`,this._div.style.position="absolute",this._div.style.top=`${re}px`,this._div.style.left=`${ae}px`,this._div.style.zIndex=W.toString(),this._div.style.pointerEvents="none"),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,!0));const e=this._renderer.view.canvas;if(e.parentNode)e.parentNode.appendChild(this._div),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(e.parentNode.appendChild(this._div),t.disconnect(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;this._pool.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i=0;i--){const n=this._children[i];t.has(i)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._pool.push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,Q(this._children,i,1))}if(this._renderer.renderingToScreen){const{x:i,y:n,width:s,height:o}=this._renderer.screen,r=this._div;r.style.left=`${i}px`,r.style.top=`${n}px`,r.style.width=`${s}px`,r.style.height=`${o}px`}for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(e.accessibleType==="button"?t=document.createElement("button"):(t=document.createElement(e.accessibleType),t.style.cssText=` - color: transparent; - pointer-events: none; - padding: 0; - margin: 0; - border: 0; - outline: 0; - background: transparent; - box-sizing: border-box; - user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - `,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${D}px`,t.style.height=`${D}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=W.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e.interactive&&(e._accessibleDiv.tabIndex=e.tabIndex)}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(s,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode!==oe||!this._activateOnTab||this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._div=null,this._pool=null,this._children=null,this._renderer=null,this._activateOnTab&&globalThis.removeEventListener("keydown",this._onKeyDown)}setAccessibilityEnabled(e){e?this._activate():this._deactivate()}};B.extension={type:[b.WebGLSystem,b.WebGPUSystem],name:"accessibility"};B.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};let ce=B;const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class q{constructor(e){this._destroyRenderableBound=this.destroyRenderable.bind(this),this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"}addRenderable(e,t){this._attachedDomElements.includes(e)||(this._attachedDomElements.push(e),e.on("destroyed",this._destroyRenderableBound))}updateRenderable(e){}validateRenderable(e){return!0}destroyRenderable(e){const t=this._attachedDomElements.indexOf(e);t!==-1&&this._attachedDomElements.splice(t,1),e.off("destroyed",this._destroyRenderableBound)}postrender(){var i;const e=this._attachedDomElements;if(e.length===0){this._domElement.remove();return}const t=this._renderer.view.canvas;this._domElement.parentNode!==t.parentNode&&((i=t.parentNode)==null||i.appendChild(this._domElement)),this._domElement.style.transform=`translate(${t.offsetLeft}px, ${t.offsetTop}px)`;for(let n=0;ni.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(o=>{e.currentTarget=i[s],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;u--){const h=p[u],v=this.hitTestMoveRecursive(h,this._isInteractive(t)?t:h.eventMode,i,n,s,o||s(e,i));if(v){if(v.length>0&&!v[v.length-1].parent)continue;const c=e.isInteractive();(v.length>0||c)&&(c&&this._allInteractiveElements.push(e),v.push(e)),this._hitElements.length===0&&(this._hitElements=v),r=!0}}}const l=this._isInteractive(t),d=e.isInteractive();return d&&d&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:r?this._hitElements:l&&!s(e,i)&&n(e,i)?d?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(_.pauseUpdate=!1),e.interactiveChildren&&e.children){const l=e.children,d=i;for(let p=l.length-1;p>=0;p--){const u=l[p],h=this.hitTestRecursive(u,this._isInteractive(t)?t:u.eventMode,d,n,s);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const v=e.isInteractive();return(h.length>0||v)&&h.push(e),h}}}const o=this._isInteractive(t),r=e.isInteractive();return o&&n(e,i)?r?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i0&&s!==t.target){const p=e.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(e,p,s);if(this.dispatchEvent(u,"pointerout"),i&&this.dispatchEvent(u,"mouseout"),!t.composedPath().includes(s)){const h=this.createPointerEvent(e,"pointerleave",s);for(h.eventPhase=h.AT_TARGET;h.target&&!t.composedPath().includes(h.target);)h.currentTarget=h.target,this.notifyTarget(h),i&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;this.freeEvent(h)}this.freeEvent(u)}if(s!==t.target){const p=e.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(t,p);this.dispatchEvent(u,"pointerover"),i&&this.dispatchEvent(u,"mouseover");let h=s==null?void 0:s.parent;for(;h&&h!==this.rootTarget.parent&&h!==t.target;)h=h.parent;if(!h||h===this.rootTarget.parent){const c=this.clonePointerEvent(t,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==s&&c.target!==this.rootTarget.parent;)c.currentTarget=c.target,this.notifyTarget(c),i&&this.notifyTarget(c,"mouseenter"),c.target=c.target.parent;this.freeEvent(c)}this.freeEvent(u)}const o=[],r=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),r&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),r&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),r&&o.push("globalmousemove"),this.cursor=(d=t.target)==null?void 0:d.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const r=i.button===2;this.dispatchEvent(i,r?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=s;if(s&&!i.composedPath().includes(s)){let r=s;for(;r&&!i.composedPath().includes(r);){if(i.currentTarget=r,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const l=i.button===2;this.notifyTarget(i,l?"rightupoutside":"mouseupoutside")}r=r.parent}delete n.pressTargetsByButton[e.button],o=r}if(o){const r=this.clonePointerEvent(i,"click");r.target=o,r.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:r.target,timeStamp:t});const l=n.clicksByButton[e.button];if(l.target===r.target&&t-l.timeStamp<200?++l.clickCount:l.clickCount=1,l.target=r.target,l.timeStamp=t,r.detail=l.clickCount,r.pointerType==="mouse"){const d=r.button===2;this.dispatchEvent(r,d?"rightclick":"click")}else r.pointerType==="touch"&&this.dispatchEvent(r,"tap");this.dispatchEvent(r,"pointertap"),this.freeEvent(r)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,k._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||(e="default");let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,o=n.length;s"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=ge),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ye[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};L.extension={name:"events",type:[b.WebGLSystem,b.CanvasSystem,b.WebGPUSystem],priority:-1};L.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let J=L;const _e={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(a){this.eventMode=a?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??J.defaultEventMode},set eventMode(a){this._internalEventMode=a},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(a,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;a=i?`${a}capture`:a;const r=typeof e=="function"?e:e.handleEvent,l=this;n&&n.addEventListener("abort",()=>{l.off(a,r,o)}),s?l.once(a,r,o):l.on(a,r,o)},removeEventListener(a,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;a=i?`${a}capture`:a,e=typeof e=="function"?e:e.handleEvent,this.off(a,e,n)},dispatchEvent(a){if(!(a instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return a.defaultPrevented=!1,a.path=null,a.target=this,a.manager.dispatchEvent(a),!a.defaultPrevented}};w.add(ce);w.mixin(Z,ue);w.add(J);w.mixin(Z,_e);w.add(q); diff --git a/assets/chat-Cn2Q3Ifg.js b/assets/chat-CAoffe0W.js similarity index 90% rename from assets/chat-Cn2Q3Ifg.js rename to assets/chat-CAoffe0W.js index 5ecf6fec2dda3c1ef7d85ec48f863e9dfd63740a..4f8af4a76407d50c0a58efedd994dcccc0c80e3b 100644 --- a/assets/chat-Cn2Q3Ifg.js +++ b/assets/chat-CAoffe0W.js @@ -1 +1 @@ -import{d as N,x as W,r as S,c as h,o as y,e as i,y as C,z as E,b as M,Q as A,F as P,l as q,bz as D,j as U,t as $}from"./index-Bo-ykojl.js";import{s as K}from"./index-YUUT4m-_.js";import"./index-LHmcipjy.js";var O=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(r,o){e=r;try{return o()}finally{e=null}}}},H=new WeakMap,F=new WeakMap,I=0,T=0,_=e=>{const r=`${I++}`,o={include:t=>n.has(t),with:t=>{const d=`${T++}`,l={[Symbol.toStringTag]:`WorkflowEvent(${r}.${d})`,toString:()=>`WorkflowEvent(${r}.${d})`,toJSON:()=>({event:r,data:t}),get data(){return t}};return n.add(l),Object.freeze(l),F.set(l,o),l}},n=new WeakSet;return H.set(o,n),Object.defineProperty(o,Symbol.toStringTag,{get:()=>`WorkflowEvent<${r}>`}),Object.defineProperty(o,"displayName",{value:`WorkflowEvent<${r}>`}),o.toString=()=>`WorkflowEvent<${r}>`,Object.freeze(o),o},j=e=>e!=null&&typeof e=="object"&&"data"in e,J=e=>e!=null&&typeof e.then=="function";function R(e,r){const o=new Array(e.length);for(const n of r)for(let t=0;t{const r=[],o=(a,f,p)=>{let c;const g={get abortController(){return c||(c=new AbortController),c},handler:a,inputs:f,outputs:[],prev:p,next:new Set};g.prev.next.add(g);const v=d(g);Q.run(g,()=>{const s=[...new Set([...x.__internal__call_context,...v.__internal__call_context])];B.run(v,()=>{let u=0;const b=()=>{if(u===s.length){let k;try{k=a(...f)}catch(m){if(c??l)(c??l).abort(m);else throw console.error("unhandled error in handler",m),m}J(k)?k.then(m=>{j(m)&&v.sendEvent(m)}):j(k)&&v.sendEvent(k)}const L=s[u];L&&(u++,L(v,f,b))};b()})})},n=a=>{const f=[...r];[...e].filter(([p])=>R(p,f).length===p.length).map(([p,c])=>{const g=R(p,f);g.forEach(v=>{r.splice(r.indexOf(v),1)});for(const v of c)o(v.handler,g,a)})},t=[],d=a=>({get stream(){let f;return new ReadableStream({start:async p=>{f=c=>{let g=z.get(c);for(;g;){if(g===a){p.enqueue(c);break}g=g.prev}},t.push(f)}})},get signal(){return a.abortController.signal},sendEvent:(...f)=>{f.forEach(p=>{z.set(p,a),a.outputs.push(p),r.push(p),t.forEach(c=>c(p)),n(a)})},__internal__call_context:new Set});let l=new AbortController;const x=d({get abortController(){return l||(l=new AbortController),l},inputs:[],outputs:[],handler:null,prev:null,next:new Set});return x};function X(){const e={steps:new Map};return{handle:(r,o)=>{if(e.steps.has(r)){const n=e.steps.get(r),t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),t}else{const n=new Set,t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),e.steps.set(r,n),t}},createContext(){return G({listeners:e.steps})}}}async function Y(e,r,o){const{stream:n,sendEvent:t}=e.createContext();t(r);for await(const d of n)if(o.include(d))return d;throw new Error("Workflow did not return a stop event")}function Z(e,r){const o=(...n)=>{const t=r.filter(([w])=>w.every((x,a)=>x.include(n[a]))).map(([w,x])=>x),l=V().sendEvent;return(...w)=>{let x=!1;for(let a=0;ap.include(w[c]))){x=!0;break}}return x&&console.warn("Invalid input detected [%s]",w.map(a=>a.data).join(", ")),l(...w)}};return{...e,handle:(n,t)=>{const d=(...l)=>{const w=V();return t(w.safeSendEvent,...l)};return e.handle(n,d)},createContext(){const n=e.createContext();return n.__internal__call_context.add((t,d,l)=>{t.safeSendEvent=o(...d),l()}),n}}}const ee={flex:"","flex-col":"","gap-2":""},te={flex:"~ col","gap-2":""},ne={flex:"","flex-col":"","gap-2":""},re={grid:"","grid-cols-2":"","gap-2":""},oe={flex:"","items-center":"","gap-2":""},ae={flex:"","items-center":"","gap-2":""},le={flex:"","items-center":"","gap-2":""},se={key:0},ue={key:1},fe=N({__name:"chat",setup(e){const r=W("settings/llm/baseUrl","https://openrouter.ai/api/v1/"),o=W("settings/llm/apiKey",""),n=W("settings/llm/model","openai/gpt-4o-mini"),t=S(""),d=S([]),l=S({role:"assistant",content:""}),w=S(!1),x=_(),a=_(),f=_(),p=_(),c=_();async function g(){w.value=!0;try{const v=Z(X(),[[[x],[a,c]],[[a],[f]],[[f],[p]]]);v.handle([x],async s=>{l.value={role:"assistant",content:""},d.value.push({role:"user",content:t.value}),d.value.push(l.value);const u=await K({baseURL:r.value,apiKey:o.value,model:n.value,messages:d.value.slice(0,d.value.length-1).map(b=>D(b))});for await(const b of u.chunkStream)s(a.with(b.choices[0].delta.content||""));return c.with()}),v.handle([a],async(s,u)=>{l.value.content?l.value.content+=u.data:l.value.content=u.data}),await Y(v,x.with(),c)}catch(v){console.error(v)}finally{w.value=!1}}return(v,s)=>(y(),h("div",ee,[i("div",te,[i("div",ne,[s[7]||(s[7]=i("div",null,[i("span",{"text-neutral-500":"","dark:text-neutral-400":""},"LLM")],-1)),i("div",re,[i("label",oe,[s[4]||(s[4]=i("span",{"text-nowrap":""}," Base URL ",-1)),C(i("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>A(r)?r.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(r)]])]),i("label",ae,[s[5]||(s[5]=i("span",{"text-nowrap":""}," API Key ",-1)),C(i("input",{"onUpdate:modelValue":s[1]||(s[1]=u=>A(o)?o.value=u:null),type:"password",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(o)]])]),i("label",le,[s[6]||(s[6]=i("span",{"text-nowrap":""}," Model ",-1)),C(i("input",{"onUpdate:modelValue":s[2]||(s[2]=u=>A(n)?n.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(n)]])])])]),i("div",null,[C(i("textarea",{"onUpdate:modelValue":s[3]||(s[3]=u=>t.value=u),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,t.value]])]),i("button",{"rounded-lg":"",bg:"blue-100 dark:blue-900","px-4":"","py-2":"",onClick:g}," Send "),i("div",null,[(y(!0),h(P,null,q(d.value,(u,b)=>(y(),h("div",{key:b},[u.role==="user"?(y(),h("div",se,[i("span",null,$(u.content),1)])):U("",!0),u.role==="assistant"?(y(),h("div",ue,[i("span",null,$(u.content),1)])):U("",!0)]))),128))])])]))}});export{fe as default}; +import{d as D,x as W,r as S,c as h,o as y,e as i,y as C,z as E,b as M,Q as A,F as N,l as P,bD as q,j as U,t as $}from"./index-1_q7hlhr.js";import{s as K}from"./index-YUUT4m-_.js";import"./index-LHmcipjy.js";var z=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(r,o){e=r;try{return o()}finally{e=null}}}},H=new WeakMap,F=new WeakMap,I=0,T=0,_=e=>{const r=`${I++}`,o={include:t=>n.has(t),with:t=>{const d=`${T++}`,l={[Symbol.toStringTag]:`WorkflowEvent(${r}.${d})`,toString:()=>`WorkflowEvent(${r}.${d})`,toJSON:()=>({event:r,data:t}),get data(){return t}};return n.add(l),Object.freeze(l),F.set(l,o),l}},n=new WeakSet;return H.set(o,n),Object.defineProperty(o,Symbol.toStringTag,{get:()=>`WorkflowEvent<${r}>`}),Object.defineProperty(o,"displayName",{value:`WorkflowEvent<${r}>`}),o.toString=()=>`WorkflowEvent<${r}>`,Object.freeze(o),o},j=e=>e!=null&&typeof e=="object"&&"data"in e,J=e=>e!=null&&typeof e.then=="function";function R(e,r){const o=new Array(e.length);for(const n of r)for(let t=0;t{const r=[],o=(a,f,p)=>{let c;const g={get abortController(){return c||(c=new AbortController),c},handler:a,inputs:f,outputs:[],prev:p,next:new Set};g.prev.next.add(g);const v=d(g);Q.run(g,()=>{const s=[...new Set([...x.__internal__call_context,...v.__internal__call_context])];B.run(v,()=>{let u=0;const b=()=>{if(u===s.length){let k;try{k=a(...f)}catch(m){if(c??l)(c??l).abort(m);else throw console.error("unhandled error in handler",m),m}J(k)?k.then(m=>{j(m)&&v.sendEvent(m)}):j(k)&&v.sendEvent(k)}const L=s[u];L&&(u++,L(v,f,b))};b()})})},n=a=>{const f=[...r];[...e].filter(([p])=>R(p,f).length===p.length).map(([p,c])=>{const g=R(p,f);g.forEach(v=>{r.splice(r.indexOf(v),1)});for(const v of c)o(v.handler,g,a)})},t=[],d=a=>({get stream(){let f;return new ReadableStream({start:async p=>{f=c=>{let g=O.get(c);for(;g;){if(g===a){p.enqueue(c);break}g=g.prev}},t.push(f)}})},get signal(){return a.abortController.signal},sendEvent:(...f)=>{f.forEach(p=>{O.set(p,a),a.outputs.push(p),r.push(p),t.forEach(c=>c(p)),n(a)})},__internal__call_context:new Set});let l=new AbortController;const x=d({get abortController(){return l||(l=new AbortController),l},inputs:[],outputs:[],handler:null,prev:null,next:new Set});return x};function X(){const e={steps:new Map};return{handle:(r,o)=>{if(e.steps.has(r)){const n=e.steps.get(r),t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),t}else{const n=new Set,t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),e.steps.set(r,n),t}},createContext(){return G({listeners:e.steps})}}}async function Y(e,r,o){const{stream:n,sendEvent:t}=e.createContext();t(r);for await(const d of n)if(o.include(d))return d;throw new Error("Workflow did not return a stop event")}function Z(e,r){const o=(...n)=>{const t=r.filter(([w])=>w.every((x,a)=>x.include(n[a]))).map(([w,x])=>x),l=V().sendEvent;return(...w)=>{let x=!1;for(let a=0;ap.include(w[c]))){x=!0;break}}return x&&console.warn("Invalid input detected [%s]",w.map(a=>a.data).join(", ")),l(...w)}};return{...e,handle:(n,t)=>{const d=(...l)=>{const w=V();return t(w.safeSendEvent,...l)};return e.handle(n,d)},createContext(){const n=e.createContext();return n.__internal__call_context.add((t,d,l)=>{t.safeSendEvent=o(...d),l()}),n}}}const ee={flex:"","flex-col":"","gap-2":""},te={flex:"~ col","gap-2":""},ne={flex:"","flex-col":"","gap-2":""},re={grid:"","grid-cols-2":"","gap-2":""},oe={flex:"","items-center":"","gap-2":""},ae={flex:"","items-center":"","gap-2":""},le={flex:"","items-center":"","gap-2":""},se={key:0},ue={key:1},fe=D({__name:"chat",setup(e){const r=W("settings/llm/baseUrl","https://openrouter.ai/api/v1/"),o=W("settings/llm/apiKey",""),n=W("settings/llm/model","openai/gpt-4o-mini"),t=S(""),d=S([]),l=S({role:"assistant",content:""}),w=S(!1),x=_(),a=_(),f=_(),p=_(),c=_();async function g(){w.value=!0;try{const v=Z(X(),[[[x],[a,c]],[[a],[f]],[[f],[p]]]);v.handle([x],async s=>{l.value={role:"assistant",content:""},d.value.push({role:"user",content:t.value}),d.value.push(l.value);const u=await K({baseURL:r.value,apiKey:o.value,model:n.value,messages:d.value.slice(0,d.value.length-1).map(b=>q(b))});for await(const b of u.chunkStream)s(a.with(b.choices[0].delta.content||""));return c.with()}),v.handle([a],async(s,u)=>{l.value.content?l.value.content+=u.data:l.value.content=u.data}),await Y(v,x.with(),c)}catch(v){console.error(v)}finally{w.value=!1}}return(v,s)=>(y(),h("div",ee,[i("div",te,[i("div",ne,[s[7]||(s[7]=i("div",null,[i("span",{"text-neutral-500":"","dark:text-neutral-400":""},"LLM")],-1)),i("div",re,[i("label",oe,[s[4]||(s[4]=i("span",{"text-nowrap":""}," Base URL ",-1)),C(i("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>A(r)?r.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(r)]])]),i("label",ae,[s[5]||(s[5]=i("span",{"text-nowrap":""}," API Key ",-1)),C(i("input",{"onUpdate:modelValue":s[1]||(s[1]=u=>A(o)?o.value=u:null),type:"password",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(o)]])]),i("label",le,[s[6]||(s[6]=i("span",{"text-nowrap":""}," Model ",-1)),C(i("input",{"onUpdate:modelValue":s[2]||(s[2]=u=>A(n)?n.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(n)]])])])]),i("div",null,[C(i("textarea",{"onUpdate:modelValue":s[3]||(s[3]=u=>t.value=u),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,t.value]])]),i("button",{"rounded-lg":"",bg:"blue-100 dark:blue-900","px-4":"","py-2":"",onClick:g}," Send "),i("div",null,[(y(!0),h(N,null,P(d.value,(u,b)=>(y(),h("div",{key:b},[u.role==="user"?(y(),h("div",se,[i("span",null,$(u.content),1)])):U("",!0),u.role==="assistant"?(y(),h("div",ue,[i("span",null,$(u.content),1)])):U("",!0)]))),128))])])]))}});export{fe as default}; diff --git a/assets/cloudflare-workers-ai-GvJq8p2T.js b/assets/cloudflare-workers-ai-eBT-UXSj.js similarity index 78% rename from assets/cloudflare-workers-ai-GvJq8p2T.js rename to assets/cloudflare-workers-ai-eBT-UXSj.js index bc0f848e044c947c5b97dcb099edca65ec22a72b..695d2d136af196ca118155b5b12ec4590c355286 100644 --- a/assets/cloudflare-workers-ai-GvJq8p2T.js +++ b/assets/cloudflare-workers-ai-eBT-UXSj.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as k,m as y,u as M,A as I,o as h,b as l,g as $,S as q,s as x,h as v,H as K,p as A,w as f,i as p}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as P}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as S}from"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as B,a as C}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as V}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const R=k({__name:"ProviderAccountIdInput",props:y({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(c){const r=c,u=M(c,"modelValue");return(n,e)=>(h(),I(l(S),{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",U=k({__name:"cloudflare-workers-ai",setup(c){const{t:r}=$(),u=q(),n=P(),{providers:e}=x(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}});K(()=>{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)||""}),A([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function w(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return h(),I(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(()=>[p(l(B),null,{default:f(()=>[p(l(C),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:f(()=>{var b;return[p(l(z),{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"]),p(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"])}}});typeof V=="function"&&V(U);export{U as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as k,m as y,u as M,A as I,o as h,b as l,g as $,S as q,s as x,h as v,H as K,p as A,w as f,i as p}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as P}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as S}from"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as B,a as C}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as V}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const R=k({__name:"ProviderAccountIdInput",props:y({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(c){const r=c,u=M(c,"modelValue");return(n,e)=>(h(),I(l(S),{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",U=k({__name:"cloudflare-workers-ai",setup(c){const{t:r}=$(),u=q(),n=P(),{providers:e}=x(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}});K(()=>{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)||""}),A([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function w(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return h(),I(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(()=>[p(l(B),null,{default:f(()=>[p(l(C),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:f(()=>{var b;return[p(l(z),{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"]),p(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"])}}});typeof V=="function"&&V(U);export{U as default}; diff --git a/assets/consciousness-BX3nIDDD.js b/assets/consciousness-CnNlPxQn.js similarity index 93% rename from assets/consciousness-BX3nIDDD.js rename to assets/consciousness-CnNlPxQn.js index 516c1f23493824afe038dcb4e4280b1fcc0e489f..e3a9affdfd8d95a7f0612bb8de7655efae4fdef7 100644 --- a/assets/consciousness-BX3nIDDD.js +++ b/assets/consciousness-CnNlPxQn.js @@ -1 +1 @@ -import{d as R,s as h,g as z,H as U,K as B,c as r,o as n,e,y as b,j as f,t as i,b as s,F as k,l as D,i as j,w as q,P as F,A as y,Q as u,z as Q}from"./index-Bo-ykojl.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as T}from"./consciousness-DjkUTNrC.js";import{u as A}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{R as E,a as G}from"./RadioCardSimple-C6azzpaa.js";import{b as M}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const H={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},I={flex:"~ col gap-4"},K={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},J={text:"neutral-400 dark:neutral-400"},O={"max-w-full":""},W={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},X={key:1},Y={key:0},Z={flex:"~ col gap-4"},$={class:"text-lg md:text-2xl"},ee={text:"neutral-400 dark:neutral-400"},se={key:0,class:"flex items-center justify-center py-4"},te={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"},oe={class:"flex flex-col"},ie={class:"font-medium"},ne={class:"text-sm text-red-600 dark:text-red-400"},le={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"},re={class:"flex flex-col"},de={class:"font-medium"},ae={class:"text-sm text-amber-600 dark:text-amber-400"},ce={key:1},ue={flex:"~ col gap-4"},pe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},me={text:"neutral-400 dark:neutral-500"},xe={class:"flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20"},ve={class:"flex flex-col"},ge={class:"font-medium"},_e={class:"text-sm text-primary-600 dark:text-primary-400"},he={class:"mt-2"},be={class:"mb-1 block text-sm font-medium"},fe=["placeholder"],ke={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},ye=R({__name:"consciousness",setup(Me){const w=A(),m=T(),{availableProviders:V,availableTextGenerationsProvidersMetadata:C}=h(w),{activeProvider:d,activeModel:a,customModelName:P,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=h(m),{t}=z();U(async()=>{await m.loadModelsForProvider(d.value)});function S(_){P.value=_}return(_,o)=>{const N=B("motion");return n(),r(k,null,[e("div",H,[e("div",null,[e("div",I,[e("div",null,[e("h2",K,i(s(t)("settings.pages.providers.title")),1),e("div",J,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",O,[s(V).length>0?(n(),r("fieldset",W,[(n(!0),r(k,null,D(s(C),l=>(n(),y(s(G),{id:l.id,key:l.id,modelValue:s(d),"onUpdate:modelValue":o[0]||(o[0]=L=>u(d)?d.value=L:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(n(),r("div",X,[j(s(F),{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:q(()=>o[4]||(o[4]=[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,__:[4]})]))])])]),s(d)&&s(x)?(n(),r("div",Y,[e("div",Z,[e("div",null,[e("h2",$,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",ee,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(n(),r("div",se,[o[5]||(o[5]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(g)?(n(),r("div",te,[o[6]||(o[6]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",oe,[e("span",ie,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",ne,i(s(g)),1)])])):s(p).length===0&&!s(v)?(n(),r("div",le,[o[7]||(o[7]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",re,[e("span",de,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ae,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(n(),y(s(E),{key:3,modelValue:s(a),"onUpdate:modelValue":o[1]||(o[1]=l=>u(a)?a.value=l:null),"search-query":s(c),"onUpdate:searchQuery":o[2]||(o[2]=l=>u(c)?c.value=l:null),items:s(p),searchable:!0,"search-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":S},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)?(n(),r("div",ce,[e("div",ue,[e("div",null,[e("h2",pe,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",me,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",xe,[o[8]||(o[8]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-primary-500 dark:text-primary-400"},null,-1)),e("div",ve,[e("span",ge,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",_e,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",he,[e("label",be,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),b(e("input",{"onUpdate:modelValue":o[3]||(o[3]=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(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,fe),[[Q,s(a)]])])])])):f("",!0)]),b((n(),r("div",ke,o[9]||(o[9]=[e("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof M=="function"&&M(ye);export{ye as default}; +import{d as R,s as h,g as z,H as U,K as B,c as r,o as n,e,y as b,j as f,t as i,b as s,F as k,l as D,i as j,w as q,P as F,A as y,Q as u,z as Q}from"./index-1_q7hlhr.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as T}from"./consciousness-esOkXpB1.js";import{u as A}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{R as E,a as G}from"./RadioCardSimple-DJEw3oE4.js";import{b as M}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const H={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},I={flex:"~ col gap-4"},K={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},J={text:"neutral-400 dark:neutral-400"},O={"max-w-full":""},W={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},X={key:1},Y={key:0},Z={flex:"~ col gap-4"},$={class:"text-lg md:text-2xl"},ee={text:"neutral-400 dark:neutral-400"},se={key:0,class:"flex items-center justify-center py-4"},te={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"},oe={class:"flex flex-col"},ie={class:"font-medium"},ne={class:"text-sm text-red-600 dark:text-red-400"},le={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"},re={class:"flex flex-col"},de={class:"font-medium"},ae={class:"text-sm text-amber-600 dark:text-amber-400"},ce={key:1},ue={flex:"~ col gap-4"},pe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},me={text:"neutral-400 dark:neutral-500"},xe={class:"flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20"},ve={class:"flex flex-col"},ge={class:"font-medium"},_e={class:"text-sm text-primary-600 dark:text-primary-400"},he={class:"mt-2"},be={class:"mb-1 block text-sm font-medium"},fe=["placeholder"],ke={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},ye=R({__name:"consciousness",setup(Me){const w=A(),m=T(),{availableProviders:V,availableTextGenerationsProvidersMetadata:C}=h(w),{activeProvider:d,activeModel:a,customModelName:P,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=h(m),{t}=z();U(async()=>{await m.loadModelsForProvider(d.value)});function S(_){P.value=_}return(_,o)=>{const N=B("motion");return n(),r(k,null,[e("div",H,[e("div",null,[e("div",I,[e("div",null,[e("h2",K,i(s(t)("settings.pages.providers.title")),1),e("div",J,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",O,[s(V).length>0?(n(),r("fieldset",W,[(n(!0),r(k,null,D(s(C),l=>(n(),y(s(G),{id:l.id,key:l.id,modelValue:s(d),"onUpdate:modelValue":o[0]||(o[0]=L=>u(d)?d.value=L:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(n(),r("div",X,[j(s(F),{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:q(()=>o[4]||(o[4]=[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,__:[4]})]))])])]),s(d)&&s(x)?(n(),r("div",Y,[e("div",Z,[e("div",null,[e("h2",$,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",ee,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(n(),r("div",se,[o[5]||(o[5]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(g)?(n(),r("div",te,[o[6]||(o[6]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",oe,[e("span",ie,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",ne,i(s(g)),1)])])):s(p).length===0&&!s(v)?(n(),r("div",le,[o[7]||(o[7]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",re,[e("span",de,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ae,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(n(),y(s(E),{key:3,modelValue:s(a),"onUpdate:modelValue":o[1]||(o[1]=l=>u(a)?a.value=l:null),"search-query":s(c),"onUpdate:searchQuery":o[2]||(o[2]=l=>u(c)?c.value=l:null),items:s(p),searchable:!0,"search-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":S},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)?(n(),r("div",ce,[e("div",ue,[e("div",null,[e("h2",pe,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",me,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",xe,[o[8]||(o[8]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-primary-500 dark:text-primary-400"},null,-1)),e("div",ve,[e("span",ge,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",_e,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",he,[e("label",be,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),b(e("input",{"onUpdate:modelValue":o[3]||(o[3]=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(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,fe),[[Q,s(a)]])])])])):f("",!0)]),b((n(),r("div",ke,o[9]||(o[9]=[e("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof M=="function"&&M(ye);export{ye as default}; diff --git a/assets/consciousness-DjkUTNrC.js b/assets/consciousness-esOkXpB1.js similarity index 90% rename from assets/consciousness-DjkUTNrC.js rename to assets/consciousness-esOkXpB1.js index 8ea110c874624ea3ec6c87022ce628403d6bee85..18bbc09774a03cf555ffe494fb230626c59765a8 100644 --- a/assets/consciousness-DjkUTNrC.js +++ b/assets/consciousness-esOkXpB1.js @@ -1 +1 @@ -import{v as P,x as n,r as M,h as r,p as L}from"./index-Bo-ykojl.js";import{u as w}from"./providers-B3p38pBl.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)),p=r(()=>o.isLoadingModels[s.value]||!1),f=r(()=>o.modelLoadError[s.value]||null),g=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:p,activeProviderModelError:f,filteredModels:g,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; +import{v as P,x as n,r as M,h as r,p as L}from"./index-1_q7hlhr.js";import{u as w}from"./providers-BQORs1wj.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)),p=r(()=>o.isLoadingModels[s.value]||!1),f=r(()=>o.modelLoadError[s.value]||null),g=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:p,activeProviderModelError:f,filteredModels:g,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; diff --git a/assets/deepseek-ByIJ-ylP.js b/assets/deepseek-BguEBtU6.js similarity index 66% rename from assets/deepseek-ByIJ-ylP.js rename to assets/deepseek-BguEBtU6.js index bf48d0888b258eed690d75b251547ee708d30a4a..5f6d50a22d6098299e828678ef93db1005eae5aa 100644 --- a/assets/deepseek-ByIJ-ylP.js +++ b/assets/deepseek-BguEBtU6.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as U,g as V,S as y,s as $,h as c,H as K,p as h,A as S,o as w,w as m,i as l,b as t}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const o="deepseek",B=U({__name:"deepseek",setup(I){const{t:u}=V(),b=y(),d=x(),{providers:a}=$(d),n=c(()=>d.getProviderMetadata(o)),r=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(o),r.value=((e=a.value[o])==null?void 0:e.apiKey)||"",s.value=((i=a.value[o])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{a.value[o]={...a.value[o],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return w(),S(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(b).back()},{default:m(()=>[l(t(N),null,{default:m(()=>[l(t(P),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as U,g as V,S as y,s as $,h as c,H as K,p as h,A as S,o as w,w as m,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const o="deepseek",B=U({__name:"deepseek",setup(I){const{t:u}=V(),b=y(),d=x(),{providers:a}=$(d),n=c(()=>d.getProviderMetadata(o)),r=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(o),r.value=((e=a.value[o])==null?void 0:e.apiKey)||"",s.value=((i=a.value[o])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{a.value[o]={...a.value[o],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return w(),S(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(b).back()},{default:m(()=>[l(t(N),null,{default:m(()=>[l(t(P),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/default-D_q7oHhj.js b/assets/default-CeR2EX6F.js similarity index 89% rename from assets/default-D_q7oHhj.js rename to assets/default-CeR2EX6F.js index 8e665d232461d890f1cfb06c1bfe0d32f3988274..8962fcfbf53bea0bca18e8e35216bfcde0c7c96a 100644 --- a/assets/default-D_q7oHhj.js +++ b/assets/default-CeR2EX6F.js @@ -1 +1 @@ -import{d as t,c as s,e,i as a,b as o,R as n,o as p}from"./index-Bo-ykojl.js";import{H as d}from"./HeaderLink-CATmmLWn.js";const i={style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingTop:"env(safe-area-inset-top, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)"}},r={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},c={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},g=t({__name:"default",setup(m){return(f,l)=>(p(),s("div",i,[e("div",r,[a(d)]),e("div",c,[a(o(n))])]))}});export{g as default}; +import{d as t,c as s,e,i as a,b as o,R as n,o as p}from"./index-1_q7hlhr.js";import{H as d}from"./HeaderLink-D3zUgdpF.js";const i={style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingTop:"env(safe-area-inset-top, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)"}},r={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},c={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},g=t({__name:"default",setup(m){return(f,l)=>(p(),s("div",i,[e("div",r,[a(d)]),e("div",c,[a(o(n))])]))}});export{g as default}; diff --git a/assets/default-node-ClwjvsoD.js b/assets/default-node-DqVoet3j.js similarity index 89% rename from assets/default-node-ClwjvsoD.js rename to assets/default-node-DqVoet3j.js index 36e70f56d8b8175a3da8863211245206bfad4820..6027ad4ad060ffcbac04c40acda7cca78e4723d1 100644 --- a/assets/default-node-ClwjvsoD.js +++ b/assets/default-node-DqVoet3j.js @@ -1 +1 @@ -import{L as t}from"./index-Bo-ykojl.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:i}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:i}},[]),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{L as t}from"./index-1_q7hlhr.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:i}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:i}},[]),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-BiINGcB6.js b/assets/delays-r3Br_TGC.js similarity index 71% rename from assets/delays-BiINGcB6.js rename to assets/delays-r3Br_TGC.js index b3e649ddfa1022a48dd307fcf9cdc317126cb90f..effaf46aa7840c9851d454499b7c29e5f16092ec 100644 --- a/assets/delays-BiINGcB6.js +++ b/assets/delays-r3Br_TGC.js @@ -1 +1 @@ -import"./index-D2UJ2Jls.js";import{u as g,l as _}from"./queues-JqhmoK_1.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as k}from"./Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js";import{d as b,r,c as n,o as t,e,i as y,b as x,t as i,F as f,l as m}from"./index-Bo-ykojl.js";import"./mini_xsschema-f5xAZ6yD.js";import"./queue-BjJ4HvBx.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},h={flex:"","flex-row":"","gap-2":""},M={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},U=b({__name:"delays",setup(B){const s=r(""),c=r([]),p=r([]),u=r(!1),d=g();d.onHandlerEvent("delay",a=>{p.value.push(a)});function v(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(_),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[y(x(k),{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=l=>s.value=l),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",E,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(t(!0),n(f,null,m(c.value,l=>(t(),n("div",{key:l},[e("div",null,i(l),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(t(!0),n(f,null,m(p.value,l=>(t(),n("div",{key:l},[e("div",null,i(l)+"s",1)]))),128))])])]))}});export{U as default}; +import"./index-BX7nlSld.js";import{u as g,l as _}from"./queues-B3H1SS53.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as k}from"./Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js";import{d as b,r,c as n,o as t,e,i as y,b as x,t as i,F as f,l as m}from"./index-1_q7hlhr.js";import"./mini_xsschema-f5xAZ6yD.js";import"./queue-2ASK7l5s.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},h={flex:"","flex-row":"","gap-2":""},M={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},U=b({__name:"delays",setup(B){const s=r(""),c=r([]),p=r([]),u=r(!1),d=g();d.onHandlerEvent("delay",a=>{p.value.push(a)});function v(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(_),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[y(x(k),{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=l=>s.value=l),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",E,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(t(!0),n(f,null,m(c.value,l=>(t(),n("div",{key:l},[e("div",null,i(l),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(t(!0),n(f,null,m(p.value,l=>(t(),n("div",{key:l},[e("div",null,i(l)+"s",1)]))),128))])])]))}});export{U as default}; diff --git a/assets/effect-D-9STIhm-B6BIjJPd.js b/assets/effect-D-9STIhm-VgErbWUr.js similarity index 51% rename from assets/effect-D-9STIhm-B6BIjJPd.js rename to assets/effect-D-9STIhm-VgErbWUr.js index 04dc2130f5c6b4f4028b3776794c9b3aec2d93e0..3bd582ff84f94a48ce0434bc46fd19dd24740c5d 100644 --- a/assets/effect-D-9STIhm-B6BIjJPd.js +++ b/assets/effect-D-9STIhm-VgErbWUr.js @@ -1 +1 @@ -import{L as r}from"./index-Bo-ykojl.js";import{t as e}from"./mcp-Ce-wxTN6.js";const _=async()=>{const{JSONSchema:t}=await e(r(()=>import("./__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js"),[]),"effect");return o=>t.make(o)};export{_ as getToJsonSchemaFn}; +import{L as r}from"./index-1_q7hlhr.js";import{t as e}from"./mcp-DcvIwSEe.js";const _=async()=>{const{JSONSchema:t}=await e(r(()=>import("./__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js"),[]),"effect");return o=>t.make(o)};export{_ as getToJsonSchemaFn}; diff --git a/assets/elevenlabs-4FFnpr6K.js b/assets/elevenlabs-DvxODrlh.js similarity index 79% rename from assets/elevenlabs-4FFnpr6K.js rename to assets/elevenlabs-DvxODrlh.js index 194d9b8e776fb19a165a1d5e784b3d1c71ff5381..e3df5426a08f051af1a01a4ddff4143975528a1d 100644 --- a/assets/elevenlabs-4FFnpr6K.js +++ b/assets/elevenlabs-DvxODrlh.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as $,r as n,s as F,g as I,h as x,H as E,p as a,A as H,o as K,w as k,i as d,b as o,e as L}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as N}from"./providers-B3p38pBl.js";import{u as T}from"./speech-Br7XDY4_.js";import{_ as p,a as z}from"./FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as A,a as G}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BoWb4lIe.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";const R={flex:"~ col gap-4"},l="elevenlabs",_="eleven_multilingual_v2",j=$({__name:"elevenlabs",setup(q){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),m=n(1),u=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=T(),t=N(),{providers:C}=F(t),{t:r}=I(),B=x(()=>{var e;return!!((e=C.value[l])!=null&&e.apiKey)}),M=x(()=>y.availableVoices[l]||[]);async function U(e,i,s){const P=t.getProviderInstance(l);if(!P)throw new Error("Failed to initialize speech provider");const S=t.getProviderConfig(l),h=S.model||_;return await y.speech(P,h,e,i,{...S,...V})}return E(async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)}),a(v,async()=>{const e=t.getProviderConfig(l);e.pitch=v.value}),a(m,async()=>{const e=t.getProviderConfig(l);e.speed=m.value}),a(u,async()=>{const e=t.getProviderConfig(l);e.volume=u.value}),a(f,async()=>{const e=t.getProviderConfig(l);e.style=f.value}),a(c,async()=>{const e=t.getProviderConfig(l);e.stability=c.value}),a(g,async()=>{const e=t.getProviderConfig(l);e.similarityBoost=g.value}),a(b,async()=>{const e=t.getProviderConfig(l);e.useSpeakerBoost=b.value}),a(C,async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(K(),H(o(G),{"provider-id":l,"default-model":_,"additional-settings":V},{"voice-settings":k(()=>[L("div",R,[d(o(p),{modelValue:v.value,"onUpdate:modelValue":i[0]||(i[0]=s=>v.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=s=>m.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:u.value,"onUpdate:modelValue":i[2]||(i[2]=s=>u.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:f.value,"onUpdate:modelValue":i[3]||(i[3]=s=>f.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:c.value,"onUpdate:modelValue":i[4]||(i[4]=s=>c.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:g.value,"onUpdate:modelValue":i[5]||(i[5]=s=>g.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(z),{modelValue:b.value,"onUpdate:modelValue":i[6]||(i[6]=s=>b.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])])]),playground:k(()=>[d(o(A),{"available-voices":M.value,"generate-speech":U,"api-key-configured":B.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof w=="function"&&w(j);export{j as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as $,r as n,s as F,g as I,h as x,H as E,p as a,A as H,o as K,w as k,i as d,b as o,e as L}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as N}from"./providers-BQORs1wj.js";import{u as T}from"./speech-Bdg784LP.js";import{_ as p,a as z}from"./FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as A,a as G}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BWViBS8t.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";const R={flex:"~ col gap-4"},l="elevenlabs",_="eleven_multilingual_v2",j=$({__name:"elevenlabs",setup(q){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),m=n(1),u=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=T(),t=N(),{providers:C}=F(t),{t:r}=I(),B=x(()=>{var e;return!!((e=C.value[l])!=null&&e.apiKey)}),M=x(()=>y.availableVoices[l]||[]);async function U(e,i,s){const P=t.getProviderInstance(l);if(!P)throw new Error("Failed to initialize speech provider");const S=t.getProviderConfig(l),h=S.model||_;return await y.speech(P,h,e,i,{...S,...V})}return E(async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)}),a(v,async()=>{const e=t.getProviderConfig(l);e.pitch=v.value}),a(m,async()=>{const e=t.getProviderConfig(l);e.speed=m.value}),a(u,async()=>{const e=t.getProviderConfig(l);e.volume=u.value}),a(f,async()=>{const e=t.getProviderConfig(l);e.style=f.value}),a(c,async()=>{const e=t.getProviderConfig(l);e.stability=c.value}),a(g,async()=>{const e=t.getProviderConfig(l);e.similarityBoost=g.value}),a(b,async()=>{const e=t.getProviderConfig(l);e.useSpeakerBoost=b.value}),a(C,async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(K(),H(o(G),{"provider-id":l,"default-model":_,"additional-settings":V},{"voice-settings":k(()=>[L("div",R,[d(o(p),{modelValue:v.value,"onUpdate:modelValue":i[0]||(i[0]=s=>v.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=s=>m.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:u.value,"onUpdate:modelValue":i[2]||(i[2]=s=>u.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:f.value,"onUpdate:modelValue":i[3]||(i[3]=s=>f.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:c.value,"onUpdate:modelValue":i[4]||(i[4]=s=>c.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:g.value,"onUpdate:modelValue":i[5]||(i[5]=s=>g.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(z),{modelValue:b.value,"onUpdate:modelValue":i[6]||(i[6]=s=>b.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])])]),playground:k(()=>[d(o(A),{"available-voices":M.value,"generate-speech":U,"api-key-configured":B.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof w=="function"&&w(j);export{j as default}; diff --git a/assets/emotions-DGMgThVY.js b/assets/emotions-DPYTh_0x.js similarity index 73% rename from assets/emotions-DGMgThVY.js rename to assets/emotions-DPYTh_0x.js index 059b70ee39c2818df3f65245a75eb538ccf2edbd..22624ecc51e5103dadca5eeb46b1eec91bf35525 100644 --- a/assets/emotions-DGMgThVY.js +++ b/assets/emotions-DPYTh_0x.js @@ -1 +1 @@ -import{u as _}from"./queue-BjJ4HvBx.js";import{a as k,l as b}from"./queues-JqhmoK_1.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as x}from"./Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js";import{d as h,r,c as s,o as t,e,i as w,b as M,t as d,F as p,l as f}from"./index-Bo-ykojl.js";import"./mini_xsschema-f5xAZ6yD.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js";const V={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},E={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},Q={"w-full":"",flex:"","flex-row":"","gap-4":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},B={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},$=h({__name:"emotions",setup(P){const l=r(""),c=r([]),i=r([]),u=r(!1),g=_({handlers:[async a=>{i.value.push(a.data)}]}),m=k(g);function v(){u.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(b),l.value="",u.value=!1}return(a,o)=>(t(),s("div",V,[e("div",y,[w(M(x),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",E,d(u.value?"Processing...":"Send"),1)]),e("div",Q,[e("div",S,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(p,null,f(c.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))]),e("div",B,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(p,null,f(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{$ as default}; +import{u as _}from"./queue-2ASK7l5s.js";import{a as k,l as b}from"./queues-B3H1SS53.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as x}from"./Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js";import{d as h,r,c as s,o as t,e,i as w,b as M,t as d,F as p,l as f}from"./index-1_q7hlhr.js";import"./mini_xsschema-f5xAZ6yD.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js";const V={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},E={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},Q={"w-full":"",flex:"","flex-row":"","gap-4":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},B={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},$=h({__name:"emotions",setup(P){const l=r(""),c=r([]),i=r([]),u=r(!1),g=_({handlers:[async a=>{i.value.push(a.data)}]}),m=k(g);function v(){u.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(b),l.value="",u.value=!1}return(a,o)=>(t(),s("div",V,[e("div",y,[w(M(x),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",E,d(u.value?"Processing...":"Send"),1)]),e("div",Q,[e("div",S,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(p,null,f(c.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))]),e("div",B,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(p,null,f(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{$ as default}; diff --git a/assets/featherless-ai-BO90hbe6.js b/assets/featherless-ai-BrkEqk4n.js similarity index 66% rename from assets/featherless-ai-BO90hbe6.js rename to assets/featherless-ai-BrkEqk4n.js index d0629e70eee2b5a44494f5fd371e5821520c6f74..6b4a7a797efd055f1d02d0c83ad04eb75fb25eb4 100644 --- a/assets/featherless-ai-BO90hbe6.js +++ b/assets/featherless-ai-BrkEqk4n.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as U,g as V,S as k,s as y,h as v,H as $,p as K,A as w,o as S,w as u,i as l,b as t}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const a="featherless-ai",C=U({__name:"featherless-ai",setup(I){const{t:m}=V(),b=k(),d=x(),{providers:o}=y(d),n=v(()=>d.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}});$(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return S(),w(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=h=>r.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as U,g as V,S as k,s as y,h as v,H as $,p as K,A as w,o as S,w as u,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const a="featherless-ai",C=U({__name:"featherless-ai",setup(I){const{t:m}=V(),b=k(),d=x(),{providers:o}=y(d),n=v(()=>d.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}});$(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return S(),w(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=h=>r.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/filter-message-DNtgg60R.js b/assets/filter-message-Qm-9DQxR.js similarity index 75% rename from assets/filter-message-DNtgg60R.js rename to assets/filter-message-Qm-9DQxR.js index dd058514107fb278d48c90d778e3b7f343e54c29..5c12324814fd7439d0756a67a1f1416d53a4192d 100644 --- a/assets/filter-message-DNtgg60R.js +++ b/assets/filter-message-Qm-9DQxR.js @@ -1 +1 @@ -import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js";import{d as g,r as c,c as v,o as _,e as o,i as b,b as x,t as d}from"./index-Bo-ykojl.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},k={flex:"","flex-row":"","gap-2":""},w={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},C=g({__name:"filter-message",setup(M){const s=c(""),u=c(!1),r=c({content:""});async function f(i){return new Promise(e=>setTimeout(e,i))}async function p(){u.value=!0;const i=s.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let t="literal",l="";for(const a of i){await f(50);let n=t;a==="<"?n="special":a===">"&&(n="literal"),t==="literal"&&n==="special"&&(r.value.content+=l,l=""),t==="special"&&n==="literal"&&(l=""),t==="literal"&&n==="literal"&&(r.value.content+=a,l=""),t=n}l&&(r.value.content+=l),s.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[o("div",k,[b(x(m),{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=t=>s.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),o("button",w,d(u.value?"Processing...":"Send"),1)]),o("div",V,[e[1]||(e[1]=o("h3",{"font-semibold":""}," Streaming Message ",-1)),o("div",null,d(r.value.content),1)])]))}});export{C as default}; +import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js";import{d as g,r as c,c as v,o as _,e as o,i as b,b as x,t as d}from"./index-1_q7hlhr.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},k={flex:"","flex-row":"","gap-2":""},w={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},C=g({__name:"filter-message",setup(M){const s=c(""),u=c(!1),r=c({content:""});async function f(i){return new Promise(e=>setTimeout(e,i))}async function p(){u.value=!0;const i=s.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let t="literal",l="";for(const a of i){await f(50);let n=t;a==="<"?n="special":a===">"&&(n="literal"),t==="literal"&&n==="special"&&(r.value.content+=l,l=""),t==="special"&&n==="literal"&&(l=""),t==="literal"&&n==="literal"&&(r.value.content+=a,l=""),t=n}l&&(r.value.content+=l),s.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[o("div",k,[b(x(m),{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=t=>s.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),o("button",w,d(u.value?"Processing...":"Send"),1)]),o("div",V,[e[1]||(e[1]=o("h3",{"font-semibold":""}," Streaming Message ",-1)),o("div",null,d(r.value.content),1)])]))}});export{C as default}; diff --git a/assets/fireworks-ai-DInAhDwP.js b/assets/fireworks-ai-BS2-0VT-.js similarity index 66% rename from assets/fireworks-ai-DInAhDwP.js rename to assets/fireworks-ai-BS2-0VT-.js index cf337c94010f9300ece5f2fb50b2d112c27cee8e..dbc2b7c175dc9169b5251bd9ce8e631a1ff06746 100644 --- a/assets/fireworks-ai-DInAhDwP.js +++ b/assets/fireworks-ai-BS2-0VT-.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as w,g as U,S as V,s as y,h as c,H as $,p as K,A as h,o as S,w as u,i as l,b as t}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const a="fireworks-ai",C=w({__name:"fireworks-ai",setup(I){const{t:m}=U(),b=V(),d=x(),{providers:o}=y(d),n=c(()=>d.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}}),s=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,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return S(),h(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as w,g as U,S as V,s as y,h as c,H as $,p as K,A as h,o as S,w as u,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const a="fireworks-ai",C=w({__name:"fireworks-ai",setup(I){const{t:m}=U(),b=V(),d=x(),{providers:o}=y(d),n=c(()=>d.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}}),s=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,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return S(),h(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/google-generative-ai-WAiPtqV3.js b/assets/google-generative-ai-CSuDyEtU.js similarity index 69% rename from assets/google-generative-ai-WAiPtqV3.js rename to assets/google-generative-ai-CSuDyEtU.js index d14dd5e42ce0ae9801db2225bac994d613e17b50..6e51f2659767260e08bac8fbd1dd1db82789dc94 100644 --- a/assets/google-generative-ai-WAiPtqV3.js +++ b/assets/google-generative-ai-CSuDyEtU.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as U,g as k,S as V,s as y,h as v,H as $,p as K,A as S,o as w,w as p,i as l,b as t}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as G,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as R,a as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as f}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const e="google-generative-ai",C=U({__name:"google-generative-ai",setup(I){const{t:m}=k(),_=V(),c=x(),{providers:a}=y(c),u=v(()=>c.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}}),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});$(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function b(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return w(),S(t(B),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=u.value)==null?void 0:g.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[l(t(z),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":((n=u.value)==null?void 0:n.localizedName)||"Google",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(G),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=n=>r.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof f=="function"&&f(C);export{C as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as U,g as k,S as V,s as y,h as v,H as $,p as K,A as S,o as w,w as p,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as G,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as R,a as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as f}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const e="google-generative-ai",C=U({__name:"google-generative-ai",setup(I){const{t:m}=k(),_=V(),c=x(),{providers:a}=y(c),u=v(()=>c.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}}),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});$(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function b(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return w(),S(t(B),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=u.value)==null?void 0:g.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[l(t(z),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":((n=u.value)==null?void 0:n.localizedName)||"Google",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(G),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=n=>r.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof f=="function"&&f(C);export{C as default}; diff --git a/assets/image-RONbLfX7.js b/assets/image-BxsLSR2D.js similarity index 95% rename from assets/image-RONbLfX7.js rename to assets/image-BxsLSR2D.js index c48021f8e250ca77b2ce9a7d5a28234959ffb6dd..e895a619f6d5d3ba4e2196208ca4d8ab285ccaa6 100644 --- a/assets/image-RONbLfX7.js +++ b/assets/image-BxsLSR2D.js @@ -1,2 +1,2 @@ -import{d as _,r as c,U as y,c as d,o as u,e as a,j as x,t as v,b,_ as w}from"./index-Bo-ykojl.js";const U={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},h={key:0},C=["src"],R={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},k=_({__name:"image",setup(D){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(s){return new Promise((e,o)=>{const t=new FileReader;t.onload=r=>{var l,i;e(((i=(l=r.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=r=>{o(r)},t.readAsDataURL(s)})}async function f(s){var t;const o=(t=s.target.files)==null?void 0:t[0];if(o){p.value=o;const r=await m(o);n.value=r}}return(s,e)=>(u(),d("div",null,[a("label",U,[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,C),a("pre",R," "+v(n.value)+` +import{d as _,r as c,U as y,c as d,o as u,e as a,j as x,t as v,b,_ as w}from"./index-1_q7hlhr.js";const U={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},h={key:0},C=["src"],R={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},k=_({__name:"image",setup(D){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(s){return new Promise((e,o)=>{const t=new FileReader;t.onload=r=>{var l,i;e(((i=(l=r.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=r=>{o(r)},t.readAsDataURL(s)})}async function f(s){var t;const o=(t=s.target.files)==null?void 0:t[0];if(o){p.value=o;const r=await m(o);n.value=r}}return(s,e)=>(u(),d("div",null,[a("label",U,[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,C),a("pre",R," "+v(n.value)+` `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>b(g)())}," Copy Data URL ")])):x("",!0)]))}}),B=w(k,[["__scopeId","data-v-7edd53e6"]]);export{B as default}; diff --git a/assets/index-Bo-ykojl.js b/assets/index-1_q7hlhr.js similarity index 99% rename from assets/index-Bo-ykojl.js rename to assets/index-1_q7hlhr.js index dccfce6e08d9cff3bf65014957d402b05bf97bbf..46039fb9386f5594b5ca147773c44644061d7e33 100644 --- a/assets/index-Bo-ykojl.js +++ b/assets/index-1_q7hlhr.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-D_q7oHhj.js","assets/HeaderLink-CATmmLWn.js","assets/HeaderLink-DsxHr3rn.css","assets/settings-CUx3erI_.js","assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js","assets/Stage-D_kYuMHe.css","assets/three-vrm-animation.module-CbeIjn7h.js","assets/mcp-Ce-wxTN6.js","assets/mini_xsschema-f5xAZ6yD.js","assets/providers-B3p38pBl.js","assets/index-LHmcipjy.js","assets/Select.vue_vue_type_style_index_0_lang-CSoknWgh.js","assets/floating-ui.core-CgBsuaUc.js","assets/Select-X4vGC3oO.css","assets/index-9Uj6tS34.js","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/speech-Br7XDY4_.js","assets/queue-BjJ4HvBx.js","assets/queues-JqhmoK_1.js","assets/index-YUUT4m-_.js","assets/airi-card-Vf6km3w_.js","assets/consciousness-DjkUTNrC.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js","assets/Model.vue_vue_type_script_setup_true_lang-6CsRcxL-.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js","assets/index-D2UJ2Jls.js","assets/Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js","assets/route-block-B_A1xBdJ.js","assets/index-C6i1VIKD.css","assets/background-remove-Z6_DGmnH.js","assets/InputFile.vue_vue_type_script_setup_true_lang-CWw-Ysae.js","assets/chat-Cn2Q3Ifg.js","assets/image-RONbLfX7.js","assets/image-BhuwcwI9.css","assets/vibrant-BcTuel1R.js","assets/browser-CkchkNbv.js","assets/queue-BnZfFFfY.js","assets/index-DIv7gjQz.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-Vav3WbNP.js","assets/index-rLJvnp0C.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-CHDpOqJ6.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-B3_Iawdo.js","assets/index-DmpthJxW.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-Irw2DXRd.js","assets/CardDetailDialog-BMYdUjFX.js","assets/CardListItem-B1DYef5g.js","assets/DeleteCardDialog-Cc6M_Ghk.js","assets/index-D50uqwV2.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-cX_hB6ek.js","assets/index-BVitw2V7.css","assets/index-DvEiyc1a.js","assets/index-BDsSm1mO.js","assets/useIconAnimation-CY9TceXA.js","assets/index-rlpEp8ML.css","assets/index-DGpPP4PM.js","assets/IconStatusItem-CU771Upv.js","assets/consciousness-BX3nIDDD.js","assets/RadioCardSimple-C6azzpaa.js","assets/Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js","assets/memory-long-term-C9qQ7wym.js","assets/memory-short-term-D3escvKk.js","assets/speech-B9N_ypxE.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js","assets/FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js","assets/Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js","assets/index-BidQVtNJ.js","assets/alibaba-cloud-model-studio-CL38yAmK.js","assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BoWb4lIe.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js","assets/anthropic-amGUxRCV.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js","assets/cloudflare-workers-ai-GvJq8p2T.js","assets/deepseek-ByIJ-ylP.js","assets/elevenlabs-4FFnpr6K.js","assets/featherless-ai-BO90hbe6.js","assets/fireworks-ai-DInAhDwP.js","assets/google-generative-ai-WAiPtqV3.js","assets/microsoft-speech-CW3_aRMu.js","assets/mistral-ai-CSFCKOrv.js","assets/moonshot-ai-CsgPmibd.js","assets/novita-ai-0cbReYty.js","assets/ollama-NI_J41q3.js","assets/openai-BgJcu_8g.js","assets/openrouter-ai-DvGzxRQB.js","assets/together-ai-Dra_8Ga-.js","assets/volcengine-DZN8hofQ.js","assets/xai-BouUN5al.js","assets/index-qpRnEVwM.js","assets/filter-message-DNtgg60R.js","assets/delays-BiINGcB6.js","assets/emotions-DGMgThVY.js","assets/messages-BWoKmgZG.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-CeR2EX6F.js","assets/HeaderLink-D3zUgdpF.js","assets/HeaderLink-DsxHr3rn.css","assets/settings-qMaYBwVH.js","assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js","assets/Stage-D_kYuMHe.css","assets/three-vrm-animation.module-CtUkMEcn.js","assets/mcp-DcvIwSEe.js","assets/mini_xsschema-f5xAZ6yD.js","assets/providers-BQORs1wj.js","assets/index-LHmcipjy.js","assets/Select.vue_vue_type_style_index_0_lang-BNsd3INm.js","assets/floating-ui.core-CgBsuaUc.js","assets/Select-X4vGC3oO.css","assets/index-D-bLOGGQ.js","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/speech-Bdg784LP.js","assets/queue-2ASK7l5s.js","assets/queues-B3H1SS53.js","assets/index-YUUT4m-_.js","assets/airi-card-CFCqiAzX.js","assets/consciousness-esOkXpB1.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js","assets/Model.vue_vue_type_script_setup_true_lang-DoV2Qdhe.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js","assets/index-BX7nlSld.js","assets/Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js","assets/route-block-B_A1xBdJ.js","assets/index-C6i1VIKD.css","assets/background-remove-D0LHHV4b.js","assets/InputFile.vue_vue_type_script_setup_true_lang-DsrPsbsJ.js","assets/chat-CAoffe0W.js","assets/image-BxsLSR2D.js","assets/image-BhuwcwI9.css","assets/vibrant-C_BHDD4j.js","assets/browser-CkchkNbv.js","assets/queue-DT3alulg.js","assets/index-QlmGg2mr.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-tDvrftik.js","assets/index-DZHRHxrd.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DLR-50Jh.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-Beo1SYnL.js","assets/index-CmOAxAkQ.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-qVLsovLx.js","assets/CardDetailDialog-DAWUrvKq.js","assets/CardListItem-CZfNqIRm.js","assets/DeleteCardDialog-DgtK6LD9.js","assets/index-uIiqDbdm.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-B9HHyio1.js","assets/index-BVitw2V7.css","assets/index-ru1ciun_.js","assets/index-8sqTduK0.js","assets/useIconAnimation-rMzGkkyX.js","assets/index-rlpEp8ML.css","assets/index-CRmwnLFA.js","assets/IconStatusItem-Z8CeAcrh.js","assets/consciousness-CnNlPxQn.js","assets/RadioCardSimple-DJEw3oE4.js","assets/Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js","assets/memory-long-term-BwMIGexr.js","assets/memory-short-term-BW4nzTNl.js","assets/speech-BypMqt94.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js","assets/FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js","assets/Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js","assets/index-JZi43ROx.js","assets/alibaba-cloud-model-studio-Cro6QMhw.js","assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BWViBS8t.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js","assets/anthropic-Cbc4_CUj.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js","assets/cloudflare-workers-ai-eBT-UXSj.js","assets/deepseek-BguEBtU6.js","assets/elevenlabs-DvxODrlh.js","assets/featherless-ai-BrkEqk4n.js","assets/fireworks-ai-BS2-0VT-.js","assets/google-generative-ai-CSuDyEtU.js","assets/microsoft-speech-7XEJGMst.js","assets/mistral-ai-CH5fVxsz.js","assets/moonshot-ai-1DTwpN3B.js","assets/novita-ai-Bb31wSLB.js","assets/ollama-Bsoe-G-i.js","assets/openai-Ball6DG9.js","assets/openrouter-ai-BElqgb6j.js","assets/together-ai-B3OQea2r.js","assets/volcengine-BgioB2-t.js","assets/xai-CsHkk6is.js","assets/index-DHnlC1gY.js","assets/filter-message-Qm-9DQxR.js","assets/delays-r3Br_TGC.js","assets/emotions-DPYTh_0x.js","assets/messages-lR_ZzWbE.js"])))=>i.map(i=>d[i]); var sC=Object.defineProperty;var rC=(n,e,t)=>e in n?sC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var fi=(n,e,t)=>rC(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 oC="modulepreload",aC=function(n){return"/"+n},mv={},je=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(c=>{if(c=aC(c),c in mv)return;mv[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":oC,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((d,p)=>{h.addEventListener("load",d),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}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.14 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -3846,11 +3846,11 @@ void main() { * pinia v3.0.2 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let Dw;const Xd=n=>Dw=n,Ow=Symbol();function $g(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var zl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(zl||(zl={}));function zz(){const n=b0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=w0({install(r){Xd(s),s._a=r,r.provide(Ow,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 Nw=()=>{};function bx(n,e,t,i=Nw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&qh()&&x0(s),s}function ta(n,...e){n.slice().forEach(t=>{t(...e)})}const Vz=n=>n(),xx=Symbol(),xm=Symbol();function qg(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];$g(s)&&$g(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Ls(i)?n[t]=qg(s,i):n[t]=i}return n}const Hz=Symbol();function Gz(n){return!$g(n)||!Object.prototype.hasOwnProperty.call(n,Hz)}const{assign:rr}=Object;function Wz(n){return!!(Pt(n)&&n.effect)}function Xz(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=mS(t.state.value[n]);return rr(u,r,Object.keys(o||{}).reduce((f,h)=>(f[h]=w0(Me(()=>{Xd(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=Uw(n,c,e,t,i,!0),l}function Uw(n,e,t={},i,s,r){let o;const a=rr({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;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:zl.patchFunction,storeId:n,events:d}):(qg(i.state.value[n],P),x={type:zl.patchObject,payload:P,storeId:n,events:d});const M=_=Symbol();Ar().then(()=>{_===M&&(c=!0)}),u=!0,ta(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(D=>{rr(D,M)})}:Nw;function v(){o.stop(),f=[],h=[],i._s.delete(n)}const b=(P,x="")=>{if(xx in P)return P[xm]=x,P;const M=function(){Xd(i);const D=Array.from(arguments),z=[],H=[];function G(te){z.push(te)}function ee(te){H.push(te)}ta(h,{args:D,name:M[xm],store:E,after:G,onError:ee});let j;try{j=P.apply(this&&this.$id===n?this:E,D)}catch(te){throw ta(H,te),te}return j instanceof Promise?j.then(te=>(ta(z,te),te)).catch(te=>(ta(H,te),Promise.reject(te))):(ta(z,j),j)};return M[xx]=!0,M[xm]=x,M},y={_p:i,$id:n,$onAction:bx.bind(null,h),$patch:g,$reset:m,$subscribe(P,x={}){const M=bx(f,P,x.detached,()=>D()),D=o.run(()=>Xe(()=>i.state.value[n],z=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:zl.direct,events:d},z)},rr({},l,x)));return M},$dispose:v},E=xi(y);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||Vz)(()=>i._e.run(()=>(o=b0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!Wz(x)||Ls(x))r||(p&&Gz(x)&&(Pt(x)?x.value=p[P]:qg(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 rr(E,S),rr(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{rr(x,P)})}}),i._p.forEach(P=>{rr(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 $z(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Rc();return o=o||(l?gn(Ow,null):null),o&&Xd(o),o=Dw,o._s.has(n)||(s?Uw(n,e,i,o):Xz(n,i,o)),o._s.get(n)}return r.$id=n,r}function qz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Me({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Ls(s))&&(t[i]=gS(n,i))}return t}const Yz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>je(()=>import("./default-D_q7oHhj.js"),__vite__mapDeps([0,1,2])),"/src/layouts/settings.vue":()=>je(()=>import("./settings-CUx3erI_.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2])),"/src/layouts/stage.vue":()=>je(()=>import("./stage-Csnj3vRj.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,h;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[(h=o.meta)==null?void 0:h.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! + */let Dw;const Xd=n=>Dw=n,Ow=Symbol();function $g(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var zl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(zl||(zl={}));function zz(){const n=b0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=w0({install(r){Xd(s),s._a=r,r.provide(Ow,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 Nw=()=>{};function bx(n,e,t,i=Nw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&qh()&&x0(s),s}function ta(n,...e){n.slice().forEach(t=>{t(...e)})}const Vz=n=>n(),xx=Symbol(),xm=Symbol();function qg(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];$g(s)&&$g(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Ls(i)?n[t]=qg(s,i):n[t]=i}return n}const Hz=Symbol();function Gz(n){return!$g(n)||!Object.prototype.hasOwnProperty.call(n,Hz)}const{assign:rr}=Object;function Wz(n){return!!(Pt(n)&&n.effect)}function Xz(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=mS(t.state.value[n]);return rr(u,r,Object.keys(o||{}).reduce((f,h)=>(f[h]=w0(Me(()=>{Xd(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=Uw(n,c,e,t,i,!0),l}function Uw(n,e,t={},i,s,r){let o;const a=rr({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;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:zl.patchFunction,storeId:n,events:d}):(qg(i.state.value[n],P),x={type:zl.patchObject,payload:P,storeId:n,events:d});const M=_=Symbol();Ar().then(()=>{_===M&&(c=!0)}),u=!0,ta(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(D=>{rr(D,M)})}:Nw;function v(){o.stop(),f=[],h=[],i._s.delete(n)}const b=(P,x="")=>{if(xx in P)return P[xm]=x,P;const M=function(){Xd(i);const D=Array.from(arguments),z=[],H=[];function G(te){z.push(te)}function ee(te){H.push(te)}ta(h,{args:D,name:M[xm],store:E,after:G,onError:ee});let j;try{j=P.apply(this&&this.$id===n?this:E,D)}catch(te){throw ta(H,te),te}return j instanceof Promise?j.then(te=>(ta(z,te),te)).catch(te=>(ta(H,te),Promise.reject(te))):(ta(z,j),j)};return M[xx]=!0,M[xm]=x,M},y={_p:i,$id:n,$onAction:bx.bind(null,h),$patch:g,$reset:m,$subscribe(P,x={}){const M=bx(f,P,x.detached,()=>D()),D=o.run(()=>Xe(()=>i.state.value[n],z=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:zl.direct,events:d},z)},rr({},l,x)));return M},$dispose:v},E=xi(y);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||Vz)(()=>i._e.run(()=>(o=b0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!Wz(x)||Ls(x))r||(p&&Gz(x)&&(Pt(x)?x.value=p[P]:qg(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 rr(E,S),rr(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{rr(x,P)})}}),i._p.forEach(P=>{rr(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 $z(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Rc();return o=o||(l?gn(Ow,null):null),o&&Xd(o),o=Dw,o._s.has(n)||(s?Uw(n,e,i,o):Xz(n,i,o)),o._s.get(n)}return r.$id=n,r}function qz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Me({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Ls(s))&&(t[i]=gS(n,i))}return t}const Yz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>je(()=>import("./default-CeR2EX6F.js"),__vite__mapDeps([0,1,2])),"/src/layouts/settings.vue":()=>je(()=>import("./settings-qMaYBwVH.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2])),"/src/layouts/stage.vue":()=>je(()=>import("./stage-DvQ3MPQT.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,h;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[(h=o.meta)==null?void 0:h.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! * vue-router v4.5.1 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const ia=typeof document<"u";function Fw(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function jz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&Fw(n.default)}const Mt=Object.assign;function Mm(n,e){const t={};for(const i in e){const s=e[i];t[i]=Vi(s)?s.map(n):n(s)}return t}const Vl=()=>{},Vi=Array.isArray,kw=/#/g,Kz=/&/g,Zz=/\//g,Jz=/=/g,Qz=/\?/g,Bw=/\+/g,eV=/%5B/g,tV=/%5D/g,zw=/%5E/g,nV=/%60/g,Vw=/%7B/g,iV=/%7C/g,Hw=/%7D/g,sV=/%20/g;function W_(n){return encodeURI(""+n).replace(iV,"|").replace(eV,"[").replace(tV,"]")}function rV(n){return W_(n).replace(Vw,"{").replace(Hw,"}").replace(zw,"^")}function Yg(n){return W_(n).replace(Bw,"%2B").replace(sV,"+").replace(kw,"%23").replace(Kz,"%26").replace(nV,"`").replace(Vw,"{").replace(Hw,"}").replace(zw,"^")}function oV(n){return Yg(n).replace(Jz,"%3D")}function aV(n){return W_(n).replace(kw,"%23").replace(Qz,"%3F")}function lV(n){return n==null?"":aV(n).replace(Zz,"%2F")}function xc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const cV=/\/$/,uV=n=>n.replace(cV,"");function Sm(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=pV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:xc(o)}}function fV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function Mx(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function hV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ia(e.matched[i],t.matched[s])&&Gw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ia(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function Gw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!dV(n[t],e[t]))return!1;return!0}function dV(n,e){return Vi(n)?Sx(n,e):Vi(e)?Sx(e,n):n===e}function Sx(n,e){return Vi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function pV(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 ir={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Mc;(function(n){n.pop="pop",n.push="push"})(Mc||(Mc={}));var Hl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Hl||(Hl={}));function mV(n){if(!n)if(ia){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),uV(n)}const gV=/^[^#]+#/;function _V(n,e){return n.replace(gV,"#")+e}function vV(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 $d=()=>({left:window.scrollX,top:window.scrollY});function yV(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=vV(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 Ex(n,e){return(history.state?history.state.position-e:-1)+n}const jg=new Map;function bV(n,e){jg.set(n,e)}function xV(n){const e=jg.get(n);return jg.delete(n),e}let MV=()=>location.protocol+"//"+location.host;function Ww(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),Mx(l,"")}return Mx(t,n)+i+s}function SV(n,e,t,i){let s=[],r=[],o=null;const a=({state:h})=>{const d=Ww(n,location),p=t.value,_=e.value;let g=0;if(h){if(t.value=d,e.value=h,o&&o===p){o=null;return}g=_?h.position-_.position:0}else i(d);s.forEach(m=>{m(t.value,p,{delta:g,type:Mc.pop,direction:g?g>0?Hl.forward:Hl.back:Hl.unknown})})};function l(){o=t.value}function c(h){s.push(h);const d=()=>{const p=s.indexOf(h);p>-1&&s.splice(p,1)};return r.push(d),d}function u(){const{history:h}=window;h.state&&h.replaceState(Mt({},h.state,{scroll:$d()}),"")}function f(){for(const h of r)h();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 Tx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?$d():null}}function EV(n){const{history:e,location:t}=window,i={value:Ww(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("#"),h=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:MV()+n+l;try{e[u?"replaceState":"pushState"](c,"",h),s.value=c}catch(d){console.error(d),t[u?"replace":"assign"](h)}}function o(l,c){const u=Mt({},e.state,Tx(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:$d()});r(u.current,u,!0);const f=Mt({},Tx(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 TV(n){n=mV(n);const e=EV(n),t=SV(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:_V.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 wV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),TV(n)}function AV(n){return typeof n=="string"||n&&typeof n=="object"}function Xw(n){return typeof n=="string"||typeof n=="symbol"}const $w=Symbol("");var wx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(wx||(wx={}));function La(n,e){return Mt(new Error,{type:n,[$w]:!0},e)}function bs(n,e){return n instanceof Error&&$w in n&&(e==null||!!(n.type&e))}const Ax="[^/]+?",CV={sensitive:!1,strict:!1,start:!0,end:!0},RV=/[.+*?^${}()[\]/\\]/g;function PV(n,e){const t=Mt({},CV,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 qw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const LV={type:0,value:""},DV=/[a-zA-Z0-9_]/;function OV(n){if(!n)return[[]];if(n==="/")return[[LV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(d){throw new Error(`ERR (${t})/"${c}": ${d}`)}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 h(){c+=l}for(;a{o(b)}:Vl}function o(f){if(Xw(f)){const h=i.get(f);h&&(i.delete(f),t.splice(t.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=t.indexOf(f);h>-1&&(t.splice(h,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 h=BV(f,t);t.splice(h,0,f),f.record.name&&!Ix(f)&&i.set(f.record.name,f)}function c(f,h){let d,p={},_,g;if("name"in f&&f.name){if(d=i.get(f.name),!d)throw La(1,{location:f});g=d.record.name,p=Mt(Rx(h.params,d.keys.filter(b=>!b.optional).concat(d.parent?d.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Rx(f.params,d.keys.map(b=>b.name))),_=d.stringify(p)}else if(f.path!=null)_=f.path,d=t.find(b=>b.re.test(_)),d&&(p=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(b=>b.re.test(h.path)),!d)throw La(1,{location:f,currentLocation:h});g=d.record.name,p=Mt({},h.params,f.params),_=d.stringify(p)}const m=[];let v=d;for(;v;)m.unshift(v.record),v=v.parent;return{name:g,path:_,params:p,matched:m,meta:kV(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 Rx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Px(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:FV(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 FV(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 Ix(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function kV(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Lx(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function BV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;qw(n,e[r])<0?i=r:t=r+1}const s=zV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function zV(n){let e=n;for(;e=e.parent;)if(Yw(e)&&qw(n,e)===0)return e}function Yw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function VV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Yg(r)):[i&&Yg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function HV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Vi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const GV=Symbol(""),Ox=Symbol(""),qd=Symbol(""),X_=Symbol(""),Kg=Symbol("");function ul(){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 fr(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(La(4,{from:t,to:e})):h instanceof Error?l(h):AV(h)?l(La(2,{from:e,to:h})):(o&&i.enterCallbacks[s]===o&&typeof h=="function"&&o.push(h),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(h=>l(h))})}function Em(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(Fw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(fr(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=jz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&fr(d,t,i,o,a,s)()}))}}return r}function Nx(n){const e=gn(qd),t=gn(X_),i=Me(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Me(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const h=f.findIndex(Ia.bind(null,u));if(h>-1)return h;const d=Ux(l[c-2]);return c>1&&Ux(u)===d&&f[f.length-1].path!==d?f.findIndex(Ia.bind(null,l[c-2])):h}),r=Me(()=>s.value>-1&&YV(t.params,i.value.params)),o=Me(()=>s.value>-1&&s.value===t.matched.length-1&&Gw(t.params,i.value.params));function a(l={}){if(qV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Vl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Me(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function WV(n){return n.length===1?n[0]:n}const XV=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"},viewTransition:Boolean},useLink:Nx,setup(n,{slots:e}){const t=xi(Nx(n)),{options:i}=gn(qd),s=Me(()=>({[Fx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Fx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&WV(e.default(t));return n.custom?r:ks("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),$V=XV;function qV(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 YV(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(!Vi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Ux(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Fx=(n,e,t)=>n??e??t,jV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=gn(Kg),s=Me(()=>n.route||i.value),r=gn(Ox,0),o=Me(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Me(()=>s.value.matched[o.value]);gr(Ox,Me(()=>o.value+1)),gr(GV,a),gr(Kg,s);const l=et();return Xe(()=>[l.value,a.value,n.name],([c,u,f],[h,d,p])=>{u&&(u.instances[f]=c,d&&d!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=d.leaveGuards),u.updateGuards.size||(u.updateGuards=d.updateGuards))),c&&u&&(!d||!Ia(u,d)||!h)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,h=f&&f.components[u];if(!h)return kx(t.default,{Component:h,route:c});const d=f.props[u],p=d?d===!0?c.params:typeof d=="function"?d(c):d:null,g=ks(h,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return kx(t.default,{Component:g,route:c})||g}}});function kx(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const jw=jV;function KV(n){const e=UV(n.routes,n),t=n.parseQuery||VV,i=n.stringifyQuery||Dx,s=n.history,r=ul(),o=ul(),a=ul(),l=Oe(ir);let c=ir;ia&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Mm.bind(null,q=>""+q),f=Mm.bind(null,lV),h=Mm.bind(null,xc);function d(q,ae){let le,ce;return Xw(q)?(le=e.getRecordMatcher(q),ce=ae):ce=q,e.addRoute(ce,le)}function p(q){const ae=e.getRecordMatcher(q);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(q=>q.record)}function g(q){return!!e.getRecordMatcher(q)}function m(q,ae){if(ae=Mt({},ae||l.value),typeof q=="string"){const w=Sm(t,q,ae.path),$=e.resolve({path:w.path},ae),W=s.createHref(w.fullPath);return Mt(w,$,{params:h($.params),hash:xc(w.hash),redirectedFrom:void 0,href:W})}let le;if(q.path!=null)le=Mt({},q,{path:Sm(t,q.path,ae.path).path});else{const w=Mt({},q.params);for(const $ in w)w[$]==null&&delete w[$];le=Mt({},q,{params:f(w)}),ae.params=f(ae.params)}const ce=e.resolve(le,ae),He=q.hash||"";ce.params=u(h(ce.params));const U=fV(i,Mt({},q,{hash:rV(He),path:ce.path})),F=s.createHref(U);return Mt({fullPath:U,hash:He,query:i===Dx?HV(q.query):q.query||{}},ce,{redirectedFrom:void 0,href:F})}function v(q){return typeof q=="string"?Sm(t,q,l.value.path):Mt({},q)}function b(q,ae){if(c!==q)return La(8,{from:ae,to:q})}function y(q){return S(q)}function E(q){return y(Mt(v(q),{replace:!0}))}function T(q){const ae=q.matched[q.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ce=typeof le=="function"?le(q):le;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=v(ce):{path:ce},ce.params={}),Mt({query:q.query,hash:q.hash,params:ce.path!=null?{}:q.params},ce)}}function S(q,ae){const le=c=m(q),ce=l.value,He=q.state,U=q.force,F=q.replace===!0,w=T(le);if(w)return S(Mt(v(w),{state:typeof w=="object"?Mt({},He,w.state):He,force:U,replace:F}),ae||le);const $=le;$.redirectedFrom=ae;let W;return!U&&hV(i,ce,le)&&(W=La(16,{to:$,from:ce}),se(ce,ce,!0,!1)),(W?Promise.resolve(W):M($,ce)).catch(X=>bs(X)?bs(X,2)?X:be(X):J(X,$,ce)).then(X=>{if(X){if(bs(X,2))return S(Mt({replace:F},v(X.to),{state:typeof X.to=="object"?Mt({},He,X.to.state):He,force:U}),ae||$)}else X=z($,ce,!0,F,He);return D($,ce,X),X})}function P(q,ae){const le=b(q,ae);return le?Promise.reject(le):Promise.resolve()}function x(q){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(q):q()}function M(q,ae){let le;const[ce,He,U]=ZV(q,ae);le=Em(ce.reverse(),"beforeRouteLeave",q,ae);for(const w of ce)w.leaveGuards.forEach($=>{le.push(fr($,q,ae))});const F=P.bind(null,q,ae);return le.push(F),xe(le).then(()=>{le=[];for(const w of r.list())le.push(fr(w,q,ae));return le.push(F),xe(le)}).then(()=>{le=Em(He,"beforeRouteUpdate",q,ae);for(const w of He)w.updateGuards.forEach($=>{le.push(fr($,q,ae))});return le.push(F),xe(le)}).then(()=>{le=[];for(const w of U)if(w.beforeEnter)if(Vi(w.beforeEnter))for(const $ of w.beforeEnter)le.push(fr($,q,ae));else le.push(fr(w.beforeEnter,q,ae));return le.push(F),xe(le)}).then(()=>(q.matched.forEach(w=>w.enterCallbacks={}),le=Em(U,"beforeRouteEnter",q,ae,x),le.push(F),xe(le))).then(()=>{le=[];for(const w of o.list())le.push(fr(w,q,ae));return le.push(F),xe(le)}).catch(w=>bs(w,8)?w:Promise.reject(w))}function D(q,ae,le){a.list().forEach(ce=>x(()=>ce(q,ae,le)))}function z(q,ae,le,ce,He){const U=b(q,ae);if(U)return U;const F=ae===ir,w=ia?history.state:{};le&&(ce||F?s.replace(q.fullPath,Mt({scroll:F&&w&&w.scroll},He)):s.push(q.fullPath,He)),l.value=q,se(q,ae,le,F),be()}let H;function G(){H||(H=s.listen((q,ae,le)=>{if(!ge.listening)return;const ce=m(q),He=T(ce);if(He){S(Mt(He,{replace:!0,force:!0}),ce).catch(Vl);return}c=ce;const U=l.value;ia&&bV(Ex(U.fullPath,le.delta),$d()),M(ce,U).catch(F=>bs(F,12)?F:bs(F,2)?(S(Mt(v(F.to),{force:!0}),ce).then(w=>{bs(w,20)&&!le.delta&&le.type===Mc.pop&&s.go(-1,!1)}).catch(Vl),Promise.reject()):(le.delta&&s.go(-le.delta,!1),J(F,ce,U))).then(F=>{F=F||z(ce,U,!1),F&&(le.delta&&!bs(F,8)?s.go(-le.delta,!1):le.type===Mc.pop&&bs(F,20)&&s.go(-1,!1)),D(ce,U,F)}).catch(Vl)}))}let ee=ul(),j=ul(),te;function J(q,ae,le){be(q);const ce=j.list();return ce.length?ce.forEach(He=>He(q,ae,le)):console.error(q),Promise.reject(q)}function de(){return te&&l.value!==ir?Promise.resolve():new Promise((q,ae)=>{ee.add([q,ae])})}function be(q){return te||(te=!q,G(),ee.list().forEach(([ae,le])=>q?le(q):ae()),ee.reset()),q}function se(q,ae,le,ce){const{scrollBehavior:He}=n;if(!ia||!He)return Promise.resolve();const U=!le&&xV(Ex(q.fullPath,0))||(ce||!le)&&history.state&&history.state.scroll||null;return Ar().then(()=>He(q,ae,U)).then(F=>F&&yV(F)).catch(F=>J(F,q,ae))}const ye=q=>s.go(q);let Be;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:y,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:j.add,isReady:de,install(q){const ae=this;q.component("RouterLink",$V),q.component("RouterView",jw),q.config.globalProperties.$router=ae,Object.defineProperty(q.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),ia&&!Be&&l.value===ir&&(Be=!0,y(s.location).catch(He=>{}));const le={};for(const He in ir)Object.defineProperty(le,He,{get:()=>l.value[He],enumerable:!0});q.provide(qd,ae),q.provide(X_,fS(le)),q.provide(Kg,l);const ce=q.unmount;re.add(q),q.unmount=function(){re.delete(q),re.size<1&&(c=ir,H&&H(),H=null,l.value=ir,Be=!1,te=!1),ce()}}};function xe(q){return q.reduce((ae,le)=>ae.then(()=>x(le)),Promise.resolve())}return ge}function ZV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oIa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ia(c,l))||s.push(l))}return[t,i,s]}function JV(){return gn(qd)}function GG(n){return gn(X_)}const QV=[{path:"/",name:"/",component:()=>je(()=>import("./index-9Uj6tS34.js"),__vite__mapDeps([14,4,5,6,7,8,11,12,13,15,16,17,10,9,18,19,20,21,22,23,24,25,1,2,26,27,28,29])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>je(()=>import("./_...all_-CXzmHUmr.js"),[])},{path:"/audio",name:"/audio",component:()=>je(()=>import("./audio-CbuXl7xe.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>je(()=>import("./background-remove-Z6_DGmnH.js"),__vite__mapDeps([30,11,12,13,31]))},{path:"chat",name:"/devtools/chat",component:()=>je(()=>import("./chat-Cn2Q3Ifg.js"),__vite__mapDeps([32,20,10]))},{path:"image",name:"/devtools/image",component:()=>je(()=>import("./image-RONbLfX7.js"),__vite__mapDeps([33,34]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>je(()=>import("./vibrant-BcTuel1R.js"),__vite__mapDeps([35,11,12,13,31,36]))}]},{path:"/queue",name:"/queue",component:()=>je(()=>import("./queue-BnZfFFfY.js"),__vite__mapDeps([37,18]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>je(()=>import("./index-DIv7gjQz.js"),__vite__mapDeps([38,4,5,6,7,8,11,12,13,39,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>je(()=>import("./index-rLJvnp0C.js"),__vite__mapDeps([40,7,21,8,22,9,10,17,11,12,13,31,41,42,43,4,5,6,44,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>je(()=>import("./CardDetailDialog-BMYdUjFX.js"),__vite__mapDeps([45,41,42,43,12,4,5,6,7,21,8,22,9,10,17,11,13]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>je(()=>import("./CardListItem-B1DYef5g.js"),__vite__mapDeps([46,44,4,5,6,7,8,11,12,13]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>je(()=>import("./DeleteCardDialog-Cc6M_Ghk.js"),__vite__mapDeps([47,42,43,12]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>je(()=>import("./index-D50uqwV2.js"),__vite__mapDeps([48,4,5,6,7,8,11,12,13,49,25,23,43,28,50])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>je(()=>import("./index-DvEiyc1a.js"),__vite__mapDeps([51,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>je(()=>import("./index-BDsSm1mO.js"),__vite__mapDeps([52,4,5,24,6,7,8,11,12,13,36,49,25,23,43,53,28,54])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>je(()=>import("./index-DGpPP4PM.js"),__vite__mapDeps([55,4,5,6,7,8,56,11,12,13,39,53,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>je(()=>import("./consciousness-BX3nIDDD.js"),__vite__mapDeps([57,4,5,6,7,8,22,9,10,11,12,13,58,23,59,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>je(()=>import("./memory-long-term-C9qQ7wym.js"),__vite__mapDeps([60,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>je(()=>import("./memory-short-term-D3escvKk.js"),__vite__mapDeps([61,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>je(()=>import("./speech-B9N_ypxE.js"),__vite__mapDeps([62,63,4,5,11,12,13,6,7,8,9,10,17,64,59,65,27,58,23,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>je(()=>import("./index-BidQVtNJ.js"),__vite__mapDeps([66,4,5,6,7,8,9,10,56,11,12,13,53,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>je(()=>import("./alibaba-cloud-model-studio-CL38yAmK.js"),__vite__mapDeps([67,4,5,6,7,8,9,10,17,63,11,12,13,68,69,25,23,64,59,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>je(()=>import("./anthropic-amGUxRCV.js"),__vite__mapDeps([72,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>je(()=>import("./cloudflare-workers-ai-GvJq8p2T.js"),__vite__mapDeps([74,4,5,6,7,8,9,10,11,12,13,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>je(()=>import("./deepseek-ByIJ-ylP.js"),__vite__mapDeps([75,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>je(()=>import("./elevenlabs-4FFnpr6K.js"),__vite__mapDeps([76,4,5,6,7,8,9,10,17,63,11,12,13,68,69,25,23,64,59,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>je(()=>import("./featherless-ai-BO90hbe6.js"),__vite__mapDeps([77,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>je(()=>import("./fireworks-ai-DInAhDwP.js"),__vite__mapDeps([78,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>je(()=>import("./google-generative-ai-WAiPtqV3.js"),__vite__mapDeps([79,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>je(()=>import("./microsoft-speech-CW3_aRMu.js"),__vite__mapDeps([80,4,5,6,7,8,9,10,17,64,59,63,11,12,13,68,69,25,23,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>je(()=>import("./mistral-ai-CSFCKOrv.js"),__vite__mapDeps([81,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>je(()=>import("./moonshot-ai-CsgPmibd.js"),__vite__mapDeps([82,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>je(()=>import("./novita-ai-0cbReYty.js"),__vite__mapDeps([83,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"ollama",name:"/settings/providers/ollama",component:()=>je(()=>import("./ollama-NI_J41q3.js"),__vite__mapDeps([84,4,5,6,7,8,9,10,59,11,12,13,69,25,23,64,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai",name:"/settings/providers/openai",component:()=>je(()=>import("./openai-BgJcu_8g.js"),__vite__mapDeps([85,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>je(()=>import("./openrouter-ai-DvGzxRQB.js"),__vite__mapDeps([86,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>je(()=>import("./together-ai-Dra_8Ga-.js"),__vite__mapDeps([87,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>je(()=>import("./volcengine-DZN8hofQ.js"),__vite__mapDeps([88,4,5,6,7,8,9,10,17,64,59,63,11,12,13,68,69,25,23,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"xai",name:"/settings/providers/xai",component:()=>je(()=>import("./xai-BouUN5al.js"),__vite__mapDeps([89,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>je(()=>import("./index-qpRnEVwM.js"),__vite__mapDeps([90,53,7,8,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>je(()=>import("./filter-message-DNtgg60R.js"),__vite__mapDeps([91,11,12,13,65,27]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>je(()=>import("./delays-BiINGcB6.js"),__vite__mapDeps([92,26,19,8,18,6,11,12,13,65,27]))},{path:"emotions",name:"/test/queues/emotions",component:()=>je(()=>import("./emotions-DGMgThVY.js"),__vite__mapDeps([93,18,19,8,11,12,13,65,27]))},{path:"messages",name:"/test/queues/messages",component:()=>je(()=>import("./messages-BWoKmgZG.js"),__vite__mapDeps([94,18,19,8,11,12,13,65,27]))}]}]}],Kw=(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}}},e6={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},t6=n=>Kw(e6[n.toLowerCase()],6),n6=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,i6=n=>{let e;return(e=n.match(n6))?Kw(parseInt(e[1],16),e[1].length):void 0},_r="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Gl=`${_r}%`,$_=`(?:${_r}%|${_r})`,s6=`(?:${_r}(deg|grad|rad|turn)|${_r})`,Da="\\s*,\\s*",r6=new RegExp(`^rgba?\\(\\s*${_r}${Da}${_r}${Da}${_r}\\s*(?:,\\s*${$_}\\s*)?\\)$`),o6=new RegExp(`^rgba?\\(\\s*${Gl}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${$_}\\s*)?\\)$`),a6=n=>{let e={mode:"rgb"},t;if(t=n.match(r6))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(o6))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},l6=(n,e)=>n===void 0?void 0:typeof n!="object"?v6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,Zw=(n="rgb")=>e=>(e=l6(e,n))!==void 0?e.mode===n?e:Ji[e.mode][n]?Ji[e.mode][n](e):n==="rgb"?Ji[e.mode].rgb(e):Ji.rgb[n](Ji[e.mode].rgb(e)):void 0,Ji={},Jw={},Oh=[],Qw={},c6=n=>n,Et=n=>(Ji[n.mode]={...Ji[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Ji[e]||(Ji[e]={}),Ji[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=c6)}),Jw[n.mode]=n,(n.parse||[]).forEach(e=>{f6(e,n.mode)}),Zw(n.mode)),u6=n=>Jw[n],f6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Qw[n]=e}else typeof n=="function"&&Oh.indexOf(n)<0&&Oh.push(n)},Zg=/[^\x00-\x7F]|[a-zA-Z_]/,h6=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let $e=0;function uf(n){let e=n[$e],t=n[$e+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[$e+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Jg(n){if($e>=n.length)return!1;let e=n[$e];if(Zg.test(e))return!0;if(e==="-"){if(n.length-$e<2)return!1;let t=n[$e+1];return!!(t==="-"||Zg.test(t))}return!1}const d6={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function fl(n){let e="";if((n[$e]==="-"||n[$e]==="+")&&(e+=n[$e++]),e+=ff(n),n[$e]==="."&&/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n)),(n[$e]==="e"||n[$e]==="E")&&((n[$e+1]==="-"||n[$e+1]==="+")&&/\d/.test(n[$e+2])?e+=n[$e++]+n[$e++]+ff(n):/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n))),Jg(n)){let t=Nh(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*d6[t]}:void 0}return n[$e]==="%"?($e++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function ff(n){let e="";for(;/\d/.test(n[$e]);)e+=n[$e++];return e}function Nh(n){let e="";for(;$e{},Vi=Array.isArray,kw=/#/g,Kz=/&/g,Zz=/\//g,Jz=/=/g,Qz=/\?/g,Bw=/\+/g,eV=/%5B/g,tV=/%5D/g,zw=/%5E/g,nV=/%60/g,Vw=/%7B/g,iV=/%7C/g,Hw=/%7D/g,sV=/%20/g;function W_(n){return encodeURI(""+n).replace(iV,"|").replace(eV,"[").replace(tV,"]")}function rV(n){return W_(n).replace(Vw,"{").replace(Hw,"}").replace(zw,"^")}function Yg(n){return W_(n).replace(Bw,"%2B").replace(sV,"+").replace(kw,"%23").replace(Kz,"%26").replace(nV,"`").replace(Vw,"{").replace(Hw,"}").replace(zw,"^")}function oV(n){return Yg(n).replace(Jz,"%3D")}function aV(n){return W_(n).replace(kw,"%23").replace(Qz,"%3F")}function lV(n){return n==null?"":aV(n).replace(Zz,"%2F")}function xc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const cV=/\/$/,uV=n=>n.replace(cV,"");function Sm(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=pV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:xc(o)}}function fV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function Mx(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function hV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ia(e.matched[i],t.matched[s])&&Gw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ia(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function Gw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!dV(n[t],e[t]))return!1;return!0}function dV(n,e){return Vi(n)?Sx(n,e):Vi(e)?Sx(e,n):n===e}function Sx(n,e){return Vi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function pV(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 ir={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Mc;(function(n){n.pop="pop",n.push="push"})(Mc||(Mc={}));var Hl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Hl||(Hl={}));function mV(n){if(!n)if(ia){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),uV(n)}const gV=/^[^#]+#/;function _V(n,e){return n.replace(gV,"#")+e}function vV(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 $d=()=>({left:window.scrollX,top:window.scrollY});function yV(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=vV(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 Ex(n,e){return(history.state?history.state.position-e:-1)+n}const jg=new Map;function bV(n,e){jg.set(n,e)}function xV(n){const e=jg.get(n);return jg.delete(n),e}let MV=()=>location.protocol+"//"+location.host;function Ww(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),Mx(l,"")}return Mx(t,n)+i+s}function SV(n,e,t,i){let s=[],r=[],o=null;const a=({state:h})=>{const d=Ww(n,location),p=t.value,_=e.value;let g=0;if(h){if(t.value=d,e.value=h,o&&o===p){o=null;return}g=_?h.position-_.position:0}else i(d);s.forEach(m=>{m(t.value,p,{delta:g,type:Mc.pop,direction:g?g>0?Hl.forward:Hl.back:Hl.unknown})})};function l(){o=t.value}function c(h){s.push(h);const d=()=>{const p=s.indexOf(h);p>-1&&s.splice(p,1)};return r.push(d),d}function u(){const{history:h}=window;h.state&&h.replaceState(Mt({},h.state,{scroll:$d()}),"")}function f(){for(const h of r)h();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 Tx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?$d():null}}function EV(n){const{history:e,location:t}=window,i={value:Ww(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("#"),h=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:MV()+n+l;try{e[u?"replaceState":"pushState"](c,"",h),s.value=c}catch(d){console.error(d),t[u?"replace":"assign"](h)}}function o(l,c){const u=Mt({},e.state,Tx(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:$d()});r(u.current,u,!0);const f=Mt({},Tx(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 TV(n){n=mV(n);const e=EV(n),t=SV(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:_V.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 wV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),TV(n)}function AV(n){return typeof n=="string"||n&&typeof n=="object"}function Xw(n){return typeof n=="string"||typeof n=="symbol"}const $w=Symbol("");var wx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(wx||(wx={}));function La(n,e){return Mt(new Error,{type:n,[$w]:!0},e)}function bs(n,e){return n instanceof Error&&$w in n&&(e==null||!!(n.type&e))}const Ax="[^/]+?",CV={sensitive:!1,strict:!1,start:!0,end:!0},RV=/[.+*?^${}()[\]/\\]/g;function PV(n,e){const t=Mt({},CV,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 qw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const LV={type:0,value:""},DV=/[a-zA-Z0-9_]/;function OV(n){if(!n)return[[]];if(n==="/")return[[LV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(d){throw new Error(`ERR (${t})/"${c}": ${d}`)}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 h(){c+=l}for(;a{o(b)}:Vl}function o(f){if(Xw(f)){const h=i.get(f);h&&(i.delete(f),t.splice(t.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=t.indexOf(f);h>-1&&(t.splice(h,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 h=BV(f,t);t.splice(h,0,f),f.record.name&&!Ix(f)&&i.set(f.record.name,f)}function c(f,h){let d,p={},_,g;if("name"in f&&f.name){if(d=i.get(f.name),!d)throw La(1,{location:f});g=d.record.name,p=Mt(Rx(h.params,d.keys.filter(b=>!b.optional).concat(d.parent?d.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Rx(f.params,d.keys.map(b=>b.name))),_=d.stringify(p)}else if(f.path!=null)_=f.path,d=t.find(b=>b.re.test(_)),d&&(p=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(b=>b.re.test(h.path)),!d)throw La(1,{location:f,currentLocation:h});g=d.record.name,p=Mt({},h.params,f.params),_=d.stringify(p)}const m=[];let v=d;for(;v;)m.unshift(v.record),v=v.parent;return{name:g,path:_,params:p,matched:m,meta:kV(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 Rx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Px(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:FV(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 FV(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 Ix(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function kV(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Lx(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function BV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;qw(n,e[r])<0?i=r:t=r+1}const s=zV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function zV(n){let e=n;for(;e=e.parent;)if(Yw(e)&&qw(n,e)===0)return e}function Yw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function VV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Yg(r)):[i&&Yg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function HV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Vi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const GV=Symbol(""),Ox=Symbol(""),qd=Symbol(""),X_=Symbol(""),Kg=Symbol("");function ul(){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 fr(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(La(4,{from:t,to:e})):h instanceof Error?l(h):AV(h)?l(La(2,{from:e,to:h})):(o&&i.enterCallbacks[s]===o&&typeof h=="function"&&o.push(h),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(h=>l(h))})}function Em(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(Fw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(fr(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=jz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&fr(d,t,i,o,a,s)()}))}}return r}function Nx(n){const e=gn(qd),t=gn(X_),i=Me(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Me(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const h=f.findIndex(Ia.bind(null,u));if(h>-1)return h;const d=Ux(l[c-2]);return c>1&&Ux(u)===d&&f[f.length-1].path!==d?f.findIndex(Ia.bind(null,l[c-2])):h}),r=Me(()=>s.value>-1&&YV(t.params,i.value.params)),o=Me(()=>s.value>-1&&s.value===t.matched.length-1&&Gw(t.params,i.value.params));function a(l={}){if(qV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Vl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Me(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function WV(n){return n.length===1?n[0]:n}const XV=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"},viewTransition:Boolean},useLink:Nx,setup(n,{slots:e}){const t=xi(Nx(n)),{options:i}=gn(qd),s=Me(()=>({[Fx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Fx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&WV(e.default(t));return n.custom?r:ks("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),$V=XV;function qV(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 YV(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(!Vi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Ux(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Fx=(n,e,t)=>n??e??t,jV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=gn(Kg),s=Me(()=>n.route||i.value),r=gn(Ox,0),o=Me(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Me(()=>s.value.matched[o.value]);gr(Ox,Me(()=>o.value+1)),gr(GV,a),gr(Kg,s);const l=et();return Xe(()=>[l.value,a.value,n.name],([c,u,f],[h,d,p])=>{u&&(u.instances[f]=c,d&&d!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=d.leaveGuards),u.updateGuards.size||(u.updateGuards=d.updateGuards))),c&&u&&(!d||!Ia(u,d)||!h)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,h=f&&f.components[u];if(!h)return kx(t.default,{Component:h,route:c});const d=f.props[u],p=d?d===!0?c.params:typeof d=="function"?d(c):d:null,g=ks(h,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return kx(t.default,{Component:g,route:c})||g}}});function kx(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const jw=jV;function KV(n){const e=UV(n.routes,n),t=n.parseQuery||VV,i=n.stringifyQuery||Dx,s=n.history,r=ul(),o=ul(),a=ul(),l=Oe(ir);let c=ir;ia&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Mm.bind(null,q=>""+q),f=Mm.bind(null,lV),h=Mm.bind(null,xc);function d(q,ae){let le,ce;return Xw(q)?(le=e.getRecordMatcher(q),ce=ae):ce=q,e.addRoute(ce,le)}function p(q){const ae=e.getRecordMatcher(q);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(q=>q.record)}function g(q){return!!e.getRecordMatcher(q)}function m(q,ae){if(ae=Mt({},ae||l.value),typeof q=="string"){const w=Sm(t,q,ae.path),$=e.resolve({path:w.path},ae),W=s.createHref(w.fullPath);return Mt(w,$,{params:h($.params),hash:xc(w.hash),redirectedFrom:void 0,href:W})}let le;if(q.path!=null)le=Mt({},q,{path:Sm(t,q.path,ae.path).path});else{const w=Mt({},q.params);for(const $ in w)w[$]==null&&delete w[$];le=Mt({},q,{params:f(w)}),ae.params=f(ae.params)}const ce=e.resolve(le,ae),He=q.hash||"";ce.params=u(h(ce.params));const U=fV(i,Mt({},q,{hash:rV(He),path:ce.path})),F=s.createHref(U);return Mt({fullPath:U,hash:He,query:i===Dx?HV(q.query):q.query||{}},ce,{redirectedFrom:void 0,href:F})}function v(q){return typeof q=="string"?Sm(t,q,l.value.path):Mt({},q)}function b(q,ae){if(c!==q)return La(8,{from:ae,to:q})}function y(q){return S(q)}function E(q){return y(Mt(v(q),{replace:!0}))}function T(q){const ae=q.matched[q.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ce=typeof le=="function"?le(q):le;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=v(ce):{path:ce},ce.params={}),Mt({query:q.query,hash:q.hash,params:ce.path!=null?{}:q.params},ce)}}function S(q,ae){const le=c=m(q),ce=l.value,He=q.state,U=q.force,F=q.replace===!0,w=T(le);if(w)return S(Mt(v(w),{state:typeof w=="object"?Mt({},He,w.state):He,force:U,replace:F}),ae||le);const $=le;$.redirectedFrom=ae;let W;return!U&&hV(i,ce,le)&&(W=La(16,{to:$,from:ce}),se(ce,ce,!0,!1)),(W?Promise.resolve(W):M($,ce)).catch(X=>bs(X)?bs(X,2)?X:be(X):J(X,$,ce)).then(X=>{if(X){if(bs(X,2))return S(Mt({replace:F},v(X.to),{state:typeof X.to=="object"?Mt({},He,X.to.state):He,force:U}),ae||$)}else X=z($,ce,!0,F,He);return D($,ce,X),X})}function P(q,ae){const le=b(q,ae);return le?Promise.reject(le):Promise.resolve()}function x(q){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(q):q()}function M(q,ae){let le;const[ce,He,U]=ZV(q,ae);le=Em(ce.reverse(),"beforeRouteLeave",q,ae);for(const w of ce)w.leaveGuards.forEach($=>{le.push(fr($,q,ae))});const F=P.bind(null,q,ae);return le.push(F),xe(le).then(()=>{le=[];for(const w of r.list())le.push(fr(w,q,ae));return le.push(F),xe(le)}).then(()=>{le=Em(He,"beforeRouteUpdate",q,ae);for(const w of He)w.updateGuards.forEach($=>{le.push(fr($,q,ae))});return le.push(F),xe(le)}).then(()=>{le=[];for(const w of U)if(w.beforeEnter)if(Vi(w.beforeEnter))for(const $ of w.beforeEnter)le.push(fr($,q,ae));else le.push(fr(w.beforeEnter,q,ae));return le.push(F),xe(le)}).then(()=>(q.matched.forEach(w=>w.enterCallbacks={}),le=Em(U,"beforeRouteEnter",q,ae,x),le.push(F),xe(le))).then(()=>{le=[];for(const w of o.list())le.push(fr(w,q,ae));return le.push(F),xe(le)}).catch(w=>bs(w,8)?w:Promise.reject(w))}function D(q,ae,le){a.list().forEach(ce=>x(()=>ce(q,ae,le)))}function z(q,ae,le,ce,He){const U=b(q,ae);if(U)return U;const F=ae===ir,w=ia?history.state:{};le&&(ce||F?s.replace(q.fullPath,Mt({scroll:F&&w&&w.scroll},He)):s.push(q.fullPath,He)),l.value=q,se(q,ae,le,F),be()}let H;function G(){H||(H=s.listen((q,ae,le)=>{if(!ge.listening)return;const ce=m(q),He=T(ce);if(He){S(Mt(He,{replace:!0,force:!0}),ce).catch(Vl);return}c=ce;const U=l.value;ia&&bV(Ex(U.fullPath,le.delta),$d()),M(ce,U).catch(F=>bs(F,12)?F:bs(F,2)?(S(Mt(v(F.to),{force:!0}),ce).then(w=>{bs(w,20)&&!le.delta&&le.type===Mc.pop&&s.go(-1,!1)}).catch(Vl),Promise.reject()):(le.delta&&s.go(-le.delta,!1),J(F,ce,U))).then(F=>{F=F||z(ce,U,!1),F&&(le.delta&&!bs(F,8)?s.go(-le.delta,!1):le.type===Mc.pop&&bs(F,20)&&s.go(-1,!1)),D(ce,U,F)}).catch(Vl)}))}let ee=ul(),j=ul(),te;function J(q,ae,le){be(q);const ce=j.list();return ce.length?ce.forEach(He=>He(q,ae,le)):console.error(q),Promise.reject(q)}function de(){return te&&l.value!==ir?Promise.resolve():new Promise((q,ae)=>{ee.add([q,ae])})}function be(q){return te||(te=!q,G(),ee.list().forEach(([ae,le])=>q?le(q):ae()),ee.reset()),q}function se(q,ae,le,ce){const{scrollBehavior:He}=n;if(!ia||!He)return Promise.resolve();const U=!le&&xV(Ex(q.fullPath,0))||(ce||!le)&&history.state&&history.state.scroll||null;return Ar().then(()=>He(q,ae,U)).then(F=>F&&yV(F)).catch(F=>J(F,q,ae))}const ye=q=>s.go(q);let Be;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:y,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:j.add,isReady:de,install(q){const ae=this;q.component("RouterLink",$V),q.component("RouterView",jw),q.config.globalProperties.$router=ae,Object.defineProperty(q.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),ia&&!Be&&l.value===ir&&(Be=!0,y(s.location).catch(He=>{}));const le={};for(const He in ir)Object.defineProperty(le,He,{get:()=>l.value[He],enumerable:!0});q.provide(qd,ae),q.provide(X_,fS(le)),q.provide(Kg,l);const ce=q.unmount;re.add(q),q.unmount=function(){re.delete(q),re.size<1&&(c=ir,H&&H(),H=null,l.value=ir,Be=!1,te=!1),ce()}}};function xe(q){return q.reduce((ae,le)=>ae.then(()=>x(le)),Promise.resolve())}return ge}function ZV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oIa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ia(c,l))||s.push(l))}return[t,i,s]}function JV(){return gn(qd)}function GG(n){return gn(X_)}const QV=[{path:"/",name:"/",component:()=>je(()=>import("./index-D-bLOGGQ.js"),__vite__mapDeps([14,4,5,6,7,8,11,12,13,15,16,17,10,9,18,19,20,21,22,23,24,25,1,2,26,27,28,29])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>je(()=>import("./_...all_-DGe7yWRr.js"),[])},{path:"/audio",name:"/audio",component:()=>je(()=>import("./audio-DFCkLcc2.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>je(()=>import("./background-remove-D0LHHV4b.js"),__vite__mapDeps([30,11,12,13,31]))},{path:"chat",name:"/devtools/chat",component:()=>je(()=>import("./chat-CAoffe0W.js"),__vite__mapDeps([32,20,10]))},{path:"image",name:"/devtools/image",component:()=>je(()=>import("./image-BxsLSR2D.js"),__vite__mapDeps([33,34]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>je(()=>import("./vibrant-C_BHDD4j.js"),__vite__mapDeps([35,11,12,13,31,36]))}]},{path:"/queue",name:"/queue",component:()=>je(()=>import("./queue-DT3alulg.js"),__vite__mapDeps([37,18]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>je(()=>import("./index-QlmGg2mr.js"),__vite__mapDeps([38,4,5,6,7,8,11,12,13,39,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>je(()=>import("./index-DZHRHxrd.js"),__vite__mapDeps([40,7,21,8,22,9,10,17,11,12,13,31,41,42,43,4,5,6,44,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>je(()=>import("./CardDetailDialog-DAWUrvKq.js"),__vite__mapDeps([45,41,42,43,12,4,5,6,7,21,8,22,9,10,17,11,13]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>je(()=>import("./CardListItem-CZfNqIRm.js"),__vite__mapDeps([46,44,4,5,6,7,8,11,12,13]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>je(()=>import("./DeleteCardDialog-DgtK6LD9.js"),__vite__mapDeps([47,42,43,12]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>je(()=>import("./index-uIiqDbdm.js"),__vite__mapDeps([48,4,5,6,7,8,11,12,13,49,25,23,43,28,50])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>je(()=>import("./index-ru1ciun_.js"),__vite__mapDeps([51,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>je(()=>import("./index-8sqTduK0.js"),__vite__mapDeps([52,4,5,24,6,7,8,11,12,13,36,49,25,23,43,53,28,54])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>je(()=>import("./index-CRmwnLFA.js"),__vite__mapDeps([55,4,5,6,7,8,56,11,12,13,39,53,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>je(()=>import("./consciousness-CnNlPxQn.js"),__vite__mapDeps([57,4,5,6,7,8,22,9,10,11,12,13,58,23,59,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>je(()=>import("./memory-long-term-BwMIGexr.js"),__vite__mapDeps([60,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>je(()=>import("./memory-short-term-BW4nzTNl.js"),__vite__mapDeps([61,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>je(()=>import("./speech-BypMqt94.js"),__vite__mapDeps([62,63,4,5,11,12,13,6,7,8,9,10,17,64,59,65,27,58,23,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>je(()=>import("./index-JZi43ROx.js"),__vite__mapDeps([66,4,5,6,7,8,9,10,56,11,12,13,53,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>je(()=>import("./alibaba-cloud-model-studio-Cro6QMhw.js"),__vite__mapDeps([67,4,5,6,7,8,9,10,17,63,11,12,13,68,69,25,23,64,59,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>je(()=>import("./anthropic-Cbc4_CUj.js"),__vite__mapDeps([72,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>je(()=>import("./cloudflare-workers-ai-eBT-UXSj.js"),__vite__mapDeps([74,4,5,6,7,8,9,10,11,12,13,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>je(()=>import("./deepseek-BguEBtU6.js"),__vite__mapDeps([75,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>je(()=>import("./elevenlabs-DvxODrlh.js"),__vite__mapDeps([76,4,5,6,7,8,9,10,17,63,11,12,13,68,69,25,23,64,59,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>je(()=>import("./featherless-ai-BrkEqk4n.js"),__vite__mapDeps([77,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>je(()=>import("./fireworks-ai-BS2-0VT-.js"),__vite__mapDeps([78,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>je(()=>import("./google-generative-ai-CSuDyEtU.js"),__vite__mapDeps([79,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>je(()=>import("./microsoft-speech-7XEJGMst.js"),__vite__mapDeps([80,4,5,6,7,8,9,10,17,64,59,63,11,12,13,68,69,25,23,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>je(()=>import("./mistral-ai-CH5fVxsz.js"),__vite__mapDeps([81,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>je(()=>import("./moonshot-ai-1DTwpN3B.js"),__vite__mapDeps([82,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>je(()=>import("./novita-ai-Bb31wSLB.js"),__vite__mapDeps([83,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"ollama",name:"/settings/providers/ollama",component:()=>je(()=>import("./ollama-Bsoe-G-i.js"),__vite__mapDeps([84,4,5,6,7,8,9,10,59,11,12,13,69,25,23,64,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai",name:"/settings/providers/openai",component:()=>je(()=>import("./openai-Ball6DG9.js"),__vite__mapDeps([85,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>je(()=>import("./openrouter-ai-BElqgb6j.js"),__vite__mapDeps([86,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>je(()=>import("./together-ai-B3OQea2r.js"),__vite__mapDeps([87,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>je(()=>import("./volcengine-BgioB2-t.js"),__vite__mapDeps([88,4,5,6,7,8,9,10,17,64,59,63,11,12,13,68,69,25,23,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"xai",name:"/settings/providers/xai",component:()=>je(()=>import("./xai-CsHkk6is.js"),__vite__mapDeps([89,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>je(()=>import("./index-DHnlC1gY.js"),__vite__mapDeps([90,53,7,8,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>je(()=>import("./filter-message-Qm-9DQxR.js"),__vite__mapDeps([91,11,12,13,65,27]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>je(()=>import("./delays-r3Br_TGC.js"),__vite__mapDeps([92,26,19,8,18,6,11,12,13,65,27]))},{path:"emotions",name:"/test/queues/emotions",component:()=>je(()=>import("./emotions-DPYTh_0x.js"),__vite__mapDeps([93,18,19,8,11,12,13,65,27]))},{path:"messages",name:"/test/queues/messages",component:()=>je(()=>import("./messages-lR_ZzWbE.js"),__vite__mapDeps([94,18,19,8,11,12,13,65,27]))}]}]}],Kw=(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}}},e6={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},t6=n=>Kw(e6[n.toLowerCase()],6),n6=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,i6=n=>{let e;return(e=n.match(n6))?Kw(parseInt(e[1],16),e[1].length):void 0},_r="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Gl=`${_r}%`,$_=`(?:${_r}%|${_r})`,s6=`(?:${_r}(deg|grad|rad|turn)|${_r})`,Da="\\s*,\\s*",r6=new RegExp(`^rgba?\\(\\s*${_r}${Da}${_r}${Da}${_r}\\s*(?:,\\s*${$_}\\s*)?\\)$`),o6=new RegExp(`^rgba?\\(\\s*${Gl}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${$_}\\s*)?\\)$`),a6=n=>{let e={mode:"rgb"},t;if(t=n.match(r6))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(o6))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},l6=(n,e)=>n===void 0?void 0:typeof n!="object"?v6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,Zw=(n="rgb")=>e=>(e=l6(e,n))!==void 0?e.mode===n?e:Ji[e.mode][n]?Ji[e.mode][n](e):n==="rgb"?Ji[e.mode].rgb(e):Ji.rgb[n](Ji[e.mode].rgb(e)):void 0,Ji={},Jw={},Oh=[],Qw={},c6=n=>n,Et=n=>(Ji[n.mode]={...Ji[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Ji[e]||(Ji[e]={}),Ji[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=c6)}),Jw[n.mode]=n,(n.parse||[]).forEach(e=>{f6(e,n.mode)}),Zw(n.mode)),u6=n=>Jw[n],f6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Qw[n]=e}else typeof n=="function"&&Oh.indexOf(n)<0&&Oh.push(n)},Zg=/[^\x00-\x7F]|[a-zA-Z_]/,h6=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let $e=0;function uf(n){let e=n[$e],t=n[$e+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[$e+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Jg(n){if($e>=n.length)return!1;let e=n[$e];if(Zg.test(e))return!0;if(e==="-"){if(n.length-$e<2)return!1;let t=n[$e+1];return!!(t==="-"||Zg.test(t))}return!1}const d6={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function fl(n){let e="";if((n[$e]==="-"||n[$e]==="+")&&(e+=n[$e++]),e+=ff(n),n[$e]==="."&&/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n)),(n[$e]==="e"||n[$e]==="E")&&((n[$e+1]==="-"||n[$e+1]==="+")&&/\d/.test(n[$e+2])?e+=n[$e++]+n[$e++]+ff(n):/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n))),Jg(n)){let t=Nh(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*d6[t]}:void 0}return n[$e]==="%"?($e++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function ff(n){let e="";for(;/\d/.test(n[$e]);)e+=n[$e++];return e}function Nh(n){let e="";for(;$e4)){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 _6(n,e){n._i=0;let t=n[n._i++];if(!t||t.type!==_e.Function)return;let i=eA(n,e);if(i)return i.unshift(t.value),i}const v6=n=>{if(typeof n!="string")return;const e=m6(n),t=e?_6(e,!0):void 0;let i,s=0,r=Oh.length;for(;sn==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,x6=(n,e,t)=>n+t*(e-n),M6=n=>{let e=[];for(let t=0;te=>{let t=M6(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)}},we=S6(x6),on=n=>{let e=!1,t=n.map(i=>i!==void 0?(e=!0,i):1);return e?t:n},Wa={mode:"rgb",channels:["r","g","b","alpha"],parse:[y6,i6,a6,t6,b6,"srgb"],serialize:"srgb",interpolate:{r:we,g:we,b:we,alpha:{use:we,fixup:on}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},Tm=(n=0)=>Math.pow(Math.abs(n),563/256)*Math.sign(n),Bx=n=>{let e=Tm(n.r),t=Tm(n.g),i=Tm(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},wm=n=>Math.pow(Math.abs(n),256/563)*Math.sign(n),zx=({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:wm(n*2.0415879038107465-e*.5650069742788597-.3447313507783297*t),g:wm(n*-.9692436362808798+e*1.8759675015077206+.0415550574071756*t),b:wm(n*.0134442806320312-e*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(s.alpha=i),s},Am=(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)},Xa=({r:n,g:e,b:t,alpha:i})=>{let s={mode:"lrgb",r:Am(n),g:Am(e),b:Am(t)};return i!==void 0&&(s.alpha=i),s},Lo=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(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},Cm=(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},$a=({r:n,g:e,b:t,alpha:i},s="rgb")=>{let r={mode:s,r:Cm(n),g:Cm(e),b:Cm(t)};return i!==void 0&&(r.alpha=i),r},Do=({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=$a({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},E6={...Wa,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:n=>zx(Lo(n)),xyz65:zx},toMode:{rgb:n=>Do(Bx(n)),xyz65:Bx}},bn=n=>(n=n%360)<0?n+360:n,T6=(n,e)=>n.map((t,i,s)=>{if(t===void 0)return t;let r=bn(t);return i===0||n[i-1]===void 0?r:e(r-bn(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),[]),qs=n=>T6(n,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),ln=[-.14861,1.78277,-.29227,-.90649,1.97294,0],w6=Math.PI/180,A6=180/Math.PI;let Vx=ln[3]*ln[4],Hx=ln[1]*ln[4],Gx=ln[1]*ln[2]-ln[0]*ln[3];const C6=({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=(Gx*t+n*Vx-e*Hx)/(Gx+Vx-Hx),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)*A6-120),i!==void 0&&(a.alpha=i),a},R6=({h:n,s:e,l:t,alpha:i})=>{let s={mode:"rgb"};n=(n===void 0?0:n+120)*w6,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},Yd=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.s||!e.s)return 0;let t=bn(n.h),i=bn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.s*e.s)*s},P6=(n,e)=>{if(n.h===void 0||e.h===void 0)return 0;let t=bn(n.h),i=bn(e.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},jd=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.c||!e.c)return 0;let t=bn(n.h),i=bn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.c*e.c)*s},Ys=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},I6={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:C6},toMode:{rgb:R6},interpolate:{h:{use:we,fixup:qs},s:we,l:we,alpha:{use:we,fixup:on}},difference:{h:Yd},average:{h:Ys}},Tr=({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=bn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(o.alpha=i),o},wr=({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},tA=Math.pow(29,3)/Math.pow(3,3),nA=Math.pow(6,3)/Math.pow(29,3),Jt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},_a={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Rm=n=>Math.pow(n,3)>nA?Math.pow(n,3):(116*n-16)/tA;const iA=({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:Rm(r)*_a.X,y:Rm(s)*_a.Y,z:Rm(o)*_a.Z};return i!==void 0&&(a.alpha=i),a},Kd=n=>Do(iA(n)),Pm=n=>n>nA?Math.cbrt(n):(tA*n+16)/116,sA=({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=Pm(n/_a.X),r=Pm(e/_a.Y),o=Pm(t/_a.Z),a={mode:"lab65",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},Zd=n=>{let e=sA(Lo(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Uh=1,rA=1,Sc=26/180*Math.PI,Fh=Math.cos(Sc),kh=Math.sin(Sc),oA=100/Math.log(139/100),Qg=({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*Uh/oA)-1)/.0039},r=(Math.exp(.0435*e*rA*Uh)-1)/.075,o=r*Math.cos(t/180*Math.PI-Sc),a=r*Math.sin(t/180*Math.PI-Sc);return s.a=o*Fh-a/.83*kh,s.b=o*kh+a/.83*Fh,i!==void 0&&(s.alpha=i),s},e0=({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*Fh+t*kh,r=.83*(t*Fh-e*kh),o=Math.sqrt(s*s+r*r),a={mode:"dlch",l:oA/Uh*Math.log(1+.0039*n),c:Math.log(1+.075*o)/(.0435*rA*Uh)};return a.c&&(a.h=bn((Math.atan2(r,s)+Sc)/Math.PI*180)),i!==void 0&&(a.alpha=i),a},Wx=n=>Qg(Tr(n,"dlch")),Xx=n=>wr(e0(n),"dlab"),L6={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Wx,rgb:n=>Kd(Wx(n))},fromMode:{lab65:Xx,rgb:n=>Xx(Zd(n))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:we,a:we,b:we,alpha:{use:we,fixup:on}}},D6={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Qg,dlab:n=>wr(n,"dlab"),rgb:n=>Kd(Qg(n))},fromMode:{lab65:e0,dlab:n=>Tr(n,"dlch"),rgb:n=>e0(Zd(n))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:we,c:we,h:{use:we,fixup:qs},alpha:{use:we,fixup:on}},difference:{h:jd},average:{h:Ys}};function O6({h:n,s:e,i:t,alpha:i}){n=bn(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 N6({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}},z6=new RegExp(`^hsla?\\(\\s*${s6}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${$_}\\s*)?\\)$`),V6=n=>{let e=n.match(z6);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=B6(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 H6(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 aA={mode:"hsl",toMode:{rgb:F6},fromMode:{rgb:k6},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[H6,V6],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:we,fixup:qs},s:we,l:we,alpha:{use:we,fixup:on}},difference:{h:Yd},average:{h:Ys}};function lA({h:n,s:e,v:t,alpha:i}){n=bn(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 cA({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 lA({h:n,s:t===1?1:1-e/(1-t),v:1-t,alpha:i})}function W6(n){let e=cA(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 X6(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 $6={mode:"hwb",toMode:{rgb:G6},fromMode:{rgb:W6},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[X6],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:we,fixup:qs},w:we,b:we,alpha:{use:we,fixup:on}},difference:{h:P6},average:{h:Ys}},fA=203,Jd=.1593017578125,hA=78.84375,Qd=.8359375,ep=18.8515625,tp=18.6875;function Im(n){if(n<0)return 0;const e=Math.pow(n,1/hA);return 1e4*Math.pow(Math.max(0,e-Qd)/(ep-tp*e),1/Jd)}function Lm(n){if(n<0)return 0;const e=Math.pow(n/1e4,Jd);return Math.pow((Qd+ep*e)/(1+tp*e),hA)}const Dm=n=>Math.max(n/fA,0),$x=({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=Im(n+.008609037037932761*e+.11102962500302593*t),r=Im(n-.00860903703793275*e-.11102962500302599*t),o=Im(n+.5600313357106791*e-.32062717498731885*t),a={mode:"xyz65",x:Dm(2.070152218389422*s-1.3263473389671556*r+.2066510476294051*o),y:Dm(.3647385209748074*s+.680566024947227*r-.0453045459220346*o),z:Dm(-.049747207535812*s-.0492609666966138*r+1.1880659249923042*o)};return i!==void 0&&(a.alpha=i),a},Om=(n=0)=>Math.max(n*fA,0),qx=({x:n,y:e,z:t,alpha:i})=>{const s=Om(n),r=Om(e),o=Om(t),a=Lm(.3592832590121217*s+.6976051147779502*r-.0358915932320289*o),l=Lm(-.1920808463704995*s+1.1004767970374323*r+.0753748658519118*o),c=Lm(.0070797844607477*s+.0748396662186366*r+.8433265453898765*o),u=.5*a+.5*l,f=1.61376953125*a-3.323486328125*l+1.709716796875*c,h=4.378173828125*a-4.24560546875*l-.132568359375*c,d={mode:"itp",i:u,t:f,p:h};return i!==void 0&&(d.alpha=i),d},q6={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:$x,rgb:n=>Do($x(n))},fromMode:{xyz65:qx,rgb:n=>qx(Lo(n))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:we,t:we,p:we,alpha:{use:we,fixup:on}}},Y6=134.03437499999998,j6=16295499532821565e-27,Nm=n=>{if(n<0)return 0;let e=Math.pow(n/1e4,Jd);return Math.pow((Qd+ep*e)/(1+tp*e),Y6)},Um=(n=0)=>Math.max(n*203,0),dA=({x:n,y:e,z:t,alpha:i})=>{n=Um(n),e=Um(e),t=Um(t);let s=1.15*n-.15*t,r=.66*e+.34*n,o=Nm(.41478972*s+.579999*r+.014648*t),a=Nm(-.20151*s+1.120649*r+.0531008*t),l=Nm(-.0166008*s+.2648*r+.6684799*t),c=(o+a)/2,u={mode:"jab",j:.44*c/(1-.56*c)-j6,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},K6=134.03437499999998,Yx=16295499532821565e-27,Fm=n=>{if(n<0)return 0;let e=Math.pow(n,1/K6);return 1e4*Math.pow((Qd-e)/(tp*e-ep),1/Jd)},km=n=>n/203,pA=({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+Yx)/(.44+.56*(n+Yx)),r=Fm(s+.13860504*e+.058047316*t),o=Fm(s-.13860504*e-.058047316*t),a=Fm(s-.096019242*e-.8118919*t),l={mode:"xyz65",x:km(1.661373024652174*r-.914523081304348*o+.23136208173913045*a),y:km(-.3250758611844533*r+1.571847026732543*o-.21825383453227928*a),z:km(-.090982811*r-.31272829*o+1.5227666*a)};return i!==void 0&&(l.alpha=i),l},mA=n=>{let e=dA(Lo(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},gA=n=>Do(pA(n)),Z6={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:mA,xyz65:dA},toMode:{rgb:gA,xyz65:pA},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:we,a:we,b:we,alpha:{use:we,fixup:on}}},jx=({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=bn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},Kx=({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},J6={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Kx,rgb:n=>gA(Kx(n))},fromMode:{rgb:n=>jx(mA(n)),jab:jx},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:we,fixup:qs},c:we,j:we,alpha:{use:we,fixup:on}},difference:{h:jd},average:{h:Ys}},np=Math.pow(29,3)/Math.pow(3,3),q_=Math.pow(6,3)/Math.pow(29,3);let Bm=n=>Math.pow(n,3)>q_?Math.pow(n,3):(116*n-16)/np;const Y_=({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:Bm(r)*Jt.X,y:Bm(s)*Jt.Y,z:Bm(o)*Jt.Z};return i!==void 0&&(a.alpha=i),a},Jc=({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=$a({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},_A=n=>Jc(Y_(n)),Qc=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(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},zm=n=>n>q_?Math.cbrt(n):(np*n+16)/116,j_=({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=zm(n/Jt.X),r=zm(e/Jt.Y),o=zm(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},vA=n=>{let e=j_(Qc(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e};function Q6(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 K_={mode:"lab",toMode:{xyz50:Y_,rgb:_A},fromMode:{xyz50:j_,rgb:vA},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[Q6],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:we,a:we,b:we,alpha:{use:we,fixup:on}}},eH={...K_,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:iA,rgb:Kd},fromMode:{xyz65:sA,rgb:Zd},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function tH(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 Z_={mode:"lch",toMode:{lab:wr,rgb:n=>_A(wr(n))},fromMode:{rgb:n=>Tr(vA(n)),lab:Tr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[tH],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:we,fixup:qs},c:we,l:we,alpha:{use:we,fixup:on}},difference:{h:jd},average:{h:Ys}},nH={...Z_,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:n=>wr(n,"lab65"),rgb:n=>Kd(wr(n,"lab65"))},fromMode:{rgb:n=>Tr(Zd(n),"lch65"),lab65:n=>Tr(n,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},yA=({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=bn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},bA=({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},xA=(n,e,t)=>4*n/(n+15*e+3*t),MA=(n,e,t)=>9*e/(n+15*e+3*t),iH=xA(Jt.X,Jt.Y,Jt.Z),sH=MA(Jt.X,Jt.Y,Jt.Z),rH=n=>n<=q_?np*n:116*Math.cbrt(n)-16,t0=({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=rH(e/Jt.Y),r=xA(n,e,t),o=MA(n,e,t);!isFinite(r)||!isFinite(o)?s=r=o=0:(r=13*s*(r-iH),o=13*s*(o-sH));let a={mode:"luv",l:s,u:r,v:o};return i!==void 0&&(a.alpha=i),a},oH=(n,e,t)=>4*n/(n+15*e+3*t),aH=(n,e,t)=>9*e/(n+15*e+3*t),lH=oH(Jt.X,Jt.Y,Jt.Z),cH=aH(Jt.X,Jt.Y,Jt.Z),n0=({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)+lH,r=t/(13*n)+cH,o=Jt.Y*(n<=8?n/np: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},uH=n=>yA(t0(Qc(n))),fH=n=>Jc(n0(bA(n))),hH={mode:"lchuv",toMode:{luv:bA,rgb:fH},fromMode:{rgb:uH,luv:yA},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:we,fixup:qs},c:we,l:we,alpha:{use:we,fixup:on}},difference:{h:jd},average:{h:Ys}},dH={...Wa,mode:"lrgb",toMode:{rgb:$a},fromMode:{rgb:Xa},parse:["srgb-linear"],serialize:"srgb-linear"},pH={mode:"luv",toMode:{xyz50:n0,rgb:n=>Jc(n0(n))},fromMode:{xyz50:t0,rgb:n=>t0(Qc(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:we,u:we,v:we,alpha:{use:we,fixup:on}}},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.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},ip=n=>{let e=SA(Xa(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},eu=({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},sp=n=>$a(eu(n));function i0(n){const i=1.170873786407767;return .5*(i*n-.206+Math.sqrt((i*n-.206)*(i*n-.206)+4*.03*i*n))}function Bh(n){return(n*n+.206*n)/(1.170873786407767*(n+.03))}function mH(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,h=-.1055613458*n-.0638541728*e,d=-.0894841775*n-1.291485548*e;{let p=1+u*f,_=1+u*h,g=1+u*d,m=p*p*p,v=_*_*_,b=g*g*g,y=3*f*p*p,E=3*h*_*_,T=3*d*g*g,S=6*f*f*p,P=6*h*h*_,x=6*d*d*g,M=a*m+l*v+c*b,D=a*y+l*E+c*T,z=a*S+l*P+c*x;u=u-M*D/(D*D-.5*M*z)}return u}function J_(n,e){let t=mH(n,e),i=eu({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 gH(n,e,t,i,s,r=null){r||(r=J_(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,h=a+l*c,d=a+l*u,p=a+l*f;{let _=s*(1-o)+o*t,g=o*i,m=_+g*c,v=_+g*u,b=_+g*f,y=m*m*m,E=v*v*v,T=b*b*b,S=3*h*m*m,P=3*d*v*v,x=3*p*b*b,M=6*h*h*m,D=6*d*d*v,z=6*p*p*b,H=4.0767416621*y-3.3077115913*E+.2309699292*T-1,G=4.0767416621*S-3.3077115913*P+.2309699292*x,ee=4.0767416621*M-3.3077115913*D+.2309699292*z,j=G/(G*G-.5*H*ee),te=-H*j,J=-1.2684380046*y+2.6097574011*E-.3413193965*T-1,de=-1.2684380046*S+2.6097574011*P-.3413193965*x,be=-1.2684380046*M+2.6097574011*D-.3413193965*z,se=de/(de*de-.5*J*be),ye=-J*se,Be=-.0041960863*y-.7034186147*E+1.707614701*T-1,re=-.0041960863*S-.7034186147*P+1.707614701*x,ge=-.0041960863*M-.7034186147*D+1.707614701*z,xe=re/(re*re-.5*Be*ge),q=-Be*xe;te=j>=0?te:1e6,ye=se>=0?ye:1e6,q=xe>=0?q:1e6,o+=Math.min(te,Math.min(ye,q))}}}return o}function Q_(n,e,t=null){t||(t=J_(n,e));let i=t[0],s=t[1];return[s/i,s/(1-i)]}function EA(n,e,t){let i=J_(e,t),s=gH(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 Zx(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:i0(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]=EA(e,t/r,i/r),c;if(rZx(ip(n))},toMode:{oklab:Jx,rgb:n=>sp(Jx(n))}};function Qx(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),h=f*e,d=f*s,p=Bh(h),_=d*p/h,g=eu({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*i0(e)/e,e=i0(e);const v={mode:"okhsv",s:s?(c+l)*d/(l*c+l*u*d):0,v:e?e/h:0};return v.s&&(v.h=bn(Math.atan2(i,t)*180/Math.PI)),n.alpha!==void 0&&(v.alpha=n.alpha),v}function eM(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),h=i*l*c/(c+l-l*u*i),d=Bh(f),p=h*d/f,_=eu({l:d,a:r*p,b:o*p}),g=Math.cbrt(1/Math.max(_.r,_.g,_.b,0)),m=Bh(s*f),v=h*m/f;return e.l=m*g,e.a=v*r*g,e.b=v*o*g,e}const vH={...uA,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Qx,rgb:n=>Qx(ip(n))},toMode:{oklab:eM,rgb:n=>sp(eM(n))}};function yH(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 bH={...K_,mode:"oklab",toMode:{lrgb:eu,rgb:sp},fromMode:{lrgb:SA,rgb:ip},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[yH],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 xH(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 MH={...Z_,mode:"oklch",toMode:{oklab:n=>wr(n,"oklab"),rgb:n=>sp(wr(n,"oklab"))},fromMode:{rgb:n=>Tr(ip(n),"oklch"),oklab:n=>Tr(n,"oklch")},parse:[xH],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]}},tM=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(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},nM=({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=$a({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},SH={...Wa,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:n=>nM(Lo(n)),xyz65:nM},toMode:{rgb:n=>Do(tM(n)),xyz65:tM}},Vm=n=>{let e=Math.abs(n);return e>=1/512?Math.sign(n)*Math.pow(e,1/1.8):16*n},iM=({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:Vm(n*1.3457868816471585-e*.2555720873797946-.0511018649755453*t),g:Vm(n*-.5446307051249019+e*1.5082477428451466+.0205274474364214*t),b:Vm(n*0+e*0+1.2119675456389452*t)};return i!==void 0&&(s.alpha=i),s},Hm=(n=0)=>{let e=Math.abs(n);return e>=16/512?Math.sign(n)*Math.pow(e,1.8):n/16},sM=n=>{let e=Hm(n.r),t=Hm(n.g),i=Hm(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},EH={...Wa,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:iM,rgb:n=>iM(Qc(n))},toMode:{xyz50:sM,rgb:n=>Jc(sM(n))}},rM=1.09929682680944,TH=.018053968510807,Gm=n=>{const e=Math.abs(n);return e>TH?(Math.sign(n)||1)*(rM*Math.pow(e,.45)-(rM-1)):4.5*n},oM=({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:Gm(n*1.7166511879712683-e*.3556707837763925-.2533662813736599*t),g:Gm(n*-.6666843518324893+e*1.6164812366349395+.0157685458139111*t),b:Gm(n*.0176398574453108-e*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(s.alpha=i),s},aM=1.09929682680944,wH=.018053968510807,Wm=(n=0)=>{let e=Math.abs(n);return e{let e=Wm(n.r),t=Wm(n.g),i=Wm(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},AH={...Wa,mode:"rec2020",fromMode:{xyz65:oM,rgb:n=>oM(Lo(n))},toMode:{xyz65:lM,rgb:n=>Do(lM(n))},parse:["rec2020"],serialize:"rec2020"},yo=.0037930732552754493,TA=Math.cbrt(yo),Xm=n=>Math.cbrt(n)-TA,CH=n=>{const{r:e,g:t,b:i,alpha:s}=Xa(n),r=Xm(.3*e+.622*t+.078*i+yo),o=Xm(.23*e+.692*t+.078*i+yo),a=Xm(.2434226892454782*e+.2047674442449682*t+.5518098665095535*i+yo),l={mode:"xyb",x:(r-o)/2,y:(r+o)/2,b:a-(r+o)/2};return s!==void 0&&(l.alpha=s),l},$m=n=>Math.pow(n+TA,3),RH=({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=$m(n+e)-yo,r=$m(e-n)-yo,o=$m(t+e)-yo,a=$a({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},PH={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:RH},fromMode:{rgb:CH},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:we,y:we,b:we,alpha:{use:we,fixup:on}}},IH={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Jc,lab:j_},fromMode:{rgb:Qc,lab:Y_},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:we,y:we,z:we,alpha:{use:we,fixup:on}}},LH=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},OH={mode:"xyz65",toMode:{rgb:Do,xyz50:LH},fromMode:{rgb:Lo,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:we,y:we,z:we,alpha:{use:we,fixup:on}}},NH=({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},UH=({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},FH={mode:"yiq",toMode:{rgb:UH},fromMode:{rgb:NH},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:we,i:we,q:we,alpha:{use:we,fixup:on}}};Et(E6);Et(I6);Et(L6);Et(D6);Et(U6);Et(aA);Et(uA);Et($6);Et(q6);Et(Z6);Et(J6);Et(K_);Et(eH);Et(Z_);Et(nH);Et(hH);Et(dH);Et(pH);Et(_H);Et(vH);Et(bH);Et(MH);Et(SH);Et(EH);Et(AH);Et(Wa);Et(PH);Et(IH);Et(OH);Et(FH);const s0=220.44,kH=Zw("oklch"),cM=n=>{var e;return n?(e=kH(n))==null?void 0:e.h:s0},BH=$z("settings",()=>{const n=et(),e=ys("settings/language","en-US"),t=ys("settings/stage/view/model-renderer","2d"),i=ys("settings/audio/input","false"),s=Me(()=>{var T;return(T=n.value)==null?void 0:T.deviceId}),{audioInputs:r,ensurePermissions:o}=KB({constraints:{audio:!0}}),a=et(),l=et("/assets/live2d/models/hiyori_pro_zh.zip"),c=et("url"),u=et(!1),f=ys("settings/live2d/position",{x:0,y:0}),h=et({group:"Idle",index:0}),d=et([]),p=ys("settings/live2d/motion-map",{}),_=ys("settings/disable-transitions",!0),g=ys("settings/use-page-specific-transitions",!0),m=ys("settings/theme/colors/hue",s0),v=ys("settings/theme/colors/hue-dynamic",!1);function b(T=s0){m.value=T,v.value=!1}function y(T){b(cM(T))}function E(T){if(v.value)return!1;const S=cM(T);if(!S)return!1;const P=Math.abs(S-m.value);return P<.01||P>359.99}return Xe(i,T=>{T==="false"&&(n.value=void 0),T==="true"&&o().then(()=>{n.value=r.value[0]})}),Xe(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])},{immediate:!0}),{live2dModelFile:a,live2dModelUrl:l,live2dLoadSource:c,live2dCurrentMotion:h,live2dPosition:f,availableLive2dMotions:d,live2dMotionMap:p,loadingLive2dModel:u,disableTransitions:_,usePageSpecificTransitions:g,language:e,stageView:t,themeColorsHue:m,themeColorsHueDynamic:v,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s,setThemeColorsHue:b,applyPrimaryColorFrom:y,isColorSelectedForPrimary:E}}),zH=fn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>t.value.primaryColor||"#666"),s=Me(()=>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)=>(_n(),yi("div",{class:"stage-transition-3",style:Si({zIndex:t.value.zIndex||100})},null,4))}}),Oo=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},VH=Oo(zH,[["__scopeId","data-v-df576df0"]]),HH=fn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>{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 _n(),yi("div",{class:"circle-expansion-transition",style:Si({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(_n(!0),yi(jt,null,m2(t.value,(o,a)=>(_n(),yi("div",{key:a}))),128))],4)}}}),GH=Oo(HH,[["__scopeId","data-v-0c29056c"]]),WH=fn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Me(()=>`fantasy-fall-${t.value}`);return Hn(()=>{var s,r,o,a,l,c,u,f,h;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",`${((h=(f=e.stageTransition)==null?void 0:f.borderRadius)==null?void 0:h.lg)||"50%"}`)}),(s,r)=>{var o;return _n(),yi("div",{class:Ua(["fantasy-fall-transition",i.value]),style:Si({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),XH=Oo(WH,[["__scopeId","data-v-e62bf496"]]),$H=fn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Me(()=>{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 _n(),yi("div",{class:"stage-transition-4",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[Y2('
',5)]),4)}}}),qH=Oo($H,[["__scopeId","data-v-6d1179fc"]]),YH=fn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Me(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Xe([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 _n(),yi("div",{class:"stage-transition-1",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),jH=Oo(YH,[["__scopeId","data-v-bf1d1566"]]),KH=fn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Me(()=>{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 _n(),yi("div",{class:"stage-transition-2",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),ZH=Oo(KH,[["__scopeId","data-v-8ff7120f"]]),JH=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 _n(),yi("div",{class:"rectangle-rotate-transition",style:Si({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[lr("div",{class:"rectangle rectangle-rotate-1"},[lr("div")],-1),lr("div",{class:"rectangle rectangle-rotate-2"},[lr("div")],-1),lr("div",{class:"rectangle rectangle-rotate-3"},[lr("div")],-1)]),4)}}}),QH=Oo(JH,[["__scopeId","data-v-f4b1dc64"]]),e8=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=JV(),i=et(!1),s=et(),r=et(""),o=et(),a=Oe({slide:{component:jH,duration:2700},"slope-slide":{component:ZH,duration:2700},arrow:{component:VH,duration:2700},"multiple-blocks-reveal":{component:qH,duration:2800},"fantasy-fall":{component:XH,duration:2700},"rectangles-rotate":{component:QH,duration:2700},"bubble-wave-out":{component:GH,duration:1e3}}),l=et([]);function c(d){return l.value.push(d),()=>{const p=l.value.indexOf(d);p>=0&&l.value.splice(p,1)}}async function u(d,p={}){s.value=d;for(const _ of l.value)try{await Promise.resolve(_(d,p))}catch(g){console.error(`Error in transition hook at stage "${d}":`,g)}}async function f(d,p,_){if(d.name==="none"||!d.name){p(),_();return}const g=a.value[d.name];if(!g){console.error(`Transition ${d.name} not found`),p(),_();return}const m=g.nextDelay!==void 0?g.nextDelay:g.duration/3;let v=!1;const y=c(E=>{E==="navigation"&&!v&&(v=!0,p())});try{await u("before-enter",{transitionName:d.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=d.name,o.value=d,i.value=!0,await u("enter-active",{transitionName:name}),setTimeout(async()=>{await u("navigation",{transitionName:d.name,config:g}),v||(v=!0,p())},m),setTimeout(async()=>{await u("after-enter",{transitionName:d.name})},g.duration),setTimeout(async()=>{await u("before-leave",{transitionName:d.name})},g.duration+10),setTimeout(async()=>{await u("leave-active",{transitionName:d.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:d.name}),_()},g.duration+E)}catch(E){console.error(E)}finally{y(),setTimeout(()=>{v||(v=!0,p())},g.duration*2)}}function h(d,p){return new Promise(_=>{f(d,p,_)})}return t.beforeEach((d,p,_)=>{if(e.disableTransitions){_();return}if(typeof d.meta.stageTransition!="object"){_();return}const g=d.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),h(g,_)}),(d,p)=>(_n(),yi(jt,null,[g2(d.$slots,"default"),i.value?(_n(),yi(jt,{key:0},[a.value[r.value]?(_n(),Kl(p2(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Ov("",!0)],64)):Ov("",!0)],64))}});/*! @@ -3903,4 +3903,4 @@ And the last, do what ever you want! - <|DELAY:3|> (延迟 3 秒) 最后,做任何你想做的事! -`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否开启舞台动画"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"某些页面会有自己的过场动画,这将覆盖舞台过场动画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"是否使用页面特定过场动画"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"从文件加载"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"选择"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"从 URL 加载"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"加载"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"输入 Live2D 模型 URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"更换模型"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"编辑动作映射"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"播放动作"}},title:{t:0,b:{t:2,i:[{t:3}],s:"映射动作"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D 设置"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"麦克风"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"激活"}},active:{t:0,b:{t:2,i:[{t:3}],s:"已激活"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"当前使用中"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"未找到角色卡"}},character:{t:0,b:{t:2,i:[{t:3}],s:"角色设定"}},close:{t:0,b:{t:2,i:[{t:3}],s:"关闭"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"意识 / 模型"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"创建者"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"创建者笔记"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"删除"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"删除角色卡"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"确定要删除这张角色卡吗?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"使用 Airi 角色卡预设"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"放开以上传文件"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"模块"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"还没有任何角色卡,点击上方按钮上传一个吧!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"没有找到匹配的角色卡"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"性格"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"历史提示指令"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"最近添加"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"场景"}},search:{t:0,b:{t:2,i:[{t:3}],s:"搜索角色卡..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"排序方式"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 模型"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 声线"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"系统提示词"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi 角色卡"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"尝试使用其他关键词搜索"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"上传"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"点击或拖拽文件到此处上传"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"存放记忆的地方,以及策略"}},title:{t:0,b:{t:2,i:[{t:3}],s:"记忆体"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"切换角色的 Live2D,VRM 模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"角色模型"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"人格设定、使用的模型等配置"}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},error:{t:0,b:{t:2,i:[{t:3}],s:"获取出错啦"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"展开"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"模型名字"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入与该提供商一起使用的模型名字"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"没有匹配的模型"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"没有模型匹配 '"},{t:4,k:"query"},{t:3,v:"' 关键字,请尝试一下别的关键词呢"}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"收起"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"思维,视觉,言语综合,游戏等"}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起玩 Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"异星工厂 Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起 Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"我的世界 Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音识别"}},title:{t:0,b:{t:2,i:[{t:3}],s:"听觉"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Discord 发消息和语音聊天"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音合成"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"停止"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"请选择声线"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定模型名字..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定声线 ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"选择合适的语音提供商"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的声线"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的声线列表没有返回任何的数据"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索声线..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个声线"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更少"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},title:{t:0,b:{t:2,i:[{t:3}],s:"选择语音合成提供商"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 SSML 文本"}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"启用后可以输入原始 SSML 而不是纯文本"}},label:{t:0,b:{t:2,i:[{t:3}],s:"选用自定义 SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}},title:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter 的浏览和使用"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API 密钥"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"添加自定义 HTTP 标头"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头名字"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP 请求头"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头数值"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"高级配置"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"基本设置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"基础配置"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"声音配置"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLM,语音合成,语音识别提供商等"}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"阿里百炼"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare 帐户 ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Workers AI 的 API Key"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节合成语音的音高(比如更尖锐或更粗旷)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"音高"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节说话的语速"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节语音的响度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"响度"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"深度求索 DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"声音相似性依从性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"相似度修正"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"增强说话者的相似性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"扬声器增强"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音生成速度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音稳定性和随机性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"稳定性"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音风格夸张"}},label:{t:0,b:{t:2,i:[{t:3}],s:"风格"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"生成中..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"测试声音"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入用于测试发音的文本"}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择语音语言"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择首选语音"}},label:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"实验平台"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"需要填写 API Key 才能用哦!"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs (11labs)"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"服务 Endpoint 地区(比如亚太 eastasia 区域)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Endpoint 地区"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure 语音服务"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"月之暗面"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenAi.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"一起"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"可在控制台获取的 App ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"火山引擎"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"X.AI"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"配置角色所在环境"}},title:{t:0,b:{t:2,i:[{t:3}],s:"场景"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"自定义你的舞台外观!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"强调色"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"配色"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"开发者"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi 绿"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"默认的绿色主题,由 Airi 为您带来!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"默认颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"米色"}},{t:0,b:{t:2,i:[{t:3}],s:"灰白色"}},{t:0,b:{t:2,i:[{t:3}],s:"浅灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"象牙色"}},{t:0,b:{t:2,i:[{t:3}],s:"橄榄灰"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受乔治·莫兰迪绘画启发的柔和、低调的色调"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi 颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"天蓝色"}},{t:0,b:{t:2,i:[{t:3}],s:"薄雾色"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"苔藓绿"}},{t:0,b:{t:2,i:[{t:3}],s:"睡莲色"}},{t:0,b:{t:2,i:[{t:3}],s:"小麦色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"鼠尾草色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受克劳德·莫奈作品启发的印象派调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"棕褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"赭色"}},{t:0,b:{t:2,i:[{t:3}],s:"咖啡色"}},{t:0,b:{t:2,i:[{t:3}],s:"青铜色"}},{t:0,b:{t:2,i:[{t:3}],s:"金色"}},{t:0,b:{t:2,i:[{t:3}],s:"芥末色"}},{t:0,b:{t:2,i:[{t:3}],s:"琥珀色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"传统日本色彩调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"北欧蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"冰色"}},{t:0,b:{t:2,i:[{t:3}],s:"峡湾色"}},{t:0,b:{t:2,i:[{t:3}],s:"钢铁色"}},{t:0,b:{t:2,i:[{t:3}],s:"冰川色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩色"}},{t:0,b:{t:2,i:[{t:3}],s:"云色"}},{t:0,b:{t:2,i:[{t:3}],s:"石头色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"北欧极简主义配色方案"}},title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"霞光红"}},{t:0,b:{t:2,i:[{t:3}],s:"枣红"}},{t:0,b:{t:2,i:[{t:3}],s:"黄栌"}},{t:0,b:{t:2,i:[{t:3}],s:"竹青"}},{t:0,b:{t:2,i:[{t:3}],s:"乌梅紫"}},{t:0,b:{t:2,i:[{t:3}],s:"缃色"}},{t:0,b:{t:2,i:[{t:3}],s:"青冥"}},{t:0,b:{t:2,i:[{t:3}],s:"赭石"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"中国传统色彩,源自古代纺织品、瓷器和绘画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"预设"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"外观"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"通用"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"主题"}},title:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"核心系统"}},you:{t:0,b:{t:2,i:[{t:3}],s:"你"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"聊天"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"换装"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"自定义"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"选择一个声线"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"表情"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"生气"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"尴尬"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"开心"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"日常"}},question:{t:0,b:{t:2,i:[{t:3}],s:"疑问"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"难过"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"惊喜"}},think:{t:0,b:{t:2,i:[{t:3}],s:"思考"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"摄像机"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}}),nG=W9({locale:iG(),fallbackLocale:"en",messages:ZA});function iG(){const n=localStorage.getItem("settings/language"),e=Object.keys(ZA);return n&&e.includes(n)?n:"en"}const sG=zz(),rG=Yz(QV);let tu;tu=KV({routes:rG,history:wV()});tu.beforeEach((n,e)=>{n.path!==e.path&&Lw.start()});tu.afterEach(()=>{Lw.done()});tu.isReady().then(async()=>{}).catch(()=>{});kR(tG).use(Nz).use(s3).use(tu).use(sG).use(nG).use(TB).mount("#app");export{qe as $,Kl as A,Pc as B,aG as C,$2 as D,j2 as E,jt as F,BH as G,Hn as H,rs as I,SG as J,mG as K,je as L,kG as M,pG as N,s0 as O,$V as P,Pt as Q,jw as R,JV as S,MG as T,DG as U,EG as V,Ae as W,he as X,B as Y,st as Z,Oo as _,RG as a,cw as a$,Pn as a0,Vn as a1,e_ as a2,Jn as a3,li as a4,la as a5,Xs as a6,Ii as a7,$t as a8,Gn as a9,Kc as aA,kl as aB,Gg as aC,lt as aD,cx as aE,eo as aF,lf as aG,qn as aH,r5 as aI,pw as aJ,XT as aK,kg as aL,mw as aM,h5 as aN,Ih as aO,K4 as aP,j4 as aQ,X4 as aR,G4 as aS,W4 as aT,B_ as aU,hw as aV,H4 as aW,fw as aX,V4 as aY,uw as aZ,k_ as a_,ls as aa,vc as ab,zi as ac,Cr as ad,aE as ae,Te as af,dt as ag,Ct as ah,D3 as ai,ot as aj,Sr as ak,dE as al,vL as am,bd as an,UL as ao,Oc as ap,_c as aq,mc as ar,$c as as,LR as at,I_ as au,xi as av,Ph as aw,JB as ax,Ft as ay,Zc as az,Ot as b,Eo as b$,UB as b0,Qn as b1,GG as b2,Ar as b3,Oe as b4,qh as b5,x0 as b6,hS as b7,mS as b8,hG as b9,NG as bA,FG as bB,OG as bC,IR as bD,Di as bE,dn as bF,AG as bG,HG as bH,Zw as bI,Uz as bJ,LG as bK,PG as bL,IG as bM,zG as bN,r3 as bO,o3 as bP,wT as bQ,CG as bR,as as bS,yL as bT,Fd as bU,Kt as bV,Ba as bW,ur as bX,mt as bY,Eh as bZ,yd as b_,Rn as ba,mf as bb,ai as bc,gn as bd,ks as be,gG as bf,p2 as bg,gS as bh,An as bi,yr as bj,Fi as bk,dG as bl,L0 as bm,b0 as bn,DS as bo,vG as bp,bG as bq,A0 as br,gr as bs,jB as bt,PR as bu,lG as bv,cG as bw,TG as bx,uG as by,ut as bz,yi as c,BG as c$,jn as c0,Cn as c1,gt as c2,ML as c3,yn as c4,Va as c5,_G as c6,wG as c7,Co as c8,os as c9,ti as cA,xg as cB,Hs as cC,LE as cD,So as cE,Fn as cF,$E as cG,qE as cH,YE as cI,pE as cJ,Ca as cK,VI as cL,qI as cM,r_ as cN,h_ as cO,gE as cP,_E as cQ,s_ as cR,gc as cS,ft as cT,Bs as cU,Xc as cV,hL as cW,EB as cX,IT as cY,Ng as cZ,Ga as c_,ka as ca,ts as cb,Md as cc,Wt as cd,zn as ce,oc as cf,vd as cg,ns as ch,vn as ci,gi as cj,IE as ck,fg as cl,xL as cm,S_ as cn,Tf as co,G0 as cp,oa as cq,en as cr,El as cs,Qi as ct,sc as cu,rc as cv,FL as cw,p3 as cx,g3 as cy,m3 as cz,fn as d,UG as d0,KB as d1,VG as d2,lr as e,g2 as f,lp as g,Me as h,mn as i,Ov as j,q2 as k,m2 as l,yG as m,Ua as n,_n as o,Xe as p,Si as q,et as r,qz as s,xC as t,xG as u,$z as v,R0 as w,ys as x,fG as y,ty as z}; +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否开启舞台动画"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"某些页面会有自己的过场动画,这将覆盖舞台过场动画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"是否使用页面特定过场动画"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"从文件加载"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"选择"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"从 URL 加载"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"加载"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"输入 Live2D 模型 URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"更换模型"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"编辑动作映射"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"播放动作"}},title:{t:0,b:{t:2,i:[{t:3}],s:"映射动作"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D 设置"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"麦克风"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"激活"}},active:{t:0,b:{t:2,i:[{t:3}],s:"已激活"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"当前使用中"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"未找到角色卡"}},character:{t:0,b:{t:2,i:[{t:3}],s:"角色设定"}},close:{t:0,b:{t:2,i:[{t:3}],s:"关闭"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"意识 / 模型"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"创建者"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"创建者笔记"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"删除"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"删除角色卡"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"确定要删除这张角色卡吗?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"使用 Airi 角色卡预设"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"放开以上传文件"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"模块"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"还没有任何角色卡,点击上方按钮上传一个吧!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"没有找到匹配的角色卡"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"性格"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"历史提示指令"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"最近添加"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"场景"}},search:{t:0,b:{t:2,i:[{t:3}],s:"搜索角色卡..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"排序方式"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 模型"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 声线"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"系统提示词"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi 角色卡"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"尝试使用其他关键词搜索"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"上传"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"点击或拖拽文件到此处上传"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"存放记忆的地方,以及策略"}},title:{t:0,b:{t:2,i:[{t:3}],s:"记忆体"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"切换角色的 Live2D,VRM 模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"角色模型"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"人格设定、使用的模型等配置"}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},error:{t:0,b:{t:2,i:[{t:3}],s:"获取出错啦"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"展开"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"模型名字"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入与该提供商一起使用的模型名字"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"没有匹配的模型"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"没有模型匹配 '"},{t:4,k:"query"},{t:3,v:"' 关键字,请尝试一下别的关键词呢"}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"收起"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"思维,视觉,言语综合,游戏等"}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起玩 Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"异星工厂 Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起 Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"我的世界 Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音识别"}},title:{t:0,b:{t:2,i:[{t:3}],s:"听觉"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Discord 发消息和语音聊天"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音合成"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"停止"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"请选择声线"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定模型名字..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定声线 ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"选择合适的语音提供商"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的声线"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的声线列表没有返回任何的数据"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索声线..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个声线"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更少"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},title:{t:0,b:{t:2,i:[{t:3}],s:"选择语音合成提供商"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 SSML 文本"}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"启用后可以输入原始 SSML 而不是纯文本"}},label:{t:0,b:{t:2,i:[{t:3}],s:"选用自定义 SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}},title:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter 的浏览和使用"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API 密钥"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"添加自定义 HTTP 标头"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头名字"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP 请求头"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头数值"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"高级配置"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"基本设置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"基础配置"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"声音配置"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLM,语音合成,语音识别提供商等"}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"阿里百炼"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare 帐户 ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Workers AI 的 API Key"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节合成语音的音高(比如更尖锐或更粗旷)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"音高"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节说话的语速"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节语音的响度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"响度"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"深度求索 DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"声音相似性依从性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"相似度修正"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"增强说话者的相似性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"扬声器增强"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音生成速度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音稳定性和随机性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"稳定性"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音风格夸张"}},label:{t:0,b:{t:2,i:[{t:3}],s:"风格"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"生成中..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"测试声音"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入用于测试发音的文本"}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择语音语言"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择首选语音"}},label:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"实验平台"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"需要填写 API Key 才能用哦!"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs (11labs)"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"服务 Endpoint 地区(比如亚太 eastasia 区域)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Endpoint 地区"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure 语音服务"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"月之暗面"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenAi.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"一起"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"可在控制台获取的 App ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"火山引擎"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"X.AI"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"配置角色所在环境"}},title:{t:0,b:{t:2,i:[{t:3}],s:"场景"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"自定义你的舞台外观!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"强调色"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"配色"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"开发者"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi 绿"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"默认的绿色主题,由 Airi 为您带来!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"默认颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"米色"}},{t:0,b:{t:2,i:[{t:3}],s:"灰白色"}},{t:0,b:{t:2,i:[{t:3}],s:"浅灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"象牙色"}},{t:0,b:{t:2,i:[{t:3}],s:"橄榄灰"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受乔治·莫兰迪绘画启发的柔和、低调的色调"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi 颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"天蓝色"}},{t:0,b:{t:2,i:[{t:3}],s:"薄雾色"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"苔藓绿"}},{t:0,b:{t:2,i:[{t:3}],s:"睡莲色"}},{t:0,b:{t:2,i:[{t:3}],s:"小麦色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"鼠尾草色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受克劳德·莫奈作品启发的印象派调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"棕褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"赭色"}},{t:0,b:{t:2,i:[{t:3}],s:"咖啡色"}},{t:0,b:{t:2,i:[{t:3}],s:"青铜色"}},{t:0,b:{t:2,i:[{t:3}],s:"金色"}},{t:0,b:{t:2,i:[{t:3}],s:"芥末色"}},{t:0,b:{t:2,i:[{t:3}],s:"琥珀色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"传统日本色彩调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"北欧蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"冰色"}},{t:0,b:{t:2,i:[{t:3}],s:"峡湾色"}},{t:0,b:{t:2,i:[{t:3}],s:"钢铁色"}},{t:0,b:{t:2,i:[{t:3}],s:"冰川色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩色"}},{t:0,b:{t:2,i:[{t:3}],s:"云色"}},{t:0,b:{t:2,i:[{t:3}],s:"石头色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"北欧极简主义配色方案"}},title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"霞光红"}},{t:0,b:{t:2,i:[{t:3}],s:"枣红"}},{t:0,b:{t:2,i:[{t:3}],s:"黄栌"}},{t:0,b:{t:2,i:[{t:3}],s:"竹青"}},{t:0,b:{t:2,i:[{t:3}],s:"乌梅紫"}},{t:0,b:{t:2,i:[{t:3}],s:"缃色"}},{t:0,b:{t:2,i:[{t:3}],s:"青冥"}},{t:0,b:{t:2,i:[{t:3}],s:"赭石"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"中国传统色彩,源自古代纺织品、瓷器和绘画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"预设"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"外观"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"通用"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"主题"}},title:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"核心系统"}},you:{t:0,b:{t:2,i:[{t:3}],s:"你"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"聊天"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"换装"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"自定义"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"选择一个声线"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"表情"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"生气"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"尴尬"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"开心"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"日常"}},question:{t:0,b:{t:2,i:[{t:3}],s:"疑问"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"难过"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"惊喜"}},think:{t:0,b:{t:2,i:[{t:3}],s:"思考"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"摄像机"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}}),nG=W9({locale:iG(),fallbackLocale:"en",messages:ZA});function iG(){const n=localStorage.getItem("settings/language"),e=Object.keys(ZA);return n&&e.includes(n)?n:"en"}const sG=zz(),rG=Yz(QV);let tu;tu=KV({routes:rG,history:wV()});tu.beforeEach((n,e)=>{n.path!==e.path&&Lw.start()});tu.afterEach(()=>{Lw.done()});tu.isReady().then(async()=>{}).catch(()=>{});kR(tG).use(Nz).use(s3).use(tu).use(sG).use(nG).use(TB).mount("#app");export{qe as $,Kl as A,Pc as B,aG as C,$2 as D,j2 as E,jt as F,BH as G,Hn as H,rs as I,SG as J,mG as K,je as L,kG as M,pG as N,s0 as O,$V as P,Pt as Q,jw as R,JV as S,MG as T,DG as U,EG as V,Ae as W,he as X,B as Y,st as Z,Oo as _,RG as a,cw as a$,Pn as a0,Vn as a1,e_ as a2,Jn as a3,li as a4,la as a5,Xs as a6,Ii as a7,$t as a8,Gn as a9,Kc as aA,kl as aB,Gg as aC,lt as aD,cx as aE,eo as aF,lf as aG,qn as aH,r5 as aI,pw as aJ,XT as aK,kg as aL,mw as aM,h5 as aN,Ih as aO,K4 as aP,j4 as aQ,X4 as aR,G4 as aS,W4 as aT,B_ as aU,hw as aV,H4 as aW,fw as aX,V4 as aY,uw as aZ,k_ as a_,ls as aa,vc as ab,zi as ac,Cr as ad,aE as ae,Te as af,dt as ag,Ct as ah,D3 as ai,ot as aj,Sr as ak,dE as al,vL as am,bd as an,UL as ao,Oc as ap,_c as aq,mc as ar,$c as as,LR as at,I_ as au,xi as av,Ph as aw,JB as ax,Ft as ay,Zc as az,Ot as b,jn as b$,UB as b0,Qn as b1,GG as b2,Ar as b3,Oe as b4,qh as b5,x0 as b6,hS as b7,mS as b8,hG as b9,cG as bA,TG as bB,uG as bC,ut as bD,NG as bE,FG as bF,OG as bG,IR as bH,Di as bI,dn as bJ,AG as bK,HG as bL,zG as bM,r3 as bN,o3 as bO,wT as bP,CG as bQ,as as bR,yL as bS,Fd as bT,Kt as bU,Ba as bV,ur as bW,mt as bX,Eh as bY,yd as bZ,Eo as b_,Rn as ba,mf as bb,ai as bc,gn as bd,ks as be,gG as bf,p2 as bg,gS as bh,An as bi,yr as bj,Fi as bk,dG as bl,L0 as bm,b0 as bn,DS as bo,vG as bp,bG as bq,A0 as br,gr as bs,jB as bt,PR as bu,Zw as bv,LG as bw,PG as bx,IG as by,lG as bz,yi as c,BG as c$,Cn as c0,gt as c1,ML as c2,yn as c3,Va as c4,_G as c5,wG as c6,Co as c7,os as c8,ka as c9,xg as cA,Hs as cB,LE as cC,So as cD,Fn as cE,$E as cF,qE as cG,YE as cH,pE as cI,Ca as cJ,VI as cK,qI as cL,r_ as cM,h_ as cN,gE as cO,_E as cP,s_ as cQ,gc as cR,ft as cS,Bs as cT,Xc as cU,hL as cV,EB as cW,Uz as cX,IT as cY,Ng as cZ,Ga as c_,ts as ca,Md as cb,Wt as cc,zn as cd,oc as ce,vd as cf,ns as cg,vn as ch,gi as ci,IE as cj,fg as ck,xL as cl,S_ as cm,Tf as cn,G0 as co,oa as cp,en as cq,El as cr,Qi as cs,sc as ct,rc as cu,FL as cv,p3 as cw,g3 as cx,m3 as cy,ti as cz,fn as d,UG as d0,KB as d1,VG as d2,lr as e,g2 as f,lp as g,Me as h,mn as i,Ov as j,q2 as k,m2 as l,yG as m,Ua as n,_n as o,Xe as p,Si as q,et as r,qz as s,xC as t,xG as u,$z as v,R0 as w,ys as x,fG as y,ty as z}; diff --git a/assets/index-BDsSm1mO.js b/assets/index-8sqTduK0.js similarity index 79% rename from assets/index-BDsSm1mO.js rename to assets/index-8sqTduK0.js index f1172274f1068fe2fe84f364cac45d6f261bfff8..7e6bd5fbea765738672d2332845bbb141dad1850 100644 --- a/assets/index-BDsSm1mO.js +++ b/assets/index-8sqTduK0.js @@ -1 +1 @@ -import{l as Z,J as P}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{_ as G,a as K}from"./Model.vue_vue_type_script_setup_true_lang-6CsRcxL-.js";import{d as z,G as B,c as f,o as s,b as t,f as W,g as q,bA as H,s as Q,r as $,p as X,bB as Y,i as l,A as D,j as ee,w as c,e as u,y as O,z as te,k as b,t as F,F as U,l as I,at as oe,_ as ne,bC as ie,N as ae,K as le}from"./index-Bo-ykojl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import"./mcp-Ce-wxTN6.js";import{a as R,b as se}from"./mini_xsschema-f5xAZ6yD.js";import"./three-vrm-animation.module-CbeIjn7h.js";import{V as re}from"./browser-CkchkNbv.js";import{_ as V,a as de}from"./ColorPalette.vue_vue_type_script_setup_true_lang-cX_hB6ek.js";import{u as ce}from"./useIconAnimation-CY9TceXA.js";import{b as A}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./index-DmpthJxW.js";const ue=["disabled"],h=z({__name:"Live2DModelControlButton",emits:["click"],setup(j){const m=B();return(r,n)=>(s(),f("button",{disabled:t(m).loadingLive2dModel,bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250",rounded:"",onClick:n[0]||(n[0]=p=>r.$emit("click"))},[W(r.$slots,"default")],8,ue))}}),me={flex:"~ col gap-4"},fe={flex:"","items-center":"","gap-2":""},pe=["disabled","placeholder"],ve={"font-medium":""},_e={flex:"","gap-2":""},ge=["onUpdate:modelValue"],be=["href","download"],he=z({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(j){const{t:m}=q(),r=H({accept:"application/zip"}),n=B(),{live2dModelFile:p,live2dMotionMap:v,live2dLoadSource:y,loadingLive2dModel:x,availableLive2dMotions:L,live2dModelUrl:M}=Q(n),_=$(M.value);r.onChange(o=>{o&&o.length>0&&(v.value={},p.value=o[0],y.value="file",x.value=!0)}),X(()=>n.loadingLive2dModel,o=>{o||y.value==="file"&&L.value.forEach(e=>{e.motionName in R?v.value[e.fileName]=e.motionName:v.value[e.fileName]=se})});async function g(o,e){if(!Object.keys(e).length)return o;const a=await new P().loadAsync(o),d=Object.keys(a.files).find(N=>N.endsWith("model3.json"));if(!d)throw new Error("model3.json not found");const J=await a.file(d).async("string"),E=JSON.parse(J),C={};Object.entries(e).forEach(([N,S])=>{if(C[S]){C[S].push({File:N});return}C[S]=[{File:N}]}),E.FileReferences.Motions=C,a.file(d,JSON.stringify(E,null,2));const T=await a.generateAsync({type:"blob"});return new File([T],o.name,{type:o.type,lastModified:o.lastModified})}async function w(){const o=await Z.getItem("live2dModel");if(!o)return;const e=await g(o,v.value);p.value=e,y.value="file",x.value=!0}const k=Y(p);return(o,e)=>(s(),f("div",me,[l(t(V),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:c(()=>[u("div",fe,[O(u("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>_.value=i),disabled:t(n).loadingLive2dModel,class:"form-control flex-1",border:"neutral-300 dark:neutral-800 solid 1 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out",placeholder:t(m)("settings.live2d.change-model.from-url-placeholder")},null,8,pe),[[te,_.value]]),l(h,{class:"form-control",onClick:e[1]||(e[1]=i=>M.value=_.value)},{default:c(()=>[b(F(t(m)("settings.live2d.change-model.from-url")),1)]),_:1})]),l(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=i=>t(r).open())},{default:c(()=>[b(F(t(m)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),l(h,{class:"form-control",onClick:e[3]||(e[3]=i=>o.$emit("extractColorsFromModel"))},{default:c(()=>e[4]||(e[4]=[b(" Extract colors from model ")])),_:1,__:[4]}),l(de,{colors:j.palette.map(i=>({hex:i,name:i}))},null,8,["colors"])]),_:1}),t(n).live2dLoadSource==="file"?(s(),D(t(V),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:c(()=>{var i;return[(s(!0),f(U,null,I(t(n).availableLive2dMotions,a=>(s(),f("div",{key:a.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[u("span",ve,F(a.fileName),1),u("div",_e,[O(u("select",{"onUpdate:modelValue":d=>t(n).live2dMotionMap[a.fileName]=d},[(s(!0),f(U,null,I(Object.keys(t(R)),d=>(s(),f("option",{key:d},F(d),1))),128))],8,ge),[[oe,t(n).live2dMotionMap[a.fileName]]]),l(h,{class:"form-control",onClick:d=>t(n).live2dCurrentMotion={group:a.motionName,index:a.motionIndex}},{default:c(()=>e[5]||(e[5]=[b(" Play ")])),_:2,__:[5]},1032,["onClick"])])]))),128)),l(h,{onClick:w},{default:c(()=>e[6]||(e[6]=[b(" Save and patch ")])),_:1,__:[6]}),u("a",{"mt-2":"",block:"",href:t(k),download:`${((i=t(n).live2dModelFile)==null?void 0:i.name)||"live2d"}-motion-edited.zip`},[l(h,{"w-full":""},{default:c(()=>e[7]||(e[7]=[b("Export")])),_:1,__:[7]})],8,be)]}),_:1})):ee("",!0)]))}}),ye=ne(he,[["__scopeId","data-v-b2e16668"]]),ke={flex:""},xe={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Me=z({__name:"index",setup(j){const m=$(),r=$(),{width:n,height:p}=ie(m),v=$([]);async function y(){if(!r.value)return;const _=await r.value.captureFrame();if(!_){console.error("No frame captured");return}const g=URL.createObjectURL(_);try{const k=await new re(g).getPalette();v.value=Object.values(k).map(o=>o==null?void 0:o.hex).filter(o=>typeof o=="string")}finally{URL.revokeObjectURL(g)}}const{iconAnimationStarted:x,showIconAnimation:L,animationIcon:M}=ce("i-solar:people-nearby-bold-duotone");return(_,g)=>{const w=ae("IconAnimation"),k=le("motion");return s(),f(U,null,[u("div",ke,[u("div",{ref_key:"live2dContainerRef",ref:m,w:"50%",h:"80vh"},[l(t(K),{ref_key:"live2dCanvasRef",ref:r,width:t(n),height:t(p)},{default:c(({app:o})=>[l(t(G),{app:o,"mouth-open-size":0,width:t(n),height:t(p),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),l(ye,{w:"50%",h:"80vh",palette:v.value,onExtractColorsFromModel:y},null,8,["palette"])]),t(L)?(s(),D(w,{key:0,"z-index":-1,icon:t(M),"icon-size":12,duration:1e3,started:t(x),"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"])):O((s(),f("div",xe,g[0]||(g[0]=[u("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[k]])],64)}}});typeof A=="function"&&A(Me);export{Me as default}; +import{l as Z,J as G}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{_ as P,a as K}from"./Model.vue_vue_type_script_setup_true_lang-DoV2Qdhe.js";import{d as E,G as B,c as f,o as s,b as t,f as W,g as q,bE as H,s as Q,r as $,p as X,bF as Y,i as l,A as D,j as ee,w as c,e as u,y as O,z as te,k as b,t as F,F as U,l as I,at as oe,_ as ne,bG as ie,N as ae,K as le}from"./index-1_q7hlhr.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import"./mcp-DcvIwSEe.js";import{a as R,b as se}from"./mini_xsschema-f5xAZ6yD.js";import"./three-vrm-animation.module-CtUkMEcn.js";import{V as re}from"./browser-CkchkNbv.js";import{_ as V,a as de}from"./ColorPalette.vue_vue_type_script_setup_true_lang-B9HHyio1.js";import{u as ce}from"./useIconAnimation-rMzGkkyX.js";import{b as A}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./index-CmOAxAkQ.js";const ue=["disabled"],h=E({__name:"Live2DModelControlButton",emits:["click"],setup(j){const m=B();return(r,n)=>(s(),f("button",{disabled:t(m).loadingLive2dModel,bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250",rounded:"",onClick:n[0]||(n[0]=p=>r.$emit("click"))},[W(r.$slots,"default")],8,ue))}}),me={flex:"~ col gap-4"},fe={flex:"","items-center":"","gap-2":""},pe=["disabled","placeholder"],ve={"font-medium":""},_e={flex:"","gap-2":""},ge=["onUpdate:modelValue"],be=["href","download"],he=E({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(j){const{t:m}=q(),r=H({accept:"application/zip"}),n=B(),{live2dModelFile:p,live2dMotionMap:v,live2dLoadSource:y,loadingLive2dModel:x,availableLive2dMotions:L,live2dModelUrl:M}=Q(n),_=$(M.value);r.onChange(o=>{o&&o.length>0&&(v.value={},p.value=o[0],y.value="file",x.value=!0)}),X(()=>n.loadingLive2dModel,o=>{o||y.value==="file"&&L.value.forEach(e=>{e.motionName in R?v.value[e.fileName]=e.motionName:v.value[e.fileName]=se})});async function g(o,e){if(!Object.keys(e).length)return o;const a=await new G().loadAsync(o),d=Object.keys(a.files).find(N=>N.endsWith("model3.json"));if(!d)throw new Error("model3.json not found");const J=await a.file(d).async("string"),z=JSON.parse(J),C={};Object.entries(e).forEach(([N,S])=>{if(C[S]){C[S].push({File:N});return}C[S]=[{File:N}]}),z.FileReferences.Motions=C,a.file(d,JSON.stringify(z,null,2));const T=await a.generateAsync({type:"blob"});return new File([T],o.name,{type:o.type,lastModified:o.lastModified})}async function w(){const o=await Z.getItem("live2dModel");if(!o)return;const e=await g(o,v.value);p.value=e,y.value="file",x.value=!0}const k=Y(p);return(o,e)=>(s(),f("div",me,[l(t(V),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:c(()=>[u("div",fe,[O(u("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>_.value=i),disabled:t(n).loadingLive2dModel,class:"form-control flex-1",border:"neutral-300 dark:neutral-800 solid 1 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out",placeholder:t(m)("settings.live2d.change-model.from-url-placeholder")},null,8,pe),[[te,_.value]]),l(h,{class:"form-control",onClick:e[1]||(e[1]=i=>M.value=_.value)},{default:c(()=>[b(F(t(m)("settings.live2d.change-model.from-url")),1)]),_:1})]),l(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=i=>t(r).open())},{default:c(()=>[b(F(t(m)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),l(h,{class:"form-control",onClick:e[3]||(e[3]=i=>o.$emit("extractColorsFromModel"))},{default:c(()=>e[4]||(e[4]=[b(" Extract colors from model ")])),_:1,__:[4]}),l(de,{colors:j.palette.map(i=>({hex:i,name:i}))},null,8,["colors"])]),_:1}),t(n).live2dLoadSource==="file"?(s(),D(t(V),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:c(()=>{var i;return[(s(!0),f(U,null,I(t(n).availableLive2dMotions,a=>(s(),f("div",{key:a.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[u("span",ve,F(a.fileName),1),u("div",_e,[O(u("select",{"onUpdate:modelValue":d=>t(n).live2dMotionMap[a.fileName]=d},[(s(!0),f(U,null,I(Object.keys(t(R)),d=>(s(),f("option",{key:d},F(d),1))),128))],8,ge),[[oe,t(n).live2dMotionMap[a.fileName]]]),l(h,{class:"form-control",onClick:d=>t(n).live2dCurrentMotion={group:a.motionName,index:a.motionIndex}},{default:c(()=>e[5]||(e[5]=[b(" Play ")])),_:2,__:[5]},1032,["onClick"])])]))),128)),l(h,{onClick:w},{default:c(()=>e[6]||(e[6]=[b(" Save and patch ")])),_:1,__:[6]}),u("a",{"mt-2":"",block:"",href:t(k),download:`${((i=t(n).live2dModelFile)==null?void 0:i.name)||"live2d"}-motion-edited.zip`},[l(h,{"w-full":""},{default:c(()=>e[7]||(e[7]=[b("Export")])),_:1,__:[7]})],8,be)]}),_:1})):ee("",!0)]))}}),ye=ne(he,[["__scopeId","data-v-b2e16668"]]),ke={flex:""},xe={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Me=E({__name:"index",setup(j){const m=$(),r=$(),{width:n,height:p}=ie(m),v=$([]);async function y(){if(!r.value)return;const _=await r.value.captureFrame();if(!_){console.error("No frame captured");return}const g=URL.createObjectURL(_);try{const k=await new re(g).getPalette();v.value=Object.values(k).map(o=>o==null?void 0:o.hex).filter(o=>typeof o=="string")}finally{URL.revokeObjectURL(g)}}const{iconAnimationStarted:x,showIconAnimation:L,animationIcon:M}=ce("i-solar:people-nearby-bold-duotone");return(_,g)=>{const w=ae("IconAnimation"),k=le("motion");return s(),f(U,null,[u("div",ke,[u("div",{ref_key:"live2dContainerRef",ref:m,w:"50%",h:"80vh"},[l(t(K),{ref_key:"live2dCanvasRef",ref:r,width:t(n),height:t(p)},{default:c(({app:o})=>[l(t(P),{app:o,"mouth-open-size":0,width:t(n),height:t(p),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),l(ye,{w:"50%",h:"80vh",palette:v.value,onExtractColorsFromModel:y},null,8,["palette"])]),t(L)?(s(),D(w,{key:0,"z-index":-1,icon:t(M),"icon-size":12,duration:1e3,started:t(x),"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"])):O((s(),f("div",xe,g[0]||(g[0]=[u("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[k]])],64)}}});typeof A=="function"&&A(Me);export{Me as default}; diff --git a/assets/index-D2UJ2Jls.js b/assets/index-BX7nlSld.js similarity index 99% rename from assets/index-D2UJ2Jls.js rename to assets/index-BX7nlSld.js index 58880542c1ea69fc988e0d6a317ee08efad83277..4c140da100fd667095e6cac7933175da6ba5584f 100644 --- a/assets/index-D2UJ2Jls.js +++ b/assets/index-BX7nlSld.js @@ -1,4 +1,4 @@ -import{bH as getAugmentedNamespace}from"./index-Bo-ykojl.js";var dist={},assetPath={},hasRequiredAssetPath;function requireAssetPath(){if(hasRequiredAssetPath)return assetPath;hasRequiredAssetPath=1,Object.defineProperty(assetPath,"__esModule",{value:!0}),assetPath.baseAssetPath=void 0;const u=typeof window<"u"&&typeof window.document<"u"?window.document.currentScript:null;let b="/";return u&&(b=u.src.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),assetPath.baseAssetPath=b,assetPath}var defaultModelFetcher={},hasRequiredDefaultModelFetcher;function requireDefaultModelFetcher(){if(hasRequiredDefaultModelFetcher)return defaultModelFetcher;hasRequiredDefaultModelFetcher=1,Object.defineProperty(defaultModelFetcher,"__esModule",{value:!0}),defaultModelFetcher.defaultModelFetcher=void 0;const D=u=>fetch(u).then(b=>b.arrayBuffer());return defaultModelFetcher.defaultModelFetcher=D,defaultModelFetcher}var frameProcessor={},logging={},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.log=D.LOG_PREFIX=void 0,D.LOG_PREFIX="[VAD]";const u=["error","debug","warn"];function b(p){return(...h)=>{console[p](D.LOG_PREFIX,...h)}}const g=u.reduce((p,h)=>(p[h]=b(h),p),{});D.log=g}(logging)),logging}var messages={},hasRequiredMessages;function requireMessages(){if(hasRequiredMessages)return messages;hasRequiredMessages=1,Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0;var D;return function(u){u.AudioFrame="AUDIO_FRAME",u.SpeechStart="SPEECH_START",u.VADMisfire="VAD_MISFIRE",u.SpeechEnd="SPEECH_END",u.SpeechStop="SPEECH_STOP",u.SpeechRealStart="SPEECH_REAL_START",u.FrameProcessed="FRAME_PROCESSED"}(D||(messages.Message=D={})),messages}var hasRequiredFrameProcessor;function requireFrameProcessor(){if(hasRequiredFrameProcessor)return frameProcessor;hasRequiredFrameProcessor=1,Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const D=requireLogging(),u=requireMessages(),b=[512,1024,1536];frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1};function g(o){b.includes(o.frameSamples)||D.log.warn("You are using an unusual frame size"),(o.positiveSpeechThreshold<0||o.positiveSpeechThreshold>1)&&D.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(o.negativeSpeechThreshold<0||o.negativeSpeechThreshold>o.positiveSpeechThreshold)&&D.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),o.preSpeechPadFrames<0&&D.log.error("preSpeechPadFrames should be positive"),o.redemptionFrames<0&&D.log.error("redemptionFrames should be positive")}frameProcessor.validateOptions=g;const p=o=>{const c=o.reduce((s,i)=>(s.push(s.at(-1)+i.length),s),[0]),f=new Float32Array(c.at(-1));return o.forEach((s,i)=>{const t=c[i];f.set(s,t)}),f};class h{constructor(c,f,s){this.modelProcessFunc=c,this.modelResetFunc=f,this.options=s,this.speaking=!1,this.redemptionCounter=0,this.speechFrameCount=0,this.active=!1,this.speechRealStartFired=!1,this.reset=()=>{this.speaking=!1,this.speechRealStartFired=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0,this.speechFrameCount=0},this.pause=i=>{this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment(i):this.reset()},this.resume=()=>{this.active=!0},this.endSegment=i=>{const t=this.audioBuffer;this.audioBuffer=[];const e=this.speaking;if(this.reset(),e)if(t.reduce((r,a)=>a.isSpeech?r+1:r,0)>=this.options.minSpeechFrames){const r=p(t.map(a=>a.frame));i({msg:u.Message.SpeechEnd,audio:r})}else i({msg:u.Message.VADMisfire});return{}},this.process=async(i,t)=>{if(!this.active)return;const e=await this.modelProcessFunc(i),n=e.isSpeech>=this.options.positiveSpeechThreshold;if(t({probs:e,msg:u.Message.FrameProcessed,frame:i}),this.audioBuffer.push({frame:i,isSpeech:n}),n&&(this.speechFrameCount++,this.redemptionCounter=0),n&&!this.speaking&&(this.speaking=!0,t({msg:u.Message.SpeechStart})),this.speaking&&this.speechFrameCount===this.options.minSpeechFrames&&!this.speechRealStartFired&&(this.speechRealStartFired=!0,t({msg:u.Message.SpeechRealStart})),e.isSpeech=this.options.redemptionFrames){this.redemptionCounter=0,this.speechFrameCount=0,this.speaking=!1,this.speechRealStartFired=!1;const r=this.audioBuffer;if(this.audioBuffer=[],r.reduce((l,d)=>d.isSpeech?l+1:l,0)>=this.options.minSpeechFrames){const l=p(r.map(d=>d.frame));t({msg:u.Message.SpeechEnd,audio:l})}else t({msg:u.Message.VADMisfire})}if(!this.speaking){for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();this.speechFrameCount=0}},this.audioBuffer=[],this.reset()}}return frameProcessor.FrameProcessor=h,frameProcessor}var nonRealTimeVad={},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,_=e*2,v=-1;s==="RGBA"?(m=0,y=e,_=e*2,v=e*3):s==="RGB"?(m=0,y=e,_=e*2):s==="RBG"&&(m=0,_=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{bL as getAugmentedNamespace}from"./index-1_q7hlhr.js";var dist={},assetPath={},hasRequiredAssetPath;function requireAssetPath(){if(hasRequiredAssetPath)return assetPath;hasRequiredAssetPath=1,Object.defineProperty(assetPath,"__esModule",{value:!0}),assetPath.baseAssetPath=void 0;const u=typeof window<"u"&&typeof window.document<"u"?window.document.currentScript:null;let b="/";return u&&(b=u.src.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),assetPath.baseAssetPath=b,assetPath}var defaultModelFetcher={},hasRequiredDefaultModelFetcher;function requireDefaultModelFetcher(){if(hasRequiredDefaultModelFetcher)return defaultModelFetcher;hasRequiredDefaultModelFetcher=1,Object.defineProperty(defaultModelFetcher,"__esModule",{value:!0}),defaultModelFetcher.defaultModelFetcher=void 0;const D=u=>fetch(u).then(b=>b.arrayBuffer());return defaultModelFetcher.defaultModelFetcher=D,defaultModelFetcher}var frameProcessor={},logging={},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.log=D.LOG_PREFIX=void 0,D.LOG_PREFIX="[VAD]";const u=["error","debug","warn"];function b(p){return(...h)=>{console[p](D.LOG_PREFIX,...h)}}const g=u.reduce((p,h)=>(p[h]=b(h),p),{});D.log=g}(logging)),logging}var messages={},hasRequiredMessages;function requireMessages(){if(hasRequiredMessages)return messages;hasRequiredMessages=1,Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0;var D;return function(u){u.AudioFrame="AUDIO_FRAME",u.SpeechStart="SPEECH_START",u.VADMisfire="VAD_MISFIRE",u.SpeechEnd="SPEECH_END",u.SpeechStop="SPEECH_STOP",u.SpeechRealStart="SPEECH_REAL_START",u.FrameProcessed="FRAME_PROCESSED"}(D||(messages.Message=D={})),messages}var hasRequiredFrameProcessor;function requireFrameProcessor(){if(hasRequiredFrameProcessor)return frameProcessor;hasRequiredFrameProcessor=1,Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const D=requireLogging(),u=requireMessages(),b=[512,1024,1536];frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1};function g(o){b.includes(o.frameSamples)||D.log.warn("You are using an unusual frame size"),(o.positiveSpeechThreshold<0||o.positiveSpeechThreshold>1)&&D.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(o.negativeSpeechThreshold<0||o.negativeSpeechThreshold>o.positiveSpeechThreshold)&&D.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),o.preSpeechPadFrames<0&&D.log.error("preSpeechPadFrames should be positive"),o.redemptionFrames<0&&D.log.error("redemptionFrames should be positive")}frameProcessor.validateOptions=g;const p=o=>{const c=o.reduce((s,i)=>(s.push(s.at(-1)+i.length),s),[0]),f=new Float32Array(c.at(-1));return o.forEach((s,i)=>{const t=c[i];f.set(s,t)}),f};class h{constructor(c,f,s){this.modelProcessFunc=c,this.modelResetFunc=f,this.options=s,this.speaking=!1,this.redemptionCounter=0,this.speechFrameCount=0,this.active=!1,this.speechRealStartFired=!1,this.reset=()=>{this.speaking=!1,this.speechRealStartFired=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0,this.speechFrameCount=0},this.pause=i=>{this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment(i):this.reset()},this.resume=()=>{this.active=!0},this.endSegment=i=>{const t=this.audioBuffer;this.audioBuffer=[];const e=this.speaking;if(this.reset(),e)if(t.reduce((r,a)=>a.isSpeech?r+1:r,0)>=this.options.minSpeechFrames){const r=p(t.map(a=>a.frame));i({msg:u.Message.SpeechEnd,audio:r})}else i({msg:u.Message.VADMisfire});return{}},this.process=async(i,t)=>{if(!this.active)return;const e=await this.modelProcessFunc(i),n=e.isSpeech>=this.options.positiveSpeechThreshold;if(t({probs:e,msg:u.Message.FrameProcessed,frame:i}),this.audioBuffer.push({frame:i,isSpeech:n}),n&&(this.speechFrameCount++,this.redemptionCounter=0),n&&!this.speaking&&(this.speaking=!0,t({msg:u.Message.SpeechStart})),this.speaking&&this.speechFrameCount===this.options.minSpeechFrames&&!this.speechRealStartFired&&(this.speechRealStartFired=!0,t({msg:u.Message.SpeechRealStart})),e.isSpeech=this.options.redemptionFrames){this.redemptionCounter=0,this.speechFrameCount=0,this.speaking=!1,this.speechRealStartFired=!1;const r=this.audioBuffer;if(this.audioBuffer=[],r.reduce((l,d)=>d.isSpeech?l+1:l,0)>=this.options.minSpeechFrames){const l=p(r.map(d=>d.frame));t({msg:u.Message.SpeechEnd,audio:l})}else t({msg:u.Message.VADMisfire})}if(!this.speaking){for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();this.speechFrameCount=0}},this.audioBuffer=[],this.reset()}}return frameProcessor.FrameProcessor=h,frameProcessor}var nonRealTimeVad={},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,_=e*2,v=-1;s==="RGBA"?(m=0,y=e,_=e*2,v=e*3):s==="RGB"?(m=0,y=e,_=e*2):s==="RBG"&&(m=0,_=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-DGpPP4PM.js b/assets/index-CRmwnLFA.js similarity index 85% rename from assets/index-DGpPP4PM.js rename to assets/index-CRmwnLFA.js index 6f8c46019d3f75248488171f5ae6462b71748f51..723ab2cab43284d0acb87eb9e2742c438b62bc84 100644 --- a/assets/index-DGpPP4PM.js +++ b/assets/index-CRmwnLFA.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as h,g as v,h as b,K as k,c as t,o as i,e as c,A as d,y as m,F as l,l as _,b as s}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{I as x}from"./IconStatusItem-CU771Upv.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as I}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Vav3WbNP.js";import{u as z}from"./useIconAnimation-CY9TceXA.js";import{b as g}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";const A={grid:"~ cols-1 sm:cols-2 gap-4"},B={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},w=h({__name:"index",setup(C){const{t:e}=v(),p=b(()=>[{id:"consciousness",name:e("settings.pages.modules.consciousness.title"),description:e("settings.pages.modules.consciousness.description"),icon:"i-solar:ghost-bold-duotone",to:"/settings/modules/consciousness",configured:!1},{id:"speech",name:e("settings.pages.modules.speech.title"),description:e("settings.pages.modules.speech.description"),icon:"i-solar:user-speak-rounded-bold-duotone",to:"/settings/modules/speech",configured:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-solar:microphone-3-bold-duotone",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-solar:eye-closed-bold-duotone",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-solar:bookmark-bold-duotone",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-solar:book-bookmark-bold-duotone",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:u,showIconAnimation:f,animationIcon:y}=z("i-solar:layers-bold-duotone");return(D,n)=>{const r=k("motion");return i(),t(l,null,[c("div",A,[(i(!0),t(l,null,_(p.value,(o,a)=>m((i(),d(s(x),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+a*10,delay:a*50,title:o.name,description:o.description,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:o.to,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),s(f)?(i(),d(I,{key:0,icon:s(y),"icon-size":12,duration:1e3,started:s(u),"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((i(),t("div",B,n[0]||(n[0]=[c("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[r]])],64)}}});typeof g=="function"&&g(w);export{w as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as h,g as v,h as b,K as k,c as t,o as i,e as c,A as d,y as m,F as l,l as _,b as s}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{I as x}from"./IconStatusItem-Z8CeAcrh.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as I}from"./IconAnimation.vue_vue_type_script_setup_true_lang-tDvrftik.js";import{u as z}from"./useIconAnimation-rMzGkkyX.js";import{b as g}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";const A={grid:"~ cols-1 sm:cols-2 gap-4"},B={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},w=h({__name:"index",setup(C){const{t:e}=v(),p=b(()=>[{id:"consciousness",name:e("settings.pages.modules.consciousness.title"),description:e("settings.pages.modules.consciousness.description"),icon:"i-solar:ghost-bold-duotone",to:"/settings/modules/consciousness",configured:!1},{id:"speech",name:e("settings.pages.modules.speech.title"),description:e("settings.pages.modules.speech.description"),icon:"i-solar:user-speak-rounded-bold-duotone",to:"/settings/modules/speech",configured:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-solar:microphone-3-bold-duotone",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-solar:eye-closed-bold-duotone",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-solar:bookmark-bold-duotone",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-solar:book-bookmark-bold-duotone",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:u,showIconAnimation:f,animationIcon:y}=z("i-solar:layers-bold-duotone");return(D,n)=>{const r=k("motion");return i(),t(l,null,[c("div",A,[(i(!0),t(l,null,_(p.value,(o,a)=>m((i(),d(s(x),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+a*10,delay:a*50,title:o.name,description:o.description,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:o.to,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),s(f)?(i(),d(I,{key:0,icon:s(y),"icon-size":12,duration:1e3,started:s(u),"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((i(),t("div",B,n[0]||(n[0]=[c("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[r]])],64)}}});typeof g=="function"&&g(w);export{w as default}; diff --git a/assets/index-0TANYLAi.js b/assets/index-ClvjpxDE.js similarity index 99% rename from assets/index-0TANYLAi.js rename to assets/index-ClvjpxDE.js index 8f2c1312d2c34cdc147ff78d7befc4e51844afa1..5d44beed37f81d9cc3e9b9f44aac30a9ba7e2a03 100644 --- a/assets/index-0TANYLAi.js +++ b/assets/index-ClvjpxDE.js @@ -1,4 +1,4 @@ -import{Z as s,a as x}from"./mcp-Ce-wxTN6.js";import"./index-Bo-ykojl.js";const M=Symbol("Let zodToJsonSchema decide on which parser to use"),P={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},D=t=>typeof t=="string"?{...P,name:t}:{...P,...t},T=t=>{const e=D(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};function _(t,e,a,n){n!=null&&n.errorMessages&&a&&(t.errorMessage={...t.errorMessage,[e]:a})}function l(t,e,a,n,r){t[e]=a,_(t,e,n,r)}function N(){return{}}function $(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==s.ZodAny&&(a.items=c(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&l(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&l(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(l(a,"minItems",t.exactLength.value,t.exactLength.message,e),l(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}function w(t,e){const a={type:"integer",format:"int64"};if(!t.checks)return a;for(const n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?l(a,"minimum",n.value,n.message,e):l(a,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(a.exclusiveMinimum=!0),l(a,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?l(a,"maximum",n.value,n.message,e):l(a,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(a.exclusiveMaximum=!0),l(a,"maximum",n.value,n.message,e));break;case"multipleOf":l(a,"multipleOf",n.value,n.message,e);break}return a}function z(){return{type:"boolean"}}function Z(t,e){return c(t.type._def,e)}const L=(t,e)=>c(t.innerType._def,e);function S(t,e,a){const n=a??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,i)=>S(t,e,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return F(t,e)}}const F=(t,e)=>{const a={type:"integer",format:"unix-time"};if(e.target==="openApi3")return a;for(const n of t.checks)switch(n.kind){case"min":l(a,"minimum",n.value,n.message,e);break;case"max":l(a,"maximum",n.value,n.message,e);break}return a};function I(t,e){return{...c(t.innerType._def,e),default:t.defaultValue()}}function E(t,e){return e.effectStrategy==="input"?c(t.schema._def,e):{}}function R(t){return{type:"string",enum:Array.from(t.values)}}const C=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function U(t,e){const a=[c(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),c(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i);let n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(i=>{if(C(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:m,...p}=i;o=p}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function B(t,e){const a=typeof t.value;return a!=="bigint"&&a!=="number"&&a!=="boolean"&&a!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:a==="bigint"?"integer":a,enum:[t.value]}:{type:a==="bigint"?"integer":a,const:t.value}}let b;const f={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(b===void 0&&(b=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),b),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function O(t,e){const a={type:"string"};if(t.checks)for(const n of t.checks)switch(n.kind){case"min":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e);break;case"max":l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":y(a,"email",n.message,e);break;case"format:idn-email":y(a,"idn-email",n.message,e);break;case"pattern:zod":d(a,f.email,n.message,e);break}break;case"url":y(a,"uri",n.message,e);break;case"uuid":y(a,"uuid",n.message,e);break;case"regex":d(a,n.regex,n.message,e);break;case"cuid":d(a,f.cuid,n.message,e);break;case"cuid2":d(a,f.cuid2,n.message,e);break;case"startsWith":d(a,RegExp(`^${v(n.value,e)}`),n.message,e);break;case"endsWith":d(a,RegExp(`${v(n.value,e)}$`),n.message,e);break;case"datetime":y(a,"date-time",n.message,e);break;case"date":y(a,"date",n.message,e);break;case"time":y(a,"time",n.message,e);break;case"duration":y(a,"duration",n.message,e);break;case"length":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e),l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"includes":{d(a,RegExp(v(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&y(a,"ipv4",n.message,e),n.version!=="v4"&&y(a,"ipv6",n.message,e);break}case"base64url":d(a,f.base64url,n.message,e);break;case"jwt":d(a,f.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&d(a,f.ipv4Cidr,n.message,e),n.version!=="v4"&&d(a,f.ipv6Cidr,n.message,e);break}case"emoji":d(a,f.emoji(),n.message,e);break;case"ulid":{d(a,f.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{y(a,"binary",n.message,e);break}case"contentEncoding:base64":{l(a,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{d(a,f.base64,n.message,e);break}}break}case"nanoid":d(a,f.nanoid,n.message,e)}return a}function v(t,e){return e.patternStrategy==="escape"?q(t):t}const V=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function q(t){let e="";for(let a=0;ai.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...a&&n.errorMessages&&{errorMessage:{format:a}}})):l(t,"format",e,a,n)}function d(t,e,a,n){var r;t.pattern||(r=t.allOf)!=null&&r.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:k(e,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):l(t,"pattern",k(e,n),a,n)}function k(t,e){var p;if(!e.applyRegexFlags||!t.flags)return t.source;const a={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=a.i?t.source.toLowerCase():t.source;let r="",i=!1,o=!1,m=!1;for(let u=0;utypeof t=="string"?{...P,name:t}:{...P,...t},T=t=>{const e=D(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};function _(t,e,a,n){n!=null&&n.errorMessages&&a&&(t.errorMessage={...t.errorMessage,[e]:a})}function l(t,e,a,n,r){t[e]=a,_(t,e,n,r)}function N(){return{}}function $(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==s.ZodAny&&(a.items=c(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&l(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&l(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(l(a,"minItems",t.exactLength.value,t.exactLength.message,e),l(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}function w(t,e){const a={type:"integer",format:"int64"};if(!t.checks)return a;for(const n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?l(a,"minimum",n.value,n.message,e):l(a,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(a.exclusiveMinimum=!0),l(a,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?l(a,"maximum",n.value,n.message,e):l(a,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(a.exclusiveMaximum=!0),l(a,"maximum",n.value,n.message,e));break;case"multipleOf":l(a,"multipleOf",n.value,n.message,e);break}return a}function z(){return{type:"boolean"}}function Z(t,e){return c(t.type._def,e)}const L=(t,e)=>c(t.innerType._def,e);function S(t,e,a){const n=a??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,i)=>S(t,e,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return F(t,e)}}const F=(t,e)=>{const a={type:"integer",format:"unix-time"};if(e.target==="openApi3")return a;for(const n of t.checks)switch(n.kind){case"min":l(a,"minimum",n.value,n.message,e);break;case"max":l(a,"maximum",n.value,n.message,e);break}return a};function I(t,e){return{...c(t.innerType._def,e),default:t.defaultValue()}}function E(t,e){return e.effectStrategy==="input"?c(t.schema._def,e):{}}function R(t){return{type:"string",enum:Array.from(t.values)}}const C=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function U(t,e){const a=[c(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),c(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i);let n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(i=>{if(C(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:m,...p}=i;o=p}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function B(t,e){const a=typeof t.value;return a!=="bigint"&&a!=="number"&&a!=="boolean"&&a!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:a==="bigint"?"integer":a,enum:[t.value]}:{type:a==="bigint"?"integer":a,const:t.value}}let b;const f={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(b===void 0&&(b=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),b),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function O(t,e){const a={type:"string"};if(t.checks)for(const n of t.checks)switch(n.kind){case"min":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e);break;case"max":l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":y(a,"email",n.message,e);break;case"format:idn-email":y(a,"idn-email",n.message,e);break;case"pattern:zod":d(a,f.email,n.message,e);break}break;case"url":y(a,"uri",n.message,e);break;case"uuid":y(a,"uuid",n.message,e);break;case"regex":d(a,n.regex,n.message,e);break;case"cuid":d(a,f.cuid,n.message,e);break;case"cuid2":d(a,f.cuid2,n.message,e);break;case"startsWith":d(a,RegExp(`^${v(n.value,e)}`),n.message,e);break;case"endsWith":d(a,RegExp(`${v(n.value,e)}$`),n.message,e);break;case"datetime":y(a,"date-time",n.message,e);break;case"date":y(a,"date",n.message,e);break;case"time":y(a,"time",n.message,e);break;case"duration":y(a,"duration",n.message,e);break;case"length":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e),l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"includes":{d(a,RegExp(v(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&y(a,"ipv4",n.message,e),n.version!=="v4"&&y(a,"ipv6",n.message,e);break}case"base64url":d(a,f.base64url,n.message,e);break;case"jwt":d(a,f.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&d(a,f.ipv4Cidr,n.message,e),n.version!=="v4"&&d(a,f.ipv6Cidr,n.message,e);break}case"emoji":d(a,f.emoji(),n.message,e);break;case"ulid":{d(a,f.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{y(a,"binary",n.message,e);break}case"contentEncoding:base64":{l(a,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{d(a,f.base64,n.message,e);break}}break}case"nanoid":d(a,f.nanoid,n.message,e)}return a}function v(t,e){return e.patternStrategy==="escape"?q(t):t}const V=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function q(t){let e="";for(let a=0;ai.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...a&&n.errorMessages&&{errorMessage:{format:a}}})):l(t,"format",e,a,n)}function d(t,e,a,n){var r;t.pattern||(r=t.allOf)!=null&&r.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:k(e,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):l(t,"pattern",k(e,n),a,n)}function k(t,e){var p;if(!e.applyRegexFlags||!t.flags)return t.source;const a={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=a.i?t.source.toLowerCase():t.source;let r="",i=!1,o=!1,m=!1;for(let u=0;u"u"?!1:e instanceof ShadowRoot||e instanceof N(e).ShadowRoot}function ve(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=k(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function En(e){return["table","td","th"].includes(re(e))}function $e(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function Xe(e){const n=Ge(),t=I(e)?k(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(t.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(t.contain||"").includes(o))}function _n(e){let n=X(e);for(;V(n)&&!ce(n);){if(Xe(n))return n;if($e(n))return null;n=X(n)}return null}function Ge(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ce(e){return["html","body","#document"].includes(re(e))}function k(e){return N(e).getComputedStyle(e)}function Re(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function X(e){if(re(e)==="html")return e;const n=e.assignedSlot||e.parentNode||it(e)&&e.host||K(e);return it(n)?n.host:n}function Bt(e){const n=X(e);return ce(n)?e.ownerDocument?e.ownerDocument.body:e.body:V(n)&&ve(n)?n:Bt(n)}function pe(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=Bt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=N(r);if(i){const a=He(l);return n.concat(l,l.visualViewport||[],ve(r)?r:[],a&&t?pe(a):[])}return n.concat(r,pe(r,[],t))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function At(e){const n=k(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=V(e),i=r?e.offsetWidth:t,l=r?e.offsetHeight:o,a=Ae(t)!==i||Ae(o)!==l;return a&&(t=i,o=l),{width:t,height:o,$:a}}function Je(e){return I(e)?e:e.contextElement}function de(e){const n=Je(e);if(!V(n))return j(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=At(n);let l=(i?Ae(t.width):t.width)/o,a=(i?Ae(t.height):t.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Dn=j(0);function Tt(e){const n=N(e);return!Ge()||!n.visualViewport?Dn:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Bn(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==N(e)?!1:n}function te(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=Je(e);let l=j(1);n&&(o?I(o)&&(l=de(o)):l=de(e));const a=Bn(i,t,o)?Tt(i):j(0);let c=(r.left+a.x)/l.x,d=(r.top+a.y)/l.y,s=r.width/l.x,u=r.height/l.y;if(i){const p=N(i),v=o&&I(o)?N(o):o;let h=p,g=He(h);for(;g&&o&&v!==h;){const m=de(g),y=g.getBoundingClientRect(),B=k(g),w=y.left+(g.clientLeft+parseFloat(B.paddingLeft))*m.x,$=y.top+(g.clientTop+parseFloat(B.paddingTop))*m.y;c*=m.x,d*=m.y,s*=m.x,u*=m.y,c+=w,d+=$,h=N(g),g=He(h)}}return Dt({width:s,height:u,x:c,y:d})}function Qe(e,n){const t=Re(e).scrollLeft;return n?n.left+t:te(K(e)).left+t}function Pt(e,n,t){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),r=o.left+n.scrollLeft-(t?0:Qe(e,o)),i=o.top+n.scrollTop;return{x:r,y:i}}function An(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",l=K(o),a=n?$e(n.floating):!1;if(o===l||a&&i)return t;let c={scrollLeft:0,scrollTop:0},d=j(1);const s=j(0),u=V(o);if((u||!u&&!i)&&((re(o)!=="body"||ve(l))&&(c=Re(o)),V(o))){const v=te(o);d=de(o),s.x=v.x+o.clientLeft,s.y=v.y+o.clientTop}const p=l&&!u&&!i?Pt(l,c,!0):j(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-c.scrollLeft*d.x+s.x+p.x,y:t.y*d.y-c.scrollTop*d.y+s.y+p.y}}function Tn(e){return Array.from(e.getClientRects())}function Pn(e){const n=K(e),t=Re(e),o=e.ownerDocument.body,r=ue(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=ue(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let l=-t.scrollLeft+Qe(e);const a=-t.scrollTop;return k(o).direction==="rtl"&&(l+=ue(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}function $n(e,n){const t=N(e),o=K(e),r=t.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,c=0;if(r){i=r.width,l=r.height;const d=Ge();(!d||d&&n==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:l,x:a,y:c}}function Rn(e,n){const t=te(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=V(e)?de(e):j(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,d=o*i.y;return{width:l,height:a,x:c,y:d}}function at(e,n,t){let o;if(n==="viewport")o=$n(e,t);else if(n==="document")o=Pn(K(e));else if(I(n))o=Rn(n,t);else{const r=Tt(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Dt(o)}function $t(e,n){const t=X(e);return t===n||!I(t)||ce(t)?!1:k(t).position==="fixed"||$t(t,n)}function Sn(e,n){const t=n.get(e);if(t)return t;let o=pe(e,[],!1).filter(a=>I(a)&&re(a)!=="body"),r=null;const i=k(e).position==="fixed";let l=i?X(e):e;for(;I(l)&&!ce(l);){const a=k(l),c=Xe(l);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ve(l)&&!c&&$t(e,l))?o=o.filter(s=>s!==l):r=a,l=X(l)}return n.set(e,o),o}function Nn(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const l=[...t==="clippingAncestors"?$e(n)?[]:Sn(n,this._c):[].concat(t),o],a=l[0],c=l.reduce((d,s)=>{const u=at(n,s,r);return d.top=ue(u.top,d.top),d.right=We(u.right,d.right),d.bottom=We(u.bottom,d.bottom),d.left=ue(u.left,d.left),d},at(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fn(e){const{width:n,height:t}=At(e);return{width:n,height:t}}function Ln(e,n,t){const o=V(n),r=K(n),i=t==="fixed",l=te(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const c=j(0);if(o||!o&&!i)if((re(n)!=="body"||ve(r))&&(a=Re(n)),o){const p=te(n,!0,i,n);c.x=p.x+n.clientLeft,c.y=p.y+n.clientTop}else r&&(c.x=Qe(r));const d=r&&!o&&!i?Pt(r,a):j(0),s=l.left+a.scrollLeft-c.x-d.x,u=l.top+a.scrollTop-c.y-d.y;return{x:s,y:u,width:l.width,height:l.height}}function Ne(e){return k(e).position==="static"}function st(e,n){if(!V(e)||k(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return K(e)===t&&(t=t.ownerDocument.body),t}function Rt(e,n){const t=N(e);if($e(e))return t;if(!V(e)){let r=X(e);for(;r&&!ce(r);){if(I(r)&&!Ne(r))return r;r=X(r)}return t}let o=st(e,n);for(;o&&En(o)&&Ne(o);)o=st(o,n);return o&&ce(o)&&Ne(o)&&!Xe(o)?t:o||_n(e)||t}const Mn=async function(e){const n=this.getOffsetParent||Rt,t=this.getDimensions,o=await t(e.floating);return{reference:Ln(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function In(e){return k(e).direction==="rtl"}const kn={convertOffsetParentRelativeRectToViewportRelativeRect:An,getDocumentElement:K,getClippingRect:Nn,getOffsetParent:Rt,getElementRects:Mn,getClientRects:Tn,getDimensions:Fn,getScale:de,isElement:I,isRTL:In};function St(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Wn(e,n){let t=null,o;const r=K(e);function i(){var a;clearTimeout(o),(a=t)==null||a.disconnect(),t=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:s,top:u,width:p,height:v}=d;if(a||n(),!p||!v)return;const h=Oe(u),g=Oe(r.clientWidth-(s+p)),m=Oe(r.clientHeight-(u+v)),y=Oe(s),w={rootMargin:-h+"px "+-g+"px "+-m+"px "+-y+"px",threshold:ue(0,We(1,c))||1};let $=!0;function R(L){const T=L[0].intersectionRatio;if(T!==c){if(!$)return l();T?l(!1,T):o=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!St(d,e.getBoundingClientRect())&&l(),$=!1}try{t=new IntersectionObserver(R,{...w,root:r.ownerDocument})}catch{t=new IntersectionObserver(R,w)}t.observe(e)}return l(!0),i}function Hn(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=Je(e),s=r||i?[...d?pe(d):[],...pe(n)]:[];s.forEach(y=>{r&&y.addEventListener("scroll",t,{passive:!0}),i&&y.addEventListener("resize",t)});const u=d&&a?Wn(d,t):null;let p=-1,v=null;l&&(v=new ResizeObserver(y=>{let[B]=y;B&&B.target===d&&v&&(v.unobserve(n),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=v)==null||w.observe(n)})),t()}),d&&!c&&v.observe(d),v.observe(n));let h,g=c?te(e):null;c&&m();function m(){const y=te(e);g&&!St(g,y)&&t(),g=y,h=requestAnimationFrame(m)}return t(),()=>{var y;s.forEach(B=>{r&&B.removeEventListener("scroll",t),i&&B.removeEventListener("resize",t)}),u==null||u(),(y=v)==null||y.disconnect(),v=null,c&&cancelAnimationFrame(h)}}const jn=mn,Vn=gn,ut=yn,Kn=bn,zn=wn,Un=On,Yn=xn,qn=(e,n,t)=>{const o=new Map,r={platform:kn,...t},i={...r.platform,_c:o};return Cn(e,n,{...r,platform:i})};function Xn(e){return e!=null&&typeof e=="object"&&"$el"in e}function je(e){if(Xn(e)){const n=e.$el;return qe(n)&&re(n)==="#comment"?null:n}return e}function se(e){return typeof e=="function"?e():f(e)}function Gn(e){return{name:"arrow",options:e,fn(n){const t=je(se(e.element));return t==null?{}:Un({element:t,padding:e.padding}).fn(n)}}}function Nt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dt(e,n){const t=Nt(e);return Math.round(n*t)/t}function Jn(e,n,t){t===void 0&&(t={});const o=t.whileElementsMounted,r=b(()=>{var T;return(T=se(t.open))!=null?T:!0}),i=b(()=>se(t.middleware)),l=b(()=>{var T;return(T=se(t.placement))!=null?T:"bottom"}),a=b(()=>{var T;return(T=se(t.strategy))!=null?T:"absolute"}),c=b(()=>{var T;return(T=se(t.transform))!=null?T:!0}),d=b(()=>je(e.value)),s=b(()=>je(n.value)),u=C(0),p=C(0),v=C(a.value),h=C(l.value),g=ht({}),m=C(!1),y=b(()=>{const T={position:v.value,left:"0",top:"0"};if(!s.value)return T;const H=dt(s.value,u.value),ge=dt(s.value,p.value);return c.value?{...T,transform:"translate("+H+"px, "+ge+"px)",...Nt(s.value)>=1.5&&{willChange:"transform"}}:{position:v.value,left:H+"px",top:ge+"px"}});let B;function w(){if(d.value==null||s.value==null)return;const T=r.value;qn(d.value,s.value,{middleware:i.value,placement:l.value,strategy:a.value}).then(H=>{u.value=H.x,p.value=H.y,v.value=H.strategy,h.value=H.placement,g.value=H.middlewareData,m.value=T!==!1})}function $(){typeof B=="function"&&(B(),B=void 0)}function R(){if($(),o===void 0){w();return}if(d.value!=null&&s.value!=null){B=o(d.value,s.value,w);return}}function L(){r.value||(m.value=!1)}return F([i,l,a,r],w,{flush:"sync"}),F([d,s],R,{flush:"sync"}),F(r,L,{flush:"sync"}),mt()&&yt($),{x:ie(u),y:ie(p),strategy:ie(v),placement:ie(h),middlewareData:ie(g),isPositioned:ie(m),floatingStyles:y,update:w}}function le(e,n){const t=typeof e=="string"&&!n?`${e}Context`:n,o=Symbol(t);return[r=>{const i=en(o,r);if(i||i===null)return i;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},r=>(hn(o,r),r)]}function Ft(e,n,t){const o=t.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&o.addEventListener(e,n,{once:!0}),o.dispatchEvent(r)}function Qn(e,n){var t;const o=ht();return M(()=>{o.value=e()},{...n,flush:(t=void 0)!=null?t:"sync"}),Ct(o)}function he(e){return mt()?(yt(e),!0):!1}function Zn(){const e=new Set,n=t=>{e.delete(t)};return{on:t=>{e.add(t);const o=()=>n(t);return he(o),{off:o}},off:n,trigger:(...t)=>Promise.all(Array.from(e).map(o=>o(...t)))}}function eo(e){let n=!1,t;const o=Et(!0);return(...r)=>(n||(t=o.run(()=>e(...r)),n=!0),t)}function to(e){let n=0,t,o;const r=()=>{n-=1,o&&n<=0&&(o.stop(),t=void 0,o=void 0)};return(...i)=>(n+=1,t||(o=Et(!0),t=o.run(()=>e(...i))),he(r),t)}function Z(e){return typeof e=="function"?e():f(e)}const Q=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const no=e=>typeof e<"u",oo=Object.prototype.toString,ro=e=>oo.call(e)==="[object Object]",lo=()=>{},ct=io();function io(){var e,n;return Q&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ao(e){return oe()}function so(e,n=1e4){return vn((t,o)=>{let r=Z(e),i;const l=()=>setTimeout(()=>{r=Z(e),o()},Z(n));return he(()=>{clearTimeout(i)}),{get(){return t(),r},set(a){r=a,o(),clearTimeout(i),i=l()}}})}function uo(e,n){ao()&&dn(e,n)}function Lt(e,n,t={}){const{immediate:o=!0}=t,r=C(!1);let i=null;function l(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,l()}function c(...d){l(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,e(...d)},Z(n))}return o&&(r.value=!0,Q&&c()),he(a),{isPending:Ct(r),start:c,stop:a}}function me(e){var n;const t=Z(e);return(n=t==null?void 0:t.$el)!=null?n:t}const Ze=Q?window:void 0;function Te(...e){let n,t,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([t,o,r]=e,n=Ze):[n,t,o,r]=e,!n)return lo;Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(s=>s()),i.length=0},a=(s,u,p,v)=>(s.addEventListener(u,p,v),()=>s.removeEventListener(u,p,v)),c=F(()=>[me(n),Z(r)],([s,u])=>{if(l(),!s)return;const p=ro(u)?{...u}:u;i.push(...t.flatMap(v=>o.map(h=>a(s,v,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return he(d),d}function co(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function fo(...e){let n,t,o={};e.length===3?(n=e[0],t=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(n=!0,t=e[0],o=e[1]):(n=e[0],t=e[1]):(n=!0,t=e[0]);const{target:r=Ze,eventName:i="keydown",passive:l=!1,dedupe:a=!1}=o,c=co(n);return Te(r,i,d=>{d.repeat&&Z(a)||c(d)&&t(d)},l)}function po(){const e=C(!1),n=oe();return n&&fe(()=>{e.value=!0},n),e}function vo(e){return JSON.parse(JSON.stringify(e))}function Mt(e,n,t,o={}){var r,i,l;const{clone:a=!1,passive:c=!1,eventName:d,deep:s=!1,defaultValue:u,shouldEmit:p}=o,v=oe(),h=t||(v==null?void 0:v.emit)||((r=v==null?void 0:v.$emit)==null?void 0:r.bind(v))||((l=(i=v==null?void 0:v.proxy)==null?void 0:i.$emit)==null?void 0:l.bind(v==null?void 0:v.proxy));let g=d;g=g||`update:${n.toString()}`;const m=w=>a?typeof a=="function"?a(w):vo(w):w,y=()=>no(e[n])?m(e[n]):u,B=w=>{p?p(w)&&h(g,w):h(g,w)};if(c){const w=y(),$=C(w);let R=!1;return F(()=>e[n],L=>{R||(R=!0,$.value=m(L),ne(()=>R=!1))}),F($,L=>{!R&&(L!==e[n]||s)&&B(L)},{deep:s}),$}else return b({get(){return y()},set(w){B(w)}})}function et(e){return e?e.flatMap(n=>n.type===rn?et(n.children):[n]):[]}function q(){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 Fe(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Ve(e,n,t=".",o){if(!Fe(n))return Ve(e,{},t);const r=Object.assign({},n);for(const i in e){if(i==="__proto__"||i==="constructor")continue;const l=e[i];l!=null&&(Array.isArray(l)&&Array.isArray(r[i])?r[i]=[...l,...r[i]]:Fe(l)&&Fe(r[i])?r[i]=Ve(l,r[i],(t?`${t}.`:"")+i.toString()):r[i]=l)}return r}function ho(e){return(...n)=>n.reduce((t,o)=>Ve(t,o,""),{})}const mo=ho(),[It,Tr]=le("ConfigProvider");let yo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",go=(e=21)=>{let n="",t=e;for(;t--;)n+=yo[Math.random()*64|0];return n};const bo=to(()=>{const e=C(new Map),n=C(),t=b(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=It({scrollBody:C(!0)});let r=null;const i=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=n.value??"",ct&&(r==null||r()),n.value=void 0};return F(t,(l,a)=>{var c;if(!Q)return;if(!l){a&&i();return}n.value===void 0&&(n.value=document.body.style.overflow);const d=window.innerWidth-document.documentElement.clientWidth,s={padding:d,margin:0},u=(c=o.scrollBody)!=null&&c.value?typeof o.scrollBody.value=="object"?mo({padding:o.scrollBody.value.padding===!0?d:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?d:o.scrollBody.value.margin},s):s:{padding:0,margin:0};d>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",`${d}px`),document.body.style.overflow="hidden"),ct&&(r=Te(document,"touchmove",p=>xo(p),{passive:!1})),ne(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function wo(e){const n=go(6),t=bo();t.value.set(n,e);const o=b({get:()=>t.value.get(n)??!1,set:r=>t.value.set(n,r)});return uo(()=>{t.value.delete(n)}),o}function kt(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth1?!0:(n.preventDefault&&n.cancelable&&n.preventDefault(),!1)}function ye(e){const n=oe(),t=n==null?void 0:n.type.emits,o={};return t!=null&&t.length||console.warn(`No emitted event found. Please check component: ${n==null?void 0:n.type.__name}`),t==null||t.forEach(r=>{o[Zt(bt(r))]=(...i)=>e(r,...i)}),o}function Wt(e){const n=oe(),t=Object.keys((n==null?void 0:n.type.props)??{}).reduce((r,i)=>{const l=(n==null?void 0:n.type.props[i]).default;return l!==void 0&&(r[i]=l),r},{}),o=on(e);return b(()=>{const r={},i=(n==null?void 0:n.vnode.props)??{};return Object.keys(i).forEach(l=>{r[bt(l)]=i[l]}),Object.keys({...t,...r}).reduce((l,a)=>(o.value[a]!==void 0&&(l[a]=o.value[a]),l),{})})}function Ht(e,n){const t=Wt(e),o=n?ye(n):{};return b(()=>({...t.value,...o}))}function A(){const e=oe(),n=C(),t=b(()=>{var l,a;return["#text","#comment"].includes((l=n.value)==null?void 0:l.$el.nodeName)?(a=n.value)==null?void 0:a.$el.nextElementSibling:me(n)}),o=Object.assign({},e.exposed),r={};for(const l in e.props)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function i(l){n.value=l,l&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=r)}return{forwardRef:i,currentRef:n,currentElement:t}}function Co(e,n){const t=so(!1,300),o=C(null),r=Zn();function i(){o.value=null,t.value=!1}function l(a,c){const d=a.currentTarget,s={x:a.clientX,y:a.clientY},u=Oo(s,d.getBoundingClientRect()),p=Eo(s,u),v=_o(c.getBoundingClientRect()),h=Bo([...p,...v]);o.value=h,t.value=!0}return M(a=>{if(e.value&&n.value){const c=s=>l(s,n.value),d=s=>l(s,e.value);e.value.addEventListener("pointerleave",c),n.value.addEventListener("pointerleave",d),a(()=>{var s,u;(s=e.value)==null||s.removeEventListener("pointerleave",c),(u=n.value)==null||u.removeEventListener("pointerleave",d)})}}),M(a=>{var c;if(o.value){const d=s=>{var u,p;if(!o.value)return;const v=s.target,h={x:s.clientX,y:s.clientY},g=((u=e.value)==null?void 0:u.contains(v))||((p=n.value)==null?void 0:p.contains(v)),m=!Do(h,o.value),y=!!v.closest("[data-grace-area-trigger]");g?i():(m||y)&&(i(),r.trigger())};(c=e.value)==null||c.ownerDocument.addEventListener("pointermove",d),a(()=>{var s;return(s=e.value)==null?void 0:s.ownerDocument.removeEventListener("pointermove",d)})}}),{isPointerInTransit:t,onPointerExit:r.on}}function Oo(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),i=Math.abs(n.left-e.x);switch(Math.min(t,o,r,i)){case i:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Eo(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function _o(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Do(e,n){const{x:t,y:o}=e;let r=!1;for(let i=0,l=n.length-1;io!=s>o&&t<(d-a)*(o-c)/(s-c)+a&&(r=!r)}return r}function Bo(e){const n=e.slice();return n.sort((t,o)=>t.xo.x?1:t.yo.y?1:0),Ao(n)}function Ao(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var To=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ae=new WeakMap,Ee=new WeakMap,_e={},Le=0,jt=function(e){return e&&(e.host||jt(e.parentNode))},Po=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=jt(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},$o=function(e,n,t,o){var r=Po(n,Array.isArray(e)?e:[e]);_e[t]||(_e[t]=new WeakMap);var i=_e[t],l=[],a=new Set,c=new Set(r),d=function(u){!u||a.has(u)||(a.add(u),d(u.parentNode))};r.forEach(d);var s=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))s(p);else try{var v=p.getAttribute(o),h=v!==null&&v!=="false",g=(ae.get(p)||0)+1,m=(i.get(p)||0)+1;ae.set(p,g),i.set(p,m),l.push(p),g===1&&h&&Ee.set(p,!0),m===1&&p.setAttribute(t,"true"),h||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return s(n),a.clear(),Le++,function(){l.forEach(function(u){var p=ae.get(u)-1,v=i.get(u)-1;ae.set(u,p),i.set(u,v),p||(Ee.has(u)||u.removeAttribute(o),Ee.delete(u)),v||u.removeAttribute(t)}),Le--,Le||(ae=new WeakMap,ae=new WeakMap,Ee=new WeakMap,_e={})}},Ro=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=To(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),$o(o,r,t,"aria-hidden")):function(){return null}};function So(e){let n;F(()=>me(e),t=>{t?n=Ro(t):n&&n()}),wt(()=>{n&&n()})}let No=0;function Ke(e,n="radix"){const t=It({useId:void 0});return lt?`${n}-${lt()}`:t.useId?`${n}-${t.useId()}`:`${n}-${++No}`}function Fo(e){const n=C(),t=b(()=>{var r;return((r=n.value)==null?void 0:r.width)??0}),o=b(()=>{var r;return((r=n.value)==null?void 0:r.height)??0});return fe(()=>{const r=me(e);if(r){n.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const a=l[0];let c,d;if("borderBoxSize"in a){const s=a.borderBoxSize,u=Array.isArray(s)?s[0]:s;c=u.inlineSize,d=u.blockSize}else c=r.offsetWidth,d=r.offsetHeight;n.value={width:c,height:d}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else n.value=void 0}),{width:t,height:o}}function Lo(e,n){const t=C(e);function o(r){return n[t.value][r]??t.value}return{state:t,dispatch:r=>{t.value=o(r)}}}const Mo=O({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:n,slots:t}){return()=>{var o,r;if(!t.default)return null;const i=et(t.default()),l=i.findIndex(s=>s.type!==xt);if(l===-1)return i;const a=i[l];(o=a.props)==null||delete o.ref;const c=a.props?P(n,a.props):n;n.class&&(r=a.props)!=null&&r.class&&delete a.props.class;const d=ln(a,c);for(const s in c)s.startsWith("on")&&(d.props||(d.props={}),d.props[s]=c[s]);return i.length===1?d:(i[l]=d,i)}}}),W=O({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:n,slots:t}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>Be(o,n):o!=="template"?()=>Be(e.as,n,{default:t.default}):()=>Be(Mo,n,{default:t.default})}});function Io(e,n){var t;const o=C({}),r=C("none"),i=C(e),l=e.value?"mounted":"unmounted";let a;const c=((t=n.value)==null?void 0:t.ownerDocument.defaultView)??Ze,{state:d,dispatch:s}=Lo(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{var y;if(Q){const B=new CustomEvent(m,{bubbles:!1,cancelable:!1});(y=n.value)==null||y.dispatchEvent(B)}};F(e,async(m,y)=>{var B;const w=y!==m;if(await ne(),w){const $=r.value,R=De(n.value);m?(s("MOUNT"),u("enter"),R==="none"&&u("after-enter")):R==="none"||((B=o.value)==null?void 0:B.display)==="none"?(s("UNMOUNT"),u("leave"),u("after-leave")):y&&$!==R?(s("ANIMATION_OUT"),u("leave")):(s("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=m=>{const y=De(n.value),B=y.includes(m.animationName),w=d.value==="mounted"?"enter":"leave";if(m.target===n.value&&B&&(u(`after-${w}`),s("ANIMATION_END"),!i.value)){const $=n.value.style.animationFillMode;n.value.style.animationFillMode="forwards",a=c==null?void 0:c.setTimeout(()=>{var R;((R=n.value)==null?void 0:R.style.animationFillMode)==="forwards"&&(n.value.style.animationFillMode=$)})}m.target===n.value&&y==="none"&&s("ANIMATION_END")},v=m=>{m.target===n.value&&(r.value=De(n.value))},h=F(n,(m,y)=>{m?(o.value=getComputedStyle(m),m.addEventListener("animationstart",v),m.addEventListener("animationcancel",p),m.addEventListener("animationend",p)):(s("ANIMATION_END"),a!==void 0&&(c==null||c.clearTimeout(a)),y==null||y.removeEventListener("animationstart",v),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=F(d,()=>{const m=De(n.value);r.value=d.value==="mounted"?m:"none"});return wt(()=>{h(),g()}),{isPresent:b(()=>["mounted","unmountSuspended"].includes(d.value))}}function De(e){return e&&getComputedStyle(e).animationName||"none"}const tt=O({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:n,expose:t}){var o;const{present:r,forceMount:i}=Ue(e),l=C(),{isPresent:a}=Io(r,l);t({present:a});let c=n.default({present:a});c=et(c||[]);const d=oe();if(c&&(c==null?void 0:c.length)>1){const s=(o=d==null?void 0:d.parent)!=null&&o.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${s}\` 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 b,r as C,b4 as ht,p as F,b5 as mt,b6 as yt,b7 as ie,b as f,d as O,A as D,o as _,w as x,f as E,C as G,D as J,E as P,V as ke,b3 as ne,H as fe,b8 as Ue,j as gt,i as ee,b9 as Qt,ba as oe,bb as Zt,bc as bt,bd as en,be as Be,bf as tn,bg as nn,bh as on,I as wt,F as rn,bi as xt,bj as ln,bk as Ct,bl as lt,B as M,bm as an,k as sn,t as un,c as Ot,q as Ye,bn as Et,bo as dn,av as _t,bp as cn,bq as fn,e as pn,br as vn,bs as hn}from"./index-1_q7hlhr.js";import{o as mn,f as yn,s as gn,a as bn,h as wn,l as xn,c as Cn,b as j,r as Dt,d as On,e as Ae,m as ue,g as We,i as Oe}from"./floating-ui.core-CgBsuaUc.js";function Pe(){return typeof window<"u"}function re(e){return qe(e)?(e.nodeName||"").toLowerCase():"#document"}function N(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function K(e){var n;return(n=(qe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function qe(e){return Pe()?e instanceof Node||e instanceof N(e).Node:!1}function I(e){return Pe()?e instanceof Element||e instanceof N(e).Element:!1}function V(e){return Pe()?e instanceof HTMLElement||e instanceof N(e).HTMLElement:!1}function it(e){return!Pe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof N(e).ShadowRoot}function ve(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=k(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function En(e){return["table","td","th"].includes(re(e))}function $e(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function Xe(e){const n=Ge(),t=I(e)?k(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(t.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(t.contain||"").includes(o))}function _n(e){let n=X(e);for(;V(n)&&!ce(n);){if(Xe(n))return n;if($e(n))return null;n=X(n)}return null}function Ge(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ce(e){return["html","body","#document"].includes(re(e))}function k(e){return N(e).getComputedStyle(e)}function Re(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function X(e){if(re(e)==="html")return e;const n=e.assignedSlot||e.parentNode||it(e)&&e.host||K(e);return it(n)?n.host:n}function Bt(e){const n=X(e);return ce(n)?e.ownerDocument?e.ownerDocument.body:e.body:V(n)&&ve(n)?n:Bt(n)}function pe(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=Bt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=N(r);if(i){const a=He(l);return n.concat(l,l.visualViewport||[],ve(r)?r:[],a&&t?pe(a):[])}return n.concat(r,pe(r,[],t))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function At(e){const n=k(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=V(e),i=r?e.offsetWidth:t,l=r?e.offsetHeight:o,a=Ae(t)!==i||Ae(o)!==l;return a&&(t=i,o=l),{width:t,height:o,$:a}}function Je(e){return I(e)?e:e.contextElement}function de(e){const n=Je(e);if(!V(n))return j(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=At(n);let l=(i?Ae(t.width):t.width)/o,a=(i?Ae(t.height):t.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Dn=j(0);function Tt(e){const n=N(e);return!Ge()||!n.visualViewport?Dn:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Bn(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==N(e)?!1:n}function te(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=Je(e);let l=j(1);n&&(o?I(o)&&(l=de(o)):l=de(e));const a=Bn(i,t,o)?Tt(i):j(0);let c=(r.left+a.x)/l.x,d=(r.top+a.y)/l.y,s=r.width/l.x,u=r.height/l.y;if(i){const p=N(i),v=o&&I(o)?N(o):o;let h=p,g=He(h);for(;g&&o&&v!==h;){const m=de(g),y=g.getBoundingClientRect(),B=k(g),w=y.left+(g.clientLeft+parseFloat(B.paddingLeft))*m.x,$=y.top+(g.clientTop+parseFloat(B.paddingTop))*m.y;c*=m.x,d*=m.y,s*=m.x,u*=m.y,c+=w,d+=$,h=N(g),g=He(h)}}return Dt({width:s,height:u,x:c,y:d})}function Qe(e,n){const t=Re(e).scrollLeft;return n?n.left+t:te(K(e)).left+t}function Pt(e,n,t){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),r=o.left+n.scrollLeft-(t?0:Qe(e,o)),i=o.top+n.scrollTop;return{x:r,y:i}}function An(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",l=K(o),a=n?$e(n.floating):!1;if(o===l||a&&i)return t;let c={scrollLeft:0,scrollTop:0},d=j(1);const s=j(0),u=V(o);if((u||!u&&!i)&&((re(o)!=="body"||ve(l))&&(c=Re(o)),V(o))){const v=te(o);d=de(o),s.x=v.x+o.clientLeft,s.y=v.y+o.clientTop}const p=l&&!u&&!i?Pt(l,c,!0):j(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-c.scrollLeft*d.x+s.x+p.x,y:t.y*d.y-c.scrollTop*d.y+s.y+p.y}}function Tn(e){return Array.from(e.getClientRects())}function Pn(e){const n=K(e),t=Re(e),o=e.ownerDocument.body,r=ue(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=ue(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let l=-t.scrollLeft+Qe(e);const a=-t.scrollTop;return k(o).direction==="rtl"&&(l+=ue(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}function $n(e,n){const t=N(e),o=K(e),r=t.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,c=0;if(r){i=r.width,l=r.height;const d=Ge();(!d||d&&n==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:l,x:a,y:c}}function Rn(e,n){const t=te(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=V(e)?de(e):j(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,d=o*i.y;return{width:l,height:a,x:c,y:d}}function at(e,n,t){let o;if(n==="viewport")o=$n(e,t);else if(n==="document")o=Pn(K(e));else if(I(n))o=Rn(n,t);else{const r=Tt(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Dt(o)}function $t(e,n){const t=X(e);return t===n||!I(t)||ce(t)?!1:k(t).position==="fixed"||$t(t,n)}function Sn(e,n){const t=n.get(e);if(t)return t;let o=pe(e,[],!1).filter(a=>I(a)&&re(a)!=="body"),r=null;const i=k(e).position==="fixed";let l=i?X(e):e;for(;I(l)&&!ce(l);){const a=k(l),c=Xe(l);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ve(l)&&!c&&$t(e,l))?o=o.filter(s=>s!==l):r=a,l=X(l)}return n.set(e,o),o}function Nn(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const l=[...t==="clippingAncestors"?$e(n)?[]:Sn(n,this._c):[].concat(t),o],a=l[0],c=l.reduce((d,s)=>{const u=at(n,s,r);return d.top=ue(u.top,d.top),d.right=We(u.right,d.right),d.bottom=We(u.bottom,d.bottom),d.left=ue(u.left,d.left),d},at(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fn(e){const{width:n,height:t}=At(e);return{width:n,height:t}}function Ln(e,n,t){const o=V(n),r=K(n),i=t==="fixed",l=te(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const c=j(0);if(o||!o&&!i)if((re(n)!=="body"||ve(r))&&(a=Re(n)),o){const p=te(n,!0,i,n);c.x=p.x+n.clientLeft,c.y=p.y+n.clientTop}else r&&(c.x=Qe(r));const d=r&&!o&&!i?Pt(r,a):j(0),s=l.left+a.scrollLeft-c.x-d.x,u=l.top+a.scrollTop-c.y-d.y;return{x:s,y:u,width:l.width,height:l.height}}function Ne(e){return k(e).position==="static"}function st(e,n){if(!V(e)||k(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return K(e)===t&&(t=t.ownerDocument.body),t}function Rt(e,n){const t=N(e);if($e(e))return t;if(!V(e)){let r=X(e);for(;r&&!ce(r);){if(I(r)&&!Ne(r))return r;r=X(r)}return t}let o=st(e,n);for(;o&&En(o)&&Ne(o);)o=st(o,n);return o&&ce(o)&&Ne(o)&&!Xe(o)?t:o||_n(e)||t}const Mn=async function(e){const n=this.getOffsetParent||Rt,t=this.getDimensions,o=await t(e.floating);return{reference:Ln(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function In(e){return k(e).direction==="rtl"}const kn={convertOffsetParentRelativeRectToViewportRelativeRect:An,getDocumentElement:K,getClippingRect:Nn,getOffsetParent:Rt,getElementRects:Mn,getClientRects:Tn,getDimensions:Fn,getScale:de,isElement:I,isRTL:In};function St(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Wn(e,n){let t=null,o;const r=K(e);function i(){var a;clearTimeout(o),(a=t)==null||a.disconnect(),t=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:s,top:u,width:p,height:v}=d;if(a||n(),!p||!v)return;const h=Oe(u),g=Oe(r.clientWidth-(s+p)),m=Oe(r.clientHeight-(u+v)),y=Oe(s),w={rootMargin:-h+"px "+-g+"px "+-m+"px "+-y+"px",threshold:ue(0,We(1,c))||1};let $=!0;function R(L){const T=L[0].intersectionRatio;if(T!==c){if(!$)return l();T?l(!1,T):o=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!St(d,e.getBoundingClientRect())&&l(),$=!1}try{t=new IntersectionObserver(R,{...w,root:r.ownerDocument})}catch{t=new IntersectionObserver(R,w)}t.observe(e)}return l(!0),i}function Hn(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=Je(e),s=r||i?[...d?pe(d):[],...pe(n)]:[];s.forEach(y=>{r&&y.addEventListener("scroll",t,{passive:!0}),i&&y.addEventListener("resize",t)});const u=d&&a?Wn(d,t):null;let p=-1,v=null;l&&(v=new ResizeObserver(y=>{let[B]=y;B&&B.target===d&&v&&(v.unobserve(n),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=v)==null||w.observe(n)})),t()}),d&&!c&&v.observe(d),v.observe(n));let h,g=c?te(e):null;c&&m();function m(){const y=te(e);g&&!St(g,y)&&t(),g=y,h=requestAnimationFrame(m)}return t(),()=>{var y;s.forEach(B=>{r&&B.removeEventListener("scroll",t),i&&B.removeEventListener("resize",t)}),u==null||u(),(y=v)==null||y.disconnect(),v=null,c&&cancelAnimationFrame(h)}}const jn=mn,Vn=gn,ut=yn,Kn=bn,zn=wn,Un=On,Yn=xn,qn=(e,n,t)=>{const o=new Map,r={platform:kn,...t},i={...r.platform,_c:o};return Cn(e,n,{...r,platform:i})};function Xn(e){return e!=null&&typeof e=="object"&&"$el"in e}function je(e){if(Xn(e)){const n=e.$el;return qe(n)&&re(n)==="#comment"?null:n}return e}function se(e){return typeof e=="function"?e():f(e)}function Gn(e){return{name:"arrow",options:e,fn(n){const t=je(se(e.element));return t==null?{}:Un({element:t,padding:e.padding}).fn(n)}}}function Nt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dt(e,n){const t=Nt(e);return Math.round(n*t)/t}function Jn(e,n,t){t===void 0&&(t={});const o=t.whileElementsMounted,r=b(()=>{var T;return(T=se(t.open))!=null?T:!0}),i=b(()=>se(t.middleware)),l=b(()=>{var T;return(T=se(t.placement))!=null?T:"bottom"}),a=b(()=>{var T;return(T=se(t.strategy))!=null?T:"absolute"}),c=b(()=>{var T;return(T=se(t.transform))!=null?T:!0}),d=b(()=>je(e.value)),s=b(()=>je(n.value)),u=C(0),p=C(0),v=C(a.value),h=C(l.value),g=ht({}),m=C(!1),y=b(()=>{const T={position:v.value,left:"0",top:"0"};if(!s.value)return T;const H=dt(s.value,u.value),ge=dt(s.value,p.value);return c.value?{...T,transform:"translate("+H+"px, "+ge+"px)",...Nt(s.value)>=1.5&&{willChange:"transform"}}:{position:v.value,left:H+"px",top:ge+"px"}});let B;function w(){if(d.value==null||s.value==null)return;const T=r.value;qn(d.value,s.value,{middleware:i.value,placement:l.value,strategy:a.value}).then(H=>{u.value=H.x,p.value=H.y,v.value=H.strategy,h.value=H.placement,g.value=H.middlewareData,m.value=T!==!1})}function $(){typeof B=="function"&&(B(),B=void 0)}function R(){if($(),o===void 0){w();return}if(d.value!=null&&s.value!=null){B=o(d.value,s.value,w);return}}function L(){r.value||(m.value=!1)}return F([i,l,a,r],w,{flush:"sync"}),F([d,s],R,{flush:"sync"}),F(r,L,{flush:"sync"}),mt()&&yt($),{x:ie(u),y:ie(p),strategy:ie(v),placement:ie(h),middlewareData:ie(g),isPositioned:ie(m),floatingStyles:y,update:w}}function le(e,n){const t=typeof e=="string"&&!n?`${e}Context`:n,o=Symbol(t);return[r=>{const i=en(o,r);if(i||i===null)return i;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},r=>(hn(o,r),r)]}function Ft(e,n,t){const o=t.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&o.addEventListener(e,n,{once:!0}),o.dispatchEvent(r)}function Qn(e,n){var t;const o=ht();return M(()=>{o.value=e()},{...n,flush:(t=void 0)!=null?t:"sync"}),Ct(o)}function he(e){return mt()?(yt(e),!0):!1}function Zn(){const e=new Set,n=t=>{e.delete(t)};return{on:t=>{e.add(t);const o=()=>n(t);return he(o),{off:o}},off:n,trigger:(...t)=>Promise.all(Array.from(e).map(o=>o(...t)))}}function eo(e){let n=!1,t;const o=Et(!0);return(...r)=>(n||(t=o.run(()=>e(...r)),n=!0),t)}function to(e){let n=0,t,o;const r=()=>{n-=1,o&&n<=0&&(o.stop(),t=void 0,o=void 0)};return(...i)=>(n+=1,t||(o=Et(!0),t=o.run(()=>e(...i))),he(r),t)}function Z(e){return typeof e=="function"?e():f(e)}const Q=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const no=e=>typeof e<"u",oo=Object.prototype.toString,ro=e=>oo.call(e)==="[object Object]",lo=()=>{},ct=io();function io(){var e,n;return Q&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ao(e){return oe()}function so(e,n=1e4){return vn((t,o)=>{let r=Z(e),i;const l=()=>setTimeout(()=>{r=Z(e),o()},Z(n));return he(()=>{clearTimeout(i)}),{get(){return t(),r},set(a){r=a,o(),clearTimeout(i),i=l()}}})}function uo(e,n){ao()&&dn(e,n)}function Lt(e,n,t={}){const{immediate:o=!0}=t,r=C(!1);let i=null;function l(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,l()}function c(...d){l(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,e(...d)},Z(n))}return o&&(r.value=!0,Q&&c()),he(a),{isPending:Ct(r),start:c,stop:a}}function me(e){var n;const t=Z(e);return(n=t==null?void 0:t.$el)!=null?n:t}const Ze=Q?window:void 0;function Te(...e){let n,t,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([t,o,r]=e,n=Ze):[n,t,o,r]=e,!n)return lo;Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(s=>s()),i.length=0},a=(s,u,p,v)=>(s.addEventListener(u,p,v),()=>s.removeEventListener(u,p,v)),c=F(()=>[me(n),Z(r)],([s,u])=>{if(l(),!s)return;const p=ro(u)?{...u}:u;i.push(...t.flatMap(v=>o.map(h=>a(s,v,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return he(d),d}function co(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function fo(...e){let n,t,o={};e.length===3?(n=e[0],t=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(n=!0,t=e[0],o=e[1]):(n=e[0],t=e[1]):(n=!0,t=e[0]);const{target:r=Ze,eventName:i="keydown",passive:l=!1,dedupe:a=!1}=o,c=co(n);return Te(r,i,d=>{d.repeat&&Z(a)||c(d)&&t(d)},l)}function po(){const e=C(!1),n=oe();return n&&fe(()=>{e.value=!0},n),e}function vo(e){return JSON.parse(JSON.stringify(e))}function Mt(e,n,t,o={}){var r,i,l;const{clone:a=!1,passive:c=!1,eventName:d,deep:s=!1,defaultValue:u,shouldEmit:p}=o,v=oe(),h=t||(v==null?void 0:v.emit)||((r=v==null?void 0:v.$emit)==null?void 0:r.bind(v))||((l=(i=v==null?void 0:v.proxy)==null?void 0:i.$emit)==null?void 0:l.bind(v==null?void 0:v.proxy));let g=d;g=g||`update:${n.toString()}`;const m=w=>a?typeof a=="function"?a(w):vo(w):w,y=()=>no(e[n])?m(e[n]):u,B=w=>{p?p(w)&&h(g,w):h(g,w)};if(c){const w=y(),$=C(w);let R=!1;return F(()=>e[n],L=>{R||(R=!0,$.value=m(L),ne(()=>R=!1))}),F($,L=>{!R&&(L!==e[n]||s)&&B(L)},{deep:s}),$}else return b({get(){return y()},set(w){B(w)}})}function et(e){return e?e.flatMap(n=>n.type===rn?et(n.children):[n]):[]}function q(){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 Fe(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Ve(e,n,t=".",o){if(!Fe(n))return Ve(e,{},t);const r=Object.assign({},n);for(const i in e){if(i==="__proto__"||i==="constructor")continue;const l=e[i];l!=null&&(Array.isArray(l)&&Array.isArray(r[i])?r[i]=[...l,...r[i]]:Fe(l)&&Fe(r[i])?r[i]=Ve(l,r[i],(t?`${t}.`:"")+i.toString()):r[i]=l)}return r}function ho(e){return(...n)=>n.reduce((t,o)=>Ve(t,o,""),{})}const mo=ho(),[It,Tr]=le("ConfigProvider");let yo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",go=(e=21)=>{let n="",t=e;for(;t--;)n+=yo[Math.random()*64|0];return n};const bo=to(()=>{const e=C(new Map),n=C(),t=b(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=It({scrollBody:C(!0)});let r=null;const i=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=n.value??"",ct&&(r==null||r()),n.value=void 0};return F(t,(l,a)=>{var c;if(!Q)return;if(!l){a&&i();return}n.value===void 0&&(n.value=document.body.style.overflow);const d=window.innerWidth-document.documentElement.clientWidth,s={padding:d,margin:0},u=(c=o.scrollBody)!=null&&c.value?typeof o.scrollBody.value=="object"?mo({padding:o.scrollBody.value.padding===!0?d:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?d:o.scrollBody.value.margin},s):s:{padding:0,margin:0};d>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",`${d}px`),document.body.style.overflow="hidden"),ct&&(r=Te(document,"touchmove",p=>xo(p),{passive:!1})),ne(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function wo(e){const n=go(6),t=bo();t.value.set(n,e);const o=b({get:()=>t.value.get(n)??!1,set:r=>t.value.set(n,r)});return uo(()=>{t.value.delete(n)}),o}function kt(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth1?!0:(n.preventDefault&&n.cancelable&&n.preventDefault(),!1)}function ye(e){const n=oe(),t=n==null?void 0:n.type.emits,o={};return t!=null&&t.length||console.warn(`No emitted event found. Please check component: ${n==null?void 0:n.type.__name}`),t==null||t.forEach(r=>{o[Zt(bt(r))]=(...i)=>e(r,...i)}),o}function Wt(e){const n=oe(),t=Object.keys((n==null?void 0:n.type.props)??{}).reduce((r,i)=>{const l=(n==null?void 0:n.type.props[i]).default;return l!==void 0&&(r[i]=l),r},{}),o=on(e);return b(()=>{const r={},i=(n==null?void 0:n.vnode.props)??{};return Object.keys(i).forEach(l=>{r[bt(l)]=i[l]}),Object.keys({...t,...r}).reduce((l,a)=>(o.value[a]!==void 0&&(l[a]=o.value[a]),l),{})})}function Ht(e,n){const t=Wt(e),o=n?ye(n):{};return b(()=>({...t.value,...o}))}function A(){const e=oe(),n=C(),t=b(()=>{var l,a;return["#text","#comment"].includes((l=n.value)==null?void 0:l.$el.nodeName)?(a=n.value)==null?void 0:a.$el.nextElementSibling:me(n)}),o=Object.assign({},e.exposed),r={};for(const l in e.props)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function i(l){n.value=l,l&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=r)}return{forwardRef:i,currentRef:n,currentElement:t}}function Co(e,n){const t=so(!1,300),o=C(null),r=Zn();function i(){o.value=null,t.value=!1}function l(a,c){const d=a.currentTarget,s={x:a.clientX,y:a.clientY},u=Oo(s,d.getBoundingClientRect()),p=Eo(s,u),v=_o(c.getBoundingClientRect()),h=Bo([...p,...v]);o.value=h,t.value=!0}return M(a=>{if(e.value&&n.value){const c=s=>l(s,n.value),d=s=>l(s,e.value);e.value.addEventListener("pointerleave",c),n.value.addEventListener("pointerleave",d),a(()=>{var s,u;(s=e.value)==null||s.removeEventListener("pointerleave",c),(u=n.value)==null||u.removeEventListener("pointerleave",d)})}}),M(a=>{var c;if(o.value){const d=s=>{var u,p;if(!o.value)return;const v=s.target,h={x:s.clientX,y:s.clientY},g=((u=e.value)==null?void 0:u.contains(v))||((p=n.value)==null?void 0:p.contains(v)),m=!Do(h,o.value),y=!!v.closest("[data-grace-area-trigger]");g?i():(m||y)&&(i(),r.trigger())};(c=e.value)==null||c.ownerDocument.addEventListener("pointermove",d),a(()=>{var s;return(s=e.value)==null?void 0:s.ownerDocument.removeEventListener("pointermove",d)})}}),{isPointerInTransit:t,onPointerExit:r.on}}function Oo(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),i=Math.abs(n.left-e.x);switch(Math.min(t,o,r,i)){case i:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Eo(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function _o(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Do(e,n){const{x:t,y:o}=e;let r=!1;for(let i=0,l=n.length-1;io!=s>o&&t<(d-a)*(o-c)/(s-c)+a&&(r=!r)}return r}function Bo(e){const n=e.slice();return n.sort((t,o)=>t.xo.x?1:t.yo.y?1:0),Ao(n)}function Ao(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var To=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ae=new WeakMap,Ee=new WeakMap,_e={},Le=0,jt=function(e){return e&&(e.host||jt(e.parentNode))},Po=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=jt(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},$o=function(e,n,t,o){var r=Po(n,Array.isArray(e)?e:[e]);_e[t]||(_e[t]=new WeakMap);var i=_e[t],l=[],a=new Set,c=new Set(r),d=function(u){!u||a.has(u)||(a.add(u),d(u.parentNode))};r.forEach(d);var s=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))s(p);else try{var v=p.getAttribute(o),h=v!==null&&v!=="false",g=(ae.get(p)||0)+1,m=(i.get(p)||0)+1;ae.set(p,g),i.set(p,m),l.push(p),g===1&&h&&Ee.set(p,!0),m===1&&p.setAttribute(t,"true"),h||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return s(n),a.clear(),Le++,function(){l.forEach(function(u){var p=ae.get(u)-1,v=i.get(u)-1;ae.set(u,p),i.set(u,v),p||(Ee.has(u)||u.removeAttribute(o),Ee.delete(u)),v||u.removeAttribute(t)}),Le--,Le||(ae=new WeakMap,ae=new WeakMap,Ee=new WeakMap,_e={})}},Ro=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=To(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),$o(o,r,t,"aria-hidden")):function(){return null}};function So(e){let n;F(()=>me(e),t=>{t?n=Ro(t):n&&n()}),wt(()=>{n&&n()})}let No=0;function Ke(e,n="radix"){const t=It({useId:void 0});return lt?`${n}-${lt()}`:t.useId?`${n}-${t.useId()}`:`${n}-${++No}`}function Fo(e){const n=C(),t=b(()=>{var r;return((r=n.value)==null?void 0:r.width)??0}),o=b(()=>{var r;return((r=n.value)==null?void 0:r.height)??0});return fe(()=>{const r=me(e);if(r){n.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const a=l[0];let c,d;if("borderBoxSize"in a){const s=a.borderBoxSize,u=Array.isArray(s)?s[0]:s;c=u.inlineSize,d=u.blockSize}else c=r.offsetWidth,d=r.offsetHeight;n.value={width:c,height:d}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else n.value=void 0}),{width:t,height:o}}function Lo(e,n){const t=C(e);function o(r){return n[t.value][r]??t.value}return{state:t,dispatch:r=>{t.value=o(r)}}}const Mo=O({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:n,slots:t}){return()=>{var o,r;if(!t.default)return null;const i=et(t.default()),l=i.findIndex(s=>s.type!==xt);if(l===-1)return i;const a=i[l];(o=a.props)==null||delete o.ref;const c=a.props?P(n,a.props):n;n.class&&(r=a.props)!=null&&r.class&&delete a.props.class;const d=ln(a,c);for(const s in c)s.startsWith("on")&&(d.props||(d.props={}),d.props[s]=c[s]);return i.length===1?d:(i[l]=d,i)}}}),W=O({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:n,slots:t}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>Be(o,n):o!=="template"?()=>Be(e.as,n,{default:t.default}):()=>Be(Mo,n,{default:t.default})}});function Io(e,n){var t;const o=C({}),r=C("none"),i=C(e),l=e.value?"mounted":"unmounted";let a;const c=((t=n.value)==null?void 0:t.ownerDocument.defaultView)??Ze,{state:d,dispatch:s}=Lo(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{var y;if(Q){const B=new CustomEvent(m,{bubbles:!1,cancelable:!1});(y=n.value)==null||y.dispatchEvent(B)}};F(e,async(m,y)=>{var B;const w=y!==m;if(await ne(),w){const $=r.value,R=De(n.value);m?(s("MOUNT"),u("enter"),R==="none"&&u("after-enter")):R==="none"||((B=o.value)==null?void 0:B.display)==="none"?(s("UNMOUNT"),u("leave"),u("after-leave")):y&&$!==R?(s("ANIMATION_OUT"),u("leave")):(s("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=m=>{const y=De(n.value),B=y.includes(m.animationName),w=d.value==="mounted"?"enter":"leave";if(m.target===n.value&&B&&(u(`after-${w}`),s("ANIMATION_END"),!i.value)){const $=n.value.style.animationFillMode;n.value.style.animationFillMode="forwards",a=c==null?void 0:c.setTimeout(()=>{var R;((R=n.value)==null?void 0:R.style.animationFillMode)==="forwards"&&(n.value.style.animationFillMode=$)})}m.target===n.value&&y==="none"&&s("ANIMATION_END")},v=m=>{m.target===n.value&&(r.value=De(n.value))},h=F(n,(m,y)=>{m?(o.value=getComputedStyle(m),m.addEventListener("animationstart",v),m.addEventListener("animationcancel",p),m.addEventListener("animationend",p)):(s("ANIMATION_END"),a!==void 0&&(c==null||c.clearTimeout(a)),y==null||y.removeEventListener("animationstart",v),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=F(d,()=>{const m=De(n.value);r.value=d.value==="mounted"?m:"none"});return wt(()=>{h(),g()}),{isPresent:b(()=>["mounted","unmountSuspended"].includes(d.value))}}function De(e){return e&&getComputedStyle(e).animationName||"none"}const tt=O({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:n,expose:t}){var o;const{present:r,forceMount:i}=Ue(e),l=C(),{isPresent:a}=Io(r,l);t({present:a});let c=n.default({present:a});c=et(c||[]);const d=oe();if(c&&(c==null?void 0:c.length)>1){const s=(o=d==null?void 0:d.parent)!=null&&o.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${s}\` 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()=>i.value||r.value||a.value?Be(n.default({present:a})[0],{ref:s=>{const u=me(s);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}}),[U,ko]=le("DialogRoot"),Wo=O({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:n}){const t=e,o=Mt(t,"open",n,{defaultValue:t.defaultOpen,passive:t.open===void 0}),r=C(),i=C(),{modal:l}=Ue(t);return ko({open:o,modal:l,openModal:()=>{o.value=!0},onOpenChange:a=>{o.value=a},onOpenToggle:()=>{o.value=!o.value},contentId:"",titleId:"",descriptionId:"",triggerElement:r,contentElement:i}),(a,c)=>E(a.$slots,"default",{open:f(o)})}}),nt=O({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=po();return(t,o)=>f(n)||t.forceMount?(_(),D(Qt,{key:0,to:t.to,disabled:t.disabled},[E(t.$slots,"default")],8,["to","disabled"])):gt("",!0)}}),Pr=O({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Ho="dismissableLayer.pointerDownOutside",jo="dismissableLayer.focusOutside";function Vt(e,n){const t=n.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),r=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(t&&o===t||r.indexOf(o){});return M(l=>{if(!Q)return;const a=async d=>{const s=d.target;if(n!=null&&n.value){if(Vt(n.value,s)){r.value=!1;return}if(d.target&&!r.value){let u=function(){Ft(Ho,e,p)};const p={originalEvent:d};d.pointerType==="touch"?(o.removeEventListener("click",i.value),i.value=u,o.addEventListener("click",i.value,{once:!0})):u()}else o.removeEventListener("click",i.value);r.value=!1}},c=window.setTimeout(()=>{o.addEventListener("pointerdown",a)},0);l(()=>{window.clearTimeout(c),o.removeEventListener("pointerdown",a),o.removeEventListener("click",i.value)})}),{onPointerDownCapture:()=>r.value=!0}}function Ko(e,n){var t;const o=((t=n==null?void 0:n.value)==null?void 0:t.ownerDocument)??(globalThis==null?void 0:globalThis.document),r=C(!1);return M(i=>{if(!Q)return;const l=async a=>{n!=null&&n.value&&(await ne(),!(!n.value||Vt(n.value,a.target))&&a.target&&!r.value&&Ft(jo,e,{originalEvent:a}))};o.addEventListener("focusin",l),i(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>r.value=!0,onBlurCapture:()=>r.value=!1}}const z=_t({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kt=O({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:n}){const t=e,o=n,{forwardRef:r,currentElement:i}=A(),l=b(()=>{var h;return((h=i.value)==null?void 0:h.ownerDocument)??globalThis.document}),a=b(()=>z.layersRoot),c=b(()=>i.value?Array.from(a.value).indexOf(i.value):-1),d=b(()=>z.layersWithOutsidePointerEventsDisabled.size>0),s=b(()=>{const h=Array.from(a.value),[g]=[...z.layersWithOutsidePointerEventsDisabled].slice(-1),m=h.indexOf(g);return c.value>=m}),u=Vo(async h=>{const g=[...z.branches].some(m=>m==null?void 0:m.contains(h.target));!s.value||g||(o("pointerDownOutside",h),o("interactOutside",h),await ne(),h.defaultPrevented||o("dismiss"))},i),p=Ko(h=>{[...z.branches].some(g=>g==null?void 0:g.contains(h.target))||(o("focusOutside",h),o("interactOutside",h),h.defaultPrevented||o("dismiss"))},i);fo("Escape",h=>{c.value===a.value.size-1&&(o("escapeKeyDown",h),h.defaultPrevented||o("dismiss"))});let v;return M(h=>{i.value&&(t.disableOutsidePointerEvents&&(z.layersWithOutsidePointerEventsDisabled.size===0&&(v=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),z.layersWithOutsidePointerEventsDisabled.add(i.value)),a.value.add(i.value),h(()=>{t.disableOutsidePointerEvents&&z.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=v)}))}),M(h=>{h(()=>{i.value&&(a.value.delete(i.value),z.layersWithOutsidePointerEventsDisabled.delete(i.value))})}),(h,g)=>(_(),D(f(W),{ref:f(r),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:Ye({pointerEvents:d.value?s.value?"auto":"none":void 0}),onFocusCapture:f(p).onFocusCapture,onBlurCapture:f(p).onBlurCapture,onPointerdownCapture:f(u).onPointerDownCapture},{default:x(()=>[E(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Me="focusScope.autoFocusOnMount",Ie="focusScope.autoFocusOnUnmount",ft={bubbles:!1,cancelable:!0};function zo(e,{select:n=!1}={}){const t=q();for(const o of e)if(Y(o,{select:n}),q()!==t)return!0}function Uo(e){const n=zt(e),t=pt(n,e),o=pt(n.reverse(),e);return[t,o]}function zt(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function pt(e,n){for(const t of e)if(!Yo(t,{upTo:n}))return t}function Yo(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function qo(e){return e instanceof HTMLInputElement&&"select"in e}function Y(e,{select:n=!1}={}){if(e&&e.focus){const t=q();e.focus({preventScroll:!0}),e!==t&&qo(e)&&n&&e.select()}}const Xo=eo(()=>C([]));function Go(){const e=Xo();return{add(n){const t=e.value[0];n!==t&&(t==null||t.pause()),e.value=vt(e.value,n),e.value.unshift(n)},remove(n){var t;e.value=vt(e.value,n),(t=e.value[0])==null||t.resume()}}}function vt(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Jo(e){return e.filter(n=>n.tagName!=="A")}const Qo=O({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:n}){const t=e,o=n,{currentRef:r,currentElement:i}=A(),l=C(null),a=Go(),c=_t({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});M(s=>{if(!Q)return;const u=i.value;if(!t.trapped)return;function p(m){if(c.paused||!u)return;const y=m.target;u.contains(y)?l.value=y:Y(l.value,{select:!0})}function v(m){if(c.paused||!u)return;const y=m.relatedTarget;y!==null&&(u.contains(y)||Y(l.value,{select:!0}))}function h(m){u.contains(l.value)||Y(u)}document.addEventListener("focusin",p),document.addEventListener("focusout",v);const g=new MutationObserver(h);u&&g.observe(u,{childList:!0,subtree:!0}),s(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),g.disconnect()})}),M(async s=>{const u=i.value;if(await ne(),!u)return;a.add(c);const p=q();if(!u.contains(p)){const v=new CustomEvent(Me,ft);u.addEventListener(Me,h=>o("mountAutoFocus",h)),u.dispatchEvent(v),v.defaultPrevented||(zo(Jo(zt(u)),{select:!0}),q()===p&&Y(u))}s(()=>{u.removeEventListener(Me,g=>o("mountAutoFocus",g));const v=new CustomEvent(Ie,ft),h=g=>{o("unmountAutoFocus",g)};u.addEventListener(Ie,h),u.dispatchEvent(v),setTimeout(()=>{v.defaultPrevented||Y(p??document.body,{select:!0}),u.removeEventListener(Ie,h),a.remove(c)},0)})});function d(s){if(!t.loop&&!t.trapped||c.paused)return;const u=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,p=q();if(u&&p){const v=s.currentTarget,[h,g]=Uo(v);h&&g?!s.shiftKey&&p===g?(s.preventDefault(),t.loop&&Y(h,{select:!0})):s.shiftKey&&p===h&&(s.preventDefault(),t.loop&&Y(g,{select:!0})):p===v&&s.preventDefault()}}return(s,u)=>(_(),D(f(W),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":s.asChild,as:s.as,onKeydown:d},{default:x(()=>[E(s.$slots,"default")]),_:3},8,["as-child","as"]))}});function Zo(e){return e?"open":"closed"}const Ut=O({__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:n}){const t=e,o=n,r=U(),{forwardRef:i,currentElement:l}=A();return r.titleId||(r.titleId=Ke(void 0,"radix-vue-dialog-title")),r.descriptionId||(r.descriptionId=Ke(void 0,"radix-vue-dialog-description")),fe(()=>{r.contentElement=l,q()!==document.body&&(r.triggerElement.value=q())}),(a,c)=>(_(),D(f(Qo),{"as-child":"",loop:"",trapped:t.trapFocus,onMountAutoFocus:c[5]||(c[5]=d=>o("openAutoFocus",d)),onUnmountAutoFocus:c[6]||(c[6]=d=>o("closeAutoFocus",d))},{default:x(()=>[ee(f(Kt),P({id:f(r).contentId,ref:f(i),as:a.as,"as-child":a.asChild,"disable-outside-pointer-events":a.disableOutsidePointerEvents,role:"dialog","aria-describedby":f(r).descriptionId,"aria-labelledby":f(r).titleId,"data-state":f(Zo)(f(r).open.value)},a.$attrs,{onDismiss:c[0]||(c[0]=d=>f(r).onOpenChange(!1)),onEscapeKeyDown:c[1]||(c[1]=d=>o("escapeKeyDown",d)),onFocusOutside:c[2]||(c[2]=d=>o("focusOutside",d)),onInteractOutside:c[3]||(c[3]=d=>o("interactOutside",d)),onPointerDownOutside:c[4]||(c[4]=d=>o("pointerDownOutside",d))}),{default:x(()=>[E(a.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),er=O({__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:n}){const t=e,o=n,r=U(),i=ye(o),{forwardRef:l,currentElement:a}=A();return So(a),(c,d)=>(_(),D(Ut,P({...t,...f(i)},{ref:f(l),"trap-focus":f(r).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:d[0]||(d[0]=s=>{var u;s.defaultPrevented||(s.preventDefault(),(u=f(r).triggerElement.value)==null||u.focus())}),onPointerDownOutside:d[1]||(d[1]=s=>{const u=s.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0;(u.button===2||p)&&s.preventDefault()}),onFocusOutside:d[2]||(d[2]=s=>{s.preventDefault()})}),{default:x(()=>[E(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),tr=O({__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:n}){const t=e,o=ye(n);A();const r=U(),i=C(!1),l=C(!1);return(a,c)=>(_(),D(Ut,P({...t,...f(o)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=d=>{var s;d.defaultPrevented||(i.value||(s=f(r).triggerElement.value)==null||s.focus(),d.preventDefault()),i.value=!1,l.value=!1}),onInteractOutside:c[1]||(c[1]=d=>{var s;d.defaultPrevented||(i.value=!0,d.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=d.target;(s=f(r).triggerElement.value)!=null&&s.contains(u)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.value&&d.preventDefault()})}),{default:x(()=>[E(a.$slots,"default")]),_:3},16))}}),nr=O({__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:n}){const t=e,o=n,r=U(),i=ye(o),{forwardRef:l}=A();return(a,c)=>(_(),D(f(tt),{present:a.forceMount||f(r).open.value},{default:x(()=>[f(r).modal.value?(_(),D(er,P({key:0,ref:f(l)},{...t,...f(i),...a.$attrs}),{default:x(()=>[E(a.$slots,"default")]),_:3},16)):(_(),D(tr,P({key:1,ref:f(l)},{...t,...f(i),...a.$attrs}),{default:x(()=>[E(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),or=O({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(e){const n=U();return wo(!0),A(),(t,o)=>(_(),D(f(W),{as:t.as,"as-child":t.asChild,"data-state":f(n).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:x(()=>[E(t.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),rr=O({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=U(),{forwardRef:t}=A();return(o,r)=>{var i;return(i=f(n))!=null&&i.modal.value?(_(),D(f(tt),{key:0,present:o.forceMount||f(n).open.value},{default:x(()=>[ee(or,P(o.$attrs,{ref:f(t),as:o.as,"as-child":o.asChild}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):gt("",!0)}}}),Yt=O({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;A();const t=U();return(o,r)=>(_(),D(f(W),P(n,{type:o.as==="button"?"button":void 0,onClick:r[0]||(r[0]=i=>f(t).onOpenChange(!1))}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["type"]))}}),lr=O({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const n=e,t=U();return A(),(o,r)=>(_(),D(f(W),P(n,{id:f(t).titleId}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["id"]))}}),ir=O({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const n=e;A();const t=U();return(o,r)=>(_(),D(f(W),P(n,{id:f(t).descriptionId}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["id"]))}}),$r=O({__name:"AlertDialogRoot",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(e,{emit:n}){const t=Ht(e,n);return A(),(o,r)=>(_(),D(f(Wo),P(f(t),{modal:!0}),{default:x(()=>[E(o.$slots,"default")]),_:3},16))}}),Rr=O({__name:"AlertDialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),[ar,sr]=le("AlertDialogContent"),Sr=O({__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:n}){const t=e,o=ye(n);A();const r=C();return sr({onCancelElementChange:i=>{r.value=i}}),(i,l)=>(_(),D(f(nr),P({...t,...f(o)},{role:"alertdialog",onPointerDownOutside:l[0]||(l[0]=ke(()=>{},["prevent"])),onInteractOutside:l[1]||(l[1]=ke(()=>{},["prevent"])),onOpenAutoFocus:l[2]||(l[2]=()=>{ne(()=>{var a;(a=r.value)==null||a.focus({preventScroll:!0})})})}),{default:x(()=>[E(i.$slots,"default")]),_:3},16))}}),Nr=O({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(rr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Fr=O({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e,t=ar(),{forwardRef:o,currentElement:r}=A();return fe(()=>{t.onCancelElementChange(r.value)}),(i,l)=>(_(),D(f(Yt),P(n,{ref:f(o)}),{default:x(()=>[E(i.$slots,"default")]),_:3},16))}}),Lr=O({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(lr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Mr=O({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(ir),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Ir=O({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(Yt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),[qt,ur]=le("PopperRoot"),dr=O({inheritAttrs:!1,__name:"PopperRoot",setup(e){const n=C();return ur({anchor:n,onAnchorChange:t=>n.value=t}),(t,o)=>E(t.$slots,"default")}}),cr=O({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const n=e,{forwardRef:t,currentElement:o}=A(),r=qt();return M(()=>{r.onAnchorChange(n.element??o.value)}),(i,l)=>(_(),D(f(W),{ref:f(t),as:i.as,"as-child":i.asChild},{default:x(()=>[E(i.$slots,"default")]),_:3},8,["as","as-child"]))}});function fr(e){return e!==null}function pr(e){return{name:"transformOrigin",options:e,fn(n){var t,o,r;const{placement:i,rects:l,middlewareData:a}=n,c=((t=a.arrow)==null?void 0:t.centerOffset)!==0,d=c?0:e.arrowWidth,s=c?0:e.arrowHeight,[u,p]=ze(i),v={start:"0%",center:"50%",end:"100%"}[p],h=(((o=a.arrow)==null?void 0:o.x)??0)+d/2,g=(((r=a.arrow)==null?void 0:r.y)??0)+s/2;let m="",y="";return u==="bottom"?(m=c?v:`${h}px`,y=`${-s}px`):u==="top"?(m=c?v:`${h}px`,y=`${l.floating.height+s}px`):u==="right"?(m=`${-s}px`,y=c?v:`${g}px`):u==="left"&&(m=`${l.floating.width+s}px`,y=c?v:`${g}px`),{data:{x:m,y}}}}}function ze(e){const[n,t="center"]=e.split("-");return[n,t]}const vr={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[hr,mr]=le("PopperContent"),yr=O({inheritAttrs:!1,__name:"PopperContent",props:cn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...vr}),emits:["placed"],setup(e,{emit:n}){const t=e,o=n,r=qt(),{forwardRef:i,currentElement:l}=A(),a=C(),c=C(),{width:d,height:s}=Fo(c),u=b(()=>t.side+(t.align!=="center"?`-${t.align}`:"")),p=b(()=>typeof t.collisionPadding=="number"?t.collisionPadding:{top:0,right:0,bottom:0,left:0,...t.collisionPadding}),v=b(()=>Array.isArray(t.collisionBoundary)?t.collisionBoundary:[t.collisionBoundary]),h=b(()=>({padding:p.value,boundary:v.value.filter(fr),altBoundary:v.value.length>0})),g=Qn(()=>[jn({mainAxis:t.sideOffset+s.value,alignmentAxis:t.alignOffset}),t.prioritizePosition&&t.avoidCollisions&&ut({...h.value}),t.avoidCollisions&&Vn({mainAxis:!0,crossAxis:!!t.prioritizePosition,limiter:t.sticky==="partial"?Yn():void 0,...h.value}),!t.prioritizePosition&&t.avoidCollisions&&ut({...h.value}),Kn({...h.value,apply:({elements:S,rects:rt,availableWidth:be,availableHeight:we})=>{const{width:xe,height:Jt}=rt.reference,Ce=S.floating.style;Ce.setProperty("--radix-popper-available-width",`${be}px`),Ce.setProperty("--radix-popper-available-height",`${we}px`),Ce.setProperty("--radix-popper-anchor-width",`${xe}px`),Ce.setProperty("--radix-popper-anchor-height",`${Jt}px`)}}),c.value&&Gn({element:c.value,padding:t.arrowPadding}),pr({arrowWidth:d.value,arrowHeight:s.value}),t.hideWhenDetached&&zn({strategy:"referenceHidden",...h.value})]),{floatingStyles:m,placement:y,isPositioned:B,middlewareData:w}=Jn(r.anchor,a,{strategy:"fixed",placement:u,whileElementsMounted:(...S)=>Hn(...S,{animationFrame:t.updatePositionStrategy==="always"}),middleware:g}),$=b(()=>ze(y.value)[0]),R=b(()=>ze(y.value)[1]);fn(()=>{B.value&&o("placed")});const L=b(()=>{var S;return((S=w.value.arrow)==null?void 0:S.centerOffset)!==0}),T=C("");M(()=>{l.value&&(T.value=window.getComputedStyle(l.value).zIndex)});const H=b(()=>{var S;return((S=w.value.arrow)==null?void 0:S.x)??0}),ge=b(()=>{var S;return((S=w.value.arrow)==null?void 0:S.y)??0});return mr({placedSide:$,onArrowChange:S=>c.value=S,arrowX:H,arrowY:ge,shouldHideArrow:L}),(S,rt)=>{var be,we,xe;return _(),Ot("div",{ref_key:"floatingRef",ref:a,"data-radix-popper-content-wrapper":"",style:Ye({...f(m),transform:f(B)?f(m).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:T.value,"--radix-popper-transform-origin":[(be=f(w).transformOrigin)==null?void 0:be.x,(we=f(w).transformOrigin)==null?void 0:we.y].join(" "),...((xe=f(w).hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[ee(f(W),P({ref:f(i)},S.$attrs,{"as-child":t.asChild,as:S.as,"data-side":$.value,"data-align":R.value,style:{animation:f(B)?void 0:"none"}}),{default:x(()=>[E(S.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),gr=pn("polygon",{points:"0,0 30,0 15,10"},null,-1),br=O({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(W),P(n,{width:t.width,height:t.height,viewBox:t.asChild?void 0:"0 0 30 10",preserveAspectRatio:t.asChild?void 0:"none"}),{default:x(()=>[E(t.$slots,"default",{},()=>[gr])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),wr={top:"bottom",right:"left",bottom:"top",left:"right"},xr=O({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:n}=A(),t=hr(),o=b(()=>wr[t.placedSide.value]);return(r,i)=>{var l,a,c,d;return _(),Ot("span",{ref:s=>{f(t).onArrowChange(s)},style:Ye({position:"absolute",left:(l=f(t).arrowX)!=null&&l.value?`${(a=f(t).arrowX)==null?void 0:a.value}px`:void 0,top:(c=f(t).arrowY)!=null&&c.value?`${(d=f(t).arrowY)==null?void 0:d.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f(t).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f(t).placedSide.value],visibility:f(t).shouldHideArrow.value?"hidden":void 0})},[ee(br,P(r.$attrs,{ref:f(n),style:{display:"block"},as:r.as,"as-child":r.asChild,width:r.width,height:r.height}),{default:x(()=>[E(r.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),Cr=O({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return A(),(n,t)=>(_(),D(f(W),{as:n.as,"as-child":n.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:x(()=>[E(n.$slots,"default")]),_:3},8,["as","as-child"]))}});function Or(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Or();const Xt="tooltip.open",[ot,Er]=le("TooltipProvider"),kr=O({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 n=e,{delayDuration:t,skipDelayDuration:o,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:l,disabled:a}=Ue(n);A();const c=C(!0),d=C(!1),{start:s,stop:u}=Lt(()=>{c.value=!0},o,{immediate:!1});return Er({isOpenDelayed:c,delayDuration:t,onOpen(){u(),c.value=!1},onClose(){s()},isPointerInTransitRef:d,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:l}),(p,v)=>E(p.$slots,"default")}}),[Se,_r]=le("TooltipRoot"),Wr=O({__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:n}){const t=e,o=n;A();const r=ot(),i=b(()=>t.disableHoverableContent??r.disableHoverableContent.value),l=b(()=>t.disableClosingTrigger??r.disableClosingTrigger.value),a=b(()=>t.disabled??r.disabled.value),c=b(()=>t.delayDuration??r.delayDuration.value),d=b(()=>t.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),s=Mt(t,"open",o,{defaultValue:t.defaultOpen,passive:t.open===void 0});F(s,w=>{r.onClose&&(w?(r.onOpen(),document.dispatchEvent(new CustomEvent(Xt))):r.onClose())});const u=C(!1),p=C(),v=b(()=>s.value?u.value?"delayed-open":"instant-open":"closed"),{start:h,stop:g}=Lt(()=>{u.value=!0,s.value=!0},c,{immediate:!1});function m(){g(),u.value=!1,s.value=!0}function y(){g(),s.value=!1}function B(){h()}return _r({contentId:"",open:s,stateAttribute:v,trigger:p,onTriggerChange(w){p.value=w},onTriggerEnter(){r.isOpenDelayed.value?B():m()},onTriggerLeave(){i.value?y():g()},onOpen:m,onClose:y,disableHoverableContent:i,disableClosingTrigger:l,disabled:a,ignoreNonKeyboardFocus:d}),(w,$)=>(_(),D(f(dr),null,{default:x(()=>[E(w.$slots,"default",{open:f(s)})]),_:3}))}}),Hr=O({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e,t=Se(),o=ot();t.contentId||(t.contentId=Ke(void 0,"radix-vue-tooltip-content"));const{forwardRef:r,currentElement:i}=A(),l=C(!1),a=C(!1),c=b(()=>t.disabled.value?{}:{click:g,focus:v,pointermove:u,pointerleave:p,pointerdown:s,blur:h});fe(()=>{t.onTriggerChange(i.value)});function d(){setTimeout(()=>{l.value=!1},1)}function s(){l.value=!0,document.addEventListener("pointerup",d,{once:!0})}function u(m){m.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(t.onTriggerEnter(),a.value=!0)}function p(){t.onTriggerLeave(),a.value=!1}function v(m){var y,B;l.value||t.ignoreNonKeyboardFocus.value&&!((B=(y=m.target).matches)!=null&&B.call(y,":focus-visible"))||t.onOpen()}function h(){t.onClose()}function g(){t.disableClosingTrigger.value||t.onClose()}return(m,y)=>(_(),D(f(cr),{"as-child":""},{default:x(()=>[ee(f(W),P({ref:f(r),"aria-describedby":f(t).open.value?f(t).contentId:void 0,"data-state":f(t).stateAttribute.value,as:m.as,"as-child":n.asChild,"data-grace-area-trigger":""},tn(c.value)),{default:x(()=>[E(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),Gt=O({__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:n}){const t=e,o=n,r=Se(),{forwardRef:i}=A(),l=an(),a=b(()=>{var s;return(s=l.default)==null?void 0:s.call(l)}),c=b(()=>{var s;if(t.ariaLabel)return t.ariaLabel;let u="";function p(v){typeof v.children=="string"&&v.type!==xt?u+=v.children:Array.isArray(v.children)&&v.children.forEach(h=>p(h))}return(s=a.value)==null||s.forEach(v=>p(v)),u}),d=b(()=>{const{ariaLabel:s,...u}=t;return u});return fe(()=>{Te(window,"scroll",s=>{const u=s.target;u!=null&&u.contains(r.trigger.value)&&r.onClose()}),Te(window,Xt,r.onClose)}),(s,u)=>(_(),D(f(Kt),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var v;f(r).disableClosingTrigger.value&&(v=f(r).trigger.value)!=null&&v.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=ke(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>f(r).onClose())},{default:x(()=>[ee(f(yr),P({ref:f(i),"data-state":f(r).stateAttribute.value},{...s.$attrs,...d.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:x(()=>[E(s.$slots,"default"),ee(f(Cr),{id:f(r).contentId,role:"tooltip"},{default:x(()=>[sn(un(c.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),Dr=O({__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 n=Wt(e),{forwardRef:t,currentElement:o}=A(),{trigger:r,onClose:i}=Se(),l=ot(),{isPointerInTransit:a,onPointerExit:c}=Co(r,o);return l.isPointerInTransitRef=a,c(()=>{i()}),(d,s)=>(_(),D(Gt,P({ref:f(t)},f(n)),{default:x(()=>[E(d.$slots,"default")]),_:3},16))}}),jr=O({__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:n}){const t=e,o=n,r=Se(),i=Ht(t,o),{forwardRef:l}=A();return(a,c)=>(_(),D(f(tt),{present:a.forceMount||f(r).open.value},{default:x(()=>[(_(),D(nn(f(r).disableHoverableContent.value?Gt:Dr),P({ref:f(l)},f(i)),{default:x(()=>[E(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Vr=O({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(xr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Kr=O({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}});export{rr as $,Rr as A,lr as B,Mr as F,Vr as G,kr as H,Pr as I,Fr as M,Ir as N,Sr as O,nr as P,$r as T,jr as U,Lr as V,Wr as W,Hr as j,Nr as k,Wo as n,Kr as q}; diff --git a/assets/index-9Uj6tS34.js b/assets/index-D-bLOGGQ.js similarity index 99% rename from assets/index-9Uj6tS34.js rename to assets/index-D-bLOGGQ.js index e805a54ae11406fbd908651460d2e7ece472981a..edc490e8221bbed9d0f781f9764b63fd10846816 100644 --- a/assets/index-9Uj6tS34.js +++ b/assets/index-D-bLOGGQ.js @@ -1,4 +1,4 @@ -import{d as xs}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{v as Gn,r as W,h as Ue,s as Ke,bz as vs,d as Fe,bK as bs,bN as ws,bC as Zr,p as Be,H as mn,c as ie,o as J,f as gn,bM as ks,g as Zt,G as Wt,A as Xt,w as Ye,i as Te,e as D,n as lt,y as Et,bu as Qr,j as at,t as ve,b as H,bO as yt,bP as _t,b8 as Jr,bQ as Yn,b4 as Go,bR as On,I as Ot,bS as Ts,Y as ae,bT as Mi,a3 as Fn,bU as $t,X as Pe,bV as Mt,bW as _s,bX as Yo,bY as pn,bZ as ei,W as ze,aj as Ko,b_ as qo,b$ as ti,ac as yn,a1 as Es,ae as ni,c0 as Ms,a4 as Wo,$ as xt,c1 as ri,c2 as At,c3 as As,c4 as Xo,a2 as Dt,c5 as Zo,bm as Ss,c6 as Is,Q as Rs,c7 as Cs,B as Qo,a7 as Kn,b5 as Ns,b6 as Ls,ap as Ps,a8 as Pt,c8 as Ds,c9 as Os,ca as Fs,cb as Bs,cc as er,cd as Bn,ce as Cr,ah as Nt,cf as Jo,cg as Nr,a6 as Vt,ch as Ai,ci as Lt,cj as Ht,ck as tr,cl as zs,cm as Us,cn as js,co as Vs,cp as ea,cq as ta,cr as zn,cs as na,ct as ii,cu as Un,cv as ra,cw as Hs,q as Lr,cx as $s,cy as Pr,cz as ia,cA as Gs,cB as cn,cC as oa,cD as ft,cE as vt,cF as hn,cG as Ys,cH as Ks,cI as qs,cJ as Ws,cK as Xs,ag as oi,cL as Zs,cM as Qs,cN as Js,a0 as nr,a9 as el,cO as aa,al as tl,aa as nl,ak as rl,cP as il,cQ as ol,a5 as rr,an as al,aq as sl,cR as ll,cS as Si,ar as Ii,as as Ri,cT as Ci,cU as ul,cV as cl,cW as fl,cX as dl,bJ as pl,_ as qn,P as hl,cY as sa,cZ as ml,bh as gl,c_ as yl,c$ as xl,d0 as la,b3 as jn,K as ua,F as ai,l as si,d1 as vl,bD as ir,bt as bl}from"./index-Bo-ykojl.js";import{V as wl,a as kl,c as Tl,r as _l,b as Dr,d as El}from"./three-vrm-animation.module-CbeIjn7h.js";import{m as Ml}from"./mcp-Ce-wxTN6.js";import{c as Al,d as Sl,e as Il}from"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{getImportUrlBundles as Rl}from"./import-url-browser-CPN8ipMD.js";import{s as Gt,c as Ni,u as Cl,g as Nl}from"./speech-Br7XDY4_.js";import{u as or}from"./queue-BjJ4HvBx.js";import{b as Ll,a as Pl,u as Dl,l as Ol}from"./queues-JqhmoK_1.js";import{l as Fl,u as li}from"./providers-B3p38pBl.js";import{s as Bl}from"./index-YUUT4m-_.js";import{u as zl}from"./airi-card-Vf6km3w_.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import{_ as Ul,a as jl,c as on}from"./Model.vue_vue_type_script_setup_true_lang-6CsRcxL-.js";import{_ as Li}from"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import{H as Vl}from"./HeaderLink-CATmmLWn.js";import{d as Pi}from"./index-D2UJ2Jls.js";import{u as ca}from"./consciousness-DjkUTNrC.js";import{_ as fa}from"./Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js";import{b as Di}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-LHmcipjy.js";async function*Hl(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 $l(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 Gl(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),a=Math.max(...r)-i;let s;return a===0?s=r.map(()=>0):s=r.map(u=>(u-i)/a),s.reduce((u,c)=>u+c,0)/e.length}function Yl(t,e="linear"){switch(e){case"linear":return $l(t);case"minmax":return Gl(t)}}const da=Gn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:Yl})),Kl=Gn("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 ql(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=_n(r,s,1),u="literal",s++):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((a=t.onLiteral)==null?void 0:a.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 Wl=Gn("llm",()=>{async function t(n,r,i,o){const a=o==null?void 0:o.headers;return await Bl({...r.chat(n),maxSteps:10,messages:i,headers:a,tools:[...await Ml()]})}async function e(n,r){if(n==="")return[];try{return await Fl({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=Gn("chat",()=>{const{stream:t}=Wl(),{systemPrompt:e}=Ke(zl()),n=W(!1),r=W([]),i=W([]),o=W([]),a=W([]),s=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 y(h){a.value.push(h)}function x(h){s.value.push(h)}function w(h){l.value.push(h)}function k(h){u.value.push(h)}function S(h){c.value.push(h)}const _=W([{role:"system",content:e.value}]),R=W({role:"assistant",content:""});async function P(h,I){var v;try{if(n.value=!0,!h)return;for(const O of r.value)await O(h);R.value={role:"assistant",content:""},_.value.push({role:"user",content:h}),_.value.push(R.value);const g=_.value.slice(0,_.value.length-1).map(O=>vs(O));for(const O of i.value)await O(h);for(const O of o.value)await O(h);const m=((v=I.providerConfig)==null?void 0:v.headers)||{},T=await t(I.model,I.chatProvider,g,{headers:m});for(const O of a.value)await O(h);let M="";const F=ql({onLiteral:async O=>{for(const U of s.value)await U(O);R.value.content+=O},onSpecial:async O=>{for(const U of l.value)await U(O)}});for await(const O of Hl(T.textStream,async U=>U))M+=O,await F.consume(O);await F.end();for(const O of u.value)await O();for(const O of c.value)await O(M);console.debug("LLM output:",M)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:_,streamingMessage:R,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:w,onStreamEnd:k,onAssistantResponseEnd:S}}),pa=Fe({__name:"Screen",setup(t){const e=W(),n=bs(ks),{width:r,height:i}=ws(),o=Zr(e,{immediate:!0,windowResize:!0,reset:!0}),a=Ue(()=>n.between("sm","md").value||n.smaller("sm").value),s=Ue(()=>n.between("md","lg").value),l=Ue(()=>n.greaterOrEqual("lg").value),u=Ue(()=>l.value?o.width.value:a.value||s.value?r.value-16:o.width.value),c=W(0);return Be([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||a.value||s.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),Be([o.width,o.height],()=>{l.value||a.value||s.value?c.value=o.height.value:c.value=600}),mn(async()=>{e.value&&o.update()}),(f,p)=>(J(),ie("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),Xl={absolute:"",bottom:"3",right:"3"},Zl={flex:"~ row","cursor-pointer":""},Ql=["checked","aria-checked"],Jl={key:0,"min-w":"50vw",z:"(J(),Xt(pa,{relative:""},{default:Ye(({width:a,height:s})=>[Te(jl,{width:a,height:s},{default:Ye(({app:l})=>[Te(Ul,{app:l,"mouth-open-size":t.mouthOpenSize,width:a,height:s,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),D("div",Xl,[D("div",Zl,[D("label",{class:lt([n.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Et(D("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox","appearance-none":"","outline-none":"",hidden:""},null,8,Ql),[[Qr,n.value]]),o[8]||(o[8]=D("div",{"select-none":""},[D("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(H(ui),null,{default:Ye(()=>[n.value?(J(),ie("div",Jl,[D("div",eu,[D("div",tu,[D("span",null,ve(H(e)("stage.viewers.debug-menu.emotions")),1)]),D("div",nu,[D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.question")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):at("",!0)]),_:1})])]),_:1}))}});var iu=Object.defineProperty,ou=(t,e,n)=>e in t?iu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,au=(t,e,n)=>ou(t,e+"",n);function su(t){return Ns()?(Ls(t),!0):!1}function ha(t){return typeof t=="function"?t():H(t)}const lu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uu=Object.prototype.toString,cu=t=>uu.call(t)==="[object Object]",fu=()=>{},du=lu?window:void 0;function pu(t){var e;const n=ha(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=du):[e,n,r,i]=t,!e)return fu;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=Be(()=>[pu(e),ha(i)],([c,f])=>{if(a(),!c)return;const p=cu(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return su(u),u}function ma(t,e,n,r){const i=class extends yn{constructor(o={}){const a=Object.entries(t);super({uniforms:a.reduce((s,[l,u])=>{const c=ni.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:e,fragmentShader:n}),au(this,"key",""),a.forEach(([s])=>Object.defineProperty(this,s,{get:()=>this.uniforms[s].value,set:l=>this.uniforms[s].value=l})),Object.assign(this,o)}};return i.key=Dt.generateUUID(),i}ma({color:new ze("white"),scale:new Pe(1,1),imageBounds:new Pe(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` +import{d as xs}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{v as Gn,r as W,h as Ue,s as Ke,bD as vs,d as Fe,bw as bs,bM as ws,bG as Zr,p as Be,H as mn,c as ie,o as J,f as gn,by as ks,g as Zt,G as Wt,A as Xt,w as Ye,i as Te,e as D,n as lt,y as Et,bu as Qr,j as at,t as ve,b as H,bN as yt,bO as _t,b8 as Jr,bP as Yn,b4 as Go,bQ as On,I as Ot,bR as Ts,Y as ae,bS as Mi,a3 as Fn,bT as $t,X as Pe,bU as Mt,bV as _s,bW as Yo,bX as pn,bY as ei,W as ze,aj as Ko,bZ as qo,b_ as ti,ac as yn,a1 as Es,ae as ni,b$ as Ms,a4 as Wo,$ as xt,c0 as ri,c1 as At,c2 as As,c3 as Xo,a2 as Dt,c4 as Zo,bm as Ss,c5 as Is,Q as Rs,c6 as Cs,B as Qo,a7 as Kn,b5 as Ns,b6 as Ls,ap as Ps,a8 as Pt,c7 as Ds,c8 as Os,c9 as Fs,ca as Bs,cb as er,cc as Bn,cd as Cr,ah as Nt,ce as Jo,cf as Nr,a6 as Vt,cg as Ai,ch as Lt,ci as Ht,cj as tr,ck as zs,cl as Us,cm as js,cn as Vs,co as ea,cp as ta,cq as zn,cr as na,cs as ii,ct as Un,cu as ra,cv as Hs,q as Lr,cw as $s,cx as Pr,cy as ia,cz as Gs,cA as cn,cB as oa,cC as ft,cD as vt,cE as hn,cF as Ys,cG as Ks,cH as qs,cI as Ws,cJ as Xs,ag as oi,cK as Zs,cL as Qs,cM as Js,a0 as nr,a9 as el,cN as aa,al as tl,aa as nl,ak as rl,cO as il,cP as ol,a5 as rr,an as al,aq as sl,cQ as ll,cR as Si,ar as Ii,as as Ri,cS as Ci,cT as ul,cU as cl,cV as fl,cW as dl,cX as pl,_ as qn,P as hl,cY as sa,cZ as ml,bh as gl,c_ as yl,c$ as xl,d0 as la,b3 as jn,K as ua,F as ai,l as si,d1 as vl,bH as ir,bt as bl}from"./index-1_q7hlhr.js";import{V as wl,a as kl,c as Tl,r as _l,b as Dr,d as El}from"./three-vrm-animation.module-CtUkMEcn.js";import{m as Ml}from"./mcp-DcvIwSEe.js";import{c as Al,d as Sl,e as Il}from"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{getImportUrlBundles as Rl}from"./import-url-browser-CPN8ipMD.js";import{s as Gt,c as Ni,u as Cl,g as Nl}from"./speech-Bdg784LP.js";import{u as or}from"./queue-2ASK7l5s.js";import{b as Ll,a as Pl,u as Dl,l as Ol}from"./queues-B3H1SS53.js";import{l as Fl,u as li}from"./providers-BQORs1wj.js";import{s as Bl}from"./index-YUUT4m-_.js";import{u as zl}from"./airi-card-CFCqiAzX.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import{_ as Ul,a as jl,r as on}from"./Model.vue_vue_type_script_setup_true_lang-DoV2Qdhe.js";import{_ as Li}from"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import{H as Vl}from"./HeaderLink-D3zUgdpF.js";import{d as Pi}from"./index-BX7nlSld.js";import{u as ca}from"./consciousness-esOkXpB1.js";import{_ as fa}from"./Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js";import{b as Di}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-LHmcipjy.js";async function*Hl(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 $l(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 Gl(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),a=Math.max(...r)-i;let s;return a===0?s=r.map(()=>0):s=r.map(u=>(u-i)/a),s.reduce((u,c)=>u+c,0)/e.length}function Yl(t,e="linear"){switch(e){case"linear":return $l(t);case"minmax":return Gl(t)}}const da=Gn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:Yl})),Kl=Gn("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 ql(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=_n(r,s,1),u="literal",s++):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((a=t.onLiteral)==null?void 0:a.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 Wl=Gn("llm",()=>{async function t(n,r,i,o){const a=o==null?void 0:o.headers;return await Bl({...r.chat(n),maxSteps:10,messages:i,headers:a,tools:[...await Ml()]})}async function e(n,r){if(n==="")return[];try{return await Fl({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=Gn("chat",()=>{const{stream:t}=Wl(),{systemPrompt:e}=Ke(zl()),n=W(!1),r=W([]),i=W([]),o=W([]),a=W([]),s=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 y(h){a.value.push(h)}function x(h){s.value.push(h)}function w(h){l.value.push(h)}function k(h){u.value.push(h)}function S(h){c.value.push(h)}const _=W([{role:"system",content:e.value}]),R=W({role:"assistant",content:""});async function P(h,I){var v;try{if(n.value=!0,!h)return;for(const O of r.value)await O(h);R.value={role:"assistant",content:""},_.value.push({role:"user",content:h}),_.value.push(R.value);const g=_.value.slice(0,_.value.length-1).map(O=>vs(O));for(const O of i.value)await O(h);for(const O of o.value)await O(h);const m=((v=I.providerConfig)==null?void 0:v.headers)||{},T=await t(I.model,I.chatProvider,g,{headers:m});for(const O of a.value)await O(h);let M="";const F=ql({onLiteral:async O=>{for(const U of s.value)await U(O);R.value.content+=O},onSpecial:async O=>{for(const U of l.value)await U(O)}});for await(const O of Hl(T.textStream,async U=>U))M+=O,await F.consume(O);await F.end();for(const O of u.value)await O();for(const O of c.value)await O(M);console.debug("LLM output:",M)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:_,streamingMessage:R,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:w,onStreamEnd:k,onAssistantResponseEnd:S}}),pa=Fe({__name:"Screen",setup(t){const e=W(),n=bs(ks),{width:r,height:i}=ws(),o=Zr(e,{immediate:!0,windowResize:!0,reset:!0}),a=Ue(()=>n.between("sm","md").value||n.smaller("sm").value),s=Ue(()=>n.between("md","lg").value),l=Ue(()=>n.greaterOrEqual("lg").value),u=Ue(()=>l.value?o.width.value:a.value||s.value?r.value-16:o.width.value),c=W(0);return Be([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||a.value||s.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),Be([o.width,o.height],()=>{l.value||a.value||s.value?c.value=o.height.value:c.value=600}),mn(async()=>{e.value&&o.update()}),(f,p)=>(J(),ie("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),Xl={absolute:"",bottom:"3",right:"3"},Zl={flex:"~ row","cursor-pointer":""},Ql=["checked","aria-checked"],Jl={key:0,"min-w":"50vw",z:"(J(),Xt(pa,{relative:""},{default:Ye(({width:a,height:s})=>[Te(jl,{width:a,height:s},{default:Ye(({app:l})=>[Te(Ul,{app:l,"mouth-open-size":t.mouthOpenSize,width:a,height:s,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),D("div",Xl,[D("div",Zl,[D("label",{class:lt([n.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Et(D("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox","appearance-none":"","outline-none":"",hidden:""},null,8,Ql),[[Qr,n.value]]),o[8]||(o[8]=D("div",{"select-none":""},[D("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(H(ui),null,{default:Ye(()=>[n.value?(J(),ie("div",Jl,[D("div",eu,[D("div",tu,[D("span",null,ve(H(e)("stage.viewers.debug-menu.emotions")),1)]),D("div",nu,[D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.question")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):at("",!0)]),_:1})])]),_:1}))}});var iu=Object.defineProperty,ou=(t,e,n)=>e in t?iu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,au=(t,e,n)=>ou(t,e+"",n);function su(t){return Ns()?(Ls(t),!0):!1}function ha(t){return typeof t=="function"?t():H(t)}const lu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uu=Object.prototype.toString,cu=t=>uu.call(t)==="[object Object]",fu=()=>{},du=lu?window:void 0;function pu(t){var e;const n=ha(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=du):[e,n,r,i]=t,!e)return fu;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=Be(()=>[pu(e),ha(i)],([c,f])=>{if(a(),!c)return;const p=cu(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return su(u),u}function ma(t,e,n,r){const i=class extends yn{constructor(o={}){const a=Object.entries(t);super({uniforms:a.reduce((s,[l,u])=>{const c=ni.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:e,fragmentShader:n}),au(this,"key",""),a.forEach(([s])=>Object.defineProperty(this,s,{get:()=>this.uniforms[s].value,set:l=>this.uniforms[s].value=l})),Object.assign(this,o)}};return i.key=Dt.generateUUID(),i}ma({color:new ze("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() { diff --git a/assets/index-qpRnEVwM.js b/assets/index-DHnlC1gY.js similarity index 84% rename from assets/index-qpRnEVwM.js rename to assets/index-DHnlC1gY.js index bd3960c1ffcf00aad60e51a87027ef91fd776157..26a6d3009d1d4a5f9eed44b48e7115a51d5bc233 100644 --- a/assets/index-qpRnEVwM.js +++ b/assets/index-DHnlC1gY.js @@ -1 +1 @@ -import{u as d}from"./useIconAnimation-CY9TceXA.js";import{d as u,N as p,K as f,c as n,o as t,e as i,A as v,y as x,b as o,F as _}from"./index-Bo-ykojl.js";import{b as r}from"./route-block-B_A1xBdJ.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";const y={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},k=u({__name:"index",setup(b){const{iconAnimationStarted:a,showIconAnimation:s,animationIcon:c}=d("i-solar:armchair-2-bold-duotone");return(A,e)=>{const l=p("IconAnimation"),m=f("motion");return t(),n(_,null,[e[1]||(e[1]=i("div",null," Scene ",-1)),o(s)?(t(),v(l,{key:0,"z-index":-1,icon:o(c),"icon-size":12,duration:1e3,started:o(a),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):x((t(),n("div",y,e[0]||(e[0]=[i("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[m]])],64)}}});typeof r=="function"&&r(k);export{k as default}; +import{u as d}from"./useIconAnimation-rMzGkkyX.js";import{d as u,N as p,K as f,c as n,o as t,e as i,A as v,y as x,b as o,F as _}from"./index-1_q7hlhr.js";import{b as r}from"./route-block-B_A1xBdJ.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";const y={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},k=u({__name:"index",setup(b){const{iconAnimationStarted:a,showIconAnimation:s,animationIcon:c}=d("i-solar:armchair-2-bold-duotone");return(A,e)=>{const l=p("IconAnimation"),m=f("motion");return t(),n(_,null,[e[1]||(e[1]=i("div",null," Scene ",-1)),o(s)?(t(),v(l,{key:0,"z-index":-1,icon:o(c),"icon-size":12,duration:1e3,started:o(a),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):x((t(),n("div",y,e[0]||(e[0]=[i("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[m]])],64)}}});typeof r=="function"&&r(k);export{k as default}; diff --git a/assets/index-rLJvnp0C.js b/assets/index-DZHRHxrd.js similarity index 91% rename from assets/index-rLJvnp0C.js rename to assets/index-DZHRHxrd.js index 78a295799311b06e708ad9822b58ef76f30d0ebb..af700ef267450d838db7a487f3d5facc88338199 100644 --- a/assets/index-rLJvnp0C.js +++ b/assets/index-DZHRHxrd.js @@ -1 +1 @@ -import{d as q,m as G,u as H,h as C,A as E,o as i,w as z,e as a,n as F,f as W,k as X,t as u,c,F as A,l as T,E as Y,b as r,g as Z,s as ee,r as x,p as te,K as ae,i as h,y as O,z as le,j as S}from"./index-Bo-ykojl.js";import"./mcp-Ce-wxTN6.js";import{u as re}from"./airi-card-Vf6km3w_.js";import{k as se}from"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as oe}from"./InputFile.vue_vue_type_script_setup_true_lang-CWw-Ysae.js";import{_ as ne}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-CHDpOqJ6.js";import{_ as ie}from"./CardListItem.vue_vue_type_script_setup_true_lang-Irw2DXRd.js";import{a as de}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-B3_Iawdo.js";import{b as U}from"./route-block-B_A1xBdJ.js";import"./mini_xsschema-f5xAZ6yD.js";import"./consciousness-DjkUTNrC.js";import"./providers-B3p38pBl.js";import"./index-LHmcipjy.js";import"./speech-Br7XDY4_.js";import"./floating-ui.core-CgBsuaUc.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./index-DmpthJxW.js";const ue={class:"flex-1 truncate"},ce={class:"min-w-[160px] flex flex-col gap-0.5 border border-neutral-200 rounded-lg bg-white p-1 shadow-lg dark:border-neutral-800 dark:bg-neutral-900"},me=["onClick"],pe=q({__name:"Select",props:G({options:null,placeholder:null,disabled:{type:Boolean},title:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(V){const s=V,p=H(V,"modelValue"),y=C(()=>{const n=s.options.find(f=>f.value===p.value);return n?n.label:s.placeholder});function $(n){p.value=n}return(n,f)=>(i(),E(r(se),{"auto-size":"","auto-boundary-max-size":""},{popper:z(({hide:g})=>[a("div",ce,[(i(!0),c(A,null,T(s.options,d=>(i(),c("div",Y({ref_for:!0},{...n.$attrs,class:null,style:null},{key:d.value,class:["cursor-pointer rounded px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800",{"bg-neutral-100 dark:bg-neutral-800":p.value===d.value}],onClick:b=>{$(d.value),g()}}),u(d.label),17,me))),128))])]),default:z(()=>[a("div",{class:F(["min-w-[160px] flex cursor-pointer items-center justify-between gap-2 border rounded-lg bg-white p-2.5 text-xs text-neutral-700 shadow-sm outline-none transition-colors disabled:cursor-not-allowed dark:border-neutral-800 dark:bg-neutral-900 disabled:bg-neutral-100 hover:bg-neutral-50 dark:text-neutral-200 disabled:text-neutral-400 focus:ring-2 focus:ring-black/10 dark:disabled:bg-neutral-800 dark:hover:bg-neutral-800 dark:disabled:text-neutral-600",{"pointer-events-none":s.disabled}])},[a("div",ue,[W(n.$slots,"default",{label:y.value},()=>[X(u(y.value),1)])]),f[0]||(f[0]=a("div",{"i-solar:alt-arrow-down-bold-duotone":"",class:"h-3.5 w-3.5 text-neutral-500 dark:text-neutral-400"},null,-1))],2)]),_:3}))}}),fe={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},ve={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},xe={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},ge=["placeholder"],be={class:"relative flex flex-row justify-start gap-2 lg:flex-col"},_e={class:"top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400"},ke={key:0,flex:"","flex-col":"","items-center":""},ye={"font-medium":"",text:"neutral-600 dark:neutral-300"},we={text:"neutral-500 dark:neutral-400","mt-2":"","text-sm":""},he={key:1,flex:"","flex-col":"","items-center":""},Ce={"font-medium":"",text:"primary-600 dark:primary-300"},Ve={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"},$e={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"},Se={class:"font-medium"},ze={class:"text-sm text-amber-600 dark:text-amber-400"},Ae={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Ne=q({__name:"index",setup(V){const{t:s}=Z(),p=re(),{addCard:y,removeCard:$}=p,{cards:n,activeCardId:f}=ee(p),g=x(""),d=x(!1),b=x(""),_=x("nameAsc"),D=x([]);te(D,async l=>{const e=l[0];if(e)try{const o=await e.text(),m=JSON.parse(o);g.value=y(m),d.value=!0}catch(o){console.error("Error processing card file:",o)}});const N=C(()=>Array.from(n.value.entries()).map(([l,e])=>({id:l,name:e.name,description:e.description}))),I=C(()=>{if(!b.value)return N.value;const l=b.value.toLowerCase();return N.value.filter(e=>e.name.toLowerCase().includes(l)||e.description&&e.description.toLowerCase().includes(l))}),j=C(()=>{const l=[...I.value];return _.value==="nameAsc"?l.sort((e,o)=>e.name.localeCompare(o.name)):_.value==="nameDesc"?l.sort((e,o)=>o.name.localeCompare(e.name)):_.value==="recent"?l.sort((e,o)=>o.id.localeCompare(e.id)):l}),w=x(!1),v=x(null);function J(){v.value&&($(v.value),v.value=null,w.value=!1)}function K(l){v.value=l,w.value=!0}function P(l){g.value=l,d.value=!0}function Q(l){f.value=l}function R(l){const e=n.value.get(l);return(e==null?void 0:e.version)||"1.0.0"}function B(l,e){var t,k,L,M;const o=n.value.get(l);if(!o||!((k=(t=o.extensions)==null?void 0:t.airi)!=null&&k.modules))return"default";const m=o.extensions.airi.modules;return e==="consciousness"?(L=m.consciousness)!=null&&L.model&&m.consciousness.model.split("-").pop()||"default":e==="voice"&&((M=m.speech)==null?void 0:M.voice_id)||"default"}return(l,e)=>{var m;const o=ae("motion");return i(),c(A,null,[a("div",fe,[a("div",ve,[a("div",xe,[e[6]||(e[6]=a("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[a("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),O(a("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>b.value=t),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:r(s)("settings.pages.card.search")},null,8,ge),[[le,b.value]])]),a("div",be,[a("div",_e,u(r(s)("settings.pages.card.sort_by"))+": ",1),h(pe,{modelValue:_.value,"onUpdate:modelValue":e[1]||(e[1]=t=>_.value=t),options:[{value:"nameAsc",label:r(s)("settings.pages.card.name_asc")},{value:"nameDesc",label:r(s)("settings.pages.card.name_desc")},{value:"recent",label:r(s)("settings.pages.card.recent")}],placeholder:"Select sort option",class:"min-w-[150px]"},null,8,["modelValue","options"])])]),a("div",{class:F(["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))]":r(n).size>0}])},[h(r(oe),{modelValue:D.value,"onUpdate:modelValue":e[2]||(e[2]=t=>D.value=t),accept:"*.json"},{default:z(({isDragging:t})=>[t?(i(),c("div",he,[e[8]||(e[8]=a("div",{"i-solar:upload-minimalistic-bold":"",class:"mb-2 text-5xl text-primary-500 dark:text-primary-400"},null,-1)),a("p",Ce,u(r(s)("settings.pages.card.drop_here")),1)])):(i(),c("div",ke,[e[7]||(e[7]=a("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),a("p",ye,u(r(s)("settings.pages.card.upload")),1),a("p",we,u(r(s)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),r(n).size>0?(i(!0),c(A,{key:0},T(j.value,t=>(i(),E(ie,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(f),"is-selected":t.id===g.value&&d.value,version:R(t.id),"consciousness-model":B(t.id,"consciousness"),"voice-model":B(t.id,"voice"),onSelect:k=>P(t.id),onActivate:k=>Q(t.id),onDelete:k=>K(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):S("",!0),r(n).size===0?(i(),c("div",Ve,[e[9]||(e[9]=a("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),a("p",null,u(r(s)("settings.pages.card.no_cards")),1)])):S("",!0),b.value&&j.value.length===0?(i(),c("div",$e,[e[10]||(e[10]=a("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),a("div",De,[a("span",Se,u(r(s)("settings.pages.card.no_results")),1),a("span",ze,u(r(s)("settings.pages.card.try_different_search")),1)])])):S("",!0)],2)]),h(de,{modelValue:w.value,"onUpdate:modelValue":e[3]||(e[3]=t=>w.value=t),"card-name":v.value?(m=r(p).getCard(v.value))==null?void 0:m.name:"",onConfirm:J,onCancel:e[4]||(e[4]=t=>v.value=null)},null,8,["modelValue","card-name"]),h(ne,{modelValue:d.value,"onUpdate:modelValue":e[5]||(e[5]=t=>d.value=t),"card-id":g.value},null,8,["modelValue","card-id"]),O((i(),c("div",Ae,e[11]||(e[11]=[a("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof U=="function"&&U(Ne);export{Ne as default}; +import{d as q,m as G,u as H,h as C,A as E,o as i,w as z,e as a,n as F,f as W,k as X,t as u,c,F as A,l as T,E as Y,b as r,g as Z,s as ee,r as x,p as te,K as ae,i as h,y as O,z as le,j as S}from"./index-1_q7hlhr.js";import"./mcp-DcvIwSEe.js";import{u as re}from"./airi-card-CFCqiAzX.js";import{k as se}from"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as oe}from"./InputFile.vue_vue_type_script_setup_true_lang-DsrPsbsJ.js";import{_ as ne}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-DLR-50Jh.js";import{_ as ie}from"./CardListItem.vue_vue_type_script_setup_true_lang-qVLsovLx.js";import{a as de}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-Beo1SYnL.js";import{b as U}from"./route-block-B_A1xBdJ.js";import"./mini_xsschema-f5xAZ6yD.js";import"./consciousness-esOkXpB1.js";import"./providers-BQORs1wj.js";import"./index-LHmcipjy.js";import"./speech-Bdg784LP.js";import"./floating-ui.core-CgBsuaUc.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./index-CmOAxAkQ.js";const ue={class:"flex-1 truncate"},ce={class:"min-w-[160px] flex flex-col gap-0.5 border border-neutral-200 rounded-lg bg-white p-1 shadow-lg dark:border-neutral-800 dark:bg-neutral-900"},me=["onClick"],pe=q({__name:"Select",props:G({options:null,placeholder:null,disabled:{type:Boolean},title:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(V){const s=V,p=H(V,"modelValue"),y=C(()=>{const n=s.options.find(f=>f.value===p.value);return n?n.label:s.placeholder});function $(n){p.value=n}return(n,f)=>(i(),E(r(se),{"auto-size":"","auto-boundary-max-size":""},{popper:z(({hide:g})=>[a("div",ce,[(i(!0),c(A,null,T(s.options,d=>(i(),c("div",Y({ref_for:!0},{...n.$attrs,class:null,style:null},{key:d.value,class:["cursor-pointer rounded px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800",{"bg-neutral-100 dark:bg-neutral-800":p.value===d.value}],onClick:b=>{$(d.value),g()}}),u(d.label),17,me))),128))])]),default:z(()=>[a("div",{class:F(["min-w-[160px] flex cursor-pointer items-center justify-between gap-2 border rounded-lg bg-white p-2.5 text-xs text-neutral-700 shadow-sm outline-none transition-colors disabled:cursor-not-allowed dark:border-neutral-800 dark:bg-neutral-900 disabled:bg-neutral-100 hover:bg-neutral-50 dark:text-neutral-200 disabled:text-neutral-400 focus:ring-2 focus:ring-black/10 dark:disabled:bg-neutral-800 dark:hover:bg-neutral-800 dark:disabled:text-neutral-600",{"pointer-events-none":s.disabled}])},[a("div",ue,[W(n.$slots,"default",{label:y.value},()=>[X(u(y.value),1)])]),f[0]||(f[0]=a("div",{"i-solar:alt-arrow-down-bold-duotone":"",class:"h-3.5 w-3.5 text-neutral-500 dark:text-neutral-400"},null,-1))],2)]),_:3}))}}),fe={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},ve={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},xe={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},ge=["placeholder"],be={class:"relative flex flex-row justify-start gap-2 lg:flex-col"},_e={class:"top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400"},ke={key:0,flex:"","flex-col":"","items-center":""},ye={"font-medium":"",text:"neutral-600 dark:neutral-300"},we={text:"neutral-500 dark:neutral-400","mt-2":"","text-sm":""},he={key:1,flex:"","flex-col":"","items-center":""},Ce={"font-medium":"",text:"primary-600 dark:primary-300"},Ve={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"},$e={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"},Se={class:"font-medium"},ze={class:"text-sm text-amber-600 dark:text-amber-400"},Ae={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Ne=q({__name:"index",setup(V){const{t:s}=Z(),p=re(),{addCard:y,removeCard:$}=p,{cards:n,activeCardId:f}=ee(p),g=x(""),d=x(!1),b=x(""),_=x("nameAsc"),D=x([]);te(D,async l=>{const e=l[0];if(e)try{const o=await e.text(),m=JSON.parse(o);g.value=y(m),d.value=!0}catch(o){console.error("Error processing card file:",o)}});const N=C(()=>Array.from(n.value.entries()).map(([l,e])=>({id:l,name:e.name,description:e.description}))),I=C(()=>{if(!b.value)return N.value;const l=b.value.toLowerCase();return N.value.filter(e=>e.name.toLowerCase().includes(l)||e.description&&e.description.toLowerCase().includes(l))}),j=C(()=>{const l=[...I.value];return _.value==="nameAsc"?l.sort((e,o)=>e.name.localeCompare(o.name)):_.value==="nameDesc"?l.sort((e,o)=>o.name.localeCompare(e.name)):_.value==="recent"?l.sort((e,o)=>o.id.localeCompare(e.id)):l}),w=x(!1),v=x(null);function J(){v.value&&($(v.value),v.value=null,w.value=!1)}function K(l){v.value=l,w.value=!0}function P(l){g.value=l,d.value=!0}function Q(l){f.value=l}function R(l){const e=n.value.get(l);return(e==null?void 0:e.version)||"1.0.0"}function B(l,e){var t,k,L,M;const o=n.value.get(l);if(!o||!((k=(t=o.extensions)==null?void 0:t.airi)!=null&&k.modules))return"default";const m=o.extensions.airi.modules;return e==="consciousness"?(L=m.consciousness)!=null&&L.model&&m.consciousness.model.split("-").pop()||"default":e==="voice"&&((M=m.speech)==null?void 0:M.voice_id)||"default"}return(l,e)=>{var m;const o=ae("motion");return i(),c(A,null,[a("div",fe,[a("div",ve,[a("div",xe,[e[6]||(e[6]=a("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[a("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),O(a("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>b.value=t),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:r(s)("settings.pages.card.search")},null,8,ge),[[le,b.value]])]),a("div",be,[a("div",_e,u(r(s)("settings.pages.card.sort_by"))+": ",1),h(pe,{modelValue:_.value,"onUpdate:modelValue":e[1]||(e[1]=t=>_.value=t),options:[{value:"nameAsc",label:r(s)("settings.pages.card.name_asc")},{value:"nameDesc",label:r(s)("settings.pages.card.name_desc")},{value:"recent",label:r(s)("settings.pages.card.recent")}],placeholder:"Select sort option",class:"min-w-[150px]"},null,8,["modelValue","options"])])]),a("div",{class:F(["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))]":r(n).size>0}])},[h(r(oe),{modelValue:D.value,"onUpdate:modelValue":e[2]||(e[2]=t=>D.value=t),accept:"*.json"},{default:z(({isDragging:t})=>[t?(i(),c("div",he,[e[8]||(e[8]=a("div",{"i-solar:upload-minimalistic-bold":"",class:"mb-2 text-5xl text-primary-500 dark:text-primary-400"},null,-1)),a("p",Ce,u(r(s)("settings.pages.card.drop_here")),1)])):(i(),c("div",ke,[e[7]||(e[7]=a("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),a("p",ye,u(r(s)("settings.pages.card.upload")),1),a("p",we,u(r(s)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),r(n).size>0?(i(!0),c(A,{key:0},T(j.value,t=>(i(),E(ie,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(f),"is-selected":t.id===g.value&&d.value,version:R(t.id),"consciousness-model":B(t.id,"consciousness"),"voice-model":B(t.id,"voice"),onSelect:k=>P(t.id),onActivate:k=>Q(t.id),onDelete:k=>K(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):S("",!0),r(n).size===0?(i(),c("div",Ve,[e[9]||(e[9]=a("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),a("p",null,u(r(s)("settings.pages.card.no_cards")),1)])):S("",!0),b.value&&j.value.length===0?(i(),c("div",$e,[e[10]||(e[10]=a("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),a("div",De,[a("span",Se,u(r(s)("settings.pages.card.no_results")),1),a("span",ze,u(r(s)("settings.pages.card.try_different_search")),1)])])):S("",!0)],2)]),h(de,{modelValue:w.value,"onUpdate:modelValue":e[3]||(e[3]=t=>w.value=t),"card-name":v.value?(m=r(p).getCard(v.value))==null?void 0:m.name:"",onConfirm:J,onCancel:e[4]||(e[4]=t=>v.value=null)},null,8,["modelValue","card-name"]),h(ne,{modelValue:d.value,"onUpdate:modelValue":e[5]||(e[5]=t=>d.value=t),"card-id":g.value},null,8,["modelValue","card-id"]),O((i(),c("div",Ae,e[11]||(e[11]=[a("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof U=="function"&&U(Ne);export{Ne as default}; diff --git a/assets/index-BidQVtNJ.js b/assets/index-JZi43ROx.js similarity index 74% rename from assets/index-BidQVtNJ.js rename to assets/index-JZi43ROx.js index adcc6d09a17cd6b77a05dce398b9b8cb89fa696b..ec083d5bf41dacb042d3c1809a7873039ed32212 100644 --- a/assets/index-BidQVtNJ.js +++ b/assets/index-JZi43ROx.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as g,s as v,N as k,K as I,c as i,o as t,e as c,A as s,y as l,F as m,l as b,b as e}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as h}from"./providers-B3p38pBl.js";import{I as z}from"./IconStatusItem-CU771Upv.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{u as A}from"./useIconAnimation-CY9TceXA.js";import{b as d}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";const B={grid:"~ cols-2 gap-4"},S={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},w=g({__name:"index",setup(C){const u=h(),{allProvidersMetadata:p}=v(u),{iconAnimationStarted:f,showIconAnimation:y,animationIcon:_}=A("i-solar:box-minimalistic-bold-duotone");return(D,n)=>{const x=k("IconAnimation"),a=I("motion");return t(),i(m,null,[c("div",B,[(t(!0),i(m,null,b(e(p),(o,r)=>l((t(),s(e(z),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:o.localizedName,description:o.localizedDescription,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:`/settings/providers/${o.id}`,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),e(y)?(t(),s(x,{key:0,"z-index":-1,icon:e(_),"icon-size":12,duration:1e3,started:e(f),"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"])):l((t(),i("div",S,n[0]||(n[0]=[c("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof d=="function"&&d(w);export{w as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as g,s as v,N as k,K as I,c as i,o as t,e as c,A as s,y as l,F as m,l as b,b as e}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as h}from"./providers-BQORs1wj.js";import{I as z}from"./IconStatusItem-Z8CeAcrh.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{u as A}from"./useIconAnimation-rMzGkkyX.js";import{b as d}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";const B={grid:"~ cols-2 gap-4"},S={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},w=g({__name:"index",setup(C){const u=h(),{allProvidersMetadata:p}=v(u),{iconAnimationStarted:f,showIconAnimation:y,animationIcon:_}=A("i-solar:box-minimalistic-bold-duotone");return(D,n)=>{const x=k("IconAnimation"),a=I("motion");return t(),i(m,null,[c("div",B,[(t(!0),i(m,null,b(e(p),(o,r)=>l((t(),s(e(z),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:o.localizedName,description:o.localizedDescription,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:`/settings/providers/${o.id}`,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),e(y)?(t(),s(x,{key:0,"z-index":-1,icon:e(_),"icon-size":12,duration:1e3,started:e(f),"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"])):l((t(),i("div",S,n[0]||(n[0]=[c("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof d=="function"&&d(w);export{w as default}; diff --git a/assets/index-DIv7gjQz.js b/assets/index-QlmGg2mr.js similarity index 92% rename from assets/index-DIv7gjQz.js rename to assets/index-QlmGg2mr.js index 519144821975ccac4ba3b8cbfc066364bbe1eee7..bcdd7f2e86f437e915787c98811947ad4d14de5c 100644 --- a/assets/index-DIv7gjQz.js +++ b/assets/index-QlmGg2mr.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as I,N as A,A as x,o as n,w as E,e as s,c as p,j as w,f as D,t as C,n as P,_ as R,S as j,r,g as q,G as L,h as N,K as F,y as _,F as V,l as G,b as y,q as K,b3 as O}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as H}from"./IconAnimation.vue_vue_type_script_setup_true_lang-Vav3WbNP.js";import{b as S}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";const J={"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=I({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(o){return(m,g)=>{const f=A("RouterLink");return n(),x(f,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-900",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:o.to},{default:E(()=>[s("div",J,[s("div",M,C(o.title),1),s("div",Q,[s("span",null,C(o.description),1)])]),typeof o.icon=="string"?(n(),p("div",{key:0,class:P(["menu-icon-item-icon",[o.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)):w("",!0),o.iconTemplate?D(m.$slots,"icon",{key:1},void 0,!0):w("",!0)]),_:3},8,["to"])}}}),W=R(U,[["__scopeId","data-v-656e0116"]]),X={flex:"~ col gap-4"},Y={flex:"~ col gap-4"},Z={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-12rem)]","bottom-0":"","right--10":"","z--1":"",initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},tt={text:"60","i-solar:settings-bold-duotone":""},et=I({__name:"index",setup(o){const m=j(),g=r(!1),f=r(),c=r(),{t}=q(),h=r(""),b=r(""),k=r(!1),d=L();function $(){var a;(a=c.value)==null||a.call(c)}async function T(a,l){const e=a.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const u=e.getBoundingClientRect(),v=`${u.left}px, ${u.top}px`;h.value=l.icon,b.value=v,k.value=!0,await O(),g.value=!0}const z=m.beforeEach(async(a,l,i)=>{if(!d.usePageSpecificTransitions||d.disableTransitions){i();return}await new Promise(e=>{c.value=e}),z(),i()}),B=N(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-solar:emoji-funny-square-bold-duotone",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-solar:layers-bold-duotone",to:"/settings/modules"},{title:t("settings.pages.scene.title"),description:t("settings.pages.scene.description"),icon:"i-solar:armchair-2-bold-duotone",to:"/settings/scene"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-solar:people-nearby-bold-duotone",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-solar:leaf-bold-duotone",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-solar:box-minimalistic-bold-duotone",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-solar:filters-bold-duotone",to:"/settings/appearance"}]);return(a,l)=>{const i=F("motion");return n(),p("div",X,[l[0]||(l[0]=s("div",null,null,-1)),s("div",Y,[(n(!0),p(V,null,G(B.value,(e,u)=>_((n(),x(y(W),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:K({transitionDelay:`${u*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:v=>T(v,e)},null,8,["style","title","description","icon","to","onClick"])),[[i]])),128))]),k.value&&!y(d).disableTransitions&&y(d).usePageSpecificTransitions?(n(),x(H,{key:0,ref_key:"iconAnimation",ref:f,icon:h.value,"icon-size":6*1.2,position:b.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:g.value,onAnimationEndedOnce:$},null,8,["icon","position","started"])):_((n(),p("div",Z,[_(s("div",tt,null,512),[[i]])])),[[i]])])}}});typeof S=="function"&&S(et);export{et as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as I,N as A,A as x,o as n,w as E,e as s,c as p,j as w,f as D,t as C,n as P,_ as R,S as j,r,g as q,G as L,h as N,K as F,y as _,F as V,l as G,b as y,q as K,b3 as O}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as H}from"./IconAnimation.vue_vue_type_script_setup_true_lang-tDvrftik.js";import{b as S}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";const J={"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=I({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(o){return(m,g)=>{const f=A("RouterLink");return n(),x(f,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-900",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:o.to},{default:E(()=>[s("div",J,[s("div",M,C(o.title),1),s("div",Q,[s("span",null,C(o.description),1)])]),typeof o.icon=="string"?(n(),p("div",{key:0,class:P(["menu-icon-item-icon",[o.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)):w("",!0),o.iconTemplate?D(m.$slots,"icon",{key:1},void 0,!0):w("",!0)]),_:3},8,["to"])}}}),W=R(U,[["__scopeId","data-v-656e0116"]]),X={flex:"~ col gap-4"},Y={flex:"~ col gap-4"},Z={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-12rem)]","bottom-0":"","right--10":"","z--1":"",initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},tt={text:"60","i-solar:settings-bold-duotone":""},et=I({__name:"index",setup(o){const m=j(),g=r(!1),f=r(),c=r(),{t}=q(),h=r(""),b=r(""),k=r(!1),d=L();function $(){var a;(a=c.value)==null||a.call(c)}async function T(a,l){const e=a.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const u=e.getBoundingClientRect(),v=`${u.left}px, ${u.top}px`;h.value=l.icon,b.value=v,k.value=!0,await O(),g.value=!0}const z=m.beforeEach(async(a,l,i)=>{if(!d.usePageSpecificTransitions||d.disableTransitions){i();return}await new Promise(e=>{c.value=e}),z(),i()}),B=N(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-solar:emoji-funny-square-bold-duotone",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-solar:layers-bold-duotone",to:"/settings/modules"},{title:t("settings.pages.scene.title"),description:t("settings.pages.scene.description"),icon:"i-solar:armchair-2-bold-duotone",to:"/settings/scene"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-solar:people-nearby-bold-duotone",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-solar:leaf-bold-duotone",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-solar:box-minimalistic-bold-duotone",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-solar:filters-bold-duotone",to:"/settings/appearance"}]);return(a,l)=>{const i=F("motion");return n(),p("div",X,[l[0]||(l[0]=s("div",null,null,-1)),s("div",Y,[(n(!0),p(V,null,G(B.value,(e,u)=>_((n(),x(y(W),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:K({transitionDelay:`${u*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:v=>T(v,e)},null,8,["style","title","description","icon","to","onClick"])),[[i]])),128))]),k.value&&!y(d).disableTransitions&&y(d).usePageSpecificTransitions?(n(),x(H,{key:0,ref_key:"iconAnimation",ref:f,icon:h.value,"icon-size":6*1.2,position:b.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:g.value,onAnimationEndedOnce:$},null,8,["icon","position","started"])):_((n(),p("div",Z,[_(s("div",tt,null,512),[[i]])])),[[i]])])}}});typeof S=="function"&&S(et);export{et as default}; diff --git a/assets/index-DvEiyc1a.js b/assets/index-ru1ciun_.js similarity index 79% rename from assets/index-DvEiyc1a.js rename to assets/index-ru1ciun_.js index ad705c2ba11ac0a62e0f079786e21930c69fd15b..2be552850c93bc5d1ee441db01e0460fc573c83b 100644 --- a/assets/index-DvEiyc1a.js +++ b/assets/index-ru1ciun_.js @@ -1 +1 @@ -import{d as i,K as n,y as r,o as a,c as s,e as c}from"./index-Bo-ykojl.js";import{b as t}from"./route-block-B_A1xBdJ.js";const l={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},d=i({__name:"index",setup(m){return(p,e)=>{const o=n("motion");return r((a(),s("div",l,e[0]||(e[0]=[c("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[o]])}}});typeof t=="function"&&t(d);export{d as default}; +import{d as i,K as n,y as r,o as a,c as s,e as c}from"./index-1_q7hlhr.js";import{b as t}from"./route-block-B_A1xBdJ.js";const l={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},d=i({__name:"index",setup(m){return(p,e)=>{const o=n("motion");return r((a(),s("div",l,e[0]||(e[0]=[c("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[o]])}}});typeof t=="function"&&t(d);export{d as default}; diff --git a/assets/index-D50uqwV2.js b/assets/index-uIiqDbdm.js similarity index 95% rename from assets/index-D50uqwV2.js rename to assets/index-uIiqDbdm.js index d039d65e88270fbc85f18930efa7981c6bfda3df..f024dd158b87f7442bc7f455463f04122ee2a1a9 100644 --- a/assets/index-D50uqwV2.js +++ b/assets/index-uIiqDbdm.js @@ -1 +1 @@ -import{d as A,m as _,u as F,c as r,o,y as a,e,i as c,bu as V,k as h,j as U,t as u,w as g,n as x,T as j,G as H,bt as M,g as O,r as N,p as P,K as z,A as b,Q as R,b as i,at as I,z as L,F as k,l as G,_ as K}from"./index-Bo-ykojl.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as C,a as Q}from"./ColorPalette.vue_vue_type_script_setup_true_lang-cX_hB6ek.js";import{b as D}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./index-DmpthJxW.js";const q={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"},J=["aria-checked"],W={key:0,text:"sm neutral-500"},B=A({__name:"CheckBar",props:_({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const n=F(p,"modelValue");return(y,m)=>(o(),r("label",q,[a(e("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>n.value=v),"aria-checked":n.value,type:"checkbox",hidden:""},null,8,J),[[V,n.value]]),e("div",null,[h(u(y.$t(p.text))+" ",1),p.description?(o(),r("div",W,u(y.$t(p.description)),1)):U("",!0)]),c(j,{name:"slide-away",mode:"out-in"},{default:g(()=>[n.value?(o(),r("div",{key:0,class:x(p.iconOn),transition:"all ease-in-out duration-250"},null,2)):(o(),r("div",{key:1,class:x(p.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),X=[[],["#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"]],Y={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",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+3*10,delay:3*50,transition:"all ease-in-out duration-250"},Z={value:"en-US"},ee={value:"zh-CN"},te={flex:"","items-center":"","justify-between":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+5*10,delay:5*50,transition:"all ease-in-out duration-250"},ie={"text-lg":"","font-semibold":""},ne={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},ae=["disabled"],oe={class:"color-bar",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+7*10,delay:7*50,transition:"all ease-in-out duration-250"},se={"text-white":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+8*10,delay:8*50,transition:"all ease-in-out duration-250"},le={class:"color-bar transparency-grid",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+9*10,delay:9*50,transition:"all ease-in-out duration-250"},re=["duration","delay"],de={"font-medium":""},ue={text:"sm neutral-500"},pe={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[65dvh]","right--15":"","z--1":"",initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:"","items-center":"","justify-center":""},w=A({__name:"index",setup(p){const n=H(),y=M(),{t:m}=O(),v=N(!1);return P(()=>[n.usePageSpecificTransitions,n.disableTransitions],()=>{v.value=!0}),(d,t)=>{const s=z("motion");return o(),r(k,null,[a((o(),b(i(C),{title:i(m)("settings.sections.section.general.title"),icon:"i-solar:filters-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+1*10,delay:1*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(c(B,{modelValue:i(y),"onUpdate:modelValue":t[0]||(t[0]=l=>R(y)?y.value=l:null),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+2*10,delay:2*50,"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme",transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a((o(),r("div",Y,[h(u(d.$t("settings.language.title"))+" ",1),a(e("select",{"onUpdate:modelValue":t[1]||(t[1]=l=>i(n).language=l),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[e("option",Z,u(d.$t("settings.language.english")),1),e("option",ee,u(d.$t("settings.language.chinese")),1)],512),[[I,i(n).language]])])),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),b(i(C),{title:i(m)("settings.pages.themes.sections.section.custom-color.title"),icon:"i-solar:pallete-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+4*10,delay:4*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a((o(),r("div",te,[e("span",ie,u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ne,[a(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>i(n).themeColorsHueDynamic=l),type:"checkbox",class:"peer sr-only"},null,512),[[V,i(n).themeColorsHueDynamic]]),t[6]||(t[6]=e("div",{class:"h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 peer-checked:bg-primary-500 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),h(" "+u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])])),[[s]]),a(e("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>i(n).themeColorsHue=l),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+6*10,delay:6*50,transition:"all ease-in-out duration-250",type:"range",min:"0",max:"360",step:"0.01",class:x(["theme-hue-slider",i(n).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:i(n).themeColorsHueDynamic},null,10,ae),[[L,i(n).themeColorsHue],[s]]),a((o(),r("div",oe,[t[8]||(t[8]=e("span",{"bg-primary-50":""},"50",-1)),t[9]||(t[9]=e("span",{"bg-primary-100":""},"100",-1)),t[10]||(t[10]=e("span",{"bg-primary-200":""},"200",-1)),t[11]||(t[11]=e("span",{"bg-primary-300":""},"300",-1)),t[12]||(t[12]=e("span",{"bg-primary-400":""},"400",-1)),t[13]||(t[13]=e("span",{"bg-primary-500":""},"500",-1)),a((o(),r("div",se,t[7]||(t[7]=[e("span",{"bg-primary-600":""},"600",-1),e("span",{"bg-primary-700":""},"700",-1),e("span",{"bg-primary-800":""},"800",-1),e("span",{"bg-primary-900":""},"900",-1),e("span",{"bg-primary-950":""},"950",-1)]))),[[s]])])),[[s]]),a((o(),r("div",le,t[14]||(t[14]=[e("span",{bg:"primary-500/5"},"500/5",-1),e("span",{bg:"primary-500/10"},"500/10",-1),e("span",{bg:"primary-500/20"},"500/20",-1),e("span",{bg:"primary-500/30"},"500/30",-1),e("span",{bg:"primary-500/40"},"500/40",-1),e("span",{bg:"primary-500/50"},"500/50",-1),e("span",{bg:"primary-500/60"},"500/60",-1),e("span",{bg:"primary-500/70"},"500/70",-1),e("span",{bg:"primary-500/80"},"500/80",-1),e("span",{bg:"primary-500/90"},"500/90",-1),e("span",{bg:"primary-500"},"500",-1)]))),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),b(i(C),{title:"settings.pages.themes.sections.section.theme-presets.title",icon:"i-solar:magic-stick-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+10*10,delay:10*50,transition:"all ease-in-out duration-250"},{default:g(()=>[(o(!0),r(k,null,G(d.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:l,description:$,colors:T},f)=>a((o(),r("div",{key:f,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",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+11*10+f*10,delay:11*50+f*50,transition:"all ease-in-out duration-250"},[e("div",null,[e("span",de,u(d.$rt(l)),1),e("div",ue,u(d.$rt($)),1)]),c(Q,{colors:T.map((E,S)=>({hex:i(X)[f][S],name:d.$rt(E)}))},null,8,["colors"])],8,re)),[[s]])),128))]),_:1})),[[s]]),a((o(),b(i(C),{title:"settings.pages.themes.sections.section.developer.title",icon:"i-solar:code-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+18*10,delay:18*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(c(B,{modelValue:i(n).disableTransitions,"onUpdate:modelValue":t[4]||(t[4]=l=>i(n).disableTransitions=l),"icon-on":"i-solar:people-nearby-bold-duotone","icon-off":"i-solar:running-2-line-duotone",text:"settings.animations.stage-transitions.title",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+19*10,delay:19*50,transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a(c(B,{modelValue:i(n).usePageSpecificTransitions,"onUpdate:modelValue":t[5]||(t[5]=l=>i(n).usePageSpecificTransitions=l),disabled:i(n).disableTransitions,"icon-on":"i-solar:running-2-line-duotone","icon-off":"i-solar:people-nearby-bold-duotone",text:"settings.animations.use-page-specific-transitions.title",description:"settings.animations.use-page-specific-transitions.description",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+20*10,delay:20*50,transition:"all ease-in-out duration-250"},null,8,["modelValue","disabled"]),[[s]])]),_:1})),[[s]]),a((o(),r("div",pe,t[15]||(t[15]=[e("div",{text:"60","i-solar:filters-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof D=="function"&&D(w);const De=K(w,[["__scopeId","data-v-aa1dd799"]]);export{De as default}; +import{d as A,m as _,u as F,c as r,o,y as a,e,i as c,bu as V,k as h,j as U,t as u,w as g,n as x,T as j,G as H,bt as M,g as O,r as N,p as P,K as z,A as b,Q as R,b as i,at as I,z as L,F as k,l as G,_ as K}from"./index-1_q7hlhr.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as C,a as Q}from"./ColorPalette.vue_vue_type_script_setup_true_lang-B9HHyio1.js";import{b as D}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./index-CmOAxAkQ.js";const q={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"},J=["aria-checked"],W={key:0,text:"sm neutral-500"},B=A({__name:"CheckBar",props:_({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const n=F(p,"modelValue");return(y,m)=>(o(),r("label",q,[a(e("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>n.value=v),"aria-checked":n.value,type:"checkbox",hidden:""},null,8,J),[[V,n.value]]),e("div",null,[h(u(y.$t(p.text))+" ",1),p.description?(o(),r("div",W,u(y.$t(p.description)),1)):U("",!0)]),c(j,{name:"slide-away",mode:"out-in"},{default:g(()=>[n.value?(o(),r("div",{key:0,class:x(p.iconOn),transition:"all ease-in-out duration-250"},null,2)):(o(),r("div",{key:1,class:x(p.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),X=[[],["#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"]],Y={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",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+3*10,delay:3*50,transition:"all ease-in-out duration-250"},Z={value:"en-US"},ee={value:"zh-CN"},te={flex:"","items-center":"","justify-between":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+5*10,delay:5*50,transition:"all ease-in-out duration-250"},ie={"text-lg":"","font-semibold":""},ne={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},ae=["disabled"],oe={class:"color-bar",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+7*10,delay:7*50,transition:"all ease-in-out duration-250"},se={"text-white":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+8*10,delay:8*50,transition:"all ease-in-out duration-250"},le={class:"color-bar transparency-grid",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+9*10,delay:9*50,transition:"all ease-in-out duration-250"},re=["duration","delay"],de={"font-medium":""},ue={text:"sm neutral-500"},pe={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[65dvh]","right--15":"","z--1":"",initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:"","items-center":"","justify-center":""},w=A({__name:"index",setup(p){const n=H(),y=M(),{t:m}=O(),v=N(!1);return P(()=>[n.usePageSpecificTransitions,n.disableTransitions],()=>{v.value=!0}),(d,t)=>{const s=z("motion");return o(),r(k,null,[a((o(),b(i(C),{title:i(m)("settings.sections.section.general.title"),icon:"i-solar:filters-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+1*10,delay:1*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(c(B,{modelValue:i(y),"onUpdate:modelValue":t[0]||(t[0]=l=>R(y)?y.value=l:null),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+2*10,delay:2*50,"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme",transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a((o(),r("div",Y,[h(u(d.$t("settings.language.title"))+" ",1),a(e("select",{"onUpdate:modelValue":t[1]||(t[1]=l=>i(n).language=l),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[e("option",Z,u(d.$t("settings.language.english")),1),e("option",ee,u(d.$t("settings.language.chinese")),1)],512),[[I,i(n).language]])])),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),b(i(C),{title:i(m)("settings.pages.themes.sections.section.custom-color.title"),icon:"i-solar:pallete-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+4*10,delay:4*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a((o(),r("div",te,[e("span",ie,u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ne,[a(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>i(n).themeColorsHueDynamic=l),type:"checkbox",class:"peer sr-only"},null,512),[[V,i(n).themeColorsHueDynamic]]),t[6]||(t[6]=e("div",{class:"h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 peer-checked:bg-primary-500 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),h(" "+u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])])),[[s]]),a(e("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>i(n).themeColorsHue=l),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+6*10,delay:6*50,transition:"all ease-in-out duration-250",type:"range",min:"0",max:"360",step:"0.01",class:x(["theme-hue-slider",i(n).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:i(n).themeColorsHueDynamic},null,10,ae),[[L,i(n).themeColorsHue],[s]]),a((o(),r("div",oe,[t[8]||(t[8]=e("span",{"bg-primary-50":""},"50",-1)),t[9]||(t[9]=e("span",{"bg-primary-100":""},"100",-1)),t[10]||(t[10]=e("span",{"bg-primary-200":""},"200",-1)),t[11]||(t[11]=e("span",{"bg-primary-300":""},"300",-1)),t[12]||(t[12]=e("span",{"bg-primary-400":""},"400",-1)),t[13]||(t[13]=e("span",{"bg-primary-500":""},"500",-1)),a((o(),r("div",se,t[7]||(t[7]=[e("span",{"bg-primary-600":""},"600",-1),e("span",{"bg-primary-700":""},"700",-1),e("span",{"bg-primary-800":""},"800",-1),e("span",{"bg-primary-900":""},"900",-1),e("span",{"bg-primary-950":""},"950",-1)]))),[[s]])])),[[s]]),a((o(),r("div",le,t[14]||(t[14]=[e("span",{bg:"primary-500/5"},"500/5",-1),e("span",{bg:"primary-500/10"},"500/10",-1),e("span",{bg:"primary-500/20"},"500/20",-1),e("span",{bg:"primary-500/30"},"500/30",-1),e("span",{bg:"primary-500/40"},"500/40",-1),e("span",{bg:"primary-500/50"},"500/50",-1),e("span",{bg:"primary-500/60"},"500/60",-1),e("span",{bg:"primary-500/70"},"500/70",-1),e("span",{bg:"primary-500/80"},"500/80",-1),e("span",{bg:"primary-500/90"},"500/90",-1),e("span",{bg:"primary-500"},"500",-1)]))),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),b(i(C),{title:"settings.pages.themes.sections.section.theme-presets.title",icon:"i-solar:magic-stick-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+10*10,delay:10*50,transition:"all ease-in-out duration-250"},{default:g(()=>[(o(!0),r(k,null,G(d.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:l,description:$,colors:T},f)=>a((o(),r("div",{key:f,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",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+11*10+f*10,delay:11*50+f*50,transition:"all ease-in-out duration-250"},[e("div",null,[e("span",de,u(d.$rt(l)),1),e("div",ue,u(d.$rt($)),1)]),c(Q,{colors:T.map((E,S)=>({hex:i(X)[f][S],name:d.$rt(E)}))},null,8,["colors"])],8,re)),[[s]])),128))]),_:1})),[[s]]),a((o(),b(i(C),{title:"settings.pages.themes.sections.section.developer.title",icon:"i-solar:code-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+18*10,delay:18*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(c(B,{modelValue:i(n).disableTransitions,"onUpdate:modelValue":t[4]||(t[4]=l=>i(n).disableTransitions=l),"icon-on":"i-solar:people-nearby-bold-duotone","icon-off":"i-solar:running-2-line-duotone",text:"settings.animations.stage-transitions.title",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+19*10,delay:19*50,transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a(c(B,{modelValue:i(n).usePageSpecificTransitions,"onUpdate:modelValue":t[5]||(t[5]=l=>i(n).usePageSpecificTransitions=l),disabled:i(n).disableTransitions,"icon-on":"i-solar:running-2-line-duotone","icon-off":"i-solar:people-nearby-bold-duotone",text:"settings.animations.use-page-specific-transitions.title",description:"settings.animations.use-page-specific-transitions.description",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+20*10,delay:20*50,transition:"all ease-in-out duration-250"},null,8,["modelValue","disabled"]),[[s]])]),_:1})),[[s]]),a((o(),r("div",pe,t[15]||(t[15]=[e("div",{text:"60","i-solar:filters-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof D=="function"&&D(w);const De=K(w,[["__scopeId","data-v-aa1dd799"]]);export{De as default}; diff --git a/assets/mcp-Ce-wxTN6.js b/assets/mcp-DcvIwSEe.js similarity index 99% rename from assets/mcp-Ce-wxTN6.js rename to assets/mcp-DcvIwSEe.js index 0010370b7397cc5fdb5d05e11cbe6674ad892eda..236d61faa19d233ed91558581b9fd35d5dcabacf 100644 --- a/assets/mcp-Ce-wxTN6.js +++ b/assets/mcp-DcvIwSEe.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-D-9STIhm-B6BIjJPd.js","assets/index-Bo-ykojl.js","assets/index-C3aYAgU8.css","assets/sury-KxK2jCkG-BJGNYLc8.js","assets/valibot-DJYmUlOb-Ig2w1UvD.js","assets/zod-CxRm5Gac-9x712NkA.js"])))=>i.map(i=>d[i]); -import{L as de}from"./index-Bo-ykojl.js";async function Se(r,e={},t){return window.__TAURI_INTERNALS__.invoke(r,e,t)}async function At(r,e){await Se("plugin:mcp|connect_server",{command:r,args:e})}async function Nt(){await Se("plugin:mcp|disconnect_server")}async function Rt(){return await Se("plugin:mcp|list_tools")}async function It(r,e){return await Se("plugin:mcp|call_tool",{name:r,args:e})}const ar=async(r,e)=>{try{return await r}catch{throw new Error(`xsschema: Missing dependencies "${e}".`)}},jt=async r=>{switch(r){case"arktype":return de(()=>import("./arktype-C-GObzDh-1xlRyYUo.js"),[]).then(async({getToJsonSchemaFn:e})=>e());case"effect":return de(()=>import("./effect-D-9STIhm-B6BIjJPd.js"),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"sury":return de(()=>import("./sury-KxK2jCkG-BJGNYLc8.js"),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"valibot":return de(()=>import("./valibot-DJYmUlOb-Ig2w1UvD.js"),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"zod":return de(()=>import("./zod-CxRm5Gac-9x712NkA.js"),__vite__mapDeps([5,1,2])).then(async({getToJsonSchemaFn:e})=>e());default:throw new Error(`xsschema: Unsupported schema vendor "${r}"`)}},Mt=async r=>jt(r["~standard"].vendor).then(async e=>e(r)),xe=async r=>{const e=await Mt(r.parameters);return{execute:r.execute,function:{description:r.description,name:r.name,parameters:{...e,additionalProperties:!1},strict:!0},type:"function"}};var g;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(g||(g={}));var be;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(be||(be={}));const f=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),N=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},c=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ve=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class Z extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,l=0;for(;lt.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}Z.create=r=>new Z(r);const W=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,g.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${g.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${g.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${g.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:g.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,g.assertNever(r)}return{message:t}};let Le=W;function De(r){Le=r}function fe(){return Le}const he=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const l=s.filter(d=>!!d).slice().reverse();for(const d of l)o=d(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},ze=[];function u(r,e){const t=fe(),s=he({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===W?void 0:W].filter(n=>!!n)});r.common.issues.push(s)}class b{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return _;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return b.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return _;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const _=Object.freeze({status:"aborted"}),F=r=>({status:"dirty",value:r}),k=r=>({status:"valid",value:r}),ke=r=>r.status==="aborted",we=r=>r.status==="dirty",D=r=>r.status==="valid",H=r=>typeof Promise<"u"&&r instanceof Promise;function Te(r,e,t,s){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Ue(r,e,t,s,n){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));var ue,le;class R{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pe=(r,e)=>{if(D(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Z(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var l,d;const{message:p}=r;return i.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:(l=p??s)!==null&&l!==void 0?l:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(d=p??t)!==null&&d!==void 0?d:o.defaultError}},description:n}}class v{get description(){return this._def.description}_getType(e){return N(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:N(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:N(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(H(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Pe(n,a)}"~validate"(e){var t,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return D(a)?{value:a.value}:{issues:n.common.issues}}catch(a){!((s=(t=a==null?void 0:a.message)===null||t===void 0?void 0:t.toLowerCase())===null||s===void 0)&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>D(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(H(n)?n:Promise.resolve(n));return Pe(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new S({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return O.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return E.create(this)}promise(){return J.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new S({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Ce({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ie({...y(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ce.create(this,e)}readonly(){return oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Pt=/^c[^\s-]{8,}$/i,$t=/^[0-9a-z]+$/,Vt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Lt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dt=/^[a-z0-9_-]{21}$/i,zt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ut=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ft=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oe;const Wt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Jt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Yt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ht=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Gt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Qt=new RegExp(`^${Fe}$`);function Be(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Xt(r){return new RegExp(`^${Be(r)}$`)}function Ne(r){let e=`${Fe}T${Be(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Kt(r,e){return!!((e==="v4"||!e)&&Wt.test(r)||(e==="v6"||!e)&&Jt.test(r))}function er(r,e){if(!zt.test(r))return!1;try{const[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||!n.typ||!n.alg||e&&n.alg!==e)}catch{return!1}}function tr(r,e){return!!((e==="v4"||!e)&&qt.test(r)||(e==="v6"||!e)&&Yt.test(r))}class C extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),_}const s=new b;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new C({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new C({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new C({checks:[],typeName:m.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...y(r)})};function rr(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class M extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),_}let s;const n=new b;for(const a of this._def.checks)a.kind==="int"?g.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?rr(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_finite,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.valuenew M({checks:[],typeName:m.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...y(r)});class P extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s;const n=new b;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new P({checks:[],typeName:m.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...y(r)})};class G extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),_}return k(e.data)}}G.create=r=>new G({typeName:m.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...y(r)});class z extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),_}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_date}),_}const s=new b;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):g.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew z({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:m.ZodDate,...y(r)});class pe extends v{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),_}return k(e.data)}}pe.create=r=>new pe({typeName:m.ZodSymbol,...y(r)});class Q extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),_}return k(e.data)}}Q.create=r=>new Q({typeName:m.ZodUndefined,...y(r)});class X extends v{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),_}return k(e.data)}}X.create=r=>new X({typeName:m.ZodNull,...y(r)});class q extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}q.create=r=>new q({typeName:m.ZodAny,...y(r)});class L extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}L.create=r=>new L({typeName:m.ZodUnknown,...y(r)});class I extends v{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),_}}I.create=r=>new I({typeName:m.ZodNever,...y(r)});class me extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),_}return k(e.data)}}me.create=r=>new me({typeName:m.ZodVoid,...y(r)});class E extends v{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return u(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),_;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(u(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new R(t,i,t.path,o)))).then(i=>b.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new R(t,i,t.path,o)));return b.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new E({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new E({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new E({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}E.create=(r,e)=>new E({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function Y(r){if(r instanceof x){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=O.create(Y(s))}return new x({...r._def,shape:()=>e})}else return r instanceof E?new E({...r._def,type:Y(r.element)}):r instanceof O?O.create(Y(r.unwrap())):r instanceof V?V.create(Y(r.unwrap())):r instanceof A?A.create(r.items.map(e=>Y(e))):r}class x extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const d=this._getOrReturnCtx(e);return u(d,{code:c.invalid_type,expected:f.object,received:d.parsedType}),_}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof I&&this._def.unknownKeys==="strip"))for(const d in n.data)i.includes(d)||o.push(d);const l=[];for(const d of i){const p=a[d],w=n.data[d];l.push({key:{status:"valid",value:d},value:p._parse(new R(n,w,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof I){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of o)l.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(d==="strict")o.length>0&&(u(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of o){const w=n.data[p];l.push({key:{status:"valid",value:p},value:d._parse(new R(n,w,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of l){const w=await p.key,ge=await p.value;d.push({key:w,value:ge,alwaysSet:p.alwaysSet})}return d}).then(d=>b.mergeObjectSync(s,d)):b.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;const l=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};return g.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new x({...this._def,shape:()=>t})}omit(e){const t={};return g.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new x({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return g.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new x({...this._def,shape:()=>t})}required(e){const t={};return g.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof O;)a=a._def.innerType;t[s]=a}}),new x({...this._def,shape:()=>t})}keyof(){return We(g.objectKeys(this.shape))}}x.create=(r,e)=>new x({shape:()=>r,unknownKeys:"strip",catchall:I.create(),typeName:m.ZodObject,...y(e)});x.strictCreate=(r,e)=>new x({shape:()=>r,unknownKeys:"strict",catchall:I.create(),typeName:m.ZodObject,...y(e)});x.lazycreate=(r,e)=>new x({shape:r,unknownKeys:"strip",catchall:I.create(),typeName:m.ZodObject,...y(e)});class K extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new Z(o.ctx.common.issues));return u(t,{code:c.invalid_union,unionErrors:i}),_}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const l of s){const d={...t,common:{...t.common,issues:[]},parent:null},p=l._parseSync({data:t.data,path:t.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(l=>new Z(l));return u(t,{code:c.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}K.create=(r,e)=>new K({options:r,typeName:m.ZodUnion,...y(e)});const j=r=>r instanceof re?j(r.schema):r instanceof S?j(r.innerType()):r instanceof se?[r.value]:r instanceof $?r.options:r instanceof ne?g.objectValues(r.enum):r instanceof ae?j(r._def.innerType):r instanceof Q?[void 0]:r instanceof X?[null]:r instanceof O?[void 0,...j(r.unwrap())]:r instanceof V?[null,...j(r.unwrap())]:r instanceof Ce||r instanceof oe?j(r.unwrap()):r instanceof ie?j(r._def.innerType):[];class ye extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return u(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),_;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=j(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new ye({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(s)})}}function Ae(r,e){const t=N(r),s=N(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=g.objectKeys(e),a=g.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const l=Ae(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(ke(a)||ke(i))return _;const o=Ae(a.value,i.value);return o.valid?((we(a)||we(i))&&t.dirty(),{status:t.value,value:o.data}):(u(s,{code:c.invalid_intersection_types}),_)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ee.create=(r,e,t)=>new ee({left:r,right:e,typeName:m.ZodIntersection,...y(t)});class A extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return u(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),_;if(s.data.lengththis._def.items.length&&(u(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new R(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>b.mergeArray(t,i)):b.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new A({...this._def,rest:e})}}A.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new A({items:r,typeName:m.ZodTuple,rest:null,...y(e)})};class te extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return u(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),_;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new R(s,o,s.path,o)),value:i._parse(new R(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?b.mergeObjectAsync(t,n):b.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new te({keyType:e,valueType:t,typeName:m.ZodRecord,...y(s)}):new te({keyType:C.create(),valueType:e,typeName:m.ZodRecord,...y(t)})}}class _e extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return u(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),_;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,l],d)=>({key:n._parse(new R(s,o,s.path,[d,"key"])),value:a._parse(new R(s,l,s.path,[d,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const d=await l.key,p=await l.value;if(d.status==="aborted"||p.status==="aborted")return _;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const d=l.key,p=l.value;if(d.status==="aborted"||p.status==="aborted")return _;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}}}}_e.create=(r,e,t)=>new _e({valueType:e,keyType:r,typeName:m.ZodMap,...y(t)});class U extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return u(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),_;const n=this._def;n.minSize!==null&&s.data.sizen.maxSize.value&&(u(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(l){const d=new Set;for(const p of l){if(p.status==="aborted")return _;p.status==="dirty"&&t.dirty(),d.add(p.value)}return{status:t.value,value:d}}const o=[...s.data.values()].map((l,d)=>a._parse(new R(s,l,s.path,d)));return s.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new U({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new U({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}U.create=(r,e)=>new U({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});class B extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return u(t,{code:c.invalid_type,expected:f.function,received:t.parsedType}),_;function s(o,l){return he({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fe(),W].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:l}})}function n(o,l){return he({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fe(),W].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:l}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof J){const o=this;return k(async function(...l){const d=new Z([]),p=await o._def.args.parseAsync(l,a).catch(Ee=>{throw d.addIssue(s(l,Ee)),d}),w=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(w,a).catch(Ee=>{throw d.addIssue(n(w,Ee)),d})})}else{const o=this;return k(function(...l){const d=o._def.args.safeParse(l,a);if(!d.success)throw new Z([s(l,d.error)]);const p=Reflect.apply(i,this,d.data),w=o._def.returns.safeParse(p,a);if(!w.success)throw new Z([n(p,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new B({...this._def,args:A.create(e).rest(L.create())})}returns(e){return new B({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new B({args:e||A.create([]).rest(L.create()),returns:t||L.create(),typeName:m.ZodFunction,...y(s)})}}class re extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}re.create=(r,e)=>new re({getter:r,typeName:m.ZodLazy,...y(e)});class se extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(r,e)=>new se({value:r,typeName:m.ZodLiteral,...y(e)});function We(r,e){return new $({values:r,typeName:m.ZodEnum,...y(e)})}class $ extends v{constructor(){super(...arguments),ue.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return u(t,{expected:g.joinValues(s),received:t.parsedType,code:c.invalid_type}),_}if(Te(this,ue)||Ue(this,ue,new Set(this._def.values)),!Te(this,ue).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return u(t,{received:t.data,code:c.invalid_enum_value,options:s}),_}return k(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}ue=new WeakMap;$.create=We;class ne extends v{constructor(){super(...arguments),le.set(this,void 0)}_parse(e){const t=g.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=g.objectValues(t);return u(s,{expected:g.joinValues(n),received:s.parsedType,code:c.invalid_type}),_}if(Te(this,le)||Ue(this,le,new Set(g.getValidEnumValues(this._def.values))),!Te(this,le).has(e.data)){const n=g.objectValues(t);return u(s,{received:s.data,code:c.invalid_enum_value,options:n}),_}return k(e.data)}get enum(){return this._def.values}}le=new WeakMap;ne.create=(r,e)=>new ne({values:r,typeName:m.ZodNativeEnum,...y(e)});class J extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return u(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),_;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return k(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}J.create=(r,e)=>new J({type:r,typeName:m.ZodPromise,...y(e)});class S extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{u(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return l.status==="aborted"?_:l.status==="dirty"||t.value==="dirty"?F(l.value):l});{if(t.value==="aborted")return _;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?_:o.status==="dirty"||t.value==="dirty"?F(o.value):o}}if(n.type==="refinement"){const i=o=>{const l=n.refinement(o,a);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!D(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>D(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);g.assertNever(n)}}S.create=(r,e,t)=>new S({schema:r,typeName:m.ZodEffects,effect:e,...y(t)});S.createWithPreprocess=(r,e,t)=>new S({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,...y(t)});class O extends v{_parse(e){return this._getType(e)===f.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}O.create=(r,e)=>new O({innerType:r,typeName:m.ZodOptional,...y(e)});class V extends v{_parse(e){return this._getType(e)===f.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}V.create=(r,e)=>new V({innerType:r,typeName:m.ZodNullable,...y(e)});class ae extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ae.create=(r,e)=>new ae({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ie extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return H(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Z(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Z(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ie.create=(r,e)=>new ie({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class ve extends v{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),_}return{status:"valid",value:e.data}}}ve.create=r=>new ve({typeName:m.ZodNaN,...y(r)});const qe=Symbol("zod_brand");class Ce extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ce extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?_:a.status==="dirty"?(t.dirty(),F(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?_:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new ce({in:e,out:t,typeName:m.ZodPipeline})}}class oe extends v{_parse(e){const t=this._def.innerType._parse(e),s=n=>(D(n)&&(n.value=Object.freeze(n.value)),n);return H(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}oe.create=(r,e)=>new oe({innerType:r,typeName:m.ZodReadonly,...y(e)});function $e(r,e){const t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Re(r,e={},t){return r?q.create().superRefine((s,n)=>{var a,i;const o=r(s);if(o instanceof Promise)return o.then(l=>{var d,p;if(!l){const w=$e(e,s),ge=(p=(d=w.fatal)!==null&&d!==void 0?d:t)!==null&&p!==void 0?p:!0;n.addIssue({code:"custom",...w,fatal:ge})}});if(!o){const l=$e(e,s),d=(i=(a=l.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0;n.addIssue({code:"custom",...l,fatal:d})}}):q.create()}const Je={object:x.lazycreate};var m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));const Ye=(r,e={message:`Input not instance of ${r.name}`})=>Re(t=>t instanceof r,e),Ie=C.create,je=M.create,He=ve.create,Ge=P.create,Me=G.create,Qe=z.create,Xe=pe.create,Ke=Q.create,et=X.create,tt=q.create,rt=L.create,st=I.create,nt=me.create,at=E.create,it=x.create,ot=x.strictCreate,ct=K.create,dt=ye.create,ut=ee.create,lt=A.create,ft=te.create,ht=_e.create,pt=U.create,mt=B.create,_t=re.create,vt=se.create,yt=$.create,gt=ne.create,xt=J.create,Ze=S.create,bt=O.create,kt=V.create,wt=S.createWithPreprocess,Tt=ce.create,Zt=()=>Ie().optional(),St=()=>je().optional(),Ct=()=>Me().optional(),Et={string:r=>C.create({...r,coerce:!0}),number:r=>M.create({...r,coerce:!0}),boolean:r=>G.create({...r,coerce:!0}),bigint:r=>P.create({...r,coerce:!0}),date:r=>z.create({...r,coerce:!0})},Ot=_;var T=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:De,getErrorMap:fe,makeIssue:he,EMPTY_PATH:ze,addIssueToContext:u,ParseStatus:b,INVALID:_,DIRTY:F,OK:k,isAborted:ke,isDirty:we,isValid:D,isAsync:H,get util(){return g},get objectUtil(){return be},ZodParsedType:f,getParsedType:N,ZodType:v,datetimeRegex:Ne,ZodString:C,ZodNumber:M,ZodBigInt:P,ZodBoolean:G,ZodDate:z,ZodSymbol:pe,ZodUndefined:Q,ZodNull:X,ZodAny:q,ZodUnknown:L,ZodNever:I,ZodVoid:me,ZodArray:E,ZodObject:x,ZodUnion:K,ZodDiscriminatedUnion:ye,ZodIntersection:ee,ZodTuple:A,ZodRecord:te,ZodMap:_e,ZodSet:U,ZodFunction:B,ZodLazy:re,ZodLiteral:se,ZodEnum:$,ZodNativeEnum:ne,ZodPromise:J,ZodEffects:S,ZodTransformer:S,ZodOptional:O,ZodNullable:V,ZodDefault:ae,ZodCatch:ie,ZodNaN:ve,BRAND:qe,ZodBranded:Ce,ZodPipeline:ce,ZodReadonly:oe,custom:Re,Schema:v,ZodSchema:v,late:Je,get ZodFirstPartyTypeKind(){return m},coerce:Et,any:tt,array:at,bigint:Ge,boolean:Me,date:Qe,discriminatedUnion:dt,effect:Ze,enum:yt,function:mt,instanceof:Ye,intersection:ut,lazy:_t,literal:vt,map:ht,nan:He,nativeEnum:gt,never:st,null:et,nullable:kt,number:je,object:it,oboolean:Ct,onumber:St,optional:bt,ostring:Zt,pipeline:Tt,preprocess:wt,promise:xt,record:ft,set:pt,strictObject:ot,string:Ie,symbol:Xe,transformer:Ze,tuple:lt,undefined:Ke,union:ct,unknown:rt,void:nt,NEVER:Ot,ZodIssueCode:c,quotelessJson:Ve,ZodError:Z});const ir=Object.freeze(Object.defineProperty({__proto__:null,BRAND:qe,DIRTY:F,EMPTY_PATH:ze,INVALID:_,NEVER:Ot,OK:k,ParseStatus:b,Schema:v,ZodAny:q,ZodArray:E,ZodBigInt:P,ZodBoolean:G,ZodBranded:Ce,ZodCatch:ie,ZodDate:z,ZodDefault:ae,ZodDiscriminatedUnion:ye,ZodEffects:S,ZodEnum:$,ZodError:Z,get ZodFirstPartyTypeKind(){return m},ZodFunction:B,ZodIntersection:ee,ZodIssueCode:c,ZodLazy:re,ZodLiteral:se,ZodMap:_e,ZodNaN:ve,ZodNativeEnum:ne,ZodNever:I,ZodNull:X,ZodNullable:V,ZodNumber:M,ZodObject:x,ZodOptional:O,ZodParsedType:f,ZodPipeline:ce,ZodPromise:J,ZodReadonly:oe,ZodRecord:te,ZodSchema:v,ZodSet:U,ZodString:C,ZodSymbol:pe,ZodTransformer:S,ZodTuple:A,ZodType:v,ZodUndefined:Q,ZodUnion:K,ZodUnknown:L,ZodVoid:me,addIssueToContext:u,any:tt,array:at,bigint:Ge,boolean:Me,coerce:Et,custom:Re,date:Qe,datetimeRegex:Ne,default:T,defaultErrorMap:W,discriminatedUnion:dt,effect:Ze,enum:yt,function:mt,getErrorMap:fe,getParsedType:N,instanceof:Ye,intersection:ut,isAborted:ke,isAsync:H,isDirty:we,isValid:D,late:Je,lazy:_t,literal:vt,makeIssue:he,map:ht,nan:He,nativeEnum:gt,never:st,null:et,nullable:kt,number:je,object:it,get objectUtil(){return be},oboolean:Ct,onumber:St,optional:bt,ostring:Zt,pipeline:Tt,preprocess:wt,promise:xt,quotelessJson:Ve,record:ft,set:pt,setErrorMap:De,strictObject:ot,string:Ie,symbol:Xe,transformer:Ze,tuple:lt,undefined:Ke,union:ct,unknown:rt,get util(){return g},void:nt,z:T},Symbol.toStringTag,{value:"Module"})),sr=[xe({name:"mcp_list_tools",description:"List all tools available on the MCP server",execute:async(r,e)=>await Rt(),parameters:T.object({})}),xe({name:"mcp_connect_server",description:'Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.',execute:async({command:r,args:e})=>(await At(r,e),"success"),parameters:T.object({command:T.string().describe("The command to connect to the MCP server"),args:T.array(T.string()).describe("The arguments to pass to the MCP server")})}),xe({name:"mcp_disconnect_server",description:'Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.',execute:async()=>(await Nt(),"success"),parameters:T.object({})}),xe({name:"mcp_call_tool",description:"Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.",execute:async({name:r,parameters:e})=>{const t=Object.fromEntries(e.map(({name:n,value:a})=>[n,a]));return await It(r,t)},parameters:T.object({name:T.string().describe("The name of the tool to call"),parameters:T.array(T.object({name:T.string().describe("The name of the parameter"),value:T.any().describe("The value of the parameter")})).describe("The parameters to pass to the tool")})})],or=async()=>Promise.all(sr);export{m as Z,O as a,ir as i,or as m,ar as t}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-D-9STIhm-VgErbWUr.js","assets/index-1_q7hlhr.js","assets/index-C3aYAgU8.css","assets/sury-KxK2jCkG-GNI7Cf4o.js","assets/valibot-DJYmUlOb-gwhRnig4.js","assets/zod-CxRm5Gac-CPTlfWG7.js"])))=>i.map(i=>d[i]); +import{L as de}from"./index-1_q7hlhr.js";async function Se(r,e={},t){return window.__TAURI_INTERNALS__.invoke(r,e,t)}async function At(r,e){await Se("plugin:mcp|connect_server",{command:r,args:e})}async function Nt(){await Se("plugin:mcp|disconnect_server")}async function Rt(){return await Se("plugin:mcp|list_tools")}async function It(r,e){return await Se("plugin:mcp|call_tool",{name:r,args:e})}const ar=async(r,e)=>{try{return await r}catch{throw new Error(`xsschema: Missing dependencies "${e}".`)}},jt=async r=>{switch(r){case"arktype":return de(()=>import("./arktype-C-GObzDh-1xlRyYUo.js"),[]).then(async({getToJsonSchemaFn:e})=>e());case"effect":return de(()=>import("./effect-D-9STIhm-VgErbWUr.js"),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"sury":return de(()=>import("./sury-KxK2jCkG-GNI7Cf4o.js"),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"valibot":return de(()=>import("./valibot-DJYmUlOb-gwhRnig4.js"),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"zod":return de(()=>import("./zod-CxRm5Gac-CPTlfWG7.js"),__vite__mapDeps([5,1,2])).then(async({getToJsonSchemaFn:e})=>e());default:throw new Error(`xsschema: Unsupported schema vendor "${r}"`)}},Mt=async r=>jt(r["~standard"].vendor).then(async e=>e(r)),xe=async r=>{const e=await Mt(r.parameters);return{execute:r.execute,function:{description:r.description,name:r.name,parameters:{...e,additionalProperties:!1},strict:!0},type:"function"}};var g;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(g||(g={}));var be;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(be||(be={}));const f=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),N=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},c=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ve=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class Z extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,l=0;for(;lt.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}Z.create=r=>new Z(r);const W=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,g.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${g.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${g.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${g.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:g.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,g.assertNever(r)}return{message:t}};let Le=W;function De(r){Le=r}function fe(){return Le}const he=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const l=s.filter(d=>!!d).slice().reverse();for(const d of l)o=d(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},ze=[];function u(r,e){const t=fe(),s=he({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===W?void 0:W].filter(n=>!!n)});r.common.issues.push(s)}class b{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return _;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return b.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return _;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const _=Object.freeze({status:"aborted"}),F=r=>({status:"dirty",value:r}),k=r=>({status:"valid",value:r}),ke=r=>r.status==="aborted",we=r=>r.status==="dirty",D=r=>r.status==="valid",H=r=>typeof Promise<"u"&&r instanceof Promise;function Te(r,e,t,s){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Ue(r,e,t,s,n){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));var ue,le;class R{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pe=(r,e)=>{if(D(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Z(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var l,d;const{message:p}=r;return i.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:(l=p??s)!==null&&l!==void 0?l:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(d=p??t)!==null&&d!==void 0?d:o.defaultError}},description:n}}class v{get description(){return this._def.description}_getType(e){return N(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:N(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:N(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(H(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Pe(n,a)}"~validate"(e){var t,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return D(a)?{value:a.value}:{issues:n.common.issues}}catch(a){!((s=(t=a==null?void 0:a.message)===null||t===void 0?void 0:t.toLowerCase())===null||s===void 0)&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>D(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(H(n)?n:Promise.resolve(n));return Pe(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new S({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return O.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return E.create(this)}promise(){return J.create(this,this._def)}or(e){return K.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new S({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Ce({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ie({...y(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ce.create(this,e)}readonly(){return oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Pt=/^c[^\s-]{8,}$/i,$t=/^[0-9a-z]+$/,Vt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Lt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dt=/^[a-z0-9_-]{21}$/i,zt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ut=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ft=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oe;const Wt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,qt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Jt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Yt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ht=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Gt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fe="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Qt=new RegExp(`^${Fe}$`);function Be(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Xt(r){return new RegExp(`^${Be(r)}$`)}function Ne(r){let e=`${Fe}T${Be(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Kt(r,e){return!!((e==="v4"||!e)&&Wt.test(r)||(e==="v6"||!e)&&Jt.test(r))}function er(r,e){if(!zt.test(r))return!1;try{const[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||!n.typ||!n.alg||e&&n.alg!==e)}catch{return!1}}function tr(r,e){return!!((e==="v4"||!e)&&qt.test(r)||(e==="v6"||!e)&&Yt.test(r))}class C extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),_}const s=new b;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new C({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new C({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new C({checks:[],typeName:m.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...y(r)})};function rr(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class M extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),_}let s;const n=new b;for(const a of this._def.checks)a.kind==="int"?g.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?rr(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_finite,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.valuenew M({checks:[],typeName:m.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...y(r)});class P extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s;const n=new b;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new P({checks:[],typeName:m.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...y(r)})};class G extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),_}return k(e.data)}}G.create=r=>new G({typeName:m.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...y(r)});class z extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),_}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_date}),_}const s=new b;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):g.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew z({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:m.ZodDate,...y(r)});class pe extends v{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),_}return k(e.data)}}pe.create=r=>new pe({typeName:m.ZodSymbol,...y(r)});class Q extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),_}return k(e.data)}}Q.create=r=>new Q({typeName:m.ZodUndefined,...y(r)});class X extends v{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),_}return k(e.data)}}X.create=r=>new X({typeName:m.ZodNull,...y(r)});class q extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}q.create=r=>new q({typeName:m.ZodAny,...y(r)});class L extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}L.create=r=>new L({typeName:m.ZodUnknown,...y(r)});class I extends v{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),_}}I.create=r=>new I({typeName:m.ZodNever,...y(r)});class me extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),_}return k(e.data)}}me.create=r=>new me({typeName:m.ZodVoid,...y(r)});class E extends v{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return u(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),_;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(u(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new R(t,i,t.path,o)))).then(i=>b.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new R(t,i,t.path,o)));return b.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new E({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new E({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new E({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}E.create=(r,e)=>new E({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function Y(r){if(r instanceof x){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=O.create(Y(s))}return new x({...r._def,shape:()=>e})}else return r instanceof E?new E({...r._def,type:Y(r.element)}):r instanceof O?O.create(Y(r.unwrap())):r instanceof V?V.create(Y(r.unwrap())):r instanceof A?A.create(r.items.map(e=>Y(e))):r}class x extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const d=this._getOrReturnCtx(e);return u(d,{code:c.invalid_type,expected:f.object,received:d.parsedType}),_}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof I&&this._def.unknownKeys==="strip"))for(const d in n.data)i.includes(d)||o.push(d);const l=[];for(const d of i){const p=a[d],w=n.data[d];l.push({key:{status:"valid",value:d},value:p._parse(new R(n,w,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof I){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of o)l.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(d==="strict")o.length>0&&(u(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of o){const w=n.data[p];l.push({key:{status:"valid",value:p},value:d._parse(new R(n,w,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of l){const w=await p.key,ge=await p.value;d.push({key:w,value:ge,alwaysSet:p.alwaysSet})}return d}).then(d=>b.mergeObjectSync(s,d)):b.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;const l=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};return g.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new x({...this._def,shape:()=>t})}omit(e){const t={};return g.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new x({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return g.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new x({...this._def,shape:()=>t})}required(e){const t={};return g.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof O;)a=a._def.innerType;t[s]=a}}),new x({...this._def,shape:()=>t})}keyof(){return We(g.objectKeys(this.shape))}}x.create=(r,e)=>new x({shape:()=>r,unknownKeys:"strip",catchall:I.create(),typeName:m.ZodObject,...y(e)});x.strictCreate=(r,e)=>new x({shape:()=>r,unknownKeys:"strict",catchall:I.create(),typeName:m.ZodObject,...y(e)});x.lazycreate=(r,e)=>new x({shape:r,unknownKeys:"strip",catchall:I.create(),typeName:m.ZodObject,...y(e)});class K extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new Z(o.ctx.common.issues));return u(t,{code:c.invalid_union,unionErrors:i}),_}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const l of s){const d={...t,common:{...t.common,issues:[]},parent:null},p=l._parseSync({data:t.data,path:t.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(l=>new Z(l));return u(t,{code:c.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}K.create=(r,e)=>new K({options:r,typeName:m.ZodUnion,...y(e)});const j=r=>r instanceof re?j(r.schema):r instanceof S?j(r.innerType()):r instanceof se?[r.value]:r instanceof $?r.options:r instanceof ne?g.objectValues(r.enum):r instanceof ae?j(r._def.innerType):r instanceof Q?[void 0]:r instanceof X?[null]:r instanceof O?[void 0,...j(r.unwrap())]:r instanceof V?[null,...j(r.unwrap())]:r instanceof Ce||r instanceof oe?j(r.unwrap()):r instanceof ie?j(r._def.innerType):[];class ye extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return u(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),_;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=j(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new ye({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(s)})}}function Ae(r,e){const t=N(r),s=N(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=g.objectKeys(e),a=g.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const l=Ae(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(ke(a)||ke(i))return _;const o=Ae(a.value,i.value);return o.valid?((we(a)||we(i))&&t.dirty(),{status:t.value,value:o.data}):(u(s,{code:c.invalid_intersection_types}),_)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ee.create=(r,e,t)=>new ee({left:r,right:e,typeName:m.ZodIntersection,...y(t)});class A extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return u(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),_;if(s.data.lengththis._def.items.length&&(u(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new R(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>b.mergeArray(t,i)):b.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new A({...this._def,rest:e})}}A.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new A({items:r,typeName:m.ZodTuple,rest:null,...y(e)})};class te extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return u(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),_;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new R(s,o,s.path,o)),value:i._parse(new R(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?b.mergeObjectAsync(t,n):b.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new te({keyType:e,valueType:t,typeName:m.ZodRecord,...y(s)}):new te({keyType:C.create(),valueType:e,typeName:m.ZodRecord,...y(t)})}}class _e extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return u(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),_;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,l],d)=>({key:n._parse(new R(s,o,s.path,[d,"key"])),value:a._parse(new R(s,l,s.path,[d,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const d=await l.key,p=await l.value;if(d.status==="aborted"||p.status==="aborted")return _;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const d=l.key,p=l.value;if(d.status==="aborted"||p.status==="aborted")return _;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}}}}_e.create=(r,e,t)=>new _e({valueType:e,keyType:r,typeName:m.ZodMap,...y(t)});class U extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return u(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),_;const n=this._def;n.minSize!==null&&s.data.sizen.maxSize.value&&(u(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(l){const d=new Set;for(const p of l){if(p.status==="aborted")return _;p.status==="dirty"&&t.dirty(),d.add(p.value)}return{status:t.value,value:d}}const o=[...s.data.values()].map((l,d)=>a._parse(new R(s,l,s.path,d)));return s.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new U({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new U({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}U.create=(r,e)=>new U({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});class B extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return u(t,{code:c.invalid_type,expected:f.function,received:t.parsedType}),_;function s(o,l){return he({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fe(),W].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:l}})}function n(o,l){return he({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fe(),W].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:l}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof J){const o=this;return k(async function(...l){const d=new Z([]),p=await o._def.args.parseAsync(l,a).catch(Ee=>{throw d.addIssue(s(l,Ee)),d}),w=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(w,a).catch(Ee=>{throw d.addIssue(n(w,Ee)),d})})}else{const o=this;return k(function(...l){const d=o._def.args.safeParse(l,a);if(!d.success)throw new Z([s(l,d.error)]);const p=Reflect.apply(i,this,d.data),w=o._def.returns.safeParse(p,a);if(!w.success)throw new Z([n(p,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new B({...this._def,args:A.create(e).rest(L.create())})}returns(e){return new B({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new B({args:e||A.create([]).rest(L.create()),returns:t||L.create(),typeName:m.ZodFunction,...y(s)})}}class re extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}re.create=(r,e)=>new re({getter:r,typeName:m.ZodLazy,...y(e)});class se extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(r,e)=>new se({value:r,typeName:m.ZodLiteral,...y(e)});function We(r,e){return new $({values:r,typeName:m.ZodEnum,...y(e)})}class $ extends v{constructor(){super(...arguments),ue.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return u(t,{expected:g.joinValues(s),received:t.parsedType,code:c.invalid_type}),_}if(Te(this,ue)||Ue(this,ue,new Set(this._def.values)),!Te(this,ue).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return u(t,{received:t.data,code:c.invalid_enum_value,options:s}),_}return k(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}ue=new WeakMap;$.create=We;class ne extends v{constructor(){super(...arguments),le.set(this,void 0)}_parse(e){const t=g.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=g.objectValues(t);return u(s,{expected:g.joinValues(n),received:s.parsedType,code:c.invalid_type}),_}if(Te(this,le)||Ue(this,le,new Set(g.getValidEnumValues(this._def.values))),!Te(this,le).has(e.data)){const n=g.objectValues(t);return u(s,{received:s.data,code:c.invalid_enum_value,options:n}),_}return k(e.data)}get enum(){return this._def.values}}le=new WeakMap;ne.create=(r,e)=>new ne({values:r,typeName:m.ZodNativeEnum,...y(e)});class J extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return u(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),_;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return k(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}J.create=(r,e)=>new J({type:r,typeName:m.ZodPromise,...y(e)});class S extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{u(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return l.status==="aborted"?_:l.status==="dirty"||t.value==="dirty"?F(l.value):l});{if(t.value==="aborted")return _;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?_:o.status==="dirty"||t.value==="dirty"?F(o.value):o}}if(n.type==="refinement"){const i=o=>{const l=n.refinement(o,a);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!D(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>D(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);g.assertNever(n)}}S.create=(r,e,t)=>new S({schema:r,typeName:m.ZodEffects,effect:e,...y(t)});S.createWithPreprocess=(r,e,t)=>new S({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,...y(t)});class O extends v{_parse(e){return this._getType(e)===f.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}O.create=(r,e)=>new O({innerType:r,typeName:m.ZodOptional,...y(e)});class V extends v{_parse(e){return this._getType(e)===f.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}V.create=(r,e)=>new V({innerType:r,typeName:m.ZodNullable,...y(e)});class ae extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ae.create=(r,e)=>new ae({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ie extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return H(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Z(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Z(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ie.create=(r,e)=>new ie({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class ve extends v{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),_}return{status:"valid",value:e.data}}}ve.create=r=>new ve({typeName:m.ZodNaN,...y(r)});const qe=Symbol("zod_brand");class Ce extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ce extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?_:a.status==="dirty"?(t.dirty(),F(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?_:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new ce({in:e,out:t,typeName:m.ZodPipeline})}}class oe extends v{_parse(e){const t=this._def.innerType._parse(e),s=n=>(D(n)&&(n.value=Object.freeze(n.value)),n);return H(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}oe.create=(r,e)=>new oe({innerType:r,typeName:m.ZodReadonly,...y(e)});function $e(r,e){const t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Re(r,e={},t){return r?q.create().superRefine((s,n)=>{var a,i;const o=r(s);if(o instanceof Promise)return o.then(l=>{var d,p;if(!l){const w=$e(e,s),ge=(p=(d=w.fatal)!==null&&d!==void 0?d:t)!==null&&p!==void 0?p:!0;n.addIssue({code:"custom",...w,fatal:ge})}});if(!o){const l=$e(e,s),d=(i=(a=l.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0;n.addIssue({code:"custom",...l,fatal:d})}}):q.create()}const Je={object:x.lazycreate};var m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));const Ye=(r,e={message:`Input not instance of ${r.name}`})=>Re(t=>t instanceof r,e),Ie=C.create,je=M.create,He=ve.create,Ge=P.create,Me=G.create,Qe=z.create,Xe=pe.create,Ke=Q.create,et=X.create,tt=q.create,rt=L.create,st=I.create,nt=me.create,at=E.create,it=x.create,ot=x.strictCreate,ct=K.create,dt=ye.create,ut=ee.create,lt=A.create,ft=te.create,ht=_e.create,pt=U.create,mt=B.create,_t=re.create,vt=se.create,yt=$.create,gt=ne.create,xt=J.create,Ze=S.create,bt=O.create,kt=V.create,wt=S.createWithPreprocess,Tt=ce.create,Zt=()=>Ie().optional(),St=()=>je().optional(),Ct=()=>Me().optional(),Et={string:r=>C.create({...r,coerce:!0}),number:r=>M.create({...r,coerce:!0}),boolean:r=>G.create({...r,coerce:!0}),bigint:r=>P.create({...r,coerce:!0}),date:r=>z.create({...r,coerce:!0})},Ot=_;var T=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:De,getErrorMap:fe,makeIssue:he,EMPTY_PATH:ze,addIssueToContext:u,ParseStatus:b,INVALID:_,DIRTY:F,OK:k,isAborted:ke,isDirty:we,isValid:D,isAsync:H,get util(){return g},get objectUtil(){return be},ZodParsedType:f,getParsedType:N,ZodType:v,datetimeRegex:Ne,ZodString:C,ZodNumber:M,ZodBigInt:P,ZodBoolean:G,ZodDate:z,ZodSymbol:pe,ZodUndefined:Q,ZodNull:X,ZodAny:q,ZodUnknown:L,ZodNever:I,ZodVoid:me,ZodArray:E,ZodObject:x,ZodUnion:K,ZodDiscriminatedUnion:ye,ZodIntersection:ee,ZodTuple:A,ZodRecord:te,ZodMap:_e,ZodSet:U,ZodFunction:B,ZodLazy:re,ZodLiteral:se,ZodEnum:$,ZodNativeEnum:ne,ZodPromise:J,ZodEffects:S,ZodTransformer:S,ZodOptional:O,ZodNullable:V,ZodDefault:ae,ZodCatch:ie,ZodNaN:ve,BRAND:qe,ZodBranded:Ce,ZodPipeline:ce,ZodReadonly:oe,custom:Re,Schema:v,ZodSchema:v,late:Je,get ZodFirstPartyTypeKind(){return m},coerce:Et,any:tt,array:at,bigint:Ge,boolean:Me,date:Qe,discriminatedUnion:dt,effect:Ze,enum:yt,function:mt,instanceof:Ye,intersection:ut,lazy:_t,literal:vt,map:ht,nan:He,nativeEnum:gt,never:st,null:et,nullable:kt,number:je,object:it,oboolean:Ct,onumber:St,optional:bt,ostring:Zt,pipeline:Tt,preprocess:wt,promise:xt,record:ft,set:pt,strictObject:ot,string:Ie,symbol:Xe,transformer:Ze,tuple:lt,undefined:Ke,union:ct,unknown:rt,void:nt,NEVER:Ot,ZodIssueCode:c,quotelessJson:Ve,ZodError:Z});const ir=Object.freeze(Object.defineProperty({__proto__:null,BRAND:qe,DIRTY:F,EMPTY_PATH:ze,INVALID:_,NEVER:Ot,OK:k,ParseStatus:b,Schema:v,ZodAny:q,ZodArray:E,ZodBigInt:P,ZodBoolean:G,ZodBranded:Ce,ZodCatch:ie,ZodDate:z,ZodDefault:ae,ZodDiscriminatedUnion:ye,ZodEffects:S,ZodEnum:$,ZodError:Z,get ZodFirstPartyTypeKind(){return m},ZodFunction:B,ZodIntersection:ee,ZodIssueCode:c,ZodLazy:re,ZodLiteral:se,ZodMap:_e,ZodNaN:ve,ZodNativeEnum:ne,ZodNever:I,ZodNull:X,ZodNullable:V,ZodNumber:M,ZodObject:x,ZodOptional:O,ZodParsedType:f,ZodPipeline:ce,ZodPromise:J,ZodReadonly:oe,ZodRecord:te,ZodSchema:v,ZodSet:U,ZodString:C,ZodSymbol:pe,ZodTransformer:S,ZodTuple:A,ZodType:v,ZodUndefined:Q,ZodUnion:K,ZodUnknown:L,ZodVoid:me,addIssueToContext:u,any:tt,array:at,bigint:Ge,boolean:Me,coerce:Et,custom:Re,date:Qe,datetimeRegex:Ne,default:T,defaultErrorMap:W,discriminatedUnion:dt,effect:Ze,enum:yt,function:mt,getErrorMap:fe,getParsedType:N,instanceof:Ye,intersection:ut,isAborted:ke,isAsync:H,isDirty:we,isValid:D,late:Je,lazy:_t,literal:vt,makeIssue:he,map:ht,nan:He,nativeEnum:gt,never:st,null:et,nullable:kt,number:je,object:it,get objectUtil(){return be},oboolean:Ct,onumber:St,optional:bt,ostring:Zt,pipeline:Tt,preprocess:wt,promise:xt,quotelessJson:Ve,record:ft,set:pt,setErrorMap:De,strictObject:ot,string:Ie,symbol:Xe,transformer:Ze,tuple:lt,undefined:Ke,union:ct,unknown:rt,get util(){return g},void:nt,z:T},Symbol.toStringTag,{value:"Module"})),sr=[xe({name:"mcp_list_tools",description:"List all tools available on the MCP server",execute:async(r,e)=>await Rt(),parameters:T.object({})}),xe({name:"mcp_connect_server",description:'Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.',execute:async({command:r,args:e})=>(await At(r,e),"success"),parameters:T.object({command:T.string().describe("The command to connect to the MCP server"),args:T.array(T.string()).describe("The arguments to pass to the MCP server")})}),xe({name:"mcp_disconnect_server",description:'Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.',execute:async()=>(await Nt(),"success"),parameters:T.object({})}),xe({name:"mcp_call_tool",description:"Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.",execute:async({name:r,parameters:e})=>{const t=Object.fromEntries(e.map(({name:n,value:a})=>[n,a]));return await It(r,t)},parameters:T.object({name:T.string().describe("The name of the tool to call"),parameters:T.array(T.object({name:T.string().describe("The name of the parameter"),value:T.any().describe("The value of the parameter")})).describe("The parameters to pass to the tool")})})],or=async()=>Promise.all(sr);export{m as Z,O as a,ir as i,or as m,ar as t}; diff --git a/assets/memory-long-term-C9qQ7wym.js b/assets/memory-long-term-BwMIGexr.js similarity index 71% rename from assets/memory-long-term-C9qQ7wym.js rename to assets/memory-long-term-BwMIGexr.js index c1592d58941bf215a3a2261b3f348ba4c8a7aaf4..bcfdd916ee93cb0034d97bb882cedb718f834f3b 100644 --- a/assets/memory-long-term-C9qQ7wym.js +++ b/assets/memory-long-term-BwMIGexr.js @@ -1 +1 @@ -import{d as o,c as t,o as n}from"./index-Bo-ykojl.js";import{b as e}from"./route-block-B_A1xBdJ.js";const r=o({__name:"memory-long-term",setup(c){return(m,a)=>(n(),t("div"))}});typeof e=="function"&&e(r);export{r as default}; +import{d as o,c as t,o as n}from"./index-1_q7hlhr.js";import{b as e}from"./route-block-B_A1xBdJ.js";const r=o({__name:"memory-long-term",setup(c){return(m,a)=>(n(),t("div"))}});typeof e=="function"&&e(r);export{r as default}; diff --git a/assets/memory-short-term-D3escvKk.js b/assets/memory-short-term-BW4nzTNl.js similarity index 71% rename from assets/memory-short-term-D3escvKk.js rename to assets/memory-short-term-BW4nzTNl.js index 24d8c1245a02e4570752e7eedd2501f3ec3ffe8d..7021ae4b1afed2864583b13582f5f8b2cb190cf1 100644 --- a/assets/memory-short-term-D3escvKk.js +++ b/assets/memory-short-term-BW4nzTNl.js @@ -1 +1 @@ -import{d as o,c as t,o as r}from"./index-Bo-ykojl.js";import{b as e}from"./route-block-B_A1xBdJ.js";const n=o({__name:"memory-short-term",setup(c){return(m,a)=>(r(),t("div"))}});typeof e=="function"&&e(n);export{n as default}; +import{d as o,c as t,o as r}from"./index-1_q7hlhr.js";import{b as e}from"./route-block-B_A1xBdJ.js";const n=o({__name:"memory-short-term",setup(c){return(m,a)=>(r(),t("div"))}});typeof e=="function"&&e(n);export{n as default}; diff --git a/assets/messages-BWoKmgZG.js b/assets/messages-lR_ZzWbE.js similarity index 68% rename from assets/messages-BWoKmgZG.js rename to assets/messages-lR_ZzWbE.js index f8ea57c6de8b122f6c1261d1d6371b5a840c1f19..25b02c971916c303b080c9c87e805bb05f091caf 100644 --- a/assets/messages-BWoKmgZG.js +++ b/assets/messages-lR_ZzWbE.js @@ -1 +1 @@ -import{u as c}from"./queue-BjJ4HvBx.js";import{b as g,l as _}from"./queues-JqhmoK_1.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js";import{d as b,r as a,c as l,o as r,e,i as x,b as k,t as p,F as h,l as w}from"./index-Bo-ykojl.js";import"./mini_xsschema-f5xAZ6yD.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},y={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},L=b({__name:"messages",setup(B){const s=a(""),u=a([]),o=a(!1),m=c({handlers:[async i=>{u.value.push(i.data)}]}),d=g(m);async function f(){o.value=!0,d.add(s.value),d.add(_),s.value="",o.value=!1}return(i,t)=>(r(),l("div",S,[e("div",V,[x(k(v),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=n=>s.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:f},null,8,["modelValue"]),e("button",y,p(o.value?"Processing...":"Send"),1)]),e("div",M,[e("div",Q,[t[1]||(t[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(r(!0),l(h,null,w(u.value,n=>(r(),l("div",{key:n},[e("div",null,p(n),1)]))),128))])])]))}});export{L as default}; +import{u as c}from"./queue-2ASK7l5s.js";import{b as g,l as _}from"./queues-B3H1SS53.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js";import{d as b,r as a,c as l,o as r,e,i as x,b as k,t as p,F as h,l as w}from"./index-1_q7hlhr.js";import"./mini_xsschema-f5xAZ6yD.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},y={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},L=b({__name:"messages",setup(B){const s=a(""),u=a([]),o=a(!1),m=c({handlers:[async i=>{u.value.push(i.data)}]}),d=g(m);async function f(){o.value=!0,d.add(s.value),d.add(_),s.value="",o.value=!1}return(i,t)=>(r(),l("div",S,[e("div",V,[x(k(v),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=n=>s.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:f},null,8,["modelValue"]),e("button",y,p(o.value?"Processing...":"Send"),1)]),e("div",M,[e("div",Q,[t[1]||(t[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(r(!0),l(h,null,w(u.value,n=>(r(),l("div",{key:n},[e("div",null,p(n),1)]))),128))])])]))}});export{L as default}; diff --git a/assets/microsoft-speech-CW3_aRMu.js b/assets/microsoft-speech-7XEJGMst.js similarity index 69% rename from assets/microsoft-speech-CW3_aRMu.js rename to assets/microsoft-speech-7XEJGMst.js index 50f1743178eef8d1ce9939b0d7d3166bbb24337a..07852f6ad2ba8d7c7817c94b93c526f1bdeb18c3 100644 --- a/assets/microsoft-speech-CW3_aRMu.js +++ b/assets/microsoft-speech-7XEJGMst.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as B,g as F,s as M,r as v,h as g,H,p as K,A as N,o as T,w as b,i as n,b as o,e as q}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as z}from"./providers-B3p38pBl.js";import{u as A}from"./speech-Br7XDY4_.js";import{_ as E}from"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import{_ as h}from"./FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as G,a as R}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BoWb4lIe.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";const j={flex:"~ col gap-4"},t="microsoft-speech",C="v1",D=B({__name:"microsoft-speech",setup(I){const{t:r}=F(),P={pitch:0,speed:1,volume:0},a=A(),d=z(),{providers:l}=M(d),m=v(0),V=v(1),_=v(0),p=g({get:()=>{var s;return((s=l.value[t])==null?void 0:s.region)||"eastasia"},set:s=>{l.value[t]||(l.value[t]={region:"eastasia"}),l.value[t].region=s}}),y=g(()=>{var s;return!!((s=l.value[t])!=null&&s.apiKey)}),w=g(()=>a.availableVoices[t]||[]);H(async()=>{await a.loadVoicesForProvider(t)}),K([y,p],async()=>{await a.loadVoicesForProvider(t)});async function U(s,i,e){const c=d.getProviderInstance(t);if(!c)throw new Error("Failed to initialize speech provider");const u=d.getProviderConfig(t),x=u.model||C,S={...u,region:p.value,disableSsml:!e};if(!e&&i){const $=w.value.find(f=>f.id===i);if($){const f=a.generateSSML(s,$,{...u,pitch:m.value});return await a.speech(c,x,f,i,S)}}return await a.speech(c,x,s,i,S)}return(s,i)=>(T(),N(o(R),{"provider-id":t,"default-model":C,"additional-settings":P},{"basic-settings":b(()=>[n(o(E),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=e=>p.value=e),label:o(r)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:o(r)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":b(()=>[q("div",j,[n(o(h),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=e=>m.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,["modelValue","label","description","format-value"]),n(o(h),{modelValue:V.value,"onUpdate:modelValue":i[2]||(i[2]=e=>V.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),n(o(h),{modelValue:_.value,"onUpdate:modelValue":i[3]||(i[3]=e=>_.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,["modelValue","label","description","format-value"])])]),playground:b(()=>[n(o(G),{"available-voices":w.value,"generate-speech":U,"api-key-configured":y.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof k=="function"&&k(D);export{D as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as B,g as F,s as M,r as v,h as g,H,p as K,A as N,o as T,w as b,i as n,b as o,e as q}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as z}from"./providers-BQORs1wj.js";import{u as A}from"./speech-Bdg784LP.js";import{_ as E}from"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import{_ as h}from"./FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as G,a as R}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BWViBS8t.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";const j={flex:"~ col gap-4"},t="microsoft-speech",C="v1",D=B({__name:"microsoft-speech",setup(I){const{t:r}=F(),P={pitch:0,speed:1,volume:0},a=A(),d=z(),{providers:l}=M(d),m=v(0),V=v(1),_=v(0),p=g({get:()=>{var s;return((s=l.value[t])==null?void 0:s.region)||"eastasia"},set:s=>{l.value[t]||(l.value[t]={region:"eastasia"}),l.value[t].region=s}}),y=g(()=>{var s;return!!((s=l.value[t])!=null&&s.apiKey)}),w=g(()=>a.availableVoices[t]||[]);H(async()=>{await a.loadVoicesForProvider(t)}),K([y,p],async()=>{await a.loadVoicesForProvider(t)});async function U(s,i,e){const c=d.getProviderInstance(t);if(!c)throw new Error("Failed to initialize speech provider");const u=d.getProviderConfig(t),x=u.model||C,S={...u,region:p.value,disableSsml:!e};if(!e&&i){const $=w.value.find(f=>f.id===i);if($){const f=a.generateSSML(s,$,{...u,pitch:m.value});return await a.speech(c,x,f,i,S)}}return await a.speech(c,x,s,i,S)}return(s,i)=>(T(),N(o(R),{"provider-id":t,"default-model":C,"additional-settings":P},{"basic-settings":b(()=>[n(o(E),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=e=>p.value=e),label:o(r)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:o(r)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":b(()=>[q("div",j,[n(o(h),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=e=>m.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,["modelValue","label","description","format-value"]),n(o(h),{modelValue:V.value,"onUpdate:modelValue":i[2]||(i[2]=e=>V.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),n(o(h),{modelValue:_.value,"onUpdate:modelValue":i[3]||(i[3]=e=>_.value=e),label:o(r)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,["modelValue","label","description","format-value"])])]),playground:b(()=>[n(o(G),{"available-voices":w.value,"generate-speech":U,"api-key-configured":y.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof k=="function"&&k(D);export{D as default}; diff --git a/assets/mistral-ai-CSFCKOrv.js b/assets/mistral-ai-CH5fVxsz.js similarity index 66% rename from assets/mistral-ai-CSFCKOrv.js rename to assets/mistral-ai-CH5fVxsz.js index a1ebf77d295975b194b2ca45cbf1b509c5a9a242..2b65c12acd204ea406f96e322310b35f80fdfdf1 100644 --- a/assets/mistral-ai-CSFCKOrv.js +++ b/assets/mistral-ai-CH5fVxsz.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as V,g as k,S as y,s as $,h as c,H as K,p as h,A as S,o as w,w as m,i as l,b as t}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const a="mistral-ai",B=V({__name:"mistral-ai",setup(I){const{t:u}=k(),b=y(),d=x(),{providers:o}=$(d),n=c(()=>d.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}}),s=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}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return w(),S(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(b).back()},{default:m(()=>[l(t(N),null,{default:m(()=>[l(t(P),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as V,g as k,S as y,s as $,h as c,H as K,p as h,A as S,o as w,w as m,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const a="mistral-ai",B=V({__name:"mistral-ai",setup(I){const{t:u}=k(),b=y(),d=x(),{providers:o}=$(d),n=c(()=>d.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}}),s=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}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return w(),S(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(b).back()},{default:m(()=>[l(t(N),null,{default:m(()=>[l(t(P),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/moonshot-ai-CsgPmibd.js b/assets/moonshot-ai-1DTwpN3B.js similarity index 66% rename from assets/moonshot-ai-CsgPmibd.js rename to assets/moonshot-ai-1DTwpN3B.js index 6e587301b8877704b32decf815c3e432d6935e9d..8bb8a0a1595bcdb96aa1deb90dac4c498687f01b 100644 --- a/assets/moonshot-ai-CsgPmibd.js +++ b/assets/moonshot-ai-1DTwpN3B.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as U,g as V,S as k,s as y,h as c,H as $,p as K,A as S,o as w,w as m,i as l,b as t}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const o="moonshot-ai",C=U({__name:"moonshot-ai",setup(I){const{t:u}=V(),b=k(),d=x(),{providers:a}=y(d),n=c(()=>d.getProviderMetadata(o)),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),r=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(o),s.value=((e=a.value[o])==null?void 0:e.apiKey)||"",r.value=((i=a.value[o])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{a.value[o]={...a.value[o],apiKey:s.value,baseUrl:r.value||""}});function g(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return w(),S(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:m(()=>[l(t(P),null,{default:m(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=p=>r.value=p),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as U,g as V,S as k,s as y,h as c,H as $,p as K,A as S,o as w,w as m,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const o="moonshot-ai",C=U({__name:"moonshot-ai",setup(I){const{t:u}=V(),b=k(),d=x(),{providers:a}=y(d),n=c(()=>d.getProviderMetadata(o)),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),r=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(o),s.value=((e=a.value[o])==null?void 0:e.apiKey)||"",r.value=((i=a.value[o])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{a.value[o]={...a.value[o],apiKey:s.value,baseUrl:r.value||""}});function g(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return w(),S(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:m(()=>[l(t(P),null,{default:m(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:m(()=>{var p;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=p=>r.value=p),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/novita-ai-0cbReYty.js b/assets/novita-ai-Bb31wSLB.js similarity index 66% rename from assets/novita-ai-0cbReYty.js rename to assets/novita-ai-Bb31wSLB.js index c184ab82ffcf859bd4919e77033af2663851adcf..0a01c1ece0031452624133e286e368b3a1f93772 100644 --- a/assets/novita-ai-0cbReYty.js +++ b/assets/novita-ai-Bb31wSLB.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as V,g as k,S as y,s as $,h as v,H as K,p as h,A as S,o as w,w as u,i as l,b as t}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const a="novita-ai",B=V({__name:"novita-ai",setup(I){const{t:m}=k(),b=y(),d=x(),{providers:o}=$(d),n=v(()=>d.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}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return w(),S(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(b).back()},{default:u(()=>[l(t(N),null,{default:u(()=>[l(t(P),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as V,g as k,S as y,s as $,h as v,H as K,p as h,A as S,o as w,w as u,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const a="novita-ai",B=V({__name:"novita-ai",setup(I){const{t:m}=k(),b=y(),d=x(),{providers:o}=$(d),n=v(()=>d.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}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return w(),S(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(b).back()},{default:u(()=>[l(t(N),null,{default:u(()=>[l(t(P),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/ollama-NI_J41q3.js b/assets/ollama-Bsoe-G-i.js similarity index 84% rename from assets/ollama-NI_J41q3.js rename to assets/ollama-Bsoe-G-i.js index 9981d3e1aaa81acbb79ac25bd4e887921c7d4c85..41f0c2357409b3c784b34e3774216a5051a5b5f9 100644 --- a/assets/ollama-NI_J41q3.js +++ b/assets/ollama-Bsoe-G-i.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as K,m as x,u as U,c as g,o as f,i as m,r as w,p as B,K as S,e as _,y as O,k as R,j as z,t as $,F as D,l as F,g as I,S as A,s as T,h as M,H as j,av as E,A as H,w as V,b as o}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as L}from"./providers-B3p38pBl.js";import{_ as q}from"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{a as G,_ as J}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as Q,a as W}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as X}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as C}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";const Y={flex:"~ gap-2"},Z=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 a=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,t)=>(f(),g("div",Y,[m(q,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=i=>s.value=i),placeholder:a.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(q,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=i=>u.value=i),placeholder:a.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),ee={"max-w-full":""},le={flex:"~ col gap-2"},te={class:"flex items-center gap-1 text-sm font-medium"},oe={key:0,class:"text-red-500"},ae={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},re={flex:"~ col gap-2"},se=["onClick"],ie=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:a}){const s=v,u=a,r=U(v,"modelValue"),t=w(""),i=w("");return B([t,i],()=>{u("add",t.value,i.value)}),(P,p)=>{const b=S("auto-animate");return f(),g("div",ee,[_("label",le,[_("div",null,[_("div",te,[R($(s.label)+" ",1),s.required!==!1?(f(),g("span",oe,"*")):z("",!0)]),_("div",ae,$(s.description),1)]),O((f(),g("div",re,[(f(!0),g(D,null,F(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Z,{"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,se)]))),128))])),[[b]])])])}}}),d="ollama",ne=K({__name:"ollama",setup(v){const{t:a}=I(),s=A(),u=L(),{providers:r}=T(u),t=M(()=>u.getProviderMetadata(d)),i=M({get:()=>{var l,e,n;return((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});j(()=>{var l,e,n,h;u.initializeProvider(d),i.value=((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||"",(h=r.value[d])!=null&&h.headers||(r.value[d].headers={})});function P(){var l;r.value[d]={...(l=t.value)==null?void 0:l.defaultOptions}}const p=E([{key:"",value:""}]);function b(l,e,n){l&&l.push({key:e,value:n})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return B(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 n,h;return f(),H(o(X),{"provider-name":(n=t.value)==null?void 0:n.localizedName,"provider-icon":(h=t.value)==null?void 0:h.icon,"on-back":()=>o(s).back()},{default:V(()=>[m(o(Q),null,{default:V(()=>[m(o(W),{title:o(a)("settings.pages.providers.common.section.basic.title"),description:o(a)("settings.pages.providers.common.section.basic.description"),"on-reset":P},{default:V(()=>{var c,k;return[m(o(G),{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=N=>i.value=N),placeholder:((k=(c=t.value)==null?void 0:c.defaultOptions)==null?void 0:k.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(o(J),{title:o(a)("settings.pages.providers.common.section.advanced.title")},{default:V(()=>[m(o(ie),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,k)=>b(p,c,k)),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"])}}});typeof C=="function"&&C(ne);export{ne as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as K,m as x,u as U,c as g,o as f,i as m,r as w,p as B,K as S,e as _,y as O,k as R,j as z,t as $,F as D,l as F,g as I,S as A,s as T,h as M,H as j,av as E,A as H,w as V,b as o}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as L}from"./providers-BQORs1wj.js";import{_ as q}from"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{a as G,_ as J}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as Q,a as W}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as X}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as C}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";const Y={flex:"~ gap-2"},Z=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 a=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,t)=>(f(),g("div",Y,[m(q,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=i=>s.value=i),placeholder:a.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(q,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=i=>u.value=i),placeholder:a.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),ee={"max-w-full":""},le={flex:"~ col gap-2"},te={class:"flex items-center gap-1 text-sm font-medium"},oe={key:0,class:"text-red-500"},ae={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},re={flex:"~ col gap-2"},se=["onClick"],ie=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:a}){const s=v,u=a,r=U(v,"modelValue"),t=w(""),i=w("");return B([t,i],()=>{u("add",t.value,i.value)}),(P,p)=>{const b=S("auto-animate");return f(),g("div",ee,[_("label",le,[_("div",null,[_("div",te,[R($(s.label)+" ",1),s.required!==!1?(f(),g("span",oe,"*")):z("",!0)]),_("div",ae,$(s.description),1)]),O((f(),g("div",re,[(f(!0),g(D,null,F(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Z,{"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,se)]))),128))])),[[b]])])])}}}),d="ollama",ne=K({__name:"ollama",setup(v){const{t:a}=I(),s=A(),u=L(),{providers:r}=T(u),t=M(()=>u.getProviderMetadata(d)),i=M({get:()=>{var l,e,n;return((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});j(()=>{var l,e,n,h;u.initializeProvider(d),i.value=((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||"",(h=r.value[d])!=null&&h.headers||(r.value[d].headers={})});function P(){var l;r.value[d]={...(l=t.value)==null?void 0:l.defaultOptions}}const p=E([{key:"",value:""}]);function b(l,e,n){l&&l.push({key:e,value:n})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return B(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 n,h;return f(),H(o(X),{"provider-name":(n=t.value)==null?void 0:n.localizedName,"provider-icon":(h=t.value)==null?void 0:h.icon,"on-back":()=>o(s).back()},{default:V(()=>[m(o(Q),null,{default:V(()=>[m(o(W),{title:o(a)("settings.pages.providers.common.section.basic.title"),description:o(a)("settings.pages.providers.common.section.basic.description"),"on-reset":P},{default:V(()=>{var c,k;return[m(o(G),{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=N=>i.value=N),placeholder:((k=(c=t.value)==null?void 0:c.defaultOptions)==null?void 0:k.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(o(J),{title:o(a)("settings.pages.providers.common.section.advanced.title")},{default:V(()=>[m(o(ie),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,k)=>b(p,c,k)),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"])}}});typeof C=="function"&&C(ne);export{ne as default}; diff --git a/assets/openai-BgJcu_8g.js b/assets/openai-Ball6DG9.js similarity index 68% rename from assets/openai-BgJcu_8g.js rename to assets/openai-Ball6DG9.js index 185bd4ab43e261e8f5a5dd2cb24f025d958c6fc0..4b64bd00a6dad4a430ceb4cd10fa229e6702c332 100644 --- a/assets/openai-BgJcu_8g.js +++ b/assets/openai-Ball6DG9.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as U,g as k,S as V,s as y,h as c,H as $,p as K,A as I,o as S,w as n,i as p,b as t}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as w}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as x,a as A}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as N,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const e="openai",B=U({__name:"openai",setup(C){const{t:m}=k(),b=V(),v=w(),{providers:a}=y(v),u=c(()=>v.getProviderMetadata(e)),s=c({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=c({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}});$(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return S(),I(t(z),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[p(t(N),null,{default:n(()=>[p(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var l;return[p(t(M),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":((l=u.value)==null?void 0:l.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(t(x),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[p(t(A),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=l=>r.value=l),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as U,g as k,S as V,s as y,h as c,H as $,p as K,A as I,o as S,w as n,i as p,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as w}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as x,a as A}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as N,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const e="openai",B=U({__name:"openai",setup(C){const{t:m}=k(),b=V(),v=w(),{providers:a}=y(v),u=c(()=>v.getProviderMetadata(e)),s=c({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=c({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}});$(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return S(),I(t(z),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[p(t(N),null,{default:n(()=>[p(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var l;return[p(t(M),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":((l=u.value)==null?void 0:l.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(t(x),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[p(t(A),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=l=>r.value=l),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/openrouter-ai-DvGzxRQB.js b/assets/openrouter-ai-BElqgb6j.js similarity index 68% rename from assets/openrouter-ai-DvGzxRQB.js rename to assets/openrouter-ai-BElqgb6j.js index 196cb241060d736ffc3abba52e6e3f26384572ba..12482d65524bf99caf70e38a8b48c6698506f9af 100644 --- a/assets/openrouter-ai-DvGzxRQB.js +++ b/assets/openrouter-ai-BElqgb6j.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as V,g as y,S as $,s as K,h as _,H as O,p as h,A as S,o as w,w as v,i as d,b as r}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-4XsML54n.js";import{b}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";const a="openrouter-ai",C=V({__name:"openrouter-ai",setup(I){const{t:c}=y(),g=$(),f=x(),{providers:o}=K(f),i=_(()=>f.getProviderMetadata(a)),l=_({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,s;return((e=o.value[a])==null?void 0:e.baseUrl)||((s=(t=i.value)==null?void 0:t.defaultOptions)==null?void 0:s.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});O(()=>{var e,t,s,u;f.initializeProvider(a),l.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(s=i.value)==null?void 0:s.defaultOptions)==null?void 0:u.baseUrl)||""}),h([l,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:l.value,baseUrl:n.value||((t=(e=i.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function U(){var e;o.value[a]={...(e=i.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var s,u;return w(),S(r(B),{"provider-name":(s=i.value)==null?void 0:s.localizedName,"provider-icon":(u=i.value)==null?void 0:u.icon,"on-back":()=>r(g).back()},{default:v(()=>[d(r(P),null,{default:v(()=>[d(r(R),{title:r(c)("settings.pages.providers.common.section.basic.title"),description:r(c)("settings.pages.providers.common.section.basic.description"),"on-reset":U},{default:v(()=>{var p;return[d(r(N),{modelValue:l.value,"onUpdate:modelValue":t[0]||(t[0]=m=>l.value=m),"provider-name":(p=i.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(r(z),{title:r(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var p,m;return[d(r(M),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=k=>n.value=k),placeholder:((m=(p=i.value)==null?void 0:p.defaultOptions)==null?void 0:m.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof b=="function"&&b(C);export{C as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as V,g as y,S as $,s as K,h as _,H as O,p as h,A as S,o as w,w as v,i as d,b as r}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as x}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const a="openrouter-ai",C=V({__name:"openrouter-ai",setup(I){const{t:c}=y(),g=$(),f=x(),{providers:o}=K(f),i=_(()=>f.getProviderMetadata(a)),l=_({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,s;return((e=o.value[a])==null?void 0:e.baseUrl)||((s=(t=i.value)==null?void 0:t.defaultOptions)==null?void 0:s.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});O(()=>{var e,t,s,u;f.initializeProvider(a),l.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(s=i.value)==null?void 0:s.defaultOptions)==null?void 0:u.baseUrl)||""}),h([l,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:l.value,baseUrl:n.value||((t=(e=i.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function U(){var e;o.value[a]={...(e=i.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var s,u;return w(),S(r(B),{"provider-name":(s=i.value)==null?void 0:s.localizedName,"provider-icon":(u=i.value)==null?void 0:u.icon,"on-back":()=>r(g).back()},{default:v(()=>[d(r(P),null,{default:v(()=>[d(r(R),{title:r(c)("settings.pages.providers.common.section.basic.title"),description:r(c)("settings.pages.providers.common.section.basic.description"),"on-reset":U},{default:v(()=>{var p;return[d(r(N),{modelValue:l.value,"onUpdate:modelValue":t[0]||(t[0]=m=>l.value=m),"provider-name":(p=i.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(r(z),{title:r(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var p,m;return[d(r(M),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=k=>n.value=k),placeholder:((m=(p=i.value)==null?void 0:p.defaultOptions)==null?void 0:m.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof b=="function"&&b(C);export{C as default}; diff --git a/assets/providers-B3p38pBl.js b/assets/providers-BQORs1wj.js similarity index 99% rename from assets/providers-B3p38pBl.js rename to assets/providers-BQORs1wj.js index 7734a8593a7680815242a8b9b3190d916f3c2290..e168c4ccd4ac6e40d36b637bd2b7eebf15f40256 100644 --- a/assets/providers-B3p38pBl.js +++ b/assets/providers-BQORs1wj.js @@ -1 +1 @@ -import{v as oe,x as le,g as de,r as S,p as ce,h as w}from"./index-Bo-ykojl.js";import{r as Z,a as R,e as ee,o as k}from"./index-LHmcipjy.js";const b=async a=>(a.fetch??globalThis.fetch)(Z("models",a.baseURL),{headers:R(a.headers,a.apiKey),signal:a.abortSignal}).then(ee).then(({data:i})=>i),_=a=>({chat:i=>Object.assign(a,{model:i})}),K=a=>({embed:i=>Object.assign(a,{model:i})}),pe=a=>({image:i=>Object.assign(a,{model:i})}),f=a=>({model:()=>a}),ue=a=>({speech:i=>Object.assign(a,{model:i})}),ge=a=>({transcription:i=>Object.assign(a,{model:i})}),m=(a,i)=>({metadata:{id:a,...i}}),p=(...a)=>Object.assign(a[0],...a.slice(1)),me=(a,i="https://api.anthropic.com/v1/")=>p(m("anthropic"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),L=(a,i="https://api.deepseek.com/")=>p(m("deepseek"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),G=(a,i="https://api.fireworks.ai/inference/v1/")=>p(m("fireworks"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),$=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>p(m("google-generative-ai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),D=(a,i="https://api.mistral.ai/v1/")=>p(m("mistral"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),V=(a,i="https://api.moonshot.cn/v1/")=>p(m("moonshot"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),N=(a,i="https://api.novita.ai/v3/openai/")=>p(m("novita"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),q=(a,i="https://api.openai.com/v1/")=>p(m("openai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),pe({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i}),ue({apiKey:a,baseURL:i}),ge({apiKey:a,baseURL:i})),ve=(a,i="")=>p(m("openrouter"),{chat:(d,o)=>{const h={apiKey:a,baseURL:i,model:d};return{...o?(({extraHeaders:n,models:v,provider:g})=>{n!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,n));let c;return g!=null&&(c=k(g)),k({models:v,provider:c})})(o):{},...h}}},f({apiKey:a,baseURL:i})),_e=(a,i="https://api.perplexity.ai/")=>p(m("perplexity"),_({apiKey:a,baseURL:i})),W=(a,i="https://api.together.xyz/v1/")=>p(m("together-ai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i,fetch:async(...d)=>globalThis.fetch(...d).then(async o=>o.json()).then(o=>Response.json({data:o,object:"list"}))})),he=(a,i)=>{const d=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return p(m("workers-ai"),_({apiKey:a,baseURL:d}),K({apiKey:a,baseURL:d}))},H=(a,i="https://api.x.ai/v1/")=>p(m("xai"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),A=(a="http://localhost:11434/v1/")=>p(m("ollama"),_({baseURL:a}),K({baseURL:a}),f({baseURL:a}));var J=(a,i="http://localhost:5933/v1/")=>{const d=({applyTextNormalization:t,languageCode:n,nextRequestIds:v,nextText:g,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x,seed:M,voiceSettings:C})=>({extraBody:k({applyTextNormalization:t,languageCode:n,nextRequestIds:v,nextText:g,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x?x.map(B=>k(B)):void 0,seed:M,voiceSettings:k(C??{similarityBoost:.75,stability:.5})})});return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`elevenlabs/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...t?d(t):{},apiKey:a,baseURL:i})})},X=(a,i="http://localhost:5933/v1/")=>{const d=t=>{const{deploymentId:n,region:v,sampleRate:g}=t,c={deploymentId:n,region:v,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 p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`microsoft/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?d(t):{},apiKey:a,baseURL:i})})},Q=(a,i="http://localhost:5933/v1/")=>{const d=t=>{var v,g;const n={app:{appid:(v=t.app)==null?void 0:v.appId,token:a}};return typeof t.app<"u"&&(n.app={...t.app,appid:(g=t.app)==null?void 0:g.appId,token:a}),typeof t.user<"u"&&(n.user=t.user),typeof t.audio<"u"&&(n.audio=t.audio),{extraBody:k(n)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`volcengine/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=volcengine",...t?d(t):{},apiKey:a,baseURL:i})})},Y=(a,i="http://localhost:5933/v1/")=>{const d=t=>{const{sampleRate:n,volume:v,rate:g,pitch:c}=t,y={sampleRate:n,volume:v,rate:g,pitch:c};return Object.keys(y).forEach(x=>y[x]===void 0&&delete y[x]),{extraBody:k(y)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let n=i;return n.endsWith("v1/")?n=n.slice(0,-3):n.endsWith("v1")&&(n=n.slice(0,-2)),{query:"provider=alibaba",...t?d(t):{},apiKey:a,baseURL:n}}})},E=async a=>(a.fetch??globalThis.fetch)(Z(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:R({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(ee).then(({voices:i})=>i);const fe=[{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=oe("providers",()=>{const a=le("settings/credentials/providers",{}),{t:i}=de();async function d(e){try{const r=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch OpenRouter models: ${r.statusText}`);return(await r.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(r){throw console.error("Error fetching OpenRouter models:",r),r}}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=>ve(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>d(e)},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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=>A(e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...A(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},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",createProvider:e=>A(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}]},validators:{validateProviderConfig:e=>!!e.baseUrl}},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=>q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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=>me(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}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"google-generative-ai":{id:"google-generative-ai",nameKey:"settings.pages.providers.provider.google-generative-ai.title",name:"Google Gemini",descriptionKey:"settings.pages.providers.provider.google-generative-ai.description",description:"ai.google.dev",icon:"i-lobe-icons:gemini",defaultOptions:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"},createProvider:e=>$(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...$(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"google-generative-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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=>H(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...H(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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",createProvider:e=>L(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...L(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>fe.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=J(e.apiKey.trim(),e.baseUrl.trim()),l=await E({...r.voice()}),s=l.findIndex(P=>P.name.includes("Aria")),u=l.findIndex(P=>P.name.includes("Bill")),j=s!==-1?s:0,I=u!==-1?u:l.length-1,F=Math.min(j,I),z=Math.max(j,I);return[...l.slice(0,F),...l.slice(z+1),...l.slice(F,z+1)].map(P=>({id:P.id,name:P.name,provider:"elevenlabs",previewURL:P.preview_audio_url,languages:P.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>X(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 r=X(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice({region:e.region})})).map(s=>{var u;return{id:s.id,name:s.name,provider:"microsoft-speech",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"alibaba-cloud-model-studio":{id:"alibaba-cloud-model-studio",nameKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.title",name:"Alibaba Cloud Model Studio",descriptionKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.description",description:"bailian.console.aliyun.com",iconColor:"i-lobe-icons:alibabacloud",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=Y(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(s=>{var u;return{id:s.id,name:s.name,provider:"alibaba-cloud-model-studio",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})},listModels:async()=>[{id:"cozyvoice-v1",name:"CozyVoice",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1},{id:"cozyvoice-v2",name:"CozyVoice (New)",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:"volcengine",nameKey:"settings.pages.providers.provider.volcengine.title",name:"settings.pages.providers.provider.volcengine.title",descriptionKey:"settings.pages.providers.provider.volcengine.description",description:"volcengine.com",iconColor:"i-lobe-icons:volcengine",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=Q(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(s=>{var u;return{id:s.id,name:s.name,provider:"volcano-engine",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})},listModels:async()=>[{id:"v1",name:"v1",provider:"volcano-engine",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl&&!!e.app&&!!e.app.appId}},"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",createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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",createProvider:e=>N(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...N(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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=>q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"featherless-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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",createProvider:e=>he(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.accountId}},"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=>_e(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}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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",createProvider:e=>D(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...D(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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=>V(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...V(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function h(e){const r=a.value[e];if(!r)return!1;const l=o[e];return l?await l.validators.validateProviderConfig(r):!1}const t=S({});function n(e){var r;if(!a.value[e]){const l=o[e];a.value[e]={baseUrl:((r=l.defaultOptions)==null?void 0:r.baseUrl)||""}}}Object.keys(o).forEach(n);async function v(){await Promise.all(Object.keys(o).map(async e=>{t.value[e]=await h(e)}))}v(),ce(a,v,{deep:!0});const g=w(()=>Object.keys(o).filter(e=>t.value[e])),c=S({}),y=S({}),x=S({});async function M(e){const r=a.value[e];if(!r)return[];const l=o[e];if(!l)return[];y.value[e]=!0,x.value[e]=null;try{const s=l.capabilities.listModels?await l.capabilities.listModels(r):[];return c.value[e]=s.map(u=>({id:u.id,name:u.name,description:u.description,contextLength:u.contextLength,deprecated:u.deprecated,provider:e})),c.value[e]}catch(s){return console.error(`Error fetching models for ${e}:`,s),x.value[e]=s instanceof Error?s.message:"Unknown error",[]}finally{y.value[e]=!1}}function C(e){return c.value[e]||[]}const B=w(()=>{const e=[];for(const r of g.value)e.push(...c.value[r]||[]);return e});async function ae(){for(const e of g.value)o[e].capabilities.listModels&&await M(e)}function T(e){const r=o[e];if(!r)throw new Error(`Provider metadata for ${e} not found`);return{...r,localizedName:i(r.nameKey,r.name),localizedDescription:i(r.descriptionKey,r.description)}}const ie=w(()=>Object.values(o).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:t.value[e.id]||!1})));function O(e){const r=a.value[e];if(!r)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(r)}catch(s){throw console.error(`Error creating provider instance for ${e}:`,s),s}}const U=w(()=>g.value.map(e=>T(e))),re=w(()=>U.value.filter(e=>{const r=O(e.id);return"chat"in r&&typeof r.chat=="function"})),te=w(()=>U.value.filter(e=>{const r=O(e.id);return"transcription"in r&&typeof r.transcription=="function"})),ne=w(()=>U.value.filter(e=>{const r=O(e.id);return"speech"in r&&typeof r.speech=="function"}));function se(e){return a.value[e]}return{providers:a,getProviderConfig:se,availableProviders:g,configuredProviders:t,providerMetadata:o,getProviderMetadata:T,allProvidersMetadata:ie,initializeProvider:n,validateProvider:h,availableModels:c,isLoadingModels:y,modelLoadError:x,fetchModelsForProvider:M,getModelsForProvider:C,allAvailableModels:B,loadModelsForConfiguredProviders:ae,getProviderInstance:O,availableProvidersMetadata:U,availableTextGenerationsProvidersMetadata:re,availableAudioSpeechProvidersMetadata:ne,availableAudioTranscriptionProvidersMetadata:te}});export{b as l,Pe as u}; +import{v as oe,x as le,g as de,r as S,p as ce,h as w}from"./index-1_q7hlhr.js";import{r as Z,a as R,e as ee,o as k}from"./index-LHmcipjy.js";const b=async a=>(a.fetch??globalThis.fetch)(Z("models",a.baseURL),{headers:R(a.headers,a.apiKey),signal:a.abortSignal}).then(ee).then(({data:i})=>i),_=a=>({chat:i=>Object.assign(a,{model:i})}),K=a=>({embed:i=>Object.assign(a,{model:i})}),pe=a=>({image:i=>Object.assign(a,{model:i})}),f=a=>({model:()=>a}),ue=a=>({speech:i=>Object.assign(a,{model:i})}),ge=a=>({transcription:i=>Object.assign(a,{model:i})}),m=(a,i)=>({metadata:{id:a,...i}}),p=(...a)=>Object.assign(a[0],...a.slice(1)),me=(a,i="https://api.anthropic.com/v1/")=>p(m("anthropic"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),L=(a,i="https://api.deepseek.com/")=>p(m("deepseek"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),G=(a,i="https://api.fireworks.ai/inference/v1/")=>p(m("fireworks"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),$=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>p(m("google-generative-ai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),D=(a,i="https://api.mistral.ai/v1/")=>p(m("mistral"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),V=(a,i="https://api.moonshot.cn/v1/")=>p(m("moonshot"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),N=(a,i="https://api.novita.ai/v3/openai/")=>p(m("novita"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),q=(a,i="https://api.openai.com/v1/")=>p(m("openai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),pe({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i}),ue({apiKey:a,baseURL:i}),ge({apiKey:a,baseURL:i})),ve=(a,i="")=>p(m("openrouter"),{chat:(d,o)=>{const h={apiKey:a,baseURL:i,model:d};return{...o?(({extraHeaders:n,models:v,provider:g})=>{n!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,n));let c;return g!=null&&(c=k(g)),k({models:v,provider:c})})(o):{},...h}}},f({apiKey:a,baseURL:i})),_e=(a,i="https://api.perplexity.ai/")=>p(m("perplexity"),_({apiKey:a,baseURL:i})),W=(a,i="https://api.together.xyz/v1/")=>p(m("together-ai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i,fetch:async(...d)=>globalThis.fetch(...d).then(async o=>o.json()).then(o=>Response.json({data:o,object:"list"}))})),he=(a,i)=>{const d=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return p(m("workers-ai"),_({apiKey:a,baseURL:d}),K({apiKey:a,baseURL:d}))},H=(a,i="https://api.x.ai/v1/")=>p(m("xai"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),A=(a="http://localhost:11434/v1/")=>p(m("ollama"),_({baseURL:a}),K({baseURL:a}),f({baseURL:a}));var J=(a,i="http://localhost:5933/v1/")=>{const d=({applyTextNormalization:t,languageCode:n,nextRequestIds:v,nextText:g,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x,seed:M,voiceSettings:C})=>({extraBody:k({applyTextNormalization:t,languageCode:n,nextRequestIds:v,nextText:g,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x?x.map(B=>k(B)):void 0,seed:M,voiceSettings:k(C??{similarityBoost:.75,stability:.5})})});return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`elevenlabs/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...t?d(t):{},apiKey:a,baseURL:i})})},X=(a,i="http://localhost:5933/v1/")=>{const d=t=>{const{deploymentId:n,region:v,sampleRate:g}=t,c={deploymentId:n,region:v,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 p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`microsoft/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?d(t):{},apiKey:a,baseURL:i})})},Q=(a,i="http://localhost:5933/v1/")=>{const d=t=>{var v,g;const n={app:{appid:(v=t.app)==null?void 0:v.appId,token:a}};return typeof t.app<"u"&&(n.app={...t.app,appid:(g=t.app)==null?void 0:g.appId,token:a}),typeof t.user<"u"&&(n.user=t.user),typeof t.audio<"u"&&(n.audio=t.audio),{extraBody:k(n)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`volcengine/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=volcengine",...t?d(t):{},apiKey:a,baseURL:i})})},Y=(a,i="http://localhost:5933/v1/")=>{const d=t=>{const{sampleRate:n,volume:v,rate:g,pitch:c}=t,y={sampleRate:n,volume:v,rate:g,pitch:c};return Object.keys(y).forEach(x=>y[x]===void 0&&delete y[x]),{extraBody:k(y)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let n=i;return n.endsWith("v1/")?n=n.slice(0,-3):n.endsWith("v1")&&(n=n.slice(0,-2)),{query:"provider=alibaba",...t?d(t):{},apiKey:a,baseURL:n}}})},E=async a=>(a.fetch??globalThis.fetch)(Z(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:R({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(ee).then(({voices:i})=>i);const fe=[{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=oe("providers",()=>{const a=le("settings/credentials/providers",{}),{t:i}=de();async function d(e){try{const r=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch OpenRouter models: ${r.statusText}`);return(await r.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(r){throw console.error("Error fetching OpenRouter models:",r),r}}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=>ve(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>d(e)},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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=>A(e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...A(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},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",createProvider:e=>A(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}]},validators:{validateProviderConfig:e=>!!e.baseUrl}},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=>q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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=>me(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}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"google-generative-ai":{id:"google-generative-ai",nameKey:"settings.pages.providers.provider.google-generative-ai.title",name:"Google Gemini",descriptionKey:"settings.pages.providers.provider.google-generative-ai.description",description:"ai.google.dev",icon:"i-lobe-icons:gemini",defaultOptions:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"},createProvider:e=>$(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...$(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"google-generative-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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=>H(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...H(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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",createProvider:e=>L(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...L(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},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=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>fe.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=J(e.apiKey.trim(),e.baseUrl.trim()),l=await E({...r.voice()}),s=l.findIndex(P=>P.name.includes("Aria")),u=l.findIndex(P=>P.name.includes("Bill")),j=s!==-1?s:0,I=u!==-1?u:l.length-1,F=Math.min(j,I),z=Math.max(j,I);return[...l.slice(0,F),...l.slice(z+1),...l.slice(F,z+1)].map(P=>({id:P.id,name:P.name,provider:"elevenlabs",previewURL:P.preview_audio_url,languages:P.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>X(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 r=X(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice({region:e.region})})).map(s=>{var u;return{id:s.id,name:s.name,provider:"microsoft-speech",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"alibaba-cloud-model-studio":{id:"alibaba-cloud-model-studio",nameKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.title",name:"Alibaba Cloud Model Studio",descriptionKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.description",description:"bailian.console.aliyun.com",iconColor:"i-lobe-icons:alibabacloud",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=Y(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(s=>{var u;return{id:s.id,name:s.name,provider:"alibaba-cloud-model-studio",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})},listModels:async()=>[{id:"cozyvoice-v1",name:"CozyVoice",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1},{id:"cozyvoice-v2",name:"CozyVoice (New)",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:"volcengine",nameKey:"settings.pages.providers.provider.volcengine.title",name:"settings.pages.providers.provider.volcengine.title",descriptionKey:"settings.pages.providers.provider.volcengine.description",description:"volcengine.com",iconColor:"i-lobe-icons:volcengine",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=Q(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(s=>{var u;return{id:s.id,name:s.name,provider:"volcano-engine",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})},listModels:async()=>[{id:"v1",name:"v1",provider:"volcano-engine",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl&&!!e.app&&!!e.app.appId}},"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",createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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",createProvider:e=>N(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...N(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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=>q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"featherless-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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",createProvider:e=>he(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.accountId}},"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=>_e(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}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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",createProvider:e=>D(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...D(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"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=>V(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...V(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function h(e){const r=a.value[e];if(!r)return!1;const l=o[e];return l?await l.validators.validateProviderConfig(r):!1}const t=S({});function n(e){var r;if(!a.value[e]){const l=o[e];a.value[e]={baseUrl:((r=l.defaultOptions)==null?void 0:r.baseUrl)||""}}}Object.keys(o).forEach(n);async function v(){await Promise.all(Object.keys(o).map(async e=>{t.value[e]=await h(e)}))}v(),ce(a,v,{deep:!0});const g=w(()=>Object.keys(o).filter(e=>t.value[e])),c=S({}),y=S({}),x=S({});async function M(e){const r=a.value[e];if(!r)return[];const l=o[e];if(!l)return[];y.value[e]=!0,x.value[e]=null;try{const s=l.capabilities.listModels?await l.capabilities.listModels(r):[];return c.value[e]=s.map(u=>({id:u.id,name:u.name,description:u.description,contextLength:u.contextLength,deprecated:u.deprecated,provider:e})),c.value[e]}catch(s){return console.error(`Error fetching models for ${e}:`,s),x.value[e]=s instanceof Error?s.message:"Unknown error",[]}finally{y.value[e]=!1}}function C(e){return c.value[e]||[]}const B=w(()=>{const e=[];for(const r of g.value)e.push(...c.value[r]||[]);return e});async function ae(){for(const e of g.value)o[e].capabilities.listModels&&await M(e)}function T(e){const r=o[e];if(!r)throw new Error(`Provider metadata for ${e} not found`);return{...r,localizedName:i(r.nameKey,r.name),localizedDescription:i(r.descriptionKey,r.description)}}const ie=w(()=>Object.values(o).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:t.value[e.id]||!1})));function O(e){const r=a.value[e];if(!r)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(r)}catch(s){throw console.error(`Error creating provider instance for ${e}:`,s),s}}const U=w(()=>g.value.map(e=>T(e))),re=w(()=>U.value.filter(e=>{const r=O(e.id);return"chat"in r&&typeof r.chat=="function"})),te=w(()=>U.value.filter(e=>{const r=O(e.id);return"transcription"in r&&typeof r.transcription=="function"})),ne=w(()=>U.value.filter(e=>{const r=O(e.id);return"speech"in r&&typeof r.speech=="function"}));function se(e){return a.value[e]}return{providers:a,getProviderConfig:se,availableProviders:g,configuredProviders:t,providerMetadata:o,getProviderMetadata:T,allProvidersMetadata:ie,initializeProvider:n,validateProvider:h,availableModels:c,isLoadingModels:y,modelLoadError:x,fetchModelsForProvider:M,getModelsForProvider:C,allAvailableModels:B,loadModelsForConfiguredProviders:ae,getProviderInstance:O,availableProvidersMetadata:U,availableTextGenerationsProvidersMetadata:re,availableAudioSpeechProvidersMetadata:ne,availableAudioTranscriptionProvidersMetadata:te}});export{b as l,Pe as u}; diff --git a/assets/queue-BjJ4HvBx.js b/assets/queue-2ASK7l5s.js similarity index 91% rename from assets/queue-BjJ4HvBx.js rename to assets/queue-2ASK7l5s.js index e2da1c1a487f5b43824974853ff86721ebfb7eaa..a6d56f5d7f0cb25f097d708168c898f6a560fd9b 100644 --- a/assets/queue-BjJ4HvBx.js +++ b/assets/queue-2ASK7l5s.js @@ -1 +1 @@ -import{r as l}from"./index-Bo-ykojl.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 E(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=E();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{r as l}from"./index-1_q7hlhr.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 E(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=E();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-BnZfFFfY.js b/assets/queue-DT3alulg.js similarity index 90% rename from assets/queue-BnZfFFfY.js rename to assets/queue-DT3alulg.js index e1c8c48d656871fe2914ad68163b5d539a1cef2e..ef62aa6a410cb39318c112d72f43927212727b58 100644 --- a/assets/queue-BnZfFFfY.js +++ b/assets/queue-DT3alulg.js @@ -1 +1 @@ -import{u as o}from"./queue-BjJ4HvBx.js";import{d as v,r as h,H as k,c as w,o as g,e as I}from"./index-Bo-ykojl.js";const Q=v({__name:"queue",setup(H){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)}]}),c=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)}]}),l=["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 l)await i(100),c.add(e)}async function m(){f()}return k(()=>{m()}),(e,a)=>(g(),w("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; +import{u as o}from"./queue-2ASK7l5s.js";import{d as v,r as h,H as k,c as w,o as g,e as I}from"./index-1_q7hlhr.js";const Q=v({__name:"queue",setup(H){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)}]}),c=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)}]}),l=["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 l)await i(100),c.add(e)}async function m(){f()}return k(()=>{m()}),(e,a)=>(g(),w("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; diff --git a/assets/queues-JqhmoK_1.js b/assets/queues-B3H1SS53.js similarity index 94% rename from assets/queues-JqhmoK_1.js rename to assets/queues-B3H1SS53.js index d423a6bcc3439d5ee3cb222135c5d8d3928abbc7..53df36cad5a4918a19ee524c09c7c3b2e7b5c982 100644 --- a/assets/queues-JqhmoK_1.js +++ b/assets/queues-B3H1SS53.js @@ -1 +1 @@ -import{E as i}from"./mini_xsschema-f5xAZ6yD.js";import{u as s}from"./queue-BjJ4HvBx.js";import{r as d}from"./index-Bo-ykojl.js";const l="<|llm_inference_end|>";function y(o){function t(e){for(const n of i)if(e.includes(n))return{ok:!0,emotion:n};return{ok:!1,emotion:""}}return s({handlers:[async e=>{if(i.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:n,emotion:a}=t(e.data);n&&(e.emit("emotion",a),await o.add(a))}}]})}function k(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const n=/<\|DELAY:(\d+)\|>/i.exec(e),a=n==null?void 0:n[1];if(!a)return{ok:!1,delay:0};const r=Number.parseFloat(a);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}function t(e){return new Promise(n=>setTimeout(n,e))}return s({handlers:[async e=>{const{ok:n,delay:a}=o(e.data);n&&(e.emit("delay",a),await t(a*1e3))}]})}function p(o){const t=d("");return s({handlers:[async e=>{if(e.data===l){const a=t.value.trim();a&&await o.add(a),t.value="";return}const n=/[.?!]/;for(t.value+=e.data;t.value;){const a=n.exec(t.value);if(!a||typeof a.index>"u")break;const r=t.value.slice(0,a.index+1),u=t.value.slice(a.index+1);await o.add(r),t.value=u}}]})}export{y as a,p as b,l,k as u}; +import{E as i}from"./mini_xsschema-f5xAZ6yD.js";import{u as s}from"./queue-2ASK7l5s.js";import{r as d}from"./index-1_q7hlhr.js";const l="<|llm_inference_end|>";function y(o){function t(e){for(const n of i)if(e.includes(n))return{ok:!0,emotion:n};return{ok:!1,emotion:""}}return s({handlers:[async e=>{if(i.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:n,emotion:a}=t(e.data);n&&(e.emit("emotion",a),await o.add(a))}}]})}function k(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const n=/<\|DELAY:(\d+)\|>/i.exec(e),a=n==null?void 0:n[1];if(!a)return{ok:!1,delay:0};const r=Number.parseFloat(a);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}function t(e){return new Promise(n=>setTimeout(n,e))}return s({handlers:[async e=>{const{ok:n,delay:a}=o(e.data);n&&(e.emit("delay",a),await t(a*1e3))}]})}function p(o){const t=d("");return s({handlers:[async e=>{if(e.data===l){const a=t.value.trim();a&&await o.add(a),t.value="";return}const n=/[.?!]/;for(t.value+=e.data;t.value;){const a=n.exec(t.value);if(!a||typeof a.index>"u")break;const r=t.value.slice(0,a.index+1),u=t.value.slice(a.index+1);await o.add(r),t.value=u}}]})}export{y as a,p as b,l,k as u}; diff --git a/assets/settings-CUx3erI_.js b/assets/settings-qMaYBwVH.js similarity index 97% rename from assets/settings-CUx3erI_.js rename to assets/settings-qMaYBwVH.js index 864c4cd89050119e287f65c056dfa88738827376..e3e49db2f6e98fe4e760e5ed34da9040c868da86 100644 --- a/assets/settings-CUx3erI_.js +++ b/assets/settings-qMaYBwVH.js @@ -1 +1 @@ -var it=Object.defineProperty;var rt=(t,s,e)=>s in t?it(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var m=(t,s,e)=>rt(t,typeof s!="symbol"?s+"":s,e);import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{av as L,p as h,b as A,r as b,h as k,aw as nt,ax as ot,ay as y,az as q,aA as at,aB as P,aC as R,aD as u,aE as $,aF as O,aG as j,aH as v,aI as ut,aJ as lt,aK as ct,aL as U,aM as ft,aN as pt,aO as dt,aP as mt,aQ as gt,aR as bt,aS as ht,aT as yt,aU as vt,aV as xt,aW as Tt,aX as At,aY as Ot,aZ as wt,a_ as St,a$ as kt,b0 as Et,b1 as jt,d as G,H as Pt,I as Vt,c as M,e as S,S as Ct,j as Nt,t as W,o as D,b2 as J,g as Rt,s as Mt,i as V,R as Dt}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as zt}from"./providers-B3p38pBl.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{H as Lt}from"./HeaderLink-CATmmLWn.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";const T={};class Ft{constructor(){m(this,"subscriptions",new Set)}add(s){return this.subscriptions.add(s),()=>this.subscriptions.delete(s)}notify(s,e,r){if(this.subscriptions.size)for(const i of this.subscriptions)i(s,e,r)}clear(){this.subscriptions.clear()}}function X(t){return!Number.isNaN(Number.parseFloat(t))}class Ht{constructor(s){m(this,"current");m(this,"prev");m(this,"timeDelta",0);m(this,"lastUpdated",0);m(this,"updateSubscribers",new Ft);m(this,"stopAnimation");m(this,"canTrackVelocity",!1);m(this,"updateAndNotify",s=>{this.prev=this.current,this.current=s;const{delta:e,timestamp:r}=ct();this.lastUpdated!==r&&(this.timeDelta=e,this.lastUpdated=r),U.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});m(this,"scheduleVelocityCheck",()=>U.postRender(this.velocityCheck));m(this,"velocityCheck",({timestamp:s})=>{this.canTrackVelocity||(this.canTrackVelocity=X(this.current)),s!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=s,this.canTrackVelocity=X(this.current)}onChange(s){return this.updateSubscribers.add(s)}clearListeners(){this.updateSubscribers.clear()}set(s){this.updateAndNotify(s)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ft(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(s){return this.stop(),new Promise(e=>{const{stop:r}=s(e);this.stopAnimation=r}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}}function Bt(t){return new Ht(t)}const{isArray:$t}=Array;function Ut(){const t=b({}),s=r=>{const i=n=>{t.value[n]&&(t.value[n].stop(),t.value[n].destroy(),delete t.value[n])};r?$t(r)?r.forEach(i):i(r):Object.keys(t.value).forEach(i)},e=(r,i,n)=>{if(t.value[r])return t.value[r];const o=Bt(i);return o.onChange(a=>n[r]=a),t.value[r]=o,o};return Et(s),{motionValues:t,get:e,stop:s}}function Wt(t){return Array.isArray(t)}function w(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function C(t){return{type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Xt(t){return{type:"spring",stiffness:550,damping:t===0?100:30,restDelta:.01,restSpeed:10}}function N(){return{type:"keyframes",ease:"linear",duration:300}}function Yt(t){return{type:"keyframes",duration:800,values:t}}const Y={default:Xt,x:w,y:w,z:w,rotate:w,rotateX:w,rotateY:w,rotateZ:w,scaleX:C,scaleY:C,scale:C,backgroundColor:N,color:N,opacity:N};function Q(t,s){let e;return Wt(s)?e=Yt:e=Y[t]||Y.default,{to:s,...e(s)}}const I={...at,transform:Math.round},_={color:v,backgroundColor:v,outlineColor:v,fill:v,stroke:v,borderColor:v,borderTopColor:v,borderRightColor:v,borderBottomColor:v,borderLeftColor:v,borderWidth:u,borderTopWidth:u,borderRightWidth:u,borderBottomWidth:u,borderLeftWidth:u,borderRadius:u,radius:u,borderTopLeftRadius:u,borderTopRightRadius:u,borderBottomRightRadius:u,borderBottomLeftRadius:u,width:u,maxWidth:u,height:u,maxHeight:u,size:u,top:u,right:u,bottom:u,left:u,padding:u,paddingTop:u,paddingRight:u,paddingBottom:u,paddingLeft:u,margin:u,marginTop:u,marginRight:u,marginBottom:u,marginLeft:u,rotate:O,rotateX:O,rotateY:O,rotateZ:O,scale:j,scaleX:j,scaleY:j,scaleZ:j,skew:O,skewX:O,skewY:O,distance:u,translateX:u,translateY:u,translateZ:u,x:u,y:u,z:u,perspective:u,transformPerspective:u,opacity:P,originX:$,originY:$,originZ:u,zIndex:I,filter:R,WebkitFilter:R,fillOpacity:P,strokeOpacity:P,numOctaves:I},F=t=>_[t];function z(t,s){return s&&typeof t=="number"&&s.transform?s.transform(t):t}function It(t,s){let e=F(t);return e!==R&&(e=q),e.getAnimatableNone?e.getAnimatableNone(s):void 0}const Zt={linear:kt,easeIn:St,easeInOut:wt,easeOut:Ot,circIn:At,circInOut:Tt,circOut:xt,backIn:vt,backInOut:yt,backOut:ht,anticipate:bt,bounceIn:gt,bounceInOut:mt,bounceOut:dt};function Z(t){if(Array.isArray(t)){const[s,e,r,i]=t;return pt(s,e,r,i)}else if(typeof t=="string")return Zt[t];return t}function Kt(t){return Array.isArray(t)&&typeof t[0]!="number"}function K(t,s){return t==="zIndex"?!1:!!(typeof s=="number"||Array.isArray(s)||typeof s=="string"&&q.test(s)&&!s.startsWith("url("))}function qt(t){return Array.isArray(t.to)&&t.to[0]===null&&(t.to=[...t.to],t.to[0]=t.from),t}function Gt({ease:t,times:s,delay:e,...r}){const i={...r};return s&&(i.offset=s),t&&(i.ease=Kt(t)?t.map(Z):Z(t)),e&&(i.elapsed=-e),i}function Jt(t,s,e){return Array.isArray(s.to)&&(t.duration||(t.duration=800)),qt(s),Qt(t)||(t={...t,...Q(e,s.to)}),{...s,...Gt(t)}}function Qt({delay:t,repeat:s,repeatType:e,repeatDelay:r,from:i,...n}){return!!Object.keys(n).length}function _t(t,s){return t[s]||t.default||t}function te(t,s,e,r,i){const n=_t(r,t);let o=n.from===null||n.from===void 0?s.get():n.from;const a=K(t,e);o==="none"&&a&&typeof e=="string"&&(o=It(t,e));const f=K(t,o);function p(c){const d={from:o,to:e,velocity:r.velocity?r.velocity:s.getVelocity(),onUpdate:x=>s.set(x)};return n.type==="inertia"||n.type==="decay"?ut({...d,...n}):lt({...Jt(n,d,t),onUpdate:x=>{d.onUpdate(x),n.onUpdate&&n.onUpdate(x)},onComplete:()=>{i&&i(),c&&c()}})}function l(c){return s.set(e),i&&i(),c&&c(),{stop:()=>{}}}return!f||!a||n.type===!1?l:p}function ee(){const{motionValues:t,stop:s,get:e}=Ut();return{motionValues:t,stop:s,push:(i,n,o,a={},f)=>{const p=o[i],l=e(i,p,o);if(a&&a.immediate){l.set(n);return}const c=te(i,l,n,a,f);l.start(c)}}}function se(t,s={},{motionValues:e,push:r,stop:i}=ee()){const n=A(s),o=b(!1);h(e,c=>{o.value=Object.values(c).filter(d=>d.isAnimating()).length>0},{immediate:!0,deep:!0});const a=c=>{if(!n||!n[c])throw new Error(`The variant ${c} does not exist.`);return n[c]},f=c=>{typeof c=="string"&&(c=a(c));const d=Object.entries(c).map(([g,E])=>{if(g!=="transition")return new Promise(st=>r(g,E,t,c.transition||Q(g,c[g]),st))}).filter(Boolean);async function x(){var g,E;await Promise.all(d),(E=(g=c.transition)==null?void 0:g.onComplete)==null||E.call(g)}return Promise.all([x()])};return{isAnimating:o,apply:f,set:c=>{const d=nt(c)?c:a(c);Object.entries(d).forEach(([x,g])=>{x!=="transition"&&r(x,g,t,{immediate:!0})})},leave:async c=>{let d;if(n&&(n.leave&&(d=n.leave),!n.leave&&n.initial&&(d=n.initial)),!d){c();return}await f(d),c()},stop:i}}const H=typeof window<"u",ie=()=>H&&(window.onpointerdown===null||(T==null?void 0:T.TEST)),re=()=>H&&(window.ontouchstart===null||(T==null?void 0:T.TEST)),ne=()=>H&&(window.onmousedown===null||(T==null?void 0:T.TEST));function oe({target:t,state:s,variants:e,apply:r}){const i=A(e),n=b(!1),o=b(!1),a=b(!1),f=k(()=>{let l=[...Object.keys(s.value||{})];return i&&(i.hovered&&(l=[...l,...Object.keys(i.hovered)]),i.tapped&&(l=[...l,...Object.keys(i.tapped)]),i.focused&&(l=[...l,...Object.keys(i.focused)])),l}),p=k(()=>{const l={};Object.assign(l,s.value),n.value&&i.hovered&&Object.assign(l,i.hovered),o.value&&i.tapped&&Object.assign(l,i.tapped),a.value&&i.focused&&Object.assign(l,i.focused);for(const c in l)f.value.includes(c)||delete l[c];return l});i.hovered&&(y(t,"mouseenter",()=>n.value=!0),y(t,"mouseleave",()=>{n.value=!1,o.value=!1})),i.tapped&&(ne()&&(y(t,"mousedown",()=>o.value=!0),y(t,"mouseup",()=>o.value=!1)),ie()&&(y(t,"pointerdown",()=>o.value=!0),y(t,"pointerup",()=>o.value=!1)),re()&&(y(t,"touchstart",()=>o.value=!0),y(t,"touchend",()=>o.value=!1))),i.focused&&(y(t,"focus",()=>a.value=!0),y(t,"blur",()=>a.value=!1)),h([n,o,a],()=>{r(p.value)})}function ae({set:t,target:s,variants:e,variant:r}){const i=A(e);h(()=>s,()=>{i&&(i.initial&&(t("initial"),r.value="initial"),i.enter&&(r.value="enter"))},{immediate:!0,flush:"pre"})}function ue({state:t,apply:s}){h(t,e=>{e&&s(e)},{immediate:!0})}function le({target:t,variants:s,variant:e}){const r=A(s);r&&(r.visible||r.visibleOnce)&&ot(t,([{isIntersecting:i}])=>{r.visible?i?e.value="visible":e.value="initial":r.visibleOnce&&(i&&e.value!=="visibleOnce"?e.value="visibleOnce":e.value||(e.value="initial"))})}function ce(t,s={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){s.lifeCycleHooks&&ae(t),s.syncVariants&&ue(t),s.visibilityHooks&&le(t),s.eventListeners&&oe(t)}function fe(t={}){const s=L({...t}),e=b({});return h(s,()=>{const r={};for(const[i,n]of Object.entries(s)){const o=F(i),a=z(n,o);r[i]=a}e.value=r},{immediate:!0,deep:!0}),{state:s,style:e}}function B(t,s){h(()=>jt(t),e=>{e&&s(e)},{immediate:!0})}const pe={x:"translateX",y:"translateY",z:"translateZ"};function de(t={},s=!0){const e=L({...t}),r=b("");return h(e,i=>{let n="",o=!1;if(s&&(i.x||i.y||i.z)){const a=[i.x||0,i.y||0,i.z||0].map(f=>z(f,u)).join(",");n+=`translate3d(${a}) `,o=!0}for(const[a,f]of Object.entries(i)){if(s&&(a==="x"||a==="y"||a==="z"))continue;const p=F(a),l=z(f,p);n+=`${pe[a]||a}(${l}) `}s&&!o&&(n+="translateZ(0px) "),r.value=n.trim()},{immediate:!0,deep:!0}),{state:e,transform:r}}const me=["","X","Y","Z"],ge=["perspective","translate","scale","rotate","skew"],tt=["transformPerspective","x","y","z"];ge.forEach(t=>{me.forEach(s=>{const e=t+s;tt.push(e)})});const be=new Set(tt);function et(t){return be.has(t)}const he=new Set(["originX","originY","originZ"]);function ye(t){return he.has(t)}function ve(t,s){let e,r;const{state:i,style:n}=fe();return B(t,o=>{r=o;for(const a of Object.keys(_))o.style[a]===null||o.style[a]===""||et(a)||ye(a)||(i[a]=o.style[a]);e&&Object.entries(e).forEach(([a,f])=>o.style[a]=f),s&&s(i)}),h(n,o=>{if(!r){e=o;return}for(const a in o)r.style[a]=o[a]},{immediate:!0}),{style:i}}function xe(t){const s=t.trim().split(/\) |\)/);if(s.length===1)return{};const e=r=>r.endsWith("px")||r.endsWith("deg")?Number.parseFloat(r):Number.isNaN(Number(r))?Number(r):r;return s.reduce((r,i)=>{if(!i)return r;const[n,o]=i.split("("),f=o.split(",").map(l=>e(l.endsWith(")")?l.replace(")",""):l.trim())),p=f.length===1?f[0]:f;return{...r,[n]:p}},{})}function Te(t,s){Object.entries(xe(s)).forEach(([e,r])=>{const i=["x","y","z"];if(e==="translate3d"){if(r===0){i.forEach(n=>t[n]=0);return}r.forEach((n,o)=>t[i[o]]=n);return}if(r=Number.parseFloat(`${r}`),e==="translateX"){t.x=r;return}if(e==="translateY"){t.y=r;return}if(e==="translateZ"){t.z=r;return}t[e]=r})}function Ae(t,s){let e,r;const{state:i,transform:n}=de();return B(t,o=>{r=o,o.style.transform&&Te(i,o.style.transform),e&&(o.style.transform=e),s&&s(i)}),h(n,o=>{if(!r){e=o;return}r.style.transform=o},{immediate:!0}),{transform:i}}function Oe(t){return Object.entries(t)}function we(t,s){const e=L({}),r=o=>Object.entries(o).forEach(([a,f])=>e[a]=f),{style:i}=ve(t,r),{transform:n}=Ae(t,r);return h(e,o=>{Oe(o).forEach(([a,f])=>{const p=et(a)?n:i;p[a]&&p[a]===f||(p[a]=f)})},{immediate:!0,deep:!0}),B(t,()=>s),{motionProperties:e,style:i,transform:n}}function Se(t={}){const s=A(t),e=b();return{state:k(()=>{if(e.value)return s[e.value]}),variant:e}}function ke(t,s={},e){const{motionProperties:r}=we(t),{variant:i,state:n}=Se(s),o=se(r,s),a={target:t,variant:i,variants:s,state:n,motionProperties:r,...o};return ce(a,e),a}const Ee={relative:""},je={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},Pe={text:"neutral-300 dark:neutral-500","text-nowrap":""},Ve={"text-nowrap":"","text-3xl":"","font-semibold":""},Ce=G({__name:"PageHeader",props:{title:null,subtitle:null},setup(t){const s=t,e=Ct(),r=J(),i=b(),n=b(s.title),o=b(s.subtitle),{apply:a}=ke(i,{initial:{opacity:0,x:10,transition:{duration:250}},enter:{opacity:1,x:0,transition:{duration:250}},leave:{opacity:0,x:-5,transition:{duration:100}}});return Pt(async()=>{await a("initial"),await a("enter")}),Vt(async()=>{await a("leave")}),h([()=>s.title,()=>s.subtitle,r],async()=>{await a("leave"),n.value=s.title,o.value=s.subtitle,await a("initial"),await a("enter")}),(f,p)=>(D(),M("div",{ref_key:"pageHeaderRef",ref:i,style:{top:"env(safe-area-inset-top, 0px)",right:"env(safe-area-inset-right, 0px)",left:"env(safe-area-inset-left, 0px)"},sticky:"","inset-x-0":"","top-0":"","z-99":"","w-full":"","pb-6":"","pt-10":"",flex:"~ row items-center gap-2",bg:"$bg-color"},[S("button",{onClick:p[0]||(p[0]=l=>A(e).back())},p[1]||(p[1]=[S("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),S("h1",Ee,[o.value?(D(),M("div",je,[S("span",Pe,W(o.value),1)])):Nt("",!0),S("div",Ve,W(n.value),1)])],512))}}),Ne={style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingTop:"env(safe-area-inset-top, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)"}},Re={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},Me={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},Ie=G({__name:"settings",setup(t){const s=J(),{t:e}=Rt(),r=zt(),{allProvidersMetadata:i}=Mt(r),n=k(()=>{const a={"/settings/airi-card":{subtitle:e("settings.title"),title:e("settings.pages.card.title")},"/settings/appearance":{subtitle:e("settings.title"),title:e("settings.pages.themes.title")},"/settings/memory":{subtitle:e("settings.title"),title:e("settings.pages.memory.title")},"/settings/models":{subtitle:e("settings.title"),title:e("settings.pages.models.title")},"/settings/modules":{subtitle:e("settings.title"),title:e("settings.pages.modules.title")},"/settings/modules/consciousness":{subtitle:e("settings.title"),title:e("settings.pages.modules.consciousness.title")},"/settings/modules/speech":{subtitle:e("settings.title"),title:e("settings.pages.modules.speech.title")},"/settings/modules/hearing":{subtitle:e("settings.title"),title:e("settings.pages.modules.hearing.title")},"/settings/modules/memory-short-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-short-term.title")},"/settings/modules/memory-long-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-long-term.title")},"/settings/modules/messaging-discord":{subtitle:e("settings.title"),title:e("settings.pages.modules.messaging-discord.title")},"/settings/modules/x":{subtitle:e("settings.title"),title:e("settings.pages.modules.x.title")},"/settings/modules/gaming-minecraft":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-minecraft.title")},"/settings/modules/gaming-factorio":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-factorio.title")},"/settings/providers":{subtitle:e("settings.title"),title:e("settings.pages.providers.title")},"/settings/scene":{subtitle:e("settings.title"),title:e("settings.pages.scene.title")},"/settings":{title:e("settings.title")}};for(const f of i.value)a[`/settings/providers/${f.id}`]={subtitle:e("settings.title"),title:e(f.nameKey)};return a}),o=k(()=>n.value[s.path]);return(a,f)=>{var p,l;return D(),M("div",Ne,[S("div",Re,[V(Lt)]),S("div",Me,[V(A(Ce),{title:(p=o.value)==null?void 0:p.title,subtitle:(l=o.value)==null?void 0:l.subtitle},null,8,["title","subtitle"]),V(A(Dt))])])}}});export{Ie as default}; +var it=Object.defineProperty;var rt=(t,s,e)=>s in t?it(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var m=(t,s,e)=>rt(t,typeof s!="symbol"?s+"":s,e);import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{av as L,p as h,b as A,r as b,h as k,aw as nt,ax as ot,ay as y,az as q,aA as at,aB as P,aC as R,aD as u,aE as $,aF as O,aG as j,aH as v,aI as ut,aJ as lt,aK as ct,aL as U,aM as ft,aN as pt,aO as dt,aP as mt,aQ as gt,aR as bt,aS as ht,aT as yt,aU as vt,aV as xt,aW as Tt,aX as At,aY as Ot,aZ as wt,a_ as St,a$ as kt,b0 as Et,b1 as jt,d as G,H as Pt,I as Vt,c as M,e as S,S as Ct,j as Nt,t as W,o as D,b2 as J,g as Rt,s as Mt,i as V,R as Dt}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as zt}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{H as Lt}from"./HeaderLink-D3zUgdpF.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";const T={};class Ft{constructor(){m(this,"subscriptions",new Set)}add(s){return this.subscriptions.add(s),()=>this.subscriptions.delete(s)}notify(s,e,r){if(this.subscriptions.size)for(const i of this.subscriptions)i(s,e,r)}clear(){this.subscriptions.clear()}}function X(t){return!Number.isNaN(Number.parseFloat(t))}class Ht{constructor(s){m(this,"current");m(this,"prev");m(this,"timeDelta",0);m(this,"lastUpdated",0);m(this,"updateSubscribers",new Ft);m(this,"stopAnimation");m(this,"canTrackVelocity",!1);m(this,"updateAndNotify",s=>{this.prev=this.current,this.current=s;const{delta:e,timestamp:r}=ct();this.lastUpdated!==r&&(this.timeDelta=e,this.lastUpdated=r),U.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});m(this,"scheduleVelocityCheck",()=>U.postRender(this.velocityCheck));m(this,"velocityCheck",({timestamp:s})=>{this.canTrackVelocity||(this.canTrackVelocity=X(this.current)),s!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=s,this.canTrackVelocity=X(this.current)}onChange(s){return this.updateSubscribers.add(s)}clearListeners(){this.updateSubscribers.clear()}set(s){this.updateAndNotify(s)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ft(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(s){return this.stop(),new Promise(e=>{const{stop:r}=s(e);this.stopAnimation=r}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}}function Bt(t){return new Ht(t)}const{isArray:$t}=Array;function Ut(){const t=b({}),s=r=>{const i=n=>{t.value[n]&&(t.value[n].stop(),t.value[n].destroy(),delete t.value[n])};r?$t(r)?r.forEach(i):i(r):Object.keys(t.value).forEach(i)},e=(r,i,n)=>{if(t.value[r])return t.value[r];const o=Bt(i);return o.onChange(a=>n[r]=a),t.value[r]=o,o};return Et(s),{motionValues:t,get:e,stop:s}}function Wt(t){return Array.isArray(t)}function w(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function C(t){return{type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Xt(t){return{type:"spring",stiffness:550,damping:t===0?100:30,restDelta:.01,restSpeed:10}}function N(){return{type:"keyframes",ease:"linear",duration:300}}function Yt(t){return{type:"keyframes",duration:800,values:t}}const Y={default:Xt,x:w,y:w,z:w,rotate:w,rotateX:w,rotateY:w,rotateZ:w,scaleX:C,scaleY:C,scale:C,backgroundColor:N,color:N,opacity:N};function Q(t,s){let e;return Wt(s)?e=Yt:e=Y[t]||Y.default,{to:s,...e(s)}}const I={...at,transform:Math.round},_={color:v,backgroundColor:v,outlineColor:v,fill:v,stroke:v,borderColor:v,borderTopColor:v,borderRightColor:v,borderBottomColor:v,borderLeftColor:v,borderWidth:u,borderTopWidth:u,borderRightWidth:u,borderBottomWidth:u,borderLeftWidth:u,borderRadius:u,radius:u,borderTopLeftRadius:u,borderTopRightRadius:u,borderBottomRightRadius:u,borderBottomLeftRadius:u,width:u,maxWidth:u,height:u,maxHeight:u,size:u,top:u,right:u,bottom:u,left:u,padding:u,paddingTop:u,paddingRight:u,paddingBottom:u,paddingLeft:u,margin:u,marginTop:u,marginRight:u,marginBottom:u,marginLeft:u,rotate:O,rotateX:O,rotateY:O,rotateZ:O,scale:j,scaleX:j,scaleY:j,scaleZ:j,skew:O,skewX:O,skewY:O,distance:u,translateX:u,translateY:u,translateZ:u,x:u,y:u,z:u,perspective:u,transformPerspective:u,opacity:P,originX:$,originY:$,originZ:u,zIndex:I,filter:R,WebkitFilter:R,fillOpacity:P,strokeOpacity:P,numOctaves:I},F=t=>_[t];function z(t,s){return s&&typeof t=="number"&&s.transform?s.transform(t):t}function It(t,s){let e=F(t);return e!==R&&(e=q),e.getAnimatableNone?e.getAnimatableNone(s):void 0}const Zt={linear:kt,easeIn:St,easeInOut:wt,easeOut:Ot,circIn:At,circInOut:Tt,circOut:xt,backIn:vt,backInOut:yt,backOut:ht,anticipate:bt,bounceIn:gt,bounceInOut:mt,bounceOut:dt};function Z(t){if(Array.isArray(t)){const[s,e,r,i]=t;return pt(s,e,r,i)}else if(typeof t=="string")return Zt[t];return t}function Kt(t){return Array.isArray(t)&&typeof t[0]!="number"}function K(t,s){return t==="zIndex"?!1:!!(typeof s=="number"||Array.isArray(s)||typeof s=="string"&&q.test(s)&&!s.startsWith("url("))}function qt(t){return Array.isArray(t.to)&&t.to[0]===null&&(t.to=[...t.to],t.to[0]=t.from),t}function Gt({ease:t,times:s,delay:e,...r}){const i={...r};return s&&(i.offset=s),t&&(i.ease=Kt(t)?t.map(Z):Z(t)),e&&(i.elapsed=-e),i}function Jt(t,s,e){return Array.isArray(s.to)&&(t.duration||(t.duration=800)),qt(s),Qt(t)||(t={...t,...Q(e,s.to)}),{...s,...Gt(t)}}function Qt({delay:t,repeat:s,repeatType:e,repeatDelay:r,from:i,...n}){return!!Object.keys(n).length}function _t(t,s){return t[s]||t.default||t}function te(t,s,e,r,i){const n=_t(r,t);let o=n.from===null||n.from===void 0?s.get():n.from;const a=K(t,e);o==="none"&&a&&typeof e=="string"&&(o=It(t,e));const f=K(t,o);function p(c){const d={from:o,to:e,velocity:r.velocity?r.velocity:s.getVelocity(),onUpdate:x=>s.set(x)};return n.type==="inertia"||n.type==="decay"?ut({...d,...n}):lt({...Jt(n,d,t),onUpdate:x=>{d.onUpdate(x),n.onUpdate&&n.onUpdate(x)},onComplete:()=>{i&&i(),c&&c()}})}function l(c){return s.set(e),i&&i(),c&&c(),{stop:()=>{}}}return!f||!a||n.type===!1?l:p}function ee(){const{motionValues:t,stop:s,get:e}=Ut();return{motionValues:t,stop:s,push:(i,n,o,a={},f)=>{const p=o[i],l=e(i,p,o);if(a&&a.immediate){l.set(n);return}const c=te(i,l,n,a,f);l.start(c)}}}function se(t,s={},{motionValues:e,push:r,stop:i}=ee()){const n=A(s),o=b(!1);h(e,c=>{o.value=Object.values(c).filter(d=>d.isAnimating()).length>0},{immediate:!0,deep:!0});const a=c=>{if(!n||!n[c])throw new Error(`The variant ${c} does not exist.`);return n[c]},f=c=>{typeof c=="string"&&(c=a(c));const d=Object.entries(c).map(([g,E])=>{if(g!=="transition")return new Promise(st=>r(g,E,t,c.transition||Q(g,c[g]),st))}).filter(Boolean);async function x(){var g,E;await Promise.all(d),(E=(g=c.transition)==null?void 0:g.onComplete)==null||E.call(g)}return Promise.all([x()])};return{isAnimating:o,apply:f,set:c=>{const d=nt(c)?c:a(c);Object.entries(d).forEach(([x,g])=>{x!=="transition"&&r(x,g,t,{immediate:!0})})},leave:async c=>{let d;if(n&&(n.leave&&(d=n.leave),!n.leave&&n.initial&&(d=n.initial)),!d){c();return}await f(d),c()},stop:i}}const H=typeof window<"u",ie=()=>H&&(window.onpointerdown===null||(T==null?void 0:T.TEST)),re=()=>H&&(window.ontouchstart===null||(T==null?void 0:T.TEST)),ne=()=>H&&(window.onmousedown===null||(T==null?void 0:T.TEST));function oe({target:t,state:s,variants:e,apply:r}){const i=A(e),n=b(!1),o=b(!1),a=b(!1),f=k(()=>{let l=[...Object.keys(s.value||{})];return i&&(i.hovered&&(l=[...l,...Object.keys(i.hovered)]),i.tapped&&(l=[...l,...Object.keys(i.tapped)]),i.focused&&(l=[...l,...Object.keys(i.focused)])),l}),p=k(()=>{const l={};Object.assign(l,s.value),n.value&&i.hovered&&Object.assign(l,i.hovered),o.value&&i.tapped&&Object.assign(l,i.tapped),a.value&&i.focused&&Object.assign(l,i.focused);for(const c in l)f.value.includes(c)||delete l[c];return l});i.hovered&&(y(t,"mouseenter",()=>n.value=!0),y(t,"mouseleave",()=>{n.value=!1,o.value=!1})),i.tapped&&(ne()&&(y(t,"mousedown",()=>o.value=!0),y(t,"mouseup",()=>o.value=!1)),ie()&&(y(t,"pointerdown",()=>o.value=!0),y(t,"pointerup",()=>o.value=!1)),re()&&(y(t,"touchstart",()=>o.value=!0),y(t,"touchend",()=>o.value=!1))),i.focused&&(y(t,"focus",()=>a.value=!0),y(t,"blur",()=>a.value=!1)),h([n,o,a],()=>{r(p.value)})}function ae({set:t,target:s,variants:e,variant:r}){const i=A(e);h(()=>s,()=>{i&&(i.initial&&(t("initial"),r.value="initial"),i.enter&&(r.value="enter"))},{immediate:!0,flush:"pre"})}function ue({state:t,apply:s}){h(t,e=>{e&&s(e)},{immediate:!0})}function le({target:t,variants:s,variant:e}){const r=A(s);r&&(r.visible||r.visibleOnce)&&ot(t,([{isIntersecting:i}])=>{r.visible?i?e.value="visible":e.value="initial":r.visibleOnce&&(i&&e.value!=="visibleOnce"?e.value="visibleOnce":e.value||(e.value="initial"))})}function ce(t,s={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){s.lifeCycleHooks&&ae(t),s.syncVariants&&ue(t),s.visibilityHooks&&le(t),s.eventListeners&&oe(t)}function fe(t={}){const s=L({...t}),e=b({});return h(s,()=>{const r={};for(const[i,n]of Object.entries(s)){const o=F(i),a=z(n,o);r[i]=a}e.value=r},{immediate:!0,deep:!0}),{state:s,style:e}}function B(t,s){h(()=>jt(t),e=>{e&&s(e)},{immediate:!0})}const pe={x:"translateX",y:"translateY",z:"translateZ"};function de(t={},s=!0){const e=L({...t}),r=b("");return h(e,i=>{let n="",o=!1;if(s&&(i.x||i.y||i.z)){const a=[i.x||0,i.y||0,i.z||0].map(f=>z(f,u)).join(",");n+=`translate3d(${a}) `,o=!0}for(const[a,f]of Object.entries(i)){if(s&&(a==="x"||a==="y"||a==="z"))continue;const p=F(a),l=z(f,p);n+=`${pe[a]||a}(${l}) `}s&&!o&&(n+="translateZ(0px) "),r.value=n.trim()},{immediate:!0,deep:!0}),{state:e,transform:r}}const me=["","X","Y","Z"],ge=["perspective","translate","scale","rotate","skew"],tt=["transformPerspective","x","y","z"];ge.forEach(t=>{me.forEach(s=>{const e=t+s;tt.push(e)})});const be=new Set(tt);function et(t){return be.has(t)}const he=new Set(["originX","originY","originZ"]);function ye(t){return he.has(t)}function ve(t,s){let e,r;const{state:i,style:n}=fe();return B(t,o=>{r=o;for(const a of Object.keys(_))o.style[a]===null||o.style[a]===""||et(a)||ye(a)||(i[a]=o.style[a]);e&&Object.entries(e).forEach(([a,f])=>o.style[a]=f),s&&s(i)}),h(n,o=>{if(!r){e=o;return}for(const a in o)r.style[a]=o[a]},{immediate:!0}),{style:i}}function xe(t){const s=t.trim().split(/\) |\)/);if(s.length===1)return{};const e=r=>r.endsWith("px")||r.endsWith("deg")?Number.parseFloat(r):Number.isNaN(Number(r))?Number(r):r;return s.reduce((r,i)=>{if(!i)return r;const[n,o]=i.split("("),f=o.split(",").map(l=>e(l.endsWith(")")?l.replace(")",""):l.trim())),p=f.length===1?f[0]:f;return{...r,[n]:p}},{})}function Te(t,s){Object.entries(xe(s)).forEach(([e,r])=>{const i=["x","y","z"];if(e==="translate3d"){if(r===0){i.forEach(n=>t[n]=0);return}r.forEach((n,o)=>t[i[o]]=n);return}if(r=Number.parseFloat(`${r}`),e==="translateX"){t.x=r;return}if(e==="translateY"){t.y=r;return}if(e==="translateZ"){t.z=r;return}t[e]=r})}function Ae(t,s){let e,r;const{state:i,transform:n}=de();return B(t,o=>{r=o,o.style.transform&&Te(i,o.style.transform),e&&(o.style.transform=e),s&&s(i)}),h(n,o=>{if(!r){e=o;return}r.style.transform=o},{immediate:!0}),{transform:i}}function Oe(t){return Object.entries(t)}function we(t,s){const e=L({}),r=o=>Object.entries(o).forEach(([a,f])=>e[a]=f),{style:i}=ve(t,r),{transform:n}=Ae(t,r);return h(e,o=>{Oe(o).forEach(([a,f])=>{const p=et(a)?n:i;p[a]&&p[a]===f||(p[a]=f)})},{immediate:!0,deep:!0}),B(t,()=>s),{motionProperties:e,style:i,transform:n}}function Se(t={}){const s=A(t),e=b();return{state:k(()=>{if(e.value)return s[e.value]}),variant:e}}function ke(t,s={},e){const{motionProperties:r}=we(t),{variant:i,state:n}=Se(s),o=se(r,s),a={target:t,variant:i,variants:s,state:n,motionProperties:r,...o};return ce(a,e),a}const Ee={relative:""},je={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},Pe={text:"neutral-300 dark:neutral-500","text-nowrap":""},Ve={"text-nowrap":"","text-3xl":"","font-semibold":""},Ce=G({__name:"PageHeader",props:{title:null,subtitle:null},setup(t){const s=t,e=Ct(),r=J(),i=b(),n=b(s.title),o=b(s.subtitle),{apply:a}=ke(i,{initial:{opacity:0,x:10,transition:{duration:250}},enter:{opacity:1,x:0,transition:{duration:250}},leave:{opacity:0,x:-5,transition:{duration:100}}});return Pt(async()=>{await a("initial"),await a("enter")}),Vt(async()=>{await a("leave")}),h([()=>s.title,()=>s.subtitle,r],async()=>{await a("leave"),n.value=s.title,o.value=s.subtitle,await a("initial"),await a("enter")}),(f,p)=>(D(),M("div",{ref_key:"pageHeaderRef",ref:i,style:{top:"env(safe-area-inset-top, 0px)",right:"env(safe-area-inset-right, 0px)",left:"env(safe-area-inset-left, 0px)"},sticky:"","inset-x-0":"","top-0":"","z-99":"","w-full":"","pb-6":"","pt-10":"",flex:"~ row items-center gap-2",bg:"$bg-color"},[S("button",{onClick:p[0]||(p[0]=l=>A(e).back())},p[1]||(p[1]=[S("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),S("h1",Ee,[o.value?(D(),M("div",je,[S("span",Pe,W(o.value),1)])):Nt("",!0),S("div",Ve,W(n.value),1)])],512))}}),Ne={style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingTop:"env(safe-area-inset-top, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)"}},Re={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},Me={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},Ie=G({__name:"settings",setup(t){const s=J(),{t:e}=Rt(),r=zt(),{allProvidersMetadata:i}=Mt(r),n=k(()=>{const a={"/settings/airi-card":{subtitle:e("settings.title"),title:e("settings.pages.card.title")},"/settings/appearance":{subtitle:e("settings.title"),title:e("settings.pages.themes.title")},"/settings/memory":{subtitle:e("settings.title"),title:e("settings.pages.memory.title")},"/settings/models":{subtitle:e("settings.title"),title:e("settings.pages.models.title")},"/settings/modules":{subtitle:e("settings.title"),title:e("settings.pages.modules.title")},"/settings/modules/consciousness":{subtitle:e("settings.title"),title:e("settings.pages.modules.consciousness.title")},"/settings/modules/speech":{subtitle:e("settings.title"),title:e("settings.pages.modules.speech.title")},"/settings/modules/hearing":{subtitle:e("settings.title"),title:e("settings.pages.modules.hearing.title")},"/settings/modules/memory-short-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-short-term.title")},"/settings/modules/memory-long-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-long-term.title")},"/settings/modules/messaging-discord":{subtitle:e("settings.title"),title:e("settings.pages.modules.messaging-discord.title")},"/settings/modules/x":{subtitle:e("settings.title"),title:e("settings.pages.modules.x.title")},"/settings/modules/gaming-minecraft":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-minecraft.title")},"/settings/modules/gaming-factorio":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-factorio.title")},"/settings/providers":{subtitle:e("settings.title"),title:e("settings.pages.providers.title")},"/settings/scene":{subtitle:e("settings.title"),title:e("settings.pages.scene.title")},"/settings":{title:e("settings.title")}};for(const f of i.value)a[`/settings/providers/${f.id}`]={subtitle:e("settings.title"),title:e(f.nameKey)};return a}),o=k(()=>n.value[s.path]);return(a,f)=>{var p,l;return D(),M("div",Ne,[S("div",Re,[V(Lt)]),S("div",Me,[V(A(Ce),{title:(p=o.value)==null?void 0:p.title,subtitle:(l=o.value)==null?void 0:l.subtitle},null,8,["title","subtitle"]),V(A(Dt))])])}}});export{Ie as default}; diff --git a/assets/speech-Br7XDY4_.js b/assets/speech-Bdg784LP.js similarity index 98% rename from assets/speech-Br7XDY4_.js rename to assets/speech-Bdg784LP.js index 53a0976eda56f5e963b0b4a8089567fabe305d04..3be0302c3044843cbb01cf4b180142306a4c766b 100644 --- a/assets/speech-Br7XDY4_.js +++ b/assets/speech-Bdg784LP.js @@ -1,2 +1,2 @@ -import{v as te,x as p,r as b,h as f,p as P,H as re}from"./index-Bo-ykojl.js";import{r as ne,a as ae,b as oe,d as se}from"./index-LHmcipjy.js";import{u as ce}from"./providers-B3p38pBl.js";const ie=async e=>(e.fetch??globalThis.fetch)(ne("audio/speech",e.baseURL),{body:oe(e),headers:ae({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(se).then(async t=>t.arrayBuffer()),ue=/["&'<>`]/g,le=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,de=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,me=/[|\\{}()[\]^$+*?.]/g,U=new WeakMap;function D(e,t){if(e=e.replace(t.subset?ge(t.subset):ue,n),t.subset||t.escapeOnly)return e;return e.replace(le,r).replace(de,n);function r(a,s,l){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(s+2),t)}function n(a,s,l){return t.format(a.charCodeAt(0),l.charCodeAt(s+1),t)}}function ge(e){let t=U.get(e);return t||(t=pe(e),U.set(e,t)),t}function pe(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:"€"},Se=["cent","copy","divide","gt","lt","not","para","times"],j={}.hasOwnProperty,L={};let S;for(S in C)j.call(C,S)&&(L[C[S]]=S);const xe=/[^\dA-Za-z]/;function Ee(e,t,r,n){const a=String.fromCharCode(e);if(j.call(L,a)){const s=L[a],l="&"+s;return r&&be.includes(s)&&!Se.includes(s)&&(!n||t&&t!==61&&xe.test(String.fromCharCode(t)))?l:l+";"}return""}function we(e,t,r){let n=he(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=Ee(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const s=ye(e,t,r.omitOptionalSemicolons);s.length/g,Te=[">"];function Le(e){return""}function Me(e){return""}const Re=[" ",` +import{v as te,x as p,r as b,h as f,p as P,H as re}from"./index-1_q7hlhr.js";import{r as ne,a as ae,b as oe,d as se}from"./index-LHmcipjy.js";import{u as ce}from"./providers-BQORs1wj.js";const ie=async e=>(e.fetch??globalThis.fetch)(ne("audio/speech",e.baseURL),{body:oe(e),headers:ae({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(se).then(async t=>t.arrayBuffer()),ue=/["&'<>`]/g,le=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,de=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,me=/[|\\{}()[\]^$+*?.]/g,U=new WeakMap;function D(e,t){if(e=e.replace(t.subset?ge(t.subset):ue,n),t.subset||t.escapeOnly)return e;return e.replace(le,r).replace(de,n);function r(a,s,l){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(s+2),t)}function n(a,s,l){return t.format(a.charCodeAt(0),l.charCodeAt(s+1),t)}}function ge(e){let t=U.get(e);return t||(t=pe(e),U.set(e,t)),t}function pe(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:"€"},Se=["cent","copy","divide","gt","lt","not","para","times"],j={}.hasOwnProperty,L={};let S;for(S in C)j.call(C,S)&&(L[C[S]]=S);const xe=/[^\dA-Za-z]/;function Ee(e,t,r,n){const a=String.fromCharCode(e);if(j.call(L,a)){const s=L[a],l="&"+s;return r&&be.includes(s)&&!Se.includes(s)&&(!n||t&&t!==61&&xe.test(String.fromCharCode(t)))?l:l+";"}return""}function we(e,t,r){let n=he(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=Ee(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const s=ye(e,t,r.omitOptionalSemicolons);s.length/g,Te=[">"];function Le(e){return""}function Me(e){return""}const Re=[" ",` `," ",'"',"&","'","/","<","=",">"];function x(e){return y(e,Re)}function F(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 M(e,t){const r=String(e);let n=t.options.quote||'"';if(t.options.quoteSmart){const a=n==='"'?"'":'"';F(r,n)>F(r,a)&&(n=a)}return n+y(r,["<","&",n])+n}function $e(e,t){const r=x(e.name),n=e.public,a=e.system;let s=""}const Ue={}.hasOwnProperty;function Fe(e,t){const r=x(e.name),n=k(e,t),a=e.attributes||{},s=n?!1:t.options.closeEmptyElements,l=[];let h;for(h in a)if(Ue.call(a,h)){const g=a[h];g!=null&&l.push(x(h)+"="+M(g,t))}return"<"+r+(l.length===0?"":" "+l.join(" "))+(s?(t.options.tightClose?"":" ")+"/":"")+">"+n+(s?"":"")}const Ne=/\?>/g,De=[">"];function je(e){const t=x(e.name)||"x",r=y(e.value,De,Ne);return""}const Ie=["&","<"];function I(e){return y(e.value,Ie)}function ze(e,t){return t.options.allowDangerousXml?e.value:I(e)}const ke={}.hasOwnProperty,N={cdata:Le,comment:Me,doctype:$e,element:Fe,instruction:je,raw:ze,root:k,text:I};function z(e,t){const r=e&&e.type;if(!r)throw new Error("Expected node, not `"+e+"`");if(!ke.call(N,r))throw new Error("Cannot compile unknown node `"+r+"`");const n=N[r];return n(e,t)}function k(e,t){const r=e&&e.children||[];let n=-1;const a=[];for(;++n{const e=ce(),t=p("settings/speech/active-provider",""),r=p("settings/speech/active-model","eleven_multilingual_v2"),n=p("settings/speech/voice",""),a=b(),s=p("settings/speech/pitch",0),l=p("settings/speech/rate",1),h=p("settings/speech/ssml-enabled",!1),g=b(!1),E=b(null),v=b({}),H=p("settings/speech/language","en-US"),w=b(""),B=f(()=>e.availableProviders.filter(o=>O(o)).map(o=>e.getProviderMetadata(o))),V=f(()=>{var o;return((o=e.getProviderMetadata(t.value))==null?void 0:o.capabilities.listModels)!==void 0}),A=f(()=>e.getModelsForProvider(t.value)),Y=f(()=>e.isLoadingModels[t.value]||!1),X=f(()=>e.modelLoadError[t.value]||null),G=f(()=>{if(!w.value.trim())return A.value;const o=w.value.toLowerCase().trim();return A.value.filter(c=>c.name.toLowerCase().includes(o)||c.id.toLowerCase().includes(o)||c.description&&c.description.toLowerCase().includes(o))}),_=f(()=>["elevenlabs","microsoft-speech","azure-speech","google","alibaba-cloud-model-studio","volcengine"].includes(t.value));function O(o){return["elevenlabs","microsoft-speech","azure-speech","google","amazon","alibaba-cloud-model-studio","volcengine"].includes(o)}async function q(o){var c,i;if(!o||!O(o))return[];g.value=!0,E.value=null;try{const u=await((i=(c=e.getProviderMetadata(o).capabilities).listVoices)==null?void 0:i.call(c,e.getProviderConfig(o)))||[];return v.value[o]=u,u}catch(u){return console.error(`Error fetching voices for ${o}:`,u),E.value=u instanceof Error?u.message:"Unknown error",[]}finally{g.value=!1}}function K(o){return v.value[o]||[]}P(t,async o=>{o&&await q(o)}),re(()=>{q(t.value).then(()=>{var o;n.value&&(a.value=(o=v.value[t.value])==null?void 0:o.find(c=>c.id===n.value))})}),P(n,o=>{var c;o&&(a.value=(c=v.value[t.value])==null?void 0:c.find(i=>i.id===o))},{immediate:!0}),P(v,o=>{var c;n.value&&(a.value=(c=o[t.value])==null?void 0:c.find(i=>i.id===n.value))},{immediate:!0});async function Q(o,c,i,u,m={}){return await ie({...o.speech(c,{...m}),input:i,voice:u})}function Z(o,c,i){var $;const u=i==null?void 0:i.pitch,m=i==null?void 0:i.speed,d=i==null?void 0:i.volume,W={pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},J=T("speak",{version:"1.0",xmlns:"http://www.w3.org/2001/10/synthesis","xml:lang":(($=c.languages[0])==null?void 0:$.code)||"en-US"},[T("voice",{name:c.id,gender:c.gender||"neutral"},[Object.entries(W).filter(([Ve,ee])=>ee!=null).length>0?T("prosody",{pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},[o]):o])]);return He(J)}return{activeSpeechProvider:t,activeSpeechModel:r,activeSpeechVoice:a,activeSpeechVoiceId:n,pitch:s,rate:l,ssmlEnabled:h,selectedLanguage:H,isLoadingSpeechProviderVoices:g,speechProviderError:E,availableVoices:v,modelSearchQuery:w,availableSpeechProvidersMetadata:B,supportsSSML:_,supportsModelListing:V,providerModels:A,isLoadingActiveProviderModels:Y,activeProviderModelError:X,filteredModels:G,speech:Q,loadVoicesForProvider:q,getVoicesForProvider:K,generateSSML:Z,isSpeechProvider:O}});export{F as c,ie as g,_e as s,Ke as u}; diff --git a/assets/speech-B9N_ypxE.js b/assets/speech-BypMqt94.js similarity index 92% rename from assets/speech-B9N_ypxE.js rename to assets/speech-BypMqt94.js index 226515a2be10f1f1be0f6b8f8aa4a5fc2a9dece4..239ed7eed520b1fd4faf4db2f7df579f658b990e 100644 --- a/assets/speech-B9N_ypxE.js +++ b/assets/speech-BypMqt94.js @@ -1 +1 @@ -import{d as D,r as V,H as ae,p as X,f as re,c as u,o as i,F as H,l as Y,e,q as ve,n as $,m as W,u as K,y as Q,bD as me,j as P,t as y,i as S,b as t,w as I,_ as Z,h as pe,bo as fe,z as ne,A as J,g as ge,s as te,I as xe,K as he,P as be,Q as F,at as ye}from"./index-Bo-ykojl.js";import{_ as se,a as le,b as ke}from"./FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as we}from"./providers-B3p38pBl.js";import{u as _e,g as Se}from"./speech-Br7XDY4_.js";import{_ as Ve}from"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as Me}from"./Textarea.vue_vue_type_script_setup_true_lang-CQ2UPQQ7.js";import{R as Ce,a as $e}from"./RadioCardSimple-C6azzpaa.js";import{_ as Pe}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import{_ as Ue}from"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-lcYV7uD0.js";const Le=D({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(l){const o=l,g=V(Array.from({length:o.bars}).fill(0));ae(()=>{m()}),X(()=>o.stream,()=>{m()});function m(){if(!o.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),f=c.createMediaStreamSource(o.stream),v=c.createAnalyser();v.fftSize=2048,f.connect(v);const h=v.frequencyBinCount,M=new Uint8Array(h),p=c.sampleRate/v.fftSize,k=Math.floor(o.minFreq/p),U=Math.floor(o.maxFreq/p),q=U-k,R=Math.floor(q/o.bars),T=()=>{try{requestAnimationFrame(T),v.getByteFrequencyData(M);const A=Array.from({length:o.bars}).fill(0);for(let z=0;zre(c.$slots,"default",{frequencies:g.value})}}),qe={"h-full":"",flex:"","items-center":"","gap-1":""},Ae=5,Re=D({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(l){const o=l;function g(c,f){return .1+(1-.1)*(c/f)}function m(c,f){const v=g(f,o.frequencies.length);return Math.min(100,Math.max(10,c*100*Ae*v))}return(c,f)=>(i(),u("div",qe,[(i(!0),u(H,null,Y(l.frequencies,(v,h)=>(i(),u("div",{key:h,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(l.barsClass),style:ve({height:`${m(v,h)}%`})},null,6)]))),128))]))}}),Ee={class:"p-3"},Te={class:"flex items-start"},ze=["checked","name","value"],Be={class:"relative mr-3 mt-0.5 flex-shrink-0"},Fe={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"},Ne={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"},De={class:"flex-1 cursor-pointer"},je={class:"flex items-center"},Oe={key:0,class:"mt-1 flex flex-wrap gap-1"},Qe={key:1,class:"mt-3"},He={relative:""},Ge={key:0,class:"h-16 px-3 pb-2"},Je=D({__name:"VoiceCard",props:W({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:W(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(l,{emit:o}){const g=l,m=o,c=K(l,"voice-id"),f=K(l,"custom-voice-name");function v(b){return b.previewURL||b.preview_audio_url}function h(b){var k,U,q;const p=[];if((k=b.labels)!=null&&k.gender&&p.push(b.labels.gender),(U=b.labels)!=null&&U.age&&p.push(b.labels.age),(q=b.labels)!=null&&q.accent&&p.push(b.labels.accent),b.languages&&b.languages.length>0){const R=b.languages.map(T=>T.name).join(", ");p.push(R)}return p}function M(){m("togglePlayback",g.voice)}return(b,p)=>(i(),u("label",{border:"2px solid",class:$(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[c.value===g.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===g.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Ee,[e("div",Te,[Q(e("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>c.value=k),checked:c.value===g.voice.id,type:"radio",name:l.name,value:g.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,ze),[[me,c.value]]),e("div",Be,[e("div",{class:$(["size-5 border-2 rounded-full transition-colors duration-200",[c.value===g.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:$(["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===g.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),v(l.voice)?(i(),u("button",{key:0,absolute:"","right-0":"",top:"0","z-3":"",class:$(["translate-x-[-50%] translate-y-[50%]",[l.currentlyPlayingId===l.voice.id?"text-white dark:text-white":""]]),onClick:M},[l.currentlyPlayingId===l.voice.id?(i(),u("div",Fe)):(i(),u("div",Ie))],2)):(i(),u("div",Ne," No preview available ")),e("div",De,[e("div",je,[e("span",{class:$(["line-clamp-1 font-medium",[c.value===l.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(l.voice.name),3)]),h(l.voice).length>0?(i(),u("div",Oe,[(i(!0),u(H,null,Y(h(l.voice),(k,U)=>(i(),u("span",{key:U,class:$(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===l.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"]])},y(k),3))),128))])):P("",!0),l.voice.customizable&&c.value===l.voice.id?(i(),u("div",Qe,[S(t(Ue),{modelValue:f.value,"onUpdate:modelValue":p[1]||(p[1]=k=>f.value=k),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:l.customInputPlaceholder},null,8,["modelValue","placeholder"])])):P("",!0),l.voice.description?(i(),u("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[c.value===l.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(l.voice.description),3)):P("",!0)])])]),e("div",He,[S(t(Pe),null,{default:I(()=>[l.showVisualizer&&l.currentlyPlayingId===l.voice.id&&l.audioStream?(i(),u("div",Ge,[S(t(Le),{stream:l.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:I(({frequencies:k})=>[S(t(Re),{frequencies:k,"bars-class":c.value===l.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):P("",!0)]),_:1})])],2))}}),Ke=Z(Je,[["__scopeId","data-v-a5ae8da9"]]),Ye={class:"voice-preview-player"},We={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Xe=["placeholder"],Ze={class:"mt-4 space-y-2"},et={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},tt={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"},st={class:"flex flex-col"},lt={class:"font-medium"},ot={class:"text-sm text-amber-600 dark:text-amber-400"},at={class:"relative"},rt=D({__name:"VoiceCardManySelect",props:W({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(l){const o=l,g=V(!1),m=V(),c=V(new Map),f=V(new Map),v=V(new Map),h=V(new Map),M=V(null);function b(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const p=K(l,"search-query"),k=K(l,"voice-id"),U=pe(()=>{if(!p.value)return o.voices;const a=p.value.toLowerCase();return o.voices.filter(r=>{const n=r.name.toLowerCase().includes(a),x=r.description&&r.description.toLowerCase().includes(a),w=r.tags&&r.tags.some(_=>_.toLowerCase().includes(a)),L=r.labels&&Object.values(r.labels).some(_=>typeof _=="string"&&_.toLowerCase().includes(a)),C=r.languages&&r.languages.some(_=>_.name.toLowerCase().includes(a)||_.code.toLowerCase().includes(a));return n||x||w||L||C})});function q(a){return a.previewURL||a.preview_audio_url}function R(a){const r=q(a);if(!r)return null;if(c.value.has(a.id))return c.value.get(a.id)||null;const n=new Audio(r);return n.crossOrigin="anonymous",n.preload="auto",n.addEventListener("ended",()=>{if(m.value===a.id){m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id))}}),c.value.set(a.id,n),n}function T(a,r){try{if(f.value.has(r))return f.value.get(r)||null;const n=b();if(h.value.has(r)){const C=h.value.get(r),_=n.createMediaStreamDestination();C.connect(_);const j=_.stream;return f.value.set(r,j),j}const x=n.createMediaElementSource(a);h.value.set(r,x),x.connect(n.destination);const w=n.createMediaStreamDestination();x.connect(w);const L=w.stream;return f.value.set(r,L),L}catch(n){return console.error("Failed to create audio stream for visualizer:",n),null}}function A(a){try{if(!q(a))return;const n=R(a);if(!n)return;if(m.value===a.id){n.pause(),m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id));return}if(m.value){const x=c.value.get(m.value);x&&x.pause();const w=f.value.get(m.value);w&&(w.getTracks().forEach(L=>L.stop()),f.value.delete(m.value))}o.showVisualizer&&!f.value.has(a.id)&&T(n,a.id),n.currentTime=0,n.play().catch(x=>{console.error("Failed to play audio:",x)}),m.value=a.id}catch(r){console.error(r),m.value=void 0}}function z(){c.value.forEach(a=>{a.pause(),a.src=""}),c.value.clear(),f.value.forEach(a=>{a.getTracks().forEach(r=>r.stop())}),f.value.clear(),v.value.forEach(a=>{a.state!=="closed"&&a.close()}),v.value.clear(),h.value.clear(),m.value=void 0}X(p,()=>{if(m.value){const a=c.value.get(m.value);a&&a.pause();const r=f.value.get(m.value);r&&(r.getTracks().forEach(n=>n.stop()),f.value.delete(m.value)),m.value=void 0}}),fe(z);const B=V("");return(a,r)=>(i(),u("div",Ye,[l.searchable?(i(),u("div",We,[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)),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=n=>p.value=n),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:l.searchPlaceholder},null,8,Xe),[[ne,p.value]])])):P("",!0),e("div",Ze,[p.value?(i(),u("div",et,y(l.searchResultsText.replace("{count}",U.value.length.toString()).replace("{total}",l.voices.length.toString())),1)):P("",!0),p.value&&U.value.length===0?(i(),u("div",tt,[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",st,[e("span",lt,y(l.searchNoResultsTitle),1),e("span",ot,y(l.searchNoResultsDescription.replace("{query}",p.value)),1)])])):P("",!0),e("div",at,[e("div",{class:$(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto scrollbar-none",[g.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"}},[(i(!0),u(H,null,Y(U.value,n=>(i(),J(Ke,{key:n.id,"voice-id":k.value,"onUpdate:voiceId":r[1]||(r[1]=x=>k.value=x),"custom-voice-name":B.value,"onUpdate:customVoiceName":r[2]||(r[2]=x=>B.value=x),name:"voice",voice:n,"currently-playing-id":m.value,"custom-input-placeholder":l.customInputPlaceholder,"show-visualizer":l.showVisualizer,"audio-stream":f.value.get(n.id),onTogglePlayback:A},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:$([g.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:$([g.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]=n=>g.value=!g.value)},[e("span",null,y(g.value?l.collapseButtonText:l.expandButtonText),1),e("div",{class:$([g.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),nt=Z(rt,[["__scopeId","data-v-4dd3b9e2"]]),it=D({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(l){const o=l;return(g,m)=>(i(),u("div",{class:$(["skeleton",o.animation!=="none"?`skeleton-${o.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[re(g.$slots,"default",{},void 0,!0)],2))}}),O=Z(it,[["__scopeId","data-v-f404da2a"]]),ut={flex:"~ col md:row gap-6"},dt={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},ct={flex:"~ col gap-4"},vt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},mt={text:"neutral-400 dark:neutral-500"},pt={"max-w-full":""},ft={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},gt={key:1},xt={key:0},ht={flex:"~ col gap-4"},bt={class:"text-lg md:text-2xl"},yt={text:"neutral-400 dark:neutral-400"},kt={key:0,class:"flex items-center justify-center py-4"},wt={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"},_t={class:"flex flex-col"},St={class:"font-medium"},Vt={class:"text-sm text-red-600 dark:text-red-400"},Mt={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"},Ct={class:"flex flex-col"},$t={class:"font-medium"},Pt={class:"text-sm text-amber-600 dark:text-amber-400"},Ut={key:0},Lt={flex:"~ col gap-4"},qt={key:0},At={class:"flex flex-col gap-4"},Rt={flex:"~ row gap-4"},Et={key:1,class:"space-y-6"},Tt={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"},zt={class:"flex flex-col"},Bt={class:"text-sm text-red-600 dark:text-red-400"},Ft={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"},It={flex:"~ col gap-4"},Nt={key:4,class:"mt-2 space-y-6"},Dt={key:0},jt={flex:"~ col gap-4"},Ot={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Qt={"w-full":"","rounded-xl":""},Ht={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Gt={class:"inline-flex items-center gap-4"},Jt={flex:"~ col gap-4"},Kt={flex:"~ row","gap-4":""},Yt=["disabled"],Wt={flex:"~ row","items-center":"","gap-2":""},Xt=["src"],Zt={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},es=D({__name:"speech",setup(l){const{t:o}=ge(),g=we(),m=_e(),{availableProviders:c,availableAudioSpeechProvidersMetadata:f}=te(g),{activeSpeechProvider:v,activeSpeechModel:h,activeSpeechVoice:M,activeSpeechVoiceId:b,pitch:p,isLoadingSpeechProviderVoices:k,supportsModelListing:U,providerModels:q,isLoadingActiveProviderModels:R,activeProviderModelError:T,modelSearchQuery:A,speechProviderError:z,ssmlEnabled:B,availableVoices:a}=te(m),r=V(""),n=V(!1),x=V("Hello, my name is AI Assistant"),w=V(""),L=V(!1),C=V(""),_=V(null),j=V("");ae(async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)}),X(v,async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)});async function ie(){if(!x.value.trim()&&!n.value||n.value&&!w.value.trim())return;if(!h.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const E=g.getProviderInstance(v.value);if(!E){console.error("Failed to initialize speech provider");return}const s=g.getProviderConfig(v.value);L.value=!0,j.value="";try{C.value&&ee();const N=n.value?w.value:m.generateSSML(x.value,M.value,{...s,pitch:p.value}),G=await Se({...E.speech(h.value,s),input:N,voice:M.value.id});C.value=URL.createObjectURL(new Blob([G])),setTimeout(()=>{_.value&&_.value.play()},100)}catch(N){console.error("Error generating speech:",N),j.value=N instanceof Error?N.message:"An unknown error occurred"}finally{L.value=!1}}function ee(){_.value&&(_.value.pause(),_.value.currentTime=0),C.value&&(URL.revokeObjectURL(C.value),C.value="")}xe(()=>{C.value&&URL.revokeObjectURL(C.value)});function ue(E){M.value={id:E,name:E,description:E,previewURL:E,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function de(E){h.value=E}return(E,s)=>{var G;const N=he("motion");return i(),u(H,null,[e("div",ut,[e("div",dt,[e("div",null,[e("div",ct,[e("div",null,[e("h2",vt,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",mt,[e("span",null,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",pt,[t(c).length>0?(i(),u("fieldset",ft,[(i(!0),u(H,null,Y(t(f),d=>(i(),J(t($e),{id:d.id,key:d.id,modelValue:t(v),"onUpdate:modelValue":s[0]||(s[0]=ce=>F(v)?v.value=ce:null),name:"speech-provider",value:d.id,title:d.localizedName,description:d.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),u("div",gt,[S(t(be),{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[13]||(s[13]=[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,__:[13]})]))])]),e("div",null,[t(v)&&t(U)?(i(),u("div",xt,[e("div",ht,[e("div",null,[e("h2",bt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",yt,[e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(R)?(i(),u("div",kt,[s[14]||(s[14]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(T)?(i(),u("div",wt,[s[15]||(s[15]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",_t,[e("span",St,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Vt,y(t(T)),1)])])):t(q).length===0&&!t(R)?(i(),u("div",Mt,[s[16]||(s[16]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",Ct,[e("span",$t,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Pt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(q).length>0?(i(),J(t(Ce),{key:3,modelValue:t(h),"onUpdate:modelValue":s[1]||(s[1]=d=>F(h)?h.value=d:null),"search-query":t(A),"onUpdate:searchQuery":s[2]||(s[2]=d=>F(A)?A.value=d:null),items:t(q),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(A)}),"search-results-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":de},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):P("",!0)])])):P("",!0)])]),t(v)?(i(),u("div",Ut,[e("div",Lt,[s[27]||(s[27]=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(k)?(i(),u("div",qt,[e("div",At,[S(t(O),{class:"w-full rounded-lg p-2.5 text-sm"},{default:I(()=>s[17]||(s[17]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[17]}),e("div",Rt,[S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[18]||(s[18]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[18]}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[19]}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[20]})]),S(t(O),{class:"w-full rounded-lg p-3 text-sm"},{default:I(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[21]})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(i(),u("div",Et,[S(t(nt),{"search-query":r.value,"onUpdate:searchQuery":s[3]||(s[3]=d=>r.value=d),"voice-id":t(b),"onUpdate:voiceId":s[4]||(s[4]=d=>F(b)?b.value=d:null),voices:(G=t(a)[t(v)])==null?void 0:G.map(d=>({id:d.id,name:d.name,description:d.description,previewURL:d.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":ue},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(z)?(i(),u("div",Tt,[s[23]||(s[23]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",zt,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Bt,y(t(z)),1)])])):(i(),u("div",Ft,s[24]||(s[24]=[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",It,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[5]||(s[5]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"]),S(t(le),{modelValue:t(B),"onUpdate:modelValue":s[6]||(s[6]=d=>F(B)?B.value=d: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?(i(),u("div",Nt,[S(t(Ve),{modelValue:t(b),"onUpdate:modelValue":s[7]||(s[7]=d=>F(b)?b.value=d: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"?(i(),u("div",Dt,[s[26]||(s[26]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),Q(e("select",{"onUpdate:modelValue":s[8]||(s[8]=d=>F(h)?h.value=d:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[25]||(s[25]=[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),[[ye,t(h)]])])):P("",!0),e("div",jt,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[9]||(s[9]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"])])])):P("",!0)])])):P("",!0)]),e("div",Ot,[e("div",Qt,[e("h2",Ht,[e("div",Gt,[S(t(ke)),e("div",null,y(t(o)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Jt,[S(t(le),{modelValue:n.value,"onUpdate:modelValue":s[10]||(s[10]=d=>n.value=d),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),n.value?Q((i(),u("textarea",{key:1,"onUpdate:modelValue":s[12]||(s[12]=d=>w.value=d),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)),[[ne,w.value]]):(i(),J(t(Me),{key:0,modelValue:x.value,"onUpdate:modelValue":s[11]||(s[11]=d=>x.value=d),"h-24":"","w-full":"",placeholder:t(o)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Kt,[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:L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M),class:$({"opacity-50 cursor-not-allowed":L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M)}),bg:"neutral-700 dark:neutral-300",onClick:ie},[e("div",Wt,[s[28]||(s[28]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,y(L.value?t(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Yt),C.value?(i(),u("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:ee},s[29]||(s[29]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):P("",!0)]),C.value?(i(),u("audio",{key:2,ref_key:"audioPlayer",ref:_,src:C.value,controls:"",class:"mt-2 w-full"},null,8,Xt)):P("",!0)])])])]),Q((i(),u("div",Zt,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof oe=="function"&&oe(es);export{es as default}; +import{d as j,r as V,H as ae,p as X,f as re,c as u,o as i,F as H,l as Y,e,q as ve,n as $,m as W,u as K,y as Q,bH as me,j as P,t as y,i as S,b as t,w as I,_ as Z,h as pe,bo as fe,z as ne,A as J,g as ge,s as te,I as xe,K as he,P as be,Q as F,at as ye}from"./index-1_q7hlhr.js";import{_ as se,a as le,b as ke}from"./FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as we}from"./providers-BQORs1wj.js";import{u as _e,g as Se}from"./speech-Bdg784LP.js";import{_ as Ve}from"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as Me}from"./Textarea.vue_vue_type_script_setup_true_lang-Bp9fxHHR.js";import{R as Ce,a as $e}from"./RadioCardSimple-DJEw3oE4.js";import{_ as Pe}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import{_ as Ue}from"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CHbKjm0D.js";const Le=j({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(l){const o=l,g=V(Array.from({length:o.bars}).fill(0));ae(()=>{m()}),X(()=>o.stream,()=>{m()});function m(){if(!o.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),f=c.createMediaStreamSource(o.stream),v=c.createAnalyser();v.fftSize=2048,f.connect(v);const h=v.frequencyBinCount,M=new Uint8Array(h),p=c.sampleRate/v.fftSize,k=Math.floor(o.minFreq/p),U=Math.floor(o.maxFreq/p),q=U-k,R=Math.floor(q/o.bars),T=()=>{try{requestAnimationFrame(T),v.getByteFrequencyData(M);const A=Array.from({length:o.bars}).fill(0);for(let z=0;zre(c.$slots,"default",{frequencies:g.value})}}),qe={"h-full":"",flex:"","items-center":"","gap-1":""},Ae=5,Re=j({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(l){const o=l;function g(c,f){return .1+(1-.1)*(c/f)}function m(c,f){const v=g(f,o.frequencies.length);return Math.min(100,Math.max(10,c*100*Ae*v))}return(c,f)=>(i(),u("div",qe,[(i(!0),u(H,null,Y(l.frequencies,(v,h)=>(i(),u("div",{key:h,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(l.barsClass),style:ve({height:`${m(v,h)}%`})},null,6)]))),128))]))}}),Ee={class:"p-3"},Te={class:"flex items-start"},ze=["checked","name","value"],Be={class:"relative mr-3 mt-0.5 flex-shrink-0"},Fe={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"},Ne={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"},De={class:"flex items-center"},Oe={key:0,class:"mt-1 flex flex-wrap gap-1"},Qe={key:1,class:"mt-3"},He={relative:""},Ge={key:0,class:"h-16 px-3 pb-2"},Je=j({__name:"VoiceCard",props:W({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:W(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(l,{emit:o}){const g=l,m=o,c=K(l,"voice-id"),f=K(l,"custom-voice-name");function v(b){return b.previewURL||b.preview_audio_url}function h(b){var k,U,q;const p=[];if((k=b.labels)!=null&&k.gender&&p.push(b.labels.gender),(U=b.labels)!=null&&U.age&&p.push(b.labels.age),(q=b.labels)!=null&&q.accent&&p.push(b.labels.accent),b.languages&&b.languages.length>0){const R=b.languages.map(T=>T.name).join(", ");p.push(R)}return p}function M(){m("togglePlayback",g.voice)}return(b,p)=>(i(),u("label",{border:"2px solid",class:$(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[c.value===g.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===g.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Ee,[e("div",Te,[Q(e("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>c.value=k),checked:c.value===g.voice.id,type:"radio",name:l.name,value:g.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,ze),[[me,c.value]]),e("div",Be,[e("div",{class:$(["size-5 border-2 rounded-full transition-colors duration-200",[c.value===g.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:$(["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===g.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),v(l.voice)?(i(),u("button",{key:0,absolute:"","right-0":"",top:"0","z-3":"",class:$(["translate-x-[-50%] translate-y-[50%]",[l.currentlyPlayingId===l.voice.id?"text-white dark:text-white":""]]),onClick:M},[l.currentlyPlayingId===l.voice.id?(i(),u("div",Fe)):(i(),u("div",Ie))],2)):(i(),u("div",Ne," No preview available ")),e("div",je,[e("div",De,[e("span",{class:$(["line-clamp-1 font-medium",[c.value===l.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(l.voice.name),3)]),h(l.voice).length>0?(i(),u("div",Oe,[(i(!0),u(H,null,Y(h(l.voice),(k,U)=>(i(),u("span",{key:U,class:$(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===l.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"]])},y(k),3))),128))])):P("",!0),l.voice.customizable&&c.value===l.voice.id?(i(),u("div",Qe,[S(t(Ue),{modelValue:f.value,"onUpdate:modelValue":p[1]||(p[1]=k=>f.value=k),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:l.customInputPlaceholder},null,8,["modelValue","placeholder"])])):P("",!0),l.voice.description?(i(),u("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[c.value===l.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(l.voice.description),3)):P("",!0)])])]),e("div",He,[S(t(Pe),null,{default:I(()=>[l.showVisualizer&&l.currentlyPlayingId===l.voice.id&&l.audioStream?(i(),u("div",Ge,[S(t(Le),{stream:l.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:I(({frequencies:k})=>[S(t(Re),{frequencies:k,"bars-class":c.value===l.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):P("",!0)]),_:1})])],2))}}),Ke=Z(Je,[["__scopeId","data-v-a5ae8da9"]]),Ye={class:"voice-preview-player"},We={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Xe=["placeholder"],Ze={class:"mt-4 space-y-2"},et={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},tt={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"},st={class:"flex flex-col"},lt={class:"font-medium"},ot={class:"text-sm text-amber-600 dark:text-amber-400"},at={class:"relative"},rt=j({__name:"VoiceCardManySelect",props:W({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(l){const o=l,g=V(!1),m=V(),c=V(new Map),f=V(new Map),v=V(new Map),h=V(new Map),M=V(null);function b(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const p=K(l,"search-query"),k=K(l,"voice-id"),U=pe(()=>{if(!p.value)return o.voices;const a=p.value.toLowerCase();return o.voices.filter(r=>{const n=r.name.toLowerCase().includes(a),x=r.description&&r.description.toLowerCase().includes(a),w=r.tags&&r.tags.some(_=>_.toLowerCase().includes(a)),L=r.labels&&Object.values(r.labels).some(_=>typeof _=="string"&&_.toLowerCase().includes(a)),C=r.languages&&r.languages.some(_=>_.name.toLowerCase().includes(a)||_.code.toLowerCase().includes(a));return n||x||w||L||C})});function q(a){return a.previewURL||a.preview_audio_url}function R(a){const r=q(a);if(!r)return null;if(c.value.has(a.id))return c.value.get(a.id)||null;const n=new Audio(r);return n.crossOrigin="anonymous",n.preload="auto",n.addEventListener("ended",()=>{if(m.value===a.id){m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id))}}),c.value.set(a.id,n),n}function T(a,r){try{if(f.value.has(r))return f.value.get(r)||null;const n=b();if(h.value.has(r)){const C=h.value.get(r),_=n.createMediaStreamDestination();C.connect(_);const D=_.stream;return f.value.set(r,D),D}const x=n.createMediaElementSource(a);h.value.set(r,x),x.connect(n.destination);const w=n.createMediaStreamDestination();x.connect(w);const L=w.stream;return f.value.set(r,L),L}catch(n){return console.error("Failed to create audio stream for visualizer:",n),null}}function A(a){try{if(!q(a))return;const n=R(a);if(!n)return;if(m.value===a.id){n.pause(),m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id));return}if(m.value){const x=c.value.get(m.value);x&&x.pause();const w=f.value.get(m.value);w&&(w.getTracks().forEach(L=>L.stop()),f.value.delete(m.value))}o.showVisualizer&&!f.value.has(a.id)&&T(n,a.id),n.currentTime=0,n.play().catch(x=>{console.error("Failed to play audio:",x)}),m.value=a.id}catch(r){console.error(r),m.value=void 0}}function z(){c.value.forEach(a=>{a.pause(),a.src=""}),c.value.clear(),f.value.forEach(a=>{a.getTracks().forEach(r=>r.stop())}),f.value.clear(),v.value.forEach(a=>{a.state!=="closed"&&a.close()}),v.value.clear(),h.value.clear(),m.value=void 0}X(p,()=>{if(m.value){const a=c.value.get(m.value);a&&a.pause();const r=f.value.get(m.value);r&&(r.getTracks().forEach(n=>n.stop()),f.value.delete(m.value)),m.value=void 0}}),fe(z);const B=V("");return(a,r)=>(i(),u("div",Ye,[l.searchable?(i(),u("div",We,[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)),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=n=>p.value=n),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:l.searchPlaceholder},null,8,Xe),[[ne,p.value]])])):P("",!0),e("div",Ze,[p.value?(i(),u("div",et,y(l.searchResultsText.replace("{count}",U.value.length.toString()).replace("{total}",l.voices.length.toString())),1)):P("",!0),p.value&&U.value.length===0?(i(),u("div",tt,[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",st,[e("span",lt,y(l.searchNoResultsTitle),1),e("span",ot,y(l.searchNoResultsDescription.replace("{query}",p.value)),1)])])):P("",!0),e("div",at,[e("div",{class:$(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto scrollbar-none",[g.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"}},[(i(!0),u(H,null,Y(U.value,n=>(i(),J(Ke,{key:n.id,"voice-id":k.value,"onUpdate:voiceId":r[1]||(r[1]=x=>k.value=x),"custom-voice-name":B.value,"onUpdate:customVoiceName":r[2]||(r[2]=x=>B.value=x),name:"voice",voice:n,"currently-playing-id":m.value,"custom-input-placeholder":l.customInputPlaceholder,"show-visualizer":l.showVisualizer,"audio-stream":f.value.get(n.id),onTogglePlayback:A},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:$([g.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:$([g.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]=n=>g.value=!g.value)},[e("span",null,y(g.value?l.collapseButtonText:l.expandButtonText),1),e("div",{class:$([g.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),nt=Z(rt,[["__scopeId","data-v-4dd3b9e2"]]),it=j({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(l){const o=l;return(g,m)=>(i(),u("div",{class:$(["skeleton",o.animation!=="none"?`skeleton-${o.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[re(g.$slots,"default",{},void 0,!0)],2))}}),O=Z(it,[["__scopeId","data-v-f404da2a"]]),ut={flex:"~ col md:row gap-6"},dt={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},ct={flex:"~ col gap-4"},vt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},mt={text:"neutral-400 dark:neutral-500"},pt={"max-w-full":""},ft={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},gt={key:1},xt={key:0},ht={flex:"~ col gap-4"},bt={class:"text-lg md:text-2xl"},yt={text:"neutral-400 dark:neutral-400"},kt={key:0,class:"flex items-center justify-center py-4"},wt={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"},_t={class:"flex flex-col"},St={class:"font-medium"},Vt={class:"text-sm text-red-600 dark:text-red-400"},Mt={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"},Ct={class:"flex flex-col"},$t={class:"font-medium"},Pt={class:"text-sm text-amber-600 dark:text-amber-400"},Ut={key:0},Lt={flex:"~ col gap-4"},qt={key:0},At={class:"flex flex-col gap-4"},Rt={flex:"~ row gap-4"},Et={key:1,class:"space-y-6"},Tt={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"},zt={class:"flex flex-col"},Bt={class:"text-sm text-red-600 dark:text-red-400"},Ft={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"},It={flex:"~ col gap-4"},Nt={key:4,class:"mt-2 space-y-6"},jt={key:0},Dt={flex:"~ col gap-4"},Ot={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Qt={"w-full":"","rounded-xl":""},Ht={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Gt={class:"inline-flex items-center gap-4"},Jt={flex:"~ col gap-4"},Kt={flex:"~ row","gap-4":""},Yt=["disabled"],Wt={flex:"~ row","items-center":"","gap-2":""},Xt=["src"],Zt={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},es=j({__name:"speech",setup(l){const{t:o}=ge(),g=we(),m=_e(),{availableProviders:c,availableAudioSpeechProvidersMetadata:f}=te(g),{activeSpeechProvider:v,activeSpeechModel:h,activeSpeechVoice:M,activeSpeechVoiceId:b,pitch:p,isLoadingSpeechProviderVoices:k,supportsModelListing:U,providerModels:q,isLoadingActiveProviderModels:R,activeProviderModelError:T,modelSearchQuery:A,speechProviderError:z,ssmlEnabled:B,availableVoices:a}=te(m),r=V(""),n=V(!1),x=V("Hello, my name is AI Assistant"),w=V(""),L=V(!1),C=V(""),_=V(null),D=V("");ae(async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)}),X(v,async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)});async function ie(){if(!x.value.trim()&&!n.value||n.value&&!w.value.trim())return;if(!h.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const E=g.getProviderInstance(v.value);if(!E){console.error("Failed to initialize speech provider");return}const s=g.getProviderConfig(v.value);L.value=!0,D.value="";try{C.value&&ee();const N=n.value?w.value:m.generateSSML(x.value,M.value,{...s,pitch:p.value}),G=await Se({...E.speech(h.value,s),input:N,voice:M.value.id});C.value=URL.createObjectURL(new Blob([G])),setTimeout(()=>{_.value&&_.value.play()},100)}catch(N){console.error("Error generating speech:",N),D.value=N instanceof Error?N.message:"An unknown error occurred"}finally{L.value=!1}}function ee(){_.value&&(_.value.pause(),_.value.currentTime=0),C.value&&(URL.revokeObjectURL(C.value),C.value="")}xe(()=>{C.value&&URL.revokeObjectURL(C.value)});function ue(E){M.value={id:E,name:E,description:E,previewURL:E,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function de(E){h.value=E}return(E,s)=>{var G;const N=he("motion");return i(),u(H,null,[e("div",ut,[e("div",dt,[e("div",null,[e("div",ct,[e("div",null,[e("h2",vt,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",mt,[e("span",null,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",pt,[t(c).length>0?(i(),u("fieldset",ft,[(i(!0),u(H,null,Y(t(f),d=>(i(),J(t($e),{id:d.id,key:d.id,modelValue:t(v),"onUpdate:modelValue":s[0]||(s[0]=ce=>F(v)?v.value=ce:null),name:"speech-provider",value:d.id,title:d.localizedName,description:d.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),u("div",gt,[S(t(be),{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[13]||(s[13]=[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,__:[13]})]))])]),e("div",null,[t(v)&&t(U)?(i(),u("div",xt,[e("div",ht,[e("div",null,[e("h2",bt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",yt,[e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(R)?(i(),u("div",kt,[s[14]||(s[14]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(T)?(i(),u("div",wt,[s[15]||(s[15]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",_t,[e("span",St,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Vt,y(t(T)),1)])])):t(q).length===0&&!t(R)?(i(),u("div",Mt,[s[16]||(s[16]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",Ct,[e("span",$t,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Pt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(q).length>0?(i(),J(t(Ce),{key:3,modelValue:t(h),"onUpdate:modelValue":s[1]||(s[1]=d=>F(h)?h.value=d:null),"search-query":t(A),"onUpdate:searchQuery":s[2]||(s[2]=d=>F(A)?A.value=d:null),items:t(q),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(A)}),"search-results-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":de},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):P("",!0)])])):P("",!0)])]),t(v)?(i(),u("div",Ut,[e("div",Lt,[s[27]||(s[27]=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(k)?(i(),u("div",qt,[e("div",At,[S(t(O),{class:"w-full rounded-lg p-2.5 text-sm"},{default:I(()=>s[17]||(s[17]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[17]}),e("div",Rt,[S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[18]||(s[18]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[18]}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[19]}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[20]})]),S(t(O),{class:"w-full rounded-lg p-3 text-sm"},{default:I(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[21]})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(i(),u("div",Et,[S(t(nt),{"search-query":r.value,"onUpdate:searchQuery":s[3]||(s[3]=d=>r.value=d),"voice-id":t(b),"onUpdate:voiceId":s[4]||(s[4]=d=>F(b)?b.value=d:null),voices:(G=t(a)[t(v)])==null?void 0:G.map(d=>({id:d.id,name:d.name,description:d.description,previewURL:d.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":ue},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(z)?(i(),u("div",Tt,[s[23]||(s[23]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",zt,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Bt,y(t(z)),1)])])):(i(),u("div",Ft,s[24]||(s[24]=[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",It,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[5]||(s[5]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"]),S(t(le),{modelValue:t(B),"onUpdate:modelValue":s[6]||(s[6]=d=>F(B)?B.value=d: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?(i(),u("div",Nt,[S(t(Ve),{modelValue:t(b),"onUpdate:modelValue":s[7]||(s[7]=d=>F(b)?b.value=d: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"?(i(),u("div",jt,[s[26]||(s[26]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),Q(e("select",{"onUpdate:modelValue":s[8]||(s[8]=d=>F(h)?h.value=d:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[25]||(s[25]=[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),[[ye,t(h)]])])):P("",!0),e("div",Dt,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[9]||(s[9]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"])])])):P("",!0)])])):P("",!0)]),e("div",Ot,[e("div",Qt,[e("h2",Ht,[e("div",Gt,[S(t(ke)),e("div",null,y(t(o)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Jt,[S(t(le),{modelValue:n.value,"onUpdate:modelValue":s[10]||(s[10]=d=>n.value=d),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),n.value?Q((i(),u("textarea",{key:1,"onUpdate:modelValue":s[12]||(s[12]=d=>w.value=d),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)),[[ne,w.value]]):(i(),J(t(Me),{key:0,modelValue:x.value,"onUpdate:modelValue":s[11]||(s[11]=d=>x.value=d),"h-24":"","w-full":"",placeholder:t(o)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Kt,[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:L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M),class:$({"opacity-50 cursor-not-allowed":L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M)}),bg:"neutral-700 dark:neutral-300",onClick:ie},[e("div",Wt,[s[28]||(s[28]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,y(L.value?t(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Yt),C.value?(i(),u("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:ee},s[29]||(s[29]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):P("",!0)]),C.value?(i(),u("audio",{key:2,ref_key:"audioPlayer",ref:_,src:C.value,controls:"",class:"mt-2 w-full"},null,8,Xt)):P("",!0)])])])]),Q((i(),u("div",Zt,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof oe=="function"&&oe(es);export{es as default}; diff --git a/assets/stage-Csnj3vRj.js b/assets/stage-DvQ3MPQT.js similarity index 84% rename from assets/stage-Csnj3vRj.js rename to assets/stage-DvQ3MPQT.js index 4f1b6835f7b72ea21d3e886715cb8a1a2a6f8bfc..e2fc2fdb1da04047de42b0dc2a4b97d4d36f904e 100644 --- a/assets/stage-Csnj3vRj.js +++ b/assets/stage-DvQ3MPQT.js @@ -1 +1 @@ -import{d as p,M as s,c,i,N as d,q as m,b as e,o as l}from"./index-Bo-ykojl.js";const x=p({__name:"stage",setup(f){const{top:t,right:o,bottom:a,left:n}=s();return(u,_)=>{const r=d("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`})},[i(r)],4)}}});export{x as default}; +import{d as p,M as s,c,i,N as d,q as m,b as e,o as l}from"./index-1_q7hlhr.js";const x=p({__name:"stage",setup(f){const{top:t,right:o,bottom:a,left:n}=s();return(u,_)=>{const r=d("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`})},[i(r)],4)}}});export{x as default}; diff --git a/assets/sury-KxK2jCkG-BJGNYLc8.js b/assets/sury-KxK2jCkG-BJGNYLc8.js deleted file mode 100644 index a705881e581ef100148b1b8dd8b61d1f85811dca..0000000000000000000000000000000000000000 --- a/assets/sury-KxK2jCkG-BJGNYLc8.js +++ /dev/null @@ -1 +0,0 @@ -import{L as r}from"./index-Bo-ykojl.js";import{t as a}from"./mcp-Ce-wxTN6.js";const s=async()=>{const{toJSONSchema:t}=await a(r(()=>import("./__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js"),[]),"sury");return o=>t(o)};export{s as getToJsonSchemaFn}; diff --git a/assets/sury-KxK2jCkG-GNI7Cf4o.js b/assets/sury-KxK2jCkG-GNI7Cf4o.js new file mode 100644 index 0000000000000000000000000000000000000000..6139c694252ba2a3eb39ef209a2af87c88073f25 --- /dev/null +++ b/assets/sury-KxK2jCkG-GNI7Cf4o.js @@ -0,0 +1 @@ +import{L as r}from"./index-1_q7hlhr.js";import{t as a}from"./mcp-DcvIwSEe.js";const s=async()=>{const{toJSONSchema:t}=await a(r(()=>import("./__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js"),[]),"sury");return o=>t(o)};export{s as getToJsonSchemaFn}; diff --git a/assets/three-vrm-animation.module-CbeIjn7h.js b/assets/three-vrm-animation.module-CtUkMEcn.js similarity index 99% rename from assets/three-vrm-animation.module-CbeIjn7h.js rename to assets/three-vrm-animation.module-CtUkMEcn.js index fdce3c7debbea92228cd38aa33c3ba5e8d35421a..b372c7a2f5cabf5cbb27d4f20835dc707094ca6d 100644 --- a/assets/three-vrm-animation.module-CbeIjn7h.js +++ b/assets/three-vrm-animation.module-CtUkMEcn.js @@ -1,4 +1,4 @@ -import{W as N,X as ae,Y as _,Z as z,$ as X,a0 as Bi,a1 as ki,a2 as C,a3 as T,a4 as ee,a5 as le,a6 as zt,a7 as jt,a8 as Xt,a9 as Oe,aa as at,ab as Fi,ac as Hi,ad as Wi,ae as zi,af as ce,ag as xe,ah as U,ai as ji,aj as Y,ak as Xi,al as qi,am as qt,an as lt,ao as Yi,ap as be,aq as Gi,ar as Qi,as as $i}from"./index-Bo-ykojl.js";const et=400,j=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let e=1;ed.getProviderMetadata(o)),i=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});$(()=>{var e,r;d.initializeProvider(o),i.value=((e=a.value[o])==null?void 0:e.apiKey)||"",s.value=((r=a.value[o])==null?void 0:r.baseUrl)||""}),K([i,s],()=>{a.value[o]={...a.value[o],apiKey:i.value,baseUrl:s.value||""}});function b(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return z(),x(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(g).back()},{default:u(()=>[l(t(N),null,{default:u(()=>[l(t(P),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:u(()=>{var p;return[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=h=>i.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as y,g as U,S as V,s as k,h as c,H as $,p as K,A as x,o as z,w as u,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as S}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as w,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const o="together-ai",B=y({__name:"together-ai",setup(I){const{t:m}=U(),g=V(),d=S(),{providers:a}=k(d),n=c(()=>d.getProviderMetadata(o)),i=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.apiKey)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].apiKey=e}}),s=c({get:()=>{var e;return((e=a.value[o])==null?void 0:e.baseUrl)||""},set:e=>{a.value[o]||(a.value[o]={}),a.value[o].baseUrl=e}});$(()=>{var e,r;d.initializeProvider(o),i.value=((e=a.value[o])==null?void 0:e.apiKey)||"",s.value=((r=a.value[o])==null?void 0:r.baseUrl)||""}),K([i,s],()=>{a.value[o]={...a.value[o],apiKey:i.value,baseUrl:s.value||""}});function b(){var e;a.value[o]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return z(),x(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(g).back()},{default:u(()=>[l(t(N),null,{default:u(()=>[l(t(P),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:u(()=>{var p;return[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=h=>i.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/useIconAnimation-CY9TceXA.js b/assets/useIconAnimation-rMzGkkyX.js similarity index 69% rename from assets/useIconAnimation-CY9TceXA.js rename to assets/useIconAnimation-rMzGkkyX.js index 497da12d924d46febfc99841a1bf4f4fb228f27d..374c8fc6d05ad75c3c379eda0503659551c857ad 100644 --- a/assets/useIconAnimation-CY9TceXA.js +++ b/assets/useIconAnimation-rMzGkkyX.js @@ -1 +1 @@ -import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{r as t,G as r,h as u,H as m,I as c}from"./index-Bo-ykojl.js";function d(s){const n=t(!1),o=t(!1),a=t(s),e=r(),i=u(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return m(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),c(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{d as u}; +import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{r as t,G as r,h as u,H as m,I as c}from"./index-1_q7hlhr.js";function d(s){const n=t(!1),o=t(!1),a=t(s),e=r(),i=u(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return m(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),c(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{d as u}; diff --git a/assets/valibot-DJYmUlOb-Ig2w1UvD.js b/assets/valibot-DJYmUlOb-Ig2w1UvD.js deleted file mode 100644 index b3de377231349d90b23b44fb42800c4a51e47910..0000000000000000000000000000000000000000 --- a/assets/valibot-DJYmUlOb-Ig2w1UvD.js +++ /dev/null @@ -1 +0,0 @@ -import{L as r}from"./index-Bo-ykojl.js";import{t as a}from"./mcp-Ce-wxTN6.js";const s=async()=>{const{toJsonSchema:o}=await a(r(()=>import("./index-CShXCEpO.js"),[]),"@valibot/to-json-schema");return t=>o(t)};export{s as getToJsonSchemaFn}; diff --git a/assets/valibot-DJYmUlOb-gwhRnig4.js b/assets/valibot-DJYmUlOb-gwhRnig4.js new file mode 100644 index 0000000000000000000000000000000000000000..cc9994885686634a0145bea456f59767a6657d26 --- /dev/null +++ b/assets/valibot-DJYmUlOb-gwhRnig4.js @@ -0,0 +1 @@ +import{L as r}from"./index-1_q7hlhr.js";import{t as a}from"./mcp-DcvIwSEe.js";const s=async()=>{const{toJsonSchema:o}=await a(r(()=>import("./index-CShXCEpO.js"),[]),"@valibot/to-json-schema");return t=>o(t)};export{s as getToJsonSchemaFn}; diff --git a/assets/vibrant-BcTuel1R.js b/assets/vibrant-C_BHDD4j.js similarity index 88% rename from assets/vibrant-BcTuel1R.js rename to assets/vibrant-C_BHDD4j.js index 1c9218e7650c6f7dd40203cc9d73e2f8c7dab292..6e8ba485b2f2c40cc839b374f1fab16bdc62e657 100644 --- a/assets/vibrant-BcTuel1R.js +++ b/assets/vibrant-C_BHDD4j.js @@ -1 +1 @@ -import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as p}from"./InputFile.vue_vue_type_script_setup_true_lang-CWw-Ysae.js";import{V as g}from"./browser-CkchkNbv.js";import{d as v,r as n,p as _,c as r,o,e as s,F as b,l as h,t as k,i as w,b as x,j as y,q as V}from"./index-Bo-ykojl.js";import"./floating-ui.core-CgBsuaUc.js";const j={flex:"","flex-col":"","gap-4":""},C={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},L={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},N={flex:"","gap-2":""},O={"h-60":"",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","rounded-lg":""},B=["src"],R=v({__name:"vibrant",setup(F){const u=n([]),t=n(),d=n([]),i=n([]);function c(l){const a=new Image;a.src=URL.createObjectURL(l),a.onload=f,t.value=a}async function f(){if(!t.value)return;const a=await new g(t.value).getPalette();d.value=Object.values(a).map(e=>e==null?void 0:e.hex).filter(e=>typeof e=="string"),i.value=Object.values(a).map(e=>JSON.stringify(e))}return _(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",j,[s("div",C,[(o(!0),r(b,null,h(d.value,(e,m)=>(o(),r("div",{key:m,style:V({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",L,k(i.value),1),s("div",N,[w(x(p),{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e),"h-60":"","w-full":""},null,8,["modelValue"])]),s("div",O,[t.value?(o(),r("img",{key:0,src:t.value.src,"h-full":"","w-full":"","object-contain":""},null,8,B)):y("",!0)])]))}});export{R as default}; +import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as p}from"./InputFile.vue_vue_type_script_setup_true_lang-DsrPsbsJ.js";import{V as g}from"./browser-CkchkNbv.js";import{d as v,r as n,p as _,c as r,o,e as s,F as b,l as h,t as k,i as w,b as x,j as y,q as V}from"./index-1_q7hlhr.js";import"./floating-ui.core-CgBsuaUc.js";const j={flex:"","flex-col":"","gap-4":""},C={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},L={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},N={flex:"","gap-2":""},O={"h-60":"",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","rounded-lg":""},B=["src"],R=v({__name:"vibrant",setup(F){const u=n([]),t=n(),d=n([]),i=n([]);function c(l){const a=new Image;a.src=URL.createObjectURL(l),a.onload=f,t.value=a}async function f(){if(!t.value)return;const a=await new g(t.value).getPalette();d.value=Object.values(a).map(e=>e==null?void 0:e.hex).filter(e=>typeof e=="string"),i.value=Object.values(a).map(e=>JSON.stringify(e))}return _(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",j,[s("div",C,[(o(!0),r(b,null,h(d.value,(e,m)=>(o(),r("div",{key:m,style:V({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",L,k(i.value),1),s("div",N,[w(x(p),{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e),"h-60":"","w-full":""},null,8,["modelValue"])]),s("div",O,[t.value?(o(),r("img",{key:0,src:t.value.src,"h-full":"","w-full":"","object-contain":""},null,8,B)):y("",!0)])]))}});export{R as default}; diff --git a/assets/volcengine-DZN8hofQ.js b/assets/volcengine-BgioB2-t.js similarity index 68% rename from assets/volcengine-DZN8hofQ.js rename to assets/volcengine-BgioB2-t.js index 2e013ceb01ca28dc6bd2711386ce4b1395138f59..42e1e9a52a8db4ff6eecfe50da37414a76369d37 100644 --- a/assets/volcengine-DZN8hofQ.js +++ b/assets/volcengine-BgioB2-t.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{d as y,r as w,s as M,g as I,h as c,H as S,p as g,A as x,o as k,w as v,i as f,b as r,e as F}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as $}from"./providers-B3p38pBl.js";import{u as B}from"./speech-Br7XDY4_.js";import{_ as R}from"./FieldInput.vue_vue_type_script_setup_true_lang-DxSQmaoE.js";import{_ as E}from"./FieldRange.vue_vue_type_script_setup_true_lang-B8PofS9C.js";import"./Select.vue_vue_type_style_index_0_lang-CSoknWgh.js";import{_ as H,a as K}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BoWb4lIe.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-BkkmvANx.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dpag3SMb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-5cQDnlor.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BT1wrLfU.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-cMNBZMRQ.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DCWh_PYi.js";const L={flex:"~ col gap-4"},o="volcengine",b="v1",N=y({__name:"volcengine",setup(T){const s=w(1),d=B(),a=$(),{providers:t}=M(a),{t:n}=I(),p=c({get:()=>{var e,i;return((i=(e=t.value[o])==null?void 0:e.app)==null?void 0:i.appId)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].app={appId:e}}}),C=c(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),h=c(()=>d.availableVoices[o]||[]);async function P(e,i,l){const m=a.getProviderInstance(o);if(!m)throw new Error("Failed to initialize speech provider");const u=a.getProviderConfig(o),V=u.model||b;return await d.speech(m,V,e,i,{...u})}return S(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),g(s,async()=>{const e=a.getProviderConfig(o);e.audio||(e.audio={}),e.audio.speedRatio=s.value}),g([t,p],async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(k(),x(r(K),{"provider-id":o,"default-model":b},{"basic-settings":v(()=>[F("div",L,[f(r(R),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=l=>p.value=l),label:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.label"),description:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.description"),required:""},null,8,["modelValue","label","description"])])]),"voice-settings":v(()=>[f(r(E),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),label:r(n)("settings.pages.providers.provider.common.fields.field.speed.label"),description:r(n)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])]),playground:v(()=>[f(r(H),{"available-voices":h.value,"generate-speech":P,"api-key-configured":C.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof _=="function"&&_(N);export{N as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as y,r as w,s as M,g as I,h as c,H as S,p as g,A as x,o as k,w as v,i as f,b as r,e as F}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as $}from"./providers-BQORs1wj.js";import{u as B}from"./speech-Bdg784LP.js";import{_ as R}from"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import{_ as E}from"./FieldRange.vue_vue_type_script_setup_true_lang-DbxTwg5R.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as H,a as K}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BWViBS8t.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";const L={flex:"~ col gap-4"},o="volcengine",b="v1",N=y({__name:"volcengine",setup(T){const s=w(1),d=B(),a=$(),{providers:t}=M(a),{t:n}=I(),p=c({get:()=>{var e,i;return((i=(e=t.value[o])==null?void 0:e.app)==null?void 0:i.appId)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].app={appId:e}}}),C=c(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),h=c(()=>d.availableVoices[o]||[]);async function P(e,i,l){const m=a.getProviderInstance(o);if(!m)throw new Error("Failed to initialize speech provider");const u=a.getProviderConfig(o),V=u.model||b;return await d.speech(m,V,e,i,{...u})}return S(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),g(s,async()=>{const e=a.getProviderConfig(o);e.audio||(e.audio={}),e.audio.speedRatio=s.value}),g([t,p],async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(k(),x(r(K),{"provider-id":o,"default-model":b},{"basic-settings":v(()=>[F("div",L,[f(r(R),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=l=>p.value=l),label:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.label"),description:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.description"),required:""},null,8,["modelValue","label","description"])])]),"voice-settings":v(()=>[f(r(E),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),label:r(n)("settings.pages.providers.provider.common.fields.field.speed.label"),description:r(n)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])]),playground:v(()=>[f(r(H),{"available-voices":h.value,"generate-speech":P,"api-key-configured":C.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof _=="function"&&_(N);export{N as default}; diff --git a/assets/webworkerAll-CcKPzOrL.js b/assets/webworkerAll-CcKPzOrL.js deleted file mode 100644 index 5a93f6384c0b70724876ca56797bcd5849cbddaa..0000000000000000000000000000000000000000 --- a/assets/webworkerAll-CcKPzOrL.js +++ /dev/null @@ -1,533 +0,0 @@ -import{E as B,U as Di,T as Oe,b as Rt,d as U,v as H,u as Z,f as Wi,g as W,h as V,I as de,M as L,D as dt,w as j,R as N,i as Ei,B as be,j as At,G as zr,k as Ur,l as pt,S as qt,m as Hi,P as gt,n as D,e as $,o as Li,p as Vi,q as Vt,s as K,t as Q,x as Se,V as $i,y as $t,z as fe,A as Oi,F as ji}from"./Model.vue_vue_type_script_setup_true_lang-6CsRcxL-.js";import{c as Yi}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BteHK6bt.js";import{bJ as Ni}from"./index-Bo-ykojl.js";import"./three-vrm-animation.module-CbeIjn7h.js";import"./mcp-Ce-wxTN6.js";import"./mini_xsschema-f5xAZ6yD.js";class Gr{static init(t){Object.defineProperty(this,"resizeTo",{set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,r;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,r=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:s}=this._resizeTo;e=i,r=s}this.renderer.resize(e,r),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Gr.extension=B.Application;class Dr{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,Di.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Oe.shared:new Oe,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Dr.extension=B.Application;class qi extends Rt{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return U(H,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return U(H,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return U(H,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return U(H,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return U(H,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(t=!1){var e;this.emit("destroy",this),this.removeAllListeners();for(const r in this.chars)(e=this.chars[r].texture)==null||e.destroy();this.chars=null,t&&(this.pages.forEach(r=>r.texture.destroy(!0)),this.pages=null)}}const je=[{offset:0,color:"white"},{offset:1,color:"black"}],we=class pe{constructor(...t){this.uid=Z("fillGradient"),this.type="linear",this.colorStops=[];let e=Xi(t);e={...e.type==="radial"?pe.defaultRadialOptions:pe.defaultLinearOptions,...Wi(e)},this._textureSize=e.textureSize,this._wrapMode=e.wrapMode,e.type==="radial"?(this.center=e.center,this.outerCenter=e.outerCenter??this.center,this.innerRadius=e.innerRadius,this.outerRadius=e.outerRadius,this.scale=e.scale,this.rotation=e.rotation):(this.start=e.start,this.end=e.end),this.textureSpace=e.textureSpace,this.type=e.type,e.colorStops.forEach(i=>{this.addColorStop(i.offset,i.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:W.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:r,y:i}=this.end,s=r-t,a=i-e;const o=s<0||a<0;if(this._wrapMode==="clamp-to-edge"){if(s<0){const x=t;t=r,r=x,s*=-1}if(a<0){const x=e;e=i,i=x,a*=-1}}const h=this.colorStops.length?this.colorStops:je,c=this._textureSize,{canvas:l,context:u}=Ne(c,1),f=o?u.createLinearGradient(this._textureSize,0,0,0):u.createLinearGradient(0,0,this._textureSize,0);Ye(f,h),u.fillStyle=f,u.fillRect(0,0,c,1),this.texture=new V({source:new de({resource:l,addressMode:this._wrapMode})});const d=Math.sqrt(s*s+a*a),g=Math.atan2(a,s),p=new L;p.scale(d/c,1),p.rotate(g),p.translate(t,e),this.textureSpace==="local"&&p.scale(c,c),this.transform=p}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:je,e=this._textureSize,{canvas:r,context:i}=Ne(e,e),{x:s,y:a}=this.center,{x:o,y:h}=this.outerCenter,c=this.innerRadius,l=this.outerRadius,u=o-l,f=h-l,d=e/(l*2),g=(s-u)*d,p=(a-f)*d,x=i.createRadialGradient(g,p,c*d,(o-u)*d,(h-f)*d,l*d);Ye(x,t),i.fillStyle=t[t.length-1].color,i.fillRect(0,0,e,e),i.fillStyle=x,i.translate(g,p),i.rotate(this.rotation),i.scale(1,this.scale),i.translate(-g,-p),i.fillRect(0,0,e,e),this.texture=new V({source:new de({resource:r,addressMode:this._wrapMode})});const m=new L;m.scale(1/d,1/d),m.translate(u,f),this.textureSpace==="local"&&m.scale(e,e),this.transform=m}get styleKey(){return this.uid}destroy(){var t;(t=this.texture)==null||t.destroy(!0),this.texture=null}};we.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};we.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let tt=we;function Ye(n,t){for(let e=0;e2&&(a.push([h].concat(c.splice(0,2))),l="l",h=h=="m"?"l":"L");;){if(c.length==n[l])return c.unshift(h),a.push(c);if(c.length0&&(i=r.pop(),i?(s=i.startX,a=i.startY):(s=0,a=0)),i=null;break;default:j(`Unknown SVG path command: ${c}`)}c!=="Z"&&c!=="z"&&i===null&&(i={startX:s,startY:a},r.push(i))}return t}class Te{constructor(t=0,e=0,r=0){this.type="circle",this.x=t,this.y=e,this.radius=r}clone(){return new Te(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let i=this.x-t,s=this.y-e;return i*=i,s*=s,i+s<=r}strokeContains(t,e,r,i=.5){if(this.radius===0)return!1;const s=this.x-t,a=this.y-e,o=this.radius,h=(1-i)*r,c=Math.sqrt(s*s+a*a);return c<=o+h&&c>o-(r-h)}getBounds(t){return t||(t=new N),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class ve{constructor(t=0,e=0,r=0,i=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=r,this.halfHeight=i}clone(){return new ve(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let r=(t-this.x)/this.halfWidth,i=(e-this.y)/this.halfHeight;return r*=r,i*=i,r+i<=1}strokeContains(t,e,r,i=.5){const{halfWidth:s,halfHeight:a}=this;if(s<=0||a<=0)return!1;const o=r*(1-i),h=r-o,c=s-h,l=a-h,u=s+o,f=a+o,d=t-this.x,g=e-this.y,p=d*d/(c*c)+g*g/(l*l),x=d*d/(u*u)+g*g/(f*f);return p>1&&x<=1}getBounds(t){return t||(t=new N),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function tn(n,t,e,r,i,s){const a=n-e,o=t-r,h=i-e,c=s-r,l=a*h+o*c,u=h*h+c*c;let f=-1;u!==0&&(f=l/u);let d,g;f<0?(d=e,g=r):f>1?(d=i,g=s):(d=e+f*h,g=r+f*c);const p=n-d,x=t-g;return p*p+x*x}let en,rn;class Pt{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const r=[];for(let i=0,s=e.length;ie!=l>e&&t<(c-o)*((e-h)/(l-h))+o&&(r=!r)}return r}strokeContains(t,e,r,i=.5){const s=r*r,a=s*(1-i),o=s-a,{points:h}=this,c=h.length-(this.closePath?0:2);for(let l=0;li?c:i,s=la?l:a}return t.x=r,t.width=i-r,t.y=s,t.height=a-s,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}}const Ut=(n,t,e,r,i,s,a)=>{const o=n-e,h=t-r,c=Math.sqrt(o*o+h*h);return c>=i-s&&c<=i+a};class Ce{constructor(t=0,e=0,r=0,i=0,s=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=r,this.height=i,this.radius=s}getBounds(t){return t||(t=new N),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Ce(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;let i=t-(this.x+r),s=e-(this.y+r);const a=r*r;if(i*i+s*s<=a||(i=t-(this.x+this.width-r),i*i+s*s<=a)||(s=e-(this.y+this.height-r),i*i+s*s<=a)||(i=t-(this.x+r),i*i+s*s<=a))return!0}return!1}strokeContains(t,e,r,i=.5){const{x:s,y:a,width:o,height:h,radius:c}=this,l=r*(1-i),u=r-l,f=s+c,d=a+c,g=o-c*2,p=h-c*2,x=s+o,m=a+h;return(t>=s-l&&t<=s+u||t>=x-u&&t<=x+l)&&e>=d&&e<=d+p||(e>=a-l&&e<=a+u||e>=m-u&&e<=m+l)&&t>=f&&t<=f+g?!0:tx-c&&ex-c&&e>m-c&&Ut(t,e,x-c,m-c,c,u,l)||tm-c&&Ut(t,e,f,m-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const nn=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` -`);function sn(n){let t="";for(let e=0;e0&&(t+=` -else `),e>>=0;return Wr[e]||hn(n,t,e)}let ee=0;function hn(n,t,e){const r={};let i=0;ee||(ee=Pe());for(let a=0;a0){const a=new Uint8Array(n,e*8,s);new Uint8Array(t,e*8,s).set(a)}}const ln={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};function kt(n,t){return t.alphaMode==="no-premultiply-alpha"&&ln[n]||n}class cn{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t0?Er[--ge]:new un}function Je(n){Er[ge++]=n}let vt=0;const Hr=class Ht{constructor(t={}){this.uid=Z("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],Ht.defaultOptions.maxTextures=Ht.defaultOptions.maxTextures??Pe(),t={...Ht.defaultOptions,...t};const{maxTextures:e,attributesInitialSize:r,indicesInitialSize:i}=t;this.attributeBuffer=new _t(r*4),this.indexBuffer=new Uint16Array(i),this.maxTextures=e}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;tthis.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const h=this.attributeBuffer.float32View,c=this.attributeBuffer.uint32View,l=this.indexBuffer;let u=this._batchIndexSize,f=this._batchIndexStart,d="startBatch";const g=this.maxTextures;for(let p=this.elementStart;p=g||y)&&(this._finishBatch(r,f,u-f,i,a,o,t,d),d="renderBatch",f=u,a=b,o=x.topology,r=Qe(),i=r.textures,i.clear(),++vt),x._textureId=_._textureBindLocation=i.count,i.ids[_.uid]=i.count,i.textures[i.count++]=_,x._batch=r,u+=x.indexSize,x.packAsQuad?(this.packQuadAttributes(x,h,c,x._attributeStart,x._textureId),this.packQuadIndex(l,x._indexStart,x._attributeStart/this.vertexSize)):(this.packAttributes(x,h,c,x._attributeStart,x._textureId),this.packIndex(x,l,x._indexStart,x._attributeStart/this.vertexSize))}i.count>0&&(this._finishBatch(r,f,u-f,i,a,o,t,d),f=u,++vt),this.elementStart=this.elementSize,this._batchIndexStart=f,this._batchIndexSize=u}_finishBatch(t,e,r,i,s,a,o,h){t.gpuBindGroup=null,t.bindGroup=null,t.action=h,t.batcher=this,t.textures=i,t.blendMode=s,t.topology=a,t.start=e,t.size=r,++vt,this.batches[this.batchIndex++]=t,o.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,this.attributeBuffer.size*2),r=new _t(e);Ke(this.attributeBuffer.rawBinaryData,r.rawBinaryData),this.attributeBuffer=r}_resizeIndexBuffer(t){const e=this.indexBuffer;let r=Math.max(t,e.length*1.5);r+=r%2;const i=r>65535?new Uint32Array(r):new Uint16Array(r);if(i.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let s=0;s(n[n.MAP_READ=1]="MAP_READ",n[n.MAP_WRITE=2]="MAP_WRITE",n[n.COPY_SRC=4]="COPY_SRC",n[n.COPY_DST=8]="COPY_DST",n[n.INDEX=16]="INDEX",n[n.VERTEX=32]="VERTEX",n[n.UNIFORM=64]="UNIFORM",n[n.STORAGE=128]="STORAGE",n[n.INDIRECT=256]="INDIRECT",n[n.QUERY_RESOLVE=512]="QUERY_RESOLVE",n[n.STATIC=1024]="STATIC",n))(G||{});class J extends Rt{constructor(t){let{data:e,size:r}=t;const{usage:i,label:s,shrinkToFit:a}=t;super(),this.uid=Z("buffer"),this._resourceType="buffer",this._resourceId=Z("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,r??(r=e==null?void 0:e.byteLength);const o=!!e;this.descriptor={size:r,usage:i,mappedAtCreation:o,label:s},this.shrinkToFit=a??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&G.STATIC)}set static(t){t?this.descriptor.usage|=G.STATIC:this.descriptor.usage&=~G.STATIC}setDataWithSize(t,e,r){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){r&&this.emit("update",this);return}const i=this._data;if(this._data=t,this._dataInt32=null,!i||i.length!==t.length){!this.shrinkToFit&&i&&t.byteLengtho&&(o=d),g>h&&(h=g),de.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const gn=new Float32Array(1),xn=new Uint32Array(1);class mn extends Kt{constructor(){const e=new J({data:gn,label:"attribute-batch-buffer",usage:G.VERTEX|G.COPY_DST,shrinkToFit:!1}),r=new J({data:xn,label:"index-batch-buffer",usage:G.INDEX|G.COPY_DST,shrinkToFit:!1}),i=6*4;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:i,offset:0},aUV:{buffer:e,format:"float32x2",stride:i,offset:2*4},aColor:{buffer:e,format:"unorm8x4",stride:i,offset:4*4},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:i,offset:5*4}},indexBuffer:r})}}function Ze(n,t,e){if(n)for(const r in n){const i=r.toLocaleLowerCase(),s=t[i];if(s){let a=n[r];r==="header"&&(a=a.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&s.push(`//----${e}----//`),s.push(a)}else j(`${r} placement hook does not exist in shader`)}}const _n=/\{\{(.*?)\}\}/g;function tr(n){var r;const t={};return(((r=n.match(_n))==null?void 0:r.map(i=>i.replace(/[{()}]/g,"")))??[]).forEach(i=>{t[i]=[]}),t}function er(n,t){let e;const r=/@in\s+([^;]+);/g;for(;(e=r.exec(n))!==null;)t.push(e[1])}function rr(n,t,e=!1){const r=[];er(t,r),n.forEach(o=>{o.header&&er(o.header,r)});const i=r;e&&i.sort();const s=i.map((o,h)=>` @location(${h}) ${o},`).join(` -`);let a=t.replace(/@in\s+[^;]+;\s*/g,"");return a=a.replace("{{in}}",` -${s} -`),a}function ir(n,t){let e;const r=/@out\s+([^;]+);/g;for(;(e=r.exec(n))!==null;)t.push(e[1])}function yn(n){const e=/\b(\w+)\s*:/g.exec(n);return e?e[1]:""}function bn(n){const t=/@.*?\s+/g;return n.replace(t,"")}function Sn(n,t){const e=[];ir(t,e),n.forEach(h=>{h.header&&ir(h.header,e)});let r=0;const i=e.sort().map(h=>h.indexOf("builtin")>-1?h:`@location(${r++}) ${h}`).join(`, -`),s=e.sort().map(h=>` var ${bn(h)};`).join(` -`),a=`return VSOutput( - ${e.sort().map(h=>` ${yn(h)}`).join(`, -`)});`;let o=t.replace(/@out\s+[^;]+;\s*/g,"");return o=o.replace("{{struct}}",` -${i} -`),o=o.replace("{{start}}",` -${s} -`),o=o.replace("{{return}}",` -${a} -`),o}function nr(n,t){let e=n;for(const r in t){const i=t[r];i.join(` -`).length?e=e.replace(`{{${r}}}`,`//-----${r} START-----// -${i.join(` -`)} -//----${r} FINISH----//`):e=e.replace(`{{${r}}}`,"")}return e}const it=Object.create(null),re=new Map;let wn=0;function Tn({template:n,bits:t}){const e=Vr(n,t);if(it[e])return it[e];const{vertex:r,fragment:i}=Cn(n,t);return it[e]=$r(r,i,t),it[e]}function vn({template:n,bits:t}){const e=Vr(n,t);return it[e]||(it[e]=$r(n.vertex,n.fragment,t)),it[e]}function Cn(n,t){const e=t.map(a=>a.vertex).filter(a=>!!a),r=t.map(a=>a.fragment).filter(a=>!!a);let i=rr(e,n.vertex,!0);i=Sn(e,i);const s=rr(r,n.fragment,!0);return{vertex:i,fragment:s}}function Vr(n,t){return t.map(e=>(re.has(e)||re.set(e,wn++),re.get(e))).sort((e,r)=>e-r).join("-")+n.vertex+n.fragment}function $r(n,t,e){const r=tr(n),i=tr(t);return e.forEach(s=>{Ze(s.vertex,r,s.name),Ze(s.fragment,i,s.name)}),{vertex:nr(n,r),fragment:nr(t,i)}}const Pn=` - @in aPosition: vec2; - @in aUV: vec2; - - @out @builtin(position) vPosition: vec4; - @out vUV : vec2; - @out vColor : vec4; - - {{header}} - - struct VSOutput { - {{struct}} - }; - - @vertex - fn main( {{in}} ) -> VSOutput { - - var worldTransformMatrix = globalUniforms.uWorldTransformMatrix; - var modelMatrix = mat3x3( - 1.0, 0.0, 0.0, - 0.0, 1.0, 0.0, - 0.0, 0.0, 1.0 - ); - var position = aPosition; - var uv = aUV; - - {{start}} - - vColor = vec4(1., 1., 1., 1.); - - {{main}} - - vUV = uv; - - var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix; - - vPosition = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - - vColor *= globalUniforms.uWorldColorAlpha; - - {{end}} - - {{return}} - }; -`,Mn=` - @in vUV : vec2; - @in vColor : vec4; - - {{header}} - - @fragment - fn main( - {{in}} - ) -> @location(0) vec4 { - - {{start}} - - var outColor:vec4; - - {{main}} - - var finalColor:vec4 = outColor * vColor; - - {{end}} - - return finalColor; - }; -`,kn=` - in vec2 aPosition; - in vec2 aUV; - - out vec4 vColor; - out vec2 vUV; - - {{header}} - - void main(void){ - - mat3 worldTransformMatrix = uWorldTransformMatrix; - mat3 modelMatrix = mat3( - 1.0, 0.0, 0.0, - 0.0, 1.0, 0.0, - 0.0, 0.0, 1.0 - ); - vec2 position = aPosition; - vec2 uv = aUV; - - {{start}} - - vColor = vec4(1.); - - {{main}} - - vUV = uv; - - mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix; - - gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); - - vColor *= uWorldColorAlpha; - - {{end}} - } -`,Bn=` - - in vec4 vColor; - in vec2 vUV; - - out vec4 finalColor; - - {{header}} - - void main(void) { - - {{start}} - - vec4 outColor; - - {{main}} - - finalColor = outColor * vColor; - - {{end}} - } -`,Rn={name:"global-uniforms-bit",vertex:{header:` - struct GlobalUniforms { - uProjectionMatrix:mat3x3, - uWorldTransformMatrix:mat3x3, - uWorldColorAlpha: vec4, - uResolution: vec2, - } - - @group(0) @binding(0) var globalUniforms : GlobalUniforms; - `}},An={name:"global-uniforms-bit",vertex:{header:` - uniform mat3 uProjectionMatrix; - uniform mat3 uWorldTransformMatrix; - uniform vec4 uWorldColorAlpha; - uniform vec2 uResolution; - `}};function Me({bits:n,name:t}){const e=Tn({template:{fragment:Mn,vertex:Pn},bits:[Rn,...n]});return Ur.from({name:t,vertex:{source:e.vertex,entryPoint:"main"},fragment:{source:e.fragment,entryPoint:"main"}})}function ke({bits:n,name:t}){return new zr({name:t,...vn({template:{vertex:kn,fragment:Bn},bits:[An,...n]})})}const Or={name:"color-bit",vertex:{header:` - @in aColor: vec4; - `,main:` - vColor *= vec4(aColor.rgb * aColor.a, aColor.a); - `}},jr={name:"color-bit",vertex:{header:` - in vec4 aColor; - `,main:` - vColor *= vec4(aColor.rgb * aColor.a, aColor.a); - `}},ie={};function Fn(n){const t=[];if(n===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let e=0;for(let r=0;r;`),t.push(`@group(1) @binding(${e++}) var textureSampler${r+1}: sampler;`)}return t.join(` -`)}function In(n){const t=[];if(n===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let e=0;e; - @out @interpolate(flat) vTextureId : u32; - `,main:` - vTextureId = aTextureIdAndRound.y; - `,end:` - if(aTextureIdAndRound.x == 1) - { - vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); - } - `},fragment:{header:` - @in @interpolate(flat) vTextureId: u32; - - ${Fn(n)} - `,main:` - var uvDx = dpdx(vUV); - var uvDy = dpdy(vUV); - - ${In(n)} - `}}),ie[n]}const ne={};function zn(n){const t=[];for(let e=0;e0&&t.push("else"),e, targetSize: vec2) -> vec2 - { - return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; - } - `}},Re={name:"round-pixels-bit",vertex:{header:` - vec2 roundPixels(vec2 position, vec2 targetSize) - { - return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; - } - `}},sr={};function qr(n){let t=sr[n];if(t)return t;const e=new Int32Array(n);for(let r=0;r>16|t&65280|(t&255)<<16,r=this.renderable;return r?Hi(e,r.groupColor)+(this.alpha*r.groupAlpha*255<<24):e+(this.alpha*255<<24)}get transform(){var t;return((t=this.renderable)==null?void 0:t.groupTransform)||En}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}}const Bt={extension:{type:B.ShapeBuilder,name:"circle"},build(n,t){let e,r,i,s,a,o;if(n.type==="circle"){const y=n;e=y.x,r=y.y,a=o=y.radius,i=s=0}else if(n.type==="ellipse"){const y=n;e=y.x,r=y.y,a=y.halfWidth,o=y.halfHeight,i=s=0}else{const y=n,T=y.width/2,S=y.height/2;e=y.x+T,r=y.y+S,a=o=Math.max(0,Math.min(y.radius,Math.min(T,S))),i=T-a,s=S-o}if(!(a>=0&&o>=0&&i>=0&&s>=0))return t;const h=Math.ceil(2.3*Math.sqrt(a+o)),c=h*8+(i?4:0)+(s?4:0);if(c===0)return t;if(h===0)return t[0]=t[6]=e+i,t[1]=t[3]=r+s,t[2]=t[4]=e-i,t[5]=t[7]=r-s,t;let l=0,u=h*4+(i?2:0)+2,f=u,d=c,g=i+a,p=s,x=e+g,m=e-g,_=r+p;if(t[l++]=x,t[l++]=_,t[--u]=_,t[--u]=m,s){const y=r-p;t[f++]=m,t[f++]=y,t[--d]=y,t[--d]=x}for(let y=1;y0&&(i[s++]=h,i[s++]=c,i[s++]=h-1),h++;i[s++]=c+1,i[s++]=c,i[s++]=h-1}},Hn={...Bt,extension:{...Bt.extension,name:"ellipse"}},Ln={...Bt,extension:{...Bt.extension,name:"roundedRectangle"}},Jr=1e-4,or=1e-4;function Vn(n){const t=n.length;if(t<6)return 1;let e=0;for(let r=0,i=n[t-2],s=n[t-1];ru&&(u+=Math.PI*2);let f=l;const d=u-l,g=Math.abs(d),p=Math.sqrt(h*h+c*c),x=(15*g*Math.sqrt(p)/Math.PI>>0)+1,m=d/x;if(f+=m,o){a.push(n,t),a.push(e,r);for(let _=1,b=f;_=0&&(o.join==="round"?p+=ct(S,w,S-C*M,w-v*M,S-A*M,w-I*M,d,!1)+4:p+=2,d.push(S-A*F,w-I*F),d.push(S+A*M,w+I*M));continue}const Le=(-C+y)*(-v+w)-(-C+S)*(-v+T),Ve=(-A+k)*(-I+w)-(-A+S)*(-I+R),It=(et*Ve-St*Le)/Ft,zt=(wt*Le-bt*Ve)/Ft,Zt=(It-S)*(It-S)+(zt-w)*(zt-w),at=S+(It-S)*M,ot=w+(zt-w)*M,ht=S-(It-S)*F,lt=w-(zt-w)*F,Ui=Math.min(et*et+bt*bt,St*St+wt*wt),$e=Tt?M:F,Gi=Ui+$e*$e*_;Zt<=Gi?o.join==="bevel"||Zt/_>b?(Tt?(d.push(at,ot),d.push(S+C*F,w+v*F),d.push(at,ot),d.push(S+A*F,w+I*F)):(d.push(S-C*M,w-v*M),d.push(ht,lt),d.push(S-A*M,w-I*M),d.push(ht,lt)),p+=2):o.join==="round"?Tt?(d.push(at,ot),d.push(S+C*F,w+v*F),p+=ct(S,w,S+C*F,w+v*F,S+A*F,w+I*F,d,!0)+4,d.push(at,ot),d.push(S+A*F,w+I*F)):(d.push(S-C*M,w-v*M),d.push(ht,lt),p+=ct(S,w,S-C*M,w-v*M,S-A*M,w-I*M,d,!1)+4,d.push(S-A*M,w-I*M),d.push(ht,lt)):(d.push(at,ot),d.push(ht,lt)):(d.push(S-C*M,w-v*M),d.push(S+C*F,w+v*F),o.join==="round"?Tt?p+=ct(S,w,S+C*F,w+v*F,S+A*F,w+I*F,d,!0)+2:p+=ct(S,w,S-C*M,w-v*M,S-A*M,w-I*M,d,!1)+2:o.join==="miter"&&Zt/_<=b&&(Tt?(d.push(ht,lt),d.push(ht,lt)):(d.push(at,ot),d.push(at,ot)),p+=2),d.push(S-A*M,w-I*M),d.push(S+A*F,w+I*F),p+=2)}y=n[(g-2)*2],T=n[(g-2)*2+1],S=n[(g-1)*2],w=n[(g-1)*2+1],C=-(T-w),v=y-S,O=Math.sqrt(C*C+v*v),C/=O,v/=O,C*=m,v*=m,d.push(S-C*M,w-v*M),d.push(S+C*F,w+v*F),u||(o.cap==="round"?p+=ct(S-C*(M-F)*.5,w-v*(M-F)*.5,S-C*M,w-v*M,S+C*F,w+v*F,d,!1)+2:o.cap==="square"&&(p+=hr(S,w,C,v,M,F,!1,d)));const zi=or*or;for(let z=x;z=0&&a>=0&&(t[0]=r,t[1]=i,t[2]=r+s,t[3]=i,t[4]=r+s,t[5]=i+a,t[6]=r,t[7]=i+a),t},triangulate(n,t,e,r,i,s){let a=0;r*=e,t[r+a]=n[0],t[r+a+1]=n[1],a+=e,t[r+a]=n[2],t[r+a+1]=n[3],a+=e,t[r+a]=n[6],t[r+a+1]=n[7],a+=e,t[r+a]=n[4],t[r+a+1]=n[5],a+=e;const o=r/e;i[s++]=o,i[s++]=o+1,i[s++]=o+2,i[s++]=o+1,i[s++]=o+3,i[s++]=o+2}},qn={extension:{type:B.ShapeBuilder,name:"triangle"},build(n,t){return t[0]=n.x,t[1]=n.y,t[2]=n.x2,t[3]=n.y2,t[4]=n.x3,t[5]=n.y3,t},triangulate(n,t,e,r,i,s){let a=0;r*=e,t[r+a]=n[0],t[r+a+1]=n[1],a+=e,t[r+a]=n[2],t[r+a+1]=n[3],a+=e,t[r+a]=n[4],t[r+a+1]=n[5];const o=r/e;i[s++]=o,i[s++]=o+1,i[s++]=o+2}},Xn=new L,Kn=new N;function Qn(n,t,e,r){const i=t.matrix?n.copyFrom(t.matrix).invert():n.identity();if(t.textureSpace==="local"){const a=e.getBounds(Kn);t.width&&a.pad(t.width);const{x:o,y:h}=a,c=1/a.width,l=1/a.height,u=-o*c,f=-h*l,d=i.a,g=i.b,p=i.c,x=i.d;i.a*=c,i.b*=c,i.c*=l,i.d*=l,i.tx=u*d+f*p+i.tx,i.ty=u*g+f*x+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);const s=t.texture.source.style;return!(t.fill instanceof tt)&&s.addressMode==="clamp-to-edge"&&(s.addressMode="repeat",s.update()),r&&i.append(Xn.copyFrom(r).invert()),i}const Qt={};$.handleByMap(B.ShapeBuilder,Qt);$.add(Nn,Yn,qn,Bt,Hn,Ln);const Jn=new N,Zn=new L;function ts(n,t){const{geometryData:e,batches:r}=t;r.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let i=0;i{const u=o.length,f=s.length/2,d=[],g=Qt[h.type];let p="triangle-list";if(g.build(h,d),c&&Qr(d,c),e){const b=h.closePath??!0,y=t;y.pixelLine?(On(d,b,s,o),p="line-list"):$n(d,y,!1,b,s,o)}else if(l){const b=[],y=d.slice();rs(l).forEach(S=>{b.push(y.length/2),y.push(...S)}),Zr(y,b,s,2,f,o,u)}else g.triangulate(d,s,2,f,o,u);const x=a.length/2,m=t.texture;if(m!==V.WHITE){const b=Qn(Zn,t,h,c);Dn(s,2,f,a,x,2,s.length/2-f,b)}else Wn(a,x,2,s.length/2-f);const _=D.get(Ae);_.indexOffset=u,_.indexSize=o.length-u,_.attributeOffset=f,_.attributeSize=s.length/2-f,_.baseColor=t.color,_.alpha=t.alpha,_.texture=m,_.geometryData=i,_.topology=p,r.push(_)})}function rs(n){const t=[];for(let e=0;e{D.return(r)})}destroy(){for(const t in this._gpuContextHash)this._gpuContextHash[t]&&this.onGraphicsContextDestroy(this._gpuContextHash[t].context)}};Fe.extension={type:[B.WebGLSystem,B.WebGPUSystem,B.CanvasSystem],name:"graphicsContext"};Fe.defaultOptions={bezierSmoothness:.5};let Ie=Fe;const ss=8,Gt=11920929e-14,as=1;function ti(n,t,e,r,i,s,a,o,h,c){const u=Math.min(.99,Math.max(0,c??Ie.defaultOptions.bezierSmoothness));let f=(as-u)/1;return f*=f,os(t,e,r,i,s,a,o,h,n,f),n}function os(n,t,e,r,i,s,a,o,h,c){me(n,t,e,r,i,s,a,o,h,c,0),h.push(a,o)}function me(n,t,e,r,i,s,a,o,h,c,l){if(l>ss)return;const u=(n+e)/2,f=(t+r)/2,d=(e+i)/2,g=(r+s)/2,p=(i+a)/2,x=(s+o)/2,m=(u+d)/2,_=(f+g)/2,b=(d+p)/2,y=(g+x)/2,T=(m+b)/2,S=(_+y)/2;if(l>0){let w=a-n,k=o-t;const R=Math.abs((e-a)*k-(r-o)*w),C=Math.abs((i-a)*k-(s-o)*w);if(R>Gt&&C>Gt){if((R+C)*(R+C)<=c*(w*w+k*k)){h.push(T,S);return}}else if(R>Gt){if(R*R<=c*(w*w+k*k)){h.push(T,S);return}}else if(C>Gt){if(C*C<=c*(w*w+k*k)){h.push(T,S);return}}else if(w=T-(n+a)/2,k=S-(t+o)/2,w*w+k*k<=c){h.push(T,S);return}}me(n,t,u,f,m,_,T,S,h,c,l+1),me(T,S,b,y,p,x,a,o,h,c,l+1)}const hs=8,ls=11920929e-14,cs=1;function us(n,t,e,r,i,s,a,o){const c=Math.min(.99,Math.max(0,o??Ie.defaultOptions.bezierSmoothness));let l=(cs-c)/1;return l*=l,ds(t,e,r,i,s,a,n,l),n}function ds(n,t,e,r,i,s,a,o){_e(a,n,t,e,r,i,s,o,0),a.push(i,s)}function _e(n,t,e,r,i,s,a,o,h){if(h>hs)return;const c=(t+r)/2,l=(e+i)/2,u=(r+s)/2,f=(i+a)/2,d=(c+u)/2,g=(l+f)/2;let p=s-t,x=a-e;const m=Math.abs((r-s)*x-(i-a)*p);if(m>ls){if(m*m<=o*(p*p+x*x)){n.push(d,g);return}}else if(p=d-(t+s)/2,x=g-(e+a)/2,p*p+x*x<=o){n.push(d,g);return}_e(n,t,e,c,l,d,g,o,h+1),_e(n,d,g,u,f,s,a,o,h+1)}function ei(n,t,e,r,i,s,a,o){let h=Math.abs(i-s);(!a&&i>s||a&&s>i)&&(h=2*Math.PI-h),o||(o=Math.max(6,Math.floor(6*Math.pow(r,1/3)*(h/Math.PI)))),o=Math.max(o,3);let c=h/o,l=i;c*=a?-1:1;for(let u=0;uu*h)}const Mt=Math.PI*2,se={centerX:0,centerY:0,ang1:0,ang2:0},ae=({x:n,y:t},e,r,i,s,a,o,h)=>{n*=e,t*=r;const c=i*n-s*t,l=s*n+i*t;return h.x=c+a,h.y=l+o,h};function ps(n,t){const e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),r=t===1.5707963267948966?.551915024494:e,i=Math.cos(n),s=Math.sin(n),a=Math.cos(n+t),o=Math.sin(n+t);return[{x:i-s*r,y:s+i*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]}const cr=(n,t,e,r)=>{const i=n*r-t*e<0?-1:1;let s=n*e+t*r;return s>1&&(s=1),s<-1&&(s=-1),i*Math.acos(s)},gs=(n,t,e,r,i,s,a,o,h,c,l,u,f)=>{const d=Math.pow(i,2),g=Math.pow(s,2),p=Math.pow(l,2),x=Math.pow(u,2);let m=d*g-d*x-g*p;m<0&&(m=0),m/=d*x+g*p,m=Math.sqrt(m)*(a===o?-1:1);const _=m*i/s*u,b=m*-s/i*l,y=c*_-h*b+(n+e)/2,T=h*_+c*b+(t+r)/2,S=(l-_)/i,w=(u-b)/s,k=(-l-_)/i,R=(-u-b)/s,C=cr(1,0,S,w);let v=cr(S,w,k,R);o===0&&v>0&&(v-=Mt),o===1&&v<0&&(v+=Mt),f.centerX=y,f.centerY=T,f.ang1=C,f.ang2=v};function xs(n,t,e,r,i,s,a,o=0,h=0,c=0){if(s===0||a===0)return;const l=Math.sin(o*Mt/360),u=Math.cos(o*Mt/360),f=u*(t-r)/2+l*(e-i)/2,d=-l*(t-r)/2+u*(e-i)/2;if(f===0&&d===0)return;s=Math.abs(s),a=Math.abs(a);const g=Math.pow(f,2)/Math.pow(s,2)+Math.pow(d,2)/Math.pow(a,2);g>1&&(s*=Math.sqrt(g),a*=Math.sqrt(g)),gs(t,e,r,i,s,a,h,c,l,u,f,d,se);let{ang1:p,ang2:x}=se;const{centerX:m,centerY:_}=se;let b=Math.abs(x)/(Mt/4);Math.abs(1-b)<1e-7&&(b=1);const y=Math.max(Math.ceil(b),1);x/=y;let T=n[n.length-2],S=n[n.length-1];const w={x:0,y:0};for(let k=0;k{const h=o.x-a.x,c=o.y-a.y,l=Math.sqrt(h*h+c*c),u=h/l,f=c/l;return{len:l,nx:u,ny:f}},i=(a,o)=>{a===0?n.moveTo(o.x,o.y):n.lineTo(o.x,o.y)};let s=t[t.length-1];for(let a=0;a0&&(d=-1,g=!0);const p=f/2;let x,m=Math.abs(Math.cos(p)*h/Math.sin(p));m>Math.min(l.len/2,u.len/2)?(m=Math.min(l.len/2,u.len/2),x=Math.abs(m*Math.sin(p)/Math.cos(p))):x=h;const _=o.x+u.nx*m+-u.ny*x*d,b=o.y+u.ny*m+u.nx*x*d,y=Math.atan2(l.ny,l.nx)+Math.PI/2*d,T=Math.atan2(u.ny,u.nx)-Math.PI/2*d;a===0&&n.moveTo(_+Math.cos(y)*x,b+Math.sin(y)*x),n.arc(_,b,x,y,T,g),s=o}}function _s(n,t,e,r){const i=(o,h)=>Math.sqrt((o.x-h.x)**2+(o.y-h.y)**2),s=(o,h,c)=>({x:o.x+(h.x-o.x)*c,y:o.y+(h.y-o.y)*c}),a=t.length;for(let o=0;o1){let s=null;for(let a=i;a=2;u-=2)l[u]===l[u-2]&&l[u-1]===l[u-3]&&l.splice(u-1,2);return this.poly(l,!0,a)}ellipse(t,e,r,i,s){return this.drawShape(new ve(t,e,r,i),s),this}roundRect(t,e,r,i,s,a){return this.drawShape(new Ce(t,e,r,i,s),a),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let r=this._currentPoly;return r&&this.endPoly(),r=new Pt,r.points.push(t,e),this._currentPoly=r,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new Pt,t)){const e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let r=e.shape.x,i=e.shape.y;if(e.transform&&!e.transform.isIdentity()){const s=e.transform,a=r;r=s.a*r+s.c*i+s.tx,i=s.b*a+s.d*i+s.ty}this._currentPoly.points.push(r,i)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;eparseInt(R,10)),t.context.poly(b,!0),e&&t.context.fill(e),r&&t.context.stroke(r);break;case"polyline":y=n.getAttribute("points"),b=y.match(/\d+/g).map(R=>parseInt(R,10)),t.context.poly(b,!1),r&&t.context.stroke(r);break;case"g":case"svg":break;default:{j(`[SVG parser] <${n.nodeName}> elements unsupported`);break}}o&&(e=null);for(let R=0;R{this._fill=ut({...this._originalFill},Y.defaultFillStyle)})),this._fill=ut(t===0?"black":t,Y.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...Y.defaultStrokeStyle,...t},()=>{this._stroke=Ot({...this._originalStroke},Y.defaultStrokeStyle)})),this._stroke=Ot(t,Y.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=ni(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const t=mt.defaultTextStyle;for(const e in t)this[e]=t[e]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new mt({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth})}destroy(t=!1){var r,i,s,a;if(this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const o=typeof t=="boolean"?t:t==null?void 0:t.textureSource;(r=this._fill)!=null&&r.texture&&this._fill.texture.destroy(o),(i=this._originalFill)!=null&&i.texture&&this._originalFill.texture.destroy(o),(s=this._stroke)!=null&&s.texture&&this._stroke.texture.destroy(o),(a=this._originalStroke)!=null&&a.texture&&this._originalStroke.texture.destroy(o)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,e){return new Proxy(t,{set:(r,i,s)=>(r[i]=s,e==null||e(i,s),this.update(),!0)})}_isFillStyle(t){return(t??null)!==null&&!(W.isColorLike(t)||t instanceof tt||t instanceof Xt)}};Ue.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Ue.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let nt=Ue;function Is(n){const t=n;if(typeof t.dropShadow=="boolean"&&t.dropShadow){const e=nt.defaultDropShadow;n.dropShadow={alpha:t.dropShadowAlpha??e.alpha,angle:t.dropShadowAngle??e.angle,blur:t.dropShadowBlur??e.blur,color:t.dropShadowColor??e.color,distance:t.dropShadowDistance??e.distance}}if(t.strokeThickness!==void 0){U(H,"strokeThickness is now a part of stroke");const e=t.stroke;let r={};if(W.isColorLike(e))r.color=e;else if(e instanceof tt||e instanceof Xt)r.fill=e;else if(Object.hasOwnProperty.call(e,"color")||Object.hasOwnProperty.call(e,"fill"))r=e;else throw new Error("Invalid stroke value.");n.stroke={...r,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){U(H,"gradient fill is now a fill pattern: `new FillGradient(...)`");let e;n.fontSize==null?n.fontSize=nt.defaultTextStyle.fontSize:typeof n.fontSize=="string"?e=parseInt(n.fontSize,10):e=n.fontSize;const r=new tt({start:{x:0,y:0},end:{x:0,y:(e||0)*1.7}}),i=t.fillGradientStops.map(s=>W.shared.setValue(s).toNumber());i.forEach((s,a)=>{const o=a/(i.length-1);r.addColorStop(o,s)}),n.fill={fill:r}}}class zs{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,e){const r=dt.get().createCanvas();r.width=t,r.height=e;const i=r.getContext("2d");return{canvas:r,context:i}}getOptimalCanvasAndContext(t,e,r=1){t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6),t=Vt(t),e=Vt(e);const i=(t<<17)+(e<<1);this._canvasPool[i]||(this._canvasPool[i]=[]);let s=this._canvasPool[i].pop();return s||(s=this._createCanvasAndContext(t,e)),s}returnCanvasAndContext(t){const e=t.canvas,{width:r,height:i}=e,s=(r<<17)+(i<<1);t.context.clearRect(0,0,r,i),this._canvasPool[s].push(t)}clear(){this._canvasPool={}}}const ft=new zs,Us=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function jt(n){const t=typeof n.fontSize=="number"?`${n.fontSize}px`:n.fontSize;let e=n.fontFamily;Array.isArray(n.fontFamily)||(e=n.fontFamily.split(","));for(let r=e.length-1;r>=0;r--){let i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!Us.includes(i)&&(i=`"${i}"`),e[r]=i}return`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${t} ${e.join(",")}`}const oe={willReadFrequently:!0},q=class P{static get experimentalLetterSpacingSupported(){let t=P._experimentalLetterSpacingSupported;if(t!==void 0){const e=dt.get().getCanvasRenderingContext2D().prototype;t=P._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,r,i,s,a,o,h,c){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=s,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=c}static measureText(t=" ",e,r=P._canvas,i=e.wordWrap){var _;const s=`${t}:${e.styleKey}`;if(P._measurementCache[s])return P._measurementCache[s];const a=jt(e),o=P.measureFont(a);o.fontSize===0&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);const h=P.__context;h.font=a;const l=(i?P._wordWrap(t,e,r):t).split(/(?:\r\n|\r|\n)/),u=new Array(l.length);let f=0;for(let b=0;b0)if(i)a-=e,c-=e;else{const l=(P.graphemeSegmenter(t).length-1)*e;a+=l,c+=l}return Math.max(a,c)}static _wordWrap(t,e,r=P._canvas){const i=r.getContext("2d",oe);let s=0,a="",o="";const h=Object.create(null),{letterSpacing:c,whiteSpace:l}=e,u=P._collapseSpaces(l),f=P._collapseNewlines(l);let d=!u;const g=e.wordWrapWidth+c,p=P._tokenize(t);for(let x=0;xg)if(a!==""&&(o+=P._addLine(a),a="",s=0),P.canBreakWords(m,e.breakWords)){const b=P.wordWrapSplit(m);for(let y=0;yg&&(o+=P._addLine(a),d=!1,a="",s=0),a+=T,s+=k}}else{a.length>0&&(o+=P._addLine(a),a="",s=0);const b=x===p.length-1;o+=P._addLine(m,!b),d=!1,a="",s=0}else _+s>g&&(d=!1,o+=P._addLine(a),a="",s=0),(a.length>0||!P.isBreakingSpace(m)||d)&&(a+=m,s+=_)}return o+=P._addLine(a,!1),o}static _addLine(t,e=!0){return t=P._trimRight(t),t=e?`${t} -`:t,t}static _getFromCache(t,e,r,i){let s=r[t];return typeof s!="number"&&(s=P._measureText(t,e,i)+e,r[t]=s),s}static _collapseSpaces(t){return t==="normal"||t==="pre-line"}static _collapseNewlines(t){return t==="normal"}static _trimRight(t){if(typeof t!="string")return"";for(let e=t.length-1;e>=0;e--){const r=t[e];if(!P.isBreakingSpace(r))break;t=t.slice(0,-1)}return t}static _isNewline(t){return typeof t!="string"?!1:P._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:P._breakingSpaces.includes(t.charCodeAt(0))}static _tokenize(t){const e=[];let r="";if(typeof t!="string")return e;for(let i=0;i{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const n=new Intl.Segmenter;return t=>[...n.segment(t)].map(e=>e.segment)}return n=>[...n]})();q.experimentalLetterSpacing=!1;q._fonts={};q._newlines=[10,13];q._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];q._measurementCache={};let rt=q;const br=1e5;function Yt(n,t,e,r=0){if(n.texture===V.WHITE&&!n.fill)return W.shared.setValue(n.color).setAlpha(n.alpha??1).toHexa();if(n.fill){if(n.fill instanceof Xt){const i=n.fill,s=t.createPattern(i.texture.source.resource,"repeat"),a=i.transform.copyTo(L.shared);return a.scale(i.texture.frame.width,i.texture.frame.height),s.setTransform(a),s}else if(n.fill instanceof tt){const i=n.fill,s=i.type==="linear",a=i.textureSpace==="local";let o=1,h=1;a&&e&&(o=e.width+r,h=e.height+r);let c,l=!1;if(s){const{start:u,end:f}=i;c=t.createLinearGradient(u.x*o,u.y*h,f.x*o,f.y*h),l=Math.abs(f.x-u.x){const p=d+g.offset*u;c.addColorStop(Math.floor(p*br)/br,W.shared.setValue(g.color).toHex())})}}else i.colorStops.forEach(u=>{c.addColorStop(u.offset,W.shared.setValue(u.color).toHex())});return c}}else{const i=t.createPattern(n.texture.source.resource,"repeat"),s=n.matrix.copyTo(L.shared);return s.scale(n.texture.frame.width,n.texture.frame.height),i.setTransform(s),i}return j("FillStyle not recognised",n),"red"}function ai(n){if(n==="")return[];typeof n=="string"&&(n=[n]);const t=[];for(let e=0,r=n.length;e!this._currentChars.includes(_)).filter((_,b,y)=>y.indexOf(_)===b);if(!e.length)return;this._currentChars=[...this._currentChars,...e];let r;this._currentPageIndex===-1?r=this._nextPage():r=this.pages[this._currentPageIndex];let{canvas:i,context:s}=r.canvasAndContext,a=r.texture.source;const o=this._style;let h=this._currentX,c=this._currentY;const l=this.baseRenderedFontSize/this.baseMeasurementFontSize,u=this._padding*l;let f=0,d=!1;const g=i.width/this.resolution,p=i.height/this.resolution;for(let _=0;_g&&(c+=f,f=R,h=0,c+f>p)){a.update();const v=this._nextPage();i=v.canvasAndContext.canvas,s=v.canvasAndContext.context,a=v.texture.source,c=0}const C=T/l-(((x=o.dropShadow)==null?void 0:x.distance)??0)-(((m=o._stroke)==null?void 0:m.width)??0);if(this.chars[b]={id:b.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:C,kerning:{}},d){this._drawGlyph(s,y,h+u,c+u,l,o);const v=a.width*l,A=a.height*l,I=new N(h/v*a.width,c/A*a.height,k/v*a.width,R/A*a.height);this.chars[b].texture=new V({source:a,frame:I}),h+=Math.ceil(k)}}a.update(),this._currentX=h,this._currentY=c,this._skipKerning&&this._applyKerning(e,s)}get pageTextures(){return U(H,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(t,e){const r=this._measureCache;for(let i=0;i{const p=s.width;for(let x=0;x{let g=s.chars.length-1;if(r){let p=s.chars[g];for(;p===" ";)s.width-=e.chars[p].xAdvance,p=s.chars[--g]}i.width=Math.max(i.width,s.width),s={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},o=!0,i.lines.push(s),i.height+=e.lineHeight},u=e.baseMeasurementFontSize/t.fontSize,f=t.letterSpacing*u,d=t.wordWrapWidth*u;for(let g=0;gd?(l(),c(h),x||s.charPositions.push(0)):(h.start=s.width,c(h),x||s.charPositions.push(0)),p==="\r"||p===` -`)s.width!==0&&l();else if(!x){const T=m.xAdvance+(m.kerning[a]||0)+f;s.width+=T,s.spaceWidth=T,s.spacesIndex.push(s.charPositions.length),s.chars.push(p)}}else{const y=m.kerning[a]||0,T=m.xAdvance+y+f;h.positions[h.index++]=h.width+y,h.chars.push(p),h.width+=T}a=p}return l(),t.align==="center"?Gs(i):t.align==="right"?Ds(i):t.align==="justify"&&Ws(i),i}function Gs(n){for(let t=0;t50&&j("BitmapText",`You have dynamically created ${Dt} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),o.once("destroy",()=>{Dt--,K.remove(r)}),K.set(r,o)}const s=K.get(r);return(a=s.ensureCharacters)==null||a.call(s,t),s}getLayout(t,e,r=!0){const i=this.getFont(t,e);return li([...t],e,i,r)}measureText(t,e,r=!0){return this.getLayout(t,e,r)}install(...t){var c,l,u,f;let e=t[0];typeof e=="string"&&(e={name:e,style:t[1],chars:(c=t[2])==null?void 0:c.chars,resolution:(l=t[2])==null?void 0:l.resolution,padding:(u=t[2])==null?void 0:u.padding,skipKerning:(f=t[2])==null?void 0:f.skipKerning},U(H,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const r=e==null?void 0:e.name;if(!r)throw new Error("[BitmapFontManager] Property `name` is required.");e={...this.defaultOptions,...e};const i=e.style,s=i instanceof nt?i:new nt(i),a=s._fill.fill!==null&&s._fill.fill!==void 0,o=new Sr({style:s,overrideFill:a,skipKerning:e.skipKerning,padding:e.padding,resolution:e.resolution,overrideSize:!1}),h=ai(e.chars);return o.ensureCharacters(h.join("")),K.set(`${r}-bitmap`,o),o.once("destroy",()=>K.remove(`${r}-bitmap`)),o}uninstall(t){const e=`${t}-bitmap`,r=K.get(e);r&&r.destroy()}}const Hs=new Es;class ci{constructor(t){this._renderer=t}push(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:e,filterEffect:t})}pop(t,e,r){this._renderer.renderPipes.batch.break(r),r.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(t){t.action==="pushFilter"?this._renderer.filter.push(t):t.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}}ci.extension={type:[B.WebGLPipes,B.WebGPUPipes,B.CanvasPipes],name:"filter"};function Ls(n,t){t.clear();const e=t.matrix;for(let r=0;r"},uInputPixel:{value:new Float32Array(4),type:"vec4"},uInputClamp:{value:new Float32Array(4),type:"vec4"},uOutputFrame:{value:new Float32Array(4),type:"vec4"},uGlobalFrame:{value:new Float32Array(4),type:"vec4"},uOutputTexture:{value:new Float32Array(4),type:"vec4"}}),this._globalFilterBindGroup=new be({}),this.renderer=t}get activeBackTexture(){var t;return(t=this._activeFilterData)==null?void 0:t.backTexture}push(t){var d;const e=this.renderer,r=t.filterEffect.filters;this._filterStack[this._filterStackIndex]||(this._filterStack[this._filterStackIndex]=this._getFilterData());const i=this._filterStack[this._filterStackIndex];if(this._filterStackIndex++,r.length===0){i.skip=!0;return}const s=i.bounds;if(t.renderables?Ls(t.renderables,s):t.filterEffect.filterArea?(s.clear(),s.addRect(t.filterEffect.filterArea),s.applyMatrix(t.container.worldTransform)):t.container.getFastGlobalBounds(!0,s),t.container){const p=(t.container.renderGroup||t.container.parentRenderGroup).cacheToLocalTransform;p&&s.applyMatrix(p)}const a=e.renderTarget.renderTarget.colorTexture.source;let o=1/0,h=0,c=!0,l=!1,u=!1,f=!0;for(let g=0;g0?this._filterStack[this._filterStackIndex-1].bounds:null,h=t.renderTarget.getRenderTarget(e.previousRenderSurface);s=this.getBackTexture(h,i,o)}e.backTexture=s;const a=e.filterEffect.filters;if(this._globalFilterBindGroup.setResource(r.source.style,2),this._globalFilterBindGroup.setResource(s.source,3),t.globalUniforms.pop(),a.length===1)a[0].apply(this,r,e.previousRenderSurface,!1),Q.returnTexture(r);else{let o=e.inputTexture,h=Q.getOptimalTexture(i.width,i.height,o.source._resolution,!1),c=0;for(c=0;c0&&this._filterStack[f].skip;)--f;f>0&&(u=this._filterStack[f].inputTexture.source._resolution);const d=this._filterGlobalUniforms,g=d.uniforms,p=g.uOutputFrame,x=g.uInputSize,m=g.uInputPixel,_=g.uInputClamp,b=g.uGlobalFrame,y=g.uOutputTexture;if(l){let w=this._filterStackIndex;for(;w>0;){w--;const k=this._filterStack[this._filterStackIndex-1];if(!k.skip){h.x=k.bounds.minX,h.y=k.bounds.minY;break}}p[0]=o.minX-h.x,p[1]=o.minY-h.y}else p[0]=0,p[1]=0;p[2]=e.frame.width,p[3]=e.frame.height,x[0]=e.source.width,x[1]=e.source.height,x[2]=1/x[0],x[3]=1/x[1],m[0]=e.source.pixelWidth,m[1]=e.source.pixelHeight,m[2]=1/m[0],m[3]=1/m[1],_[0]=.5*m[2],_[1]=.5*m[3],_[2]=e.frame.width*x[2]-.5*m[2],_[3]=e.frame.height*x[3]-.5*m[3];const T=this.renderer.renderTarget.rootRenderTarget.colorTexture;b[0]=h.x*u,b[1]=h.y*u,b[2]=T.source.width*u,b[3]=T.source.height*u;const S=this.renderer.renderTarget.getRenderTarget(r);if(s.renderTarget.bind(r,!!i),r instanceof V?(y[0]=r.frame.width,y[1]=r.frame.height):(y[0]=S.width,y[1]=S.height),y[2]=S.isRoot?-1:1,d.update(),s.renderPipes.uniformBatch){const w=s.renderPipes.uniformBatch.getUboResource(d);this._globalFilterBindGroup.setResource(w,0)}else this._globalFilterBindGroup.setResource(d,0);this._globalFilterBindGroup.setResource(e.source,1),this._globalFilterBindGroup.setResource(e.source.style,2),t.groups[0]=this._globalFilterBindGroup,s.encoder.draw({geometry:Vs,shader:t,state:t._state,topology:"triangle-list"}),s.type===Se.WEBGL&&s.renderTarget.finishRenderPass()}_getFilterData(){return{skip:!1,inputTexture:null,bounds:new At,container:null,filterEffect:null,blendRequired:!1,previousRenderSurface:null}}calculateSpriteMatrix(t,e){const r=this._activeFilterData,i=t.set(r.inputTexture._source.width,0,0,r.inputTexture._source.height,r.bounds.minX,r.bounds.minY),s=e.worldTransform.copyTo(L.shared),a=e.renderGroup||e.parentRenderGroup;return a&&a.cacheToLocalTransform&&s.prepend(a.cacheToLocalTransform),s.invert(),i.prepend(s),i.scale(1/e.texture.frame.width,1/e.texture.frame.height),i.translate(e.anchor.x,e.anchor.y),i}}ui.extension={type:[B.WebGLSystem,B.WebGPUSystem],name:"filter"};class Nt extends $i{constructor(t){t instanceof Y&&(t={context:t});const{context:e,roundPixels:r,...i}=t||{};super({label:"Graphics",...i}),this.renderPipeId="graphics",e?this._context=e:this._context=this._ownedContext=new Y,this._context.on("update",this.onViewUpdate,this),this.allowChildren=!1,this.roundPixels=r??!1}set context(t){t!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=t,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||(t==null?void 0:t.context)===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new Nt(this._context.clone()):(this._ownedContext=null,new Nt(this._context))}lineStyle(t,e,r){U(H,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const i={};return t&&(i.width=t),e&&(i.color=e),r&&(i.alpha=r),this.context.strokeStyle=i,this}beginFill(t,e){U(H,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const r={};return t!==void 0&&(r.color=t),e!==void 0&&(r.alpha=e),this.context.fillStyle=r,this}endFill(){U(H,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==Y.defaultStrokeStyle.width||t.color!==Y.defaultStrokeStyle.color||t.alpha!==Y.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return U(H,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return U(H,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return U(H,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return U(H,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return U(H,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return U(H,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}const di=class fi extends Kt{constructor(...t){let e=t[0]??{};e instanceof Float32Array&&(U(H,"use new MeshGeometry({ positions, uvs, indices }) instead"),e={positions:e,uvs:t[1],indices:t[2]}),e={...fi.defaultOptions,...e};const r=e.positions||new Float32Array([0,0,1,0,1,1,0,1]);let i=e.uvs;i||(e.positions?i=new Float32Array(r.length):i=new Float32Array([0,0,1,0,1,1,0,1]));const s=e.indices||new Uint32Array([0,1,2,0,2,3]),a=e.shrinkBuffersToFit,o=new J({data:r,label:"attribute-mesh-positions",shrinkToFit:a,usage:G.VERTEX|G.COPY_DST}),h=new J({data:i,label:"attribute-mesh-uvs",shrinkToFit:a,usage:G.VERTEX|G.COPY_DST}),c=new J({data:s,label:"index-mesh-buffer",shrinkToFit:a,usage:G.INDEX|G.COPY_DST});super({attributes:{aPosition:{buffer:o,format:"float32x2",stride:2*4,offset:0},aUV:{buffer:h,format:"float32x2",stride:2*4,offset:0}},indexBuffer:c,topology:e.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(t){this.attributes.aPosition.buffer.data=t}get uvs(){return this.attributes.aUV.buffer.data}set uvs(t){this.attributes.aUV.buffer.data=t}get indices(){return this.indexBuffer.data}set indices(t){this.indexBuffer.data=t}};di.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let Ge=di;function $s(n){const t=n._stroke,e=n._fill,i=[`div { ${[`color: ${W.shared.setValue(e.color).toHex()}`,`font-size: ${n.fontSize}px`,`font-family: ${n.fontFamily}`,`font-weight: ${n.fontWeight}`,`font-style: ${n.fontStyle}`,`font-variant: ${n.fontVariant}`,`letter-spacing: ${n.letterSpacing}px`,`text-align: ${n.align}`,`padding: ${n.padding}px`,`white-space: ${n.whiteSpace==="pre"&&n.wordWrap?"pre-wrap":n.whiteSpace}`,...n.lineHeight?[`line-height: ${n.lineHeight}px`]:[],...n.wordWrap?[`word-wrap: ${n.breakWords?"break-all":"break-word"}`,`max-width: ${n.wordWrapWidth}px`]:[],...t?[gi(t)]:[],...n.dropShadow?[pi(n.dropShadow)]:[],...n.cssOverrides].join(";")} }`];return Os(n.tagStyles,i),i.join(" ")}function pi(n){const t=W.shared.setValue(n.color).setAlpha(n.alpha).toHexa(),e=Math.round(Math.cos(n.angle)*n.distance),r=Math.round(Math.sin(n.angle)*n.distance),i=`${e}px ${r}px`;return n.blur>0?`text-shadow: ${i} ${n.blur}px ${t}`:`text-shadow: ${i} ${t}`}function gi(n){return[`-webkit-text-stroke-width: ${n.width}px`,`-webkit-text-stroke-color: ${W.shared.setValue(n.color).toHex()}`,`text-stroke-width: ${n.width}px`,`text-stroke-color: ${W.shared.setValue(n.color).toHex()}`,"paint-order: stroke"].join(";")}const wr={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},Tr={fill:n=>`color: ${W.shared.setValue(n).toHex()}`,breakWords:n=>`word-wrap: ${n?"break-all":"break-word"}`,stroke:gi,dropShadow:pi};function Os(n,t){for(const e in n){const r=n[e],i=[];for(const s in r)Tr[s]?i.push(Tr[s](r[s])):wr[s]&&i.push(wr[s].replace("{{VALUE}}",r[s]));t.push(`${e} { ${i.join(";")} }`)}}class De extends nt{constructor(t={}){super(t),this._cssOverrides=[],this.cssOverrides??(this.cssOverrides=t.cssOverrides),this.tagStyles=t.tagStyles??{}}set cssOverrides(t){this._cssOverrides=t instanceof Array?t:[t],this.update()}get cssOverrides(){return this._cssOverrides}_generateKey(){return this._styleKey=ni(this)+this._cssOverrides.join("-"),this._styleKey}update(){this._cssStyle=null,super.update()}clone(){return new De({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides})}get cssStyle(){return this._cssStyle||(this._cssStyle=$s(this)),this._cssStyle}addOverride(...t){const e=t.filter(r=>!this.cssOverrides.includes(r));e.length>0&&(this.cssOverrides.push(...e),this.update())}removeOverride(...t){const e=t.filter(r=>this.cssOverrides.includes(r));e.length>0&&(this.cssOverrides=this.cssOverrides.filter(r=>!e.includes(r)),this.update())}set fill(t){typeof t!="string"&&typeof t!="number"&&j("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=t}set stroke(t){t&&typeof t!="string"&&typeof t!="number"&&j("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=t}}const vr="http://www.w3.org/2000/svg",Cr="http://www.w3.org/1999/xhtml";class xi{constructor(){this.svgRoot=document.createElementNS(vr,"svg"),this.foreignObject=document.createElementNS(vr,"foreignObject"),this.domElement=document.createElementNS(Cr,"div"),this.styleElement=document.createElementNS(Cr,"style"),this.image=new Image;const{foreignObject:t,svgRoot:e,styleElement:r,domElement:i}=this;t.setAttribute("width","10000"),t.setAttribute("height","10000"),t.style.overflow="hidden",e.appendChild(t),t.appendChild(r),t.appendChild(i)}}let Pr;function js(n,t,e,r){r||(r=Pr||(Pr=new xi));const{domElement:i,styleElement:s,svgRoot:a}=r;i.innerHTML=`
${n}
`,i.setAttribute("style","transform-origin: top left; display: inline-block"),e&&(s.textContent=e),document.body.appendChild(a);const o=i.getBoundingClientRect();a.remove();const h=t.padding*2;return{width:o.width-h,height:o.height-h}}const Lt={name:"local-uniform-bit",vertex:{header:` - - struct LocalUniforms { - uTransformMatrix:mat3x3, - uColor:vec4, - uRound:f32, - } - - @group(1) @binding(0) var localUniforms : LocalUniforms; - `,main:` - vColor *= localUniforms.uColor; - modelMatrix *= localUniforms.uTransformMatrix; - `,end:` - if(localUniforms.uRound == 1) - { - vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); - } - `}};({...Lt,vertex:{...Lt.vertex,header:Lt.vertex.header.replace("group(1)","group(2)")}});const Ys={name:"local-uniform-bit",vertex:{header:` - - uniform mat3 uTransformMatrix; - uniform vec4 uColor; - uniform float uRound; - `,main:` - vColor *= uColor; - modelMatrix = uTransformMatrix; - `,end:` - if(uRound == 1.) - { - gl_Position.xy = roundPixels(gl_Position.xy, uResolution); - } - `}};class mi{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}}function Jt(n,t,e){const r=(n>>24&255)/255;t[e++]=(n&255)/255*r,t[e++]=(n>>8&255)/255*r,t[e++]=(n>>16&255)/255*r,t[e++]=r}class _i{constructor(t,e){this.state=$t.for2d(),this._graphicsBatchesHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this.renderer=t,this._adaptor=e,this._adaptor.init(),this.renderer.renderableGC.addManagedHash(this,"_graphicsBatchesHash")}validateRenderable(t){const e=t.context,r=!!this._graphicsBatchesHash[t.uid],i=this.renderer.graphicsContext.updateGpuContext(e);return!!(i.isBatchable||r!==i.isBatchable)}addRenderable(t,e){const r=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),r.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){const e=this._graphicsBatchesHash[t.uid];if(e)for(let r=0;r{const o=D.get(Ae);return a.copyTo(o),o.renderable=t,o.roundPixels=i,o});return this._graphicsBatchesHash[t.uid]===void 0&&t.on("destroyed",this._destroyRenderableBound),this._graphicsBatchesHash[t.uid]=s,s}_removeBatchForRenderable(t){this._graphicsBatchesHash[t].forEach(e=>{D.return(e)}),this._graphicsBatchesHash[t]=null}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;for(const t in this._graphicsBatchesHash)this._removeBatchForRenderable(t);this._graphicsBatchesHash=null}}_i.extension={type:[B.WebGLPipes,B.WebGPUPipes,B.CanvasPipes],name:"graphics"};const yi=class bi extends Ge{constructor(...t){super({});let e=t[0]??{};typeof e=="number"&&(U(H,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),e={width:e,height:t[1],verticesX:t[2],verticesY:t[3]}),this.build(e)}build(t){t={...bi.defaultOptions,...t},this.verticesX=this.verticesX??t.verticesX,this.verticesY=this.verticesY??t.verticesY,this.width=this.width??t.width,this.height=this.height??t.height;const e=this.verticesX*this.verticesY,r=[],i=[],s=[],a=this.verticesX-1,o=this.verticesY-1,h=this.width/a,c=this.height/o;for(let u=0;u"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new be({0:this.localUniforms}),this._meshDataHash=Object.create(null),this._gpuBatchableMeshHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this.renderer=t,this._adaptor=e,this._adaptor.init(),t.renderableGC.addManagedHash(this,"_gpuBatchableMeshHash"),t.renderableGC.addManagedHash(this,"_meshDataHash")}validateRenderable(t){const e=this._getMeshData(t),r=e.batched,i=t.batched;if(e.batched=i,r!==i)return!0;if(i){const s=t._geometry;if(s.indices.length!==e.indexSize||s.positions.length!==e.vertexSize)return e.indexSize=s.indices.length,e.vertexSize=s.positions.length,!0;const a=this._getBatchableMesh(t);return a.texture.uid!==t._texture.uid&&(a._textureMatrixUpdateId=-1),!a._batcher.checkAndUpdateTexture(a,t._texture)}return!1}addRenderable(t,e){const r=this.renderer.renderPipes.batch,{batched:i}=this._getMeshData(t);if(i){const s=this._getBatchableMesh(t);s.setTexture(t._texture),s.geometry=t._geometry,r.addToBatch(s,e)}else r.break(e),e.add(t)}updateRenderable(t){if(t.batched){const e=this._gpuBatchableMeshHash[t.uid];e.setTexture(t._texture),e.geometry=t._geometry,e._batcher.updateElement(e)}}destroyRenderable(t){this._meshDataHash[t.uid]=null;const e=this._gpuBatchableMeshHash[t.uid];e&&(D.return(e),this._gpuBatchableMeshHash[t.uid]=null),t.off("destroyed",this._destroyRenderableBound)}execute(t){if(!t.isRenderable)return;t.state.blendMode=kt(t.groupBlendMode,t.texture._source);const e=this.localUniforms;e.uniforms.uTransformMatrix=t.groupTransform,e.uniforms.uRound=this.renderer._roundPixels|t._roundPixels,e.update(),Jt(t.groupColorAlpha,e.uniforms.uColor,0),this._adaptor.execute(this,t)}_getMeshData(t){return this._meshDataHash[t.uid]||this._initMeshData(t)}_initMeshData(t){var e,r;return this._meshDataHash[t.uid]={batched:t.batched,indexSize:(e=t._geometry.indices)==null?void 0:e.length,vertexSize:(r=t._geometry.positions)==null?void 0:r.length},t.on("destroyed",this._destroyRenderableBound),this._meshDataHash[t.uid]}_getBatchableMesh(t){return this._gpuBatchableMeshHash[t.uid]||this._initBatchableMesh(t)}_initBatchableMesh(t){const e=D.get(We);return e.renderable=t,e.setTexture(t._texture),e.transform=t.groupTransform,e.roundPixels=this.renderer._roundPixels|t._roundPixels,this._gpuBatchableMeshHash[t.uid]=e,e}destroy(){for(const t in this._gpuBatchableMeshHash)this._gpuBatchableMeshHash[t]&&D.return(this._gpuBatchableMeshHash[t]);this._gpuBatchableMeshHash=null,this._meshDataHash=null,this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}Si.extension={type:[B.WebGLPipes,B.WebGPUPipes,B.CanvasPipes],name:"mesh"};class qs{execute(t,e){const r=t.state,i=t.renderer,s=e.shader||t.defaultShader;s.resources.uTexture=e.texture._source,s.resources.uniforms=t.localUniforms;const a=i.gl,o=t.getBuffers(e);i.shader.bind(s),i.state.set(r),i.geometry.bind(o.geometry,s.glProgram);const c=o.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?a.UNSIGNED_SHORT:a.UNSIGNED_INT;a.drawElements(a.TRIANGLES,e.particleChildren.length*6,c,0)}}class Xs{execute(t,e){const r=t.renderer,i=e.shader||t.defaultShader;i.groups[0]=r.renderPipes.uniformBatch.getUniformBindGroup(t.localUniforms,!0),i.groups[1]=r.texture.getTextureBindGroup(e.texture);const s=t.state,a=t.getBuffers(e);r.encoder.draw({geometry:a.geometry,shader:e.shader||t.defaultShader,state:s,size:e.particleChildren.length*6})}}function Mr(n,t=null){const e=n*6;if(e>65535?t||(t=new Uint32Array(e)):t||(t=new Uint16Array(e)),t.length!==e)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${e}`);for(let r=0,i=0;rthis._size&&(e=!0,this._size=Math.max(t.length,this._size*1.5|0),this.staticAttributeBuffer=new _t(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new _t(this._size*this._dynamicStride*4*4),this.indexBuffer=Mr(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,!0));const r=this.dynamicAttributeBuffer;if(this._dynamicUpload(t,r.float32View,r.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,t.length*this._dynamicStride*4,!0),e){const i=this.staticAttributeBuffer;this._staticUpload(t,i.float32View,i.uint32View),this._staticBuffer.setDataWithSize(i.float32View,t.length*this._staticStride*4,!0)}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy()}}function Js(n){const t=[];for(const e in n){const r=n[e];t.push(e,r.code,r.dynamic?"d":"s")}return t.join("_")}var Zs=`varying vec2 vUV; -varying vec4 vColor; - -uniform sampler2D uTexture; - -void main(void){ - vec4 color = texture2D(uTexture, vUV) * vColor; - gl_FragColor = color; -}`,ta=`attribute vec2 aVertex; -attribute vec2 aUV; -attribute vec4 aColor; - -attribute vec2 aPosition; -attribute float aRotation; - -uniform mat3 uTranslationMatrix; -uniform float uRound; -uniform vec2 uResolution; -uniform vec4 uColor; - -varying vec2 vUV; -varying vec4 vColor; - -vec2 roundPixels(vec2 position, vec2 targetSize) -{ - return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; -} - -void main(void){ - float cosRotation = cos(aRotation); - float sinRotation = sin(aRotation); - float x = aVertex.x * cosRotation - aVertex.y * sinRotation; - float y = aVertex.x * sinRotation + aVertex.y * cosRotation; - - vec2 v = vec2(x, y); - v = v + aPosition; - - gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0); - - if(uRound == 1.0) - { - gl_Position.xy = roundPixels(gl_Position.xy, uResolution); - } - - vUV = aUV; - vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor; -} -`,Br=` -struct ParticleUniforms { - uProjectionMatrix:mat3x3, - uColor:vec4, - uResolution:vec2, - uRoundPixels:f32, -}; - -@group(0) @binding(0) var uniforms: ParticleUniforms; - -@group(1) @binding(0) var uTexture: texture_2d; -@group(1) @binding(1) var uSampler : sampler; - -struct VSOutput { - @builtin(position) position: vec4, - @location(0) uv : vec2, - @location(1) color : vec4, - }; -@vertex -fn mainVertex( - @location(0) aVertex: vec2, - @location(1) aPosition: vec2, - @location(2) aUV: vec2, - @location(3) aColor: vec4, - @location(4) aRotation: f32, -) -> VSOutput { - - let v = vec2( - aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation), - aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation) - ) + aPosition; - - let position = vec4((uniforms.uProjectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0); - - let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor; - - return VSOutput( - position, - aUV, - vColor, - ); -} - -@fragment -fn mainFragment( - @location(0) uv: vec2, - @location(1) color: vec4, - @builtin(position) position: vec4, -) -> @location(0) vec4 { - - var sample = textureSample(uTexture, uSampler, uv) * color; - - return sample; -}`;class ea extends qt{constructor(){const t=zr.from({vertex:ta,fragment:Zs}),e=Ur.from({fragment:{source:Br,entryPoint:"mainFragment"},vertex:{source:Br,entryPoint:"mainVertex"}});super({glProgram:t,gpuProgram:e,resources:{uTexture:V.WHITE.source,uSampler:new Oi({}),uniforms:{uTranslationMatrix:{value:new L,type:"mat3x3"},uColor:{value:new W(16777215),type:"vec4"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2"}}}})}}class wi{constructor(t,e){this.state=$t.for2d(),this._gpuBufferHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this.localUniforms=new pt({uTranslationMatrix:{value:new L,type:"mat3x3"},uColor:{value:new Float32Array(4),type:"vec4"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2"}}),this.renderer=t,this.adaptor=e,this.defaultShader=new ea,this.state=$t.for2d()}validateRenderable(t){return!1}addRenderable(t,e){this.renderer.renderPipes.batch.break(e),e.add(t)}getBuffers(t){return this._gpuBufferHash[t.uid]||this._initBuffer(t)}_initBuffer(t){return this._gpuBufferHash[t.uid]=new Qs({size:t.particleChildren.length,properties:t._properties}),t.on("destroyed",this._destroyRenderableBound),this._gpuBufferHash[t.uid]}updateRenderable(t){}destroyRenderable(t){this._gpuBufferHash[t.uid].destroy(),this._gpuBufferHash[t.uid]=null,t.off("destroyed",this._destroyRenderableBound)}execute(t){const e=t.particleChildren;if(e.length===0)return;const r=this.renderer,i=this.getBuffers(t);t.texture||(t.texture=e[0].texture);const s=this.state;i.update(e,t._childrenDirty),t._childrenDirty=!1,s.blendMode=kt(t.blendMode,t.texture._source);const a=this.localUniforms.uniforms,o=a.uTranslationMatrix;t.worldTransform.copyTo(o),o.prepend(r.globalUniforms.globalUniformData.projectionMatrix),a.uResolution=r.globalUniforms.globalUniformData.resolution,a.uRound=r._roundPixels|t._roundPixels,Jt(t.groupColorAlpha,a.uColor,0),this.adaptor.execute(this,t)}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null)}}class Ti extends wi{constructor(t){super(t,new qs)}}Ti.extension={type:[B.WebGLPipes],name:"particle"};class vi extends wi{constructor(t){super(t,new Xs)}}vi.extension={type:[B.WebGPUPipes],name:"particle"};const Ci=class Pi extends Ns{constructor(t={}){t={...Pi.defaultOptions,...t},super({width:t.width,height:t.height,verticesX:4,verticesY:4}),this.update(t)}update(t){var e,r;this.width=t.width??this.width,this.height=t.height??this.height,this._originalWidth=t.originalWidth??this._originalWidth,this._originalHeight=t.originalHeight??this._originalHeight,this._leftWidth=t.leftWidth??this._leftWidth,this._rightWidth=t.rightWidth??this._rightWidth,this._topHeight=t.topHeight??this._topHeight,this._bottomHeight=t.bottomHeight??this._bottomHeight,this._anchorX=(e=t.anchor)==null?void 0:e.x,this._anchorY=(r=t.anchor)==null?void 0:r.y,this.updateUvs(),this.updatePositions()}updatePositions(){const t=this.positions,{width:e,height:r,_leftWidth:i,_rightWidth:s,_topHeight:a,_bottomHeight:o,_anchorX:h,_anchorY:c}=this,l=i+s,u=e>l?1:e/l,f=a+o,d=r>f?1:r/f,g=Math.min(u,d),p=h*e,x=c*r;t[0]=t[8]=t[16]=t[24]=-p,t[2]=t[10]=t[18]=t[26]=i*g-p,t[4]=t[12]=t[20]=t[28]=e-s*g-p,t[6]=t[14]=t[22]=t[30]=e-p,t[1]=t[3]=t[5]=t[7]=-x,t[9]=t[11]=t[13]=t[15]=a*g-x,t[17]=t[19]=t[21]=t[23]=r-o*g-x,t[25]=t[27]=t[29]=t[31]=r-x,this.getBuffer("aPosition").update()}updateUvs(){const t=this.uvs;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1;const e=1/this._originalWidth,r=1/this._originalHeight;t[2]=t[10]=t[18]=t[26]=e*this._leftWidth,t[9]=t[11]=t[13]=t[15]=r*this._topHeight,t[4]=t[12]=t[20]=t[28]=1-e*this._rightWidth,t[17]=t[19]=t[21]=t[23]=1-r*this._bottomHeight,this.getBuffer("aUV").update()}};Ci.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let ra=Ci;class Mi{constructor(t){this._gpuSpriteHash=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_gpuSpriteHash")}addRenderable(t,e){const r=this._getGpuSprite(t);t.didViewUpdate&&this._updateBatchableSprite(t,r),this._renderer.renderPipes.batch.addToBatch(r,e)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t.didViewUpdate&&this._updateBatchableSprite(t,e),e._batcher.updateElement(e)}validateRenderable(t){const e=this._getGpuSprite(t);return!e._batcher.checkAndUpdateTexture(e,t._texture)}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];D.return(e.geometry),D.return(e),this._gpuSpriteHash[t.uid]=null,t.off("destroyed",this._destroyRenderableBound)}_updateBatchableSprite(t,e){e.geometry.update(t),e.setTexture(t._texture)}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=D.get(We);return e.geometry=D.get(ra),e.renderable=t,e.transform=t.groupTransform,e.texture=t._texture,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t.didViewUpdate||this._updateBatchableSprite(t,e),t.on("destroyed",this._destroyRenderableBound),e}destroy(){for(const t in this._gpuSpriteHash)this._gpuSpriteHash[t].geometry.destroy();this._gpuSpriteHash=null,this._renderer=null}}Mi.extension={type:[B.WebGLPipes,B.WebGPUPipes,B.CanvasPipes],name:"nineSliceSprite"};const ia={name:"tiling-bit",vertex:{header:` - struct TilingUniforms { - uMapCoord:mat3x3, - uClampFrame:vec4, - uClampOffset:vec2, - uTextureTransform:mat3x3, - uSizeAnchor:vec4 - }; - - @group(2) @binding(0) var tilingUniforms: TilingUniforms; - @group(2) @binding(1) var uTexture: texture_2d; - @group(2) @binding(2) var uSampler: sampler; - `,main:` - uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy; - - position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy; - `},fragment:{header:` - struct TilingUniforms { - uMapCoord:mat3x3, - uClampFrame:vec4, - uClampOffset:vec2, - uTextureTransform:mat3x3, - uSizeAnchor:vec4 - }; - - @group(2) @binding(0) var tilingUniforms: TilingUniforms; - @group(2) @binding(1) var uTexture: texture_2d; - @group(2) @binding(2) var uSampler: sampler; - `,main:` - - var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV); - coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy; - var unclamped = coord; - coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw); - - var bias = 0.; - - if(unclamped.x == coord.x && unclamped.y == coord.y) - { - bias = -32.; - } - - outColor = textureSampleBias(uTexture, uSampler, coord, bias); - `}},na={name:"tiling-bit",vertex:{header:` - uniform mat3 uTextureTransform; - uniform vec4 uSizeAnchor; - - `,main:` - uv = (uTextureTransform * vec3(aUV, 1.0)).xy; - - position = (position - uSizeAnchor.zw) * uSizeAnchor.xy; - `},fragment:{header:` - uniform sampler2D uTexture; - uniform mat3 uMapCoord; - uniform vec4 uClampFrame; - uniform vec2 uClampOffset; - `,main:` - - vec2 coord = vUV + ceil(uClampOffset - vUV); - coord = (uMapCoord * vec3(coord, 1.0)).xy; - vec2 unclamped = coord; - coord = clamp(coord, uClampFrame.xy, uClampFrame.zw); - - outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0 - - `}};let he,le;class sa extends qt{constructor(){he??(he=Me({name:"tiling-sprite-shader",bits:[Lt,ia,Be]})),le??(le=ke({name:"tiling-sprite-shader",bits:[Ys,na,Re]}));const t=new pt({uMapCoord:{value:new L,type:"mat3x3"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2"},uTextureTransform:{value:new L,type:"mat3x3"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4"}});super({glProgram:le,gpuProgram:he,resources:{localUniforms:new pt({uTransformMatrix:{value:new L,type:"mat3x3"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uRound:{value:0,type:"f32"}}),tilingUniforms:t,uTexture:V.EMPTY.source,uSampler:V.EMPTY.source.style}})}updateUniforms(t,e,r,i,s,a){const o=this.resources.tilingUniforms,h=a.width,c=a.height,l=a.textureMatrix,u=o.uniforms.uTextureTransform;u.set(r.a*h/t,r.b*h/e,r.c*c/t,r.d*c/e,r.tx/t,r.ty/e),u.invert(),o.uniforms.uMapCoord=l.mapCoord,o.uniforms.uClampFrame=l.uClampFrame,o.uniforms.uClampOffset=l.uClampOffset,o.uniforms.uTextureTransform=u,o.uniforms.uSizeAnchor[0]=t,o.uniforms.uSizeAnchor[1]=e,o.uniforms.uSizeAnchor[2]=i,o.uniforms.uSizeAnchor[3]=s,a&&(this.resources.uTexture=a.source,this.resources.uSampler=a.source.style)}}class aa extends Ge{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}function oa(n,t){const e=n.anchor.x,r=n.anchor.y;t[0]=-e*n.width,t[1]=-r*n.height,t[2]=(1-e)*n.width,t[3]=-r*n.height,t[4]=(1-e)*n.width,t[5]=(1-r)*n.height,t[6]=-e*n.width,t[7]=(1-r)*n.height}function ha(n,t,e,r){let i=0;const s=n.length/t,a=r.a,o=r.b,h=r.c,c=r.d,l=r.tx,u=r.ty;for(e*=t;i, - uTransformMatrix:mat3x3, - uDistance: f32, - uRound:f32, - } - - @group(2) @binding(0) var localUniforms : LocalUniforms; - `,main:` - vColor *= localUniforms.uColor; - modelMatrix *= localUniforms.uTransformMatrix; - `,end:` - if(localUniforms.uRound == 1) - { - vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); - } - `},fragment:{header:` - struct LocalUniforms { - uColor:vec4, - uTransformMatrix:mat3x3, - uDistance: f32 - } - - @group(2) @binding(0) var localUniforms : LocalUniforms; - `,main:` - outColor = vec4(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance)); - `}},ua={name:"local-uniform-msdf-bit",vertex:{header:` - uniform mat3 uTransformMatrix; - uniform vec4 uColor; - uniform float uRound; - `,main:` - vColor *= uColor; - modelMatrix *= uTransformMatrix; - `,end:` - if(uRound == 1.) - { - gl_Position.xy = roundPixels(gl_Position.xy, uResolution); - } - `},fragment:{header:` - uniform float uDistance; - `,main:` - outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance)); - `}},da={name:"msdf-bit",fragment:{header:` - fn calculateMSDFAlpha(msdfColor:vec4, shapeColor:vec4, distance:f32) -> f32 { - - // MSDF - var median = msdfColor.r + msdfColor.g + msdfColor.b - - min(msdfColor.r, min(msdfColor.g, msdfColor.b)) - - max(msdfColor.r, max(msdfColor.g, msdfColor.b)); - - // SDF - median = min(median, msdfColor.a); - - var screenPxDistance = distance * (median - 0.5); - var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0); - if (median < 0.01) { - alpha = 0.0; - } else if (median > 0.99) { - alpha = 1.0; - } - - // Gamma correction for coverage-like alpha - var luma: f32 = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114)); - var gamma: f32 = mix(1.0, 1.0 / 2.2, luma); - var coverage: f32 = pow(shapeColor.a * alpha, gamma); - - return coverage; - - } - `}},fa={name:"msdf-bit",fragment:{header:` - float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) { - - // MSDF - float median = msdfColor.r + msdfColor.g + msdfColor.b - - min(msdfColor.r, min(msdfColor.g, msdfColor.b)) - - max(msdfColor.r, max(msdfColor.g, msdfColor.b)); - - // SDF - median = min(median, msdfColor.a); - - float screenPxDistance = distance * (median - 0.5); - float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0); - - if (median < 0.01) { - alpha = 0.0; - } else if (median > 0.99) { - alpha = 1.0; - } - - // Gamma correction for coverage-like alpha - float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114)); - float gamma = mix(1.0, 1.0 / 2.2, luma); - float coverage = pow(shapeColor.a * alpha, gamma); - - return coverage; - } - `}};let ce,ue;class pa extends qt{constructor(){const t=new pt({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4"},uTransformMatrix:{value:new L,type:"mat3x3"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}}),e=Pe();ce??(ce=Me({name:"sdf-shader",bits:[Or,Yr(e),ca,da,Be]})),ue??(ue=ke({name:"sdf-shader",bits:[jr,Nr(e),ua,fa,Re]})),super({glProgram:ue,gpuProgram:ce,resources:{localUniforms:t,batchSamplers:qr(e)}})}}class Bi{constructor(t){this._gpuBitmapText={},this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=t,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText")}validateRenderable(t){const e=this._getGpuBitmapText(t);return t._didTextUpdate&&(t._didTextUpdate=!1,this._updateContext(t,e)),this._renderer.renderPipes.graphics.validateRenderable(e)}addRenderable(t,e){const r=this._getGpuBitmapText(t);Rr(t,r),t._didTextUpdate&&(t._didTextUpdate=!1,this._updateContext(t,r)),this._renderer.renderPipes.graphics.addRenderable(r,e),r.context.customShader&&this._updateDistanceField(t)}destroyRenderable(t){t.off("destroyed",this._destroyRenderableBound),this._destroyRenderableByUid(t.uid)}_destroyRenderableByUid(t){const e=this._gpuBitmapText[t].context;e.customShader&&(D.return(e.customShader),e.customShader=null),D.return(this._gpuBitmapText[t]),this._gpuBitmapText[t]=null}updateRenderable(t){const e=this._getGpuBitmapText(t);Rr(t,e),this._renderer.renderPipes.graphics.updateRenderable(e),e.context.customShader&&this._updateDistanceField(t)}_updateContext(t,e){const{context:r}=e,i=Hs.getFont(t.text,t._style);r.clear(),i.distanceField.type!=="none"&&(r.customShader||(r.customShader=D.get(pa)));const s=Array.from(t.text),a=t._style;let o=i.baseLineOffset;const h=li(s,a,i,!0);let c=0;const l=a.padding,u=h.scale;let f=h.width,d=h.height+h.offsetY;a._stroke&&(f+=a._stroke.width/u,d+=a._stroke.width/u),r.translate(-t._anchor._x*f-l,-t._anchor._y*d-l).scale(u,u);const g=i.applyFillAsTint?a._fill.color:16777215;for(let p=0;p{console.error(s)}),t._didTextUpdate=!1,ye(i,t)}async _updateGpuText(t){t._didTextUpdate=!1;const e=this._getGpuText(t);if(e.generatingTexture)return;const r=t._getKey();this._renderer.htmlText.decreaseReferenceCount(e.currentKey),e.generatingTexture=!0,e.currentKey=r;const i=t.resolution??this._renderer.resolution,s=await this._renderer.htmlText.getManagedTexture(t.text,i,t._style,t._getKey()),a=e.batchableSprite;a.texture=e.texture=s,e.generatingTexture=!1,e.textureNeedsUploading=!0,t.onViewUpdate(),ye(a,t)}_getGpuText(t){return this._gpuText[t.uid]||this.initGpuText(t)}initGpuText(t){const e={texture:V.EMPTY,currentKey:"--",batchableSprite:D.get(mi),textureNeedsUploading:!1,generatingTexture:!1},r=e.batchableSprite;return r.renderable=t,r.transform=t.groupTransform,r.texture=V.EMPTY,r.bounds={minX:0,maxX:1,minY:0,maxY:0},r.roundPixels=this._renderer._roundPixels|t._roundPixels,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,this._gpuText[t.uid]=e,t.on("destroyed",this._destroyRenderableBound),e}destroy(){for(const t in this._gpuText)this._destroyRenderableById(t);this._gpuText=null,this._renderer=null}}Ri.extension={type:[B.WebGLPipes,B.WebGPUPipes,B.CanvasPipes],name:"htmlText"};function ga(){const{userAgent:n}=dt.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(n)}const xa=new At;function Ai(n,t,e,r){const i=xa;i.minX=0,i.minY=0,i.maxX=n.width/r|0,i.maxY=n.height/r|0;const s=Q.getOptimalTexture(i.width,i.height,r,!1);return s.source.uploadMethodId="image",s.source.resource=n,s.source.alphaMode="premultiply-alpha-on-upload",s.frame.width=t/r,s.frame.height=e/r,s.source.emit("update",s.source),s.updateUvs(),s}function ma(n,t){const e=t.fontFamily,r=[],i={},s=/font-family:([^;"\s]+)/g,a=n.match(s);function o(h){i[h]||(r.push(h),i[h]=!0)}if(Array.isArray(e))for(let h=0;h{const c=h.split(":")[1].trim();o(c)});for(const h in t.tagStyles){const c=t.tagStyles[h].fontFamily;o(c)}return r}async function _a(n){const e=await(await dt.get().fetch(n)).blob(),r=new FileReader;return await new Promise((s,a)=>{r.onloadend=()=>s(r.result),r.onerror=a,r.readAsDataURL(e)})}async function Ar(n,t){const e=await _a(t);return`@font-face { - font-family: "${n.fontFamily}"; - src: url('${e}'); - font-weight: ${n.fontWeight}; - font-style: ${n.fontStyle}; - }`}const Et=new Map;async function ya(n,t,e){const r=n.filter(i=>K.has(`${i}-and-url`)).map((i,s)=>{if(!Et.has(i)){const{url:a}=K.get(`${i}-and-url`);s===0?Et.set(i,Ar({fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:i},a)):Et.set(i,Ar({fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:i},a))}return Et.get(i)});return(await Promise.all(r)).join(` -`)}function ba(n,t,e,r,i){const{domElement:s,styleElement:a,svgRoot:o}=i;s.innerHTML=`
${n}
`,s.setAttribute("style",`transform: scale(${e});transform-origin: top left; display: inline-block`),a.textContent=r;const{width:h,height:c}=i.image;return o.setAttribute("width",h.toString()),o.setAttribute("height",c.toString()),new XMLSerializer().serializeToString(o)}function Sa(n,t){const e=ft.getOptimalCanvasAndContext(n.width,n.height,t),{context:r}=e;return r.clearRect(0,0,n.width,n.height),r.drawImage(n,0,0),e}function wa(n,t,e){return new Promise(async r=>{e&&await new Promise(i=>setTimeout(i,100)),n.onload=()=>{r()},n.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(t)}`,n.crossOrigin="anonymous"})}class Ee{constructor(t){this._activeTextures={},this._renderer=t,this._createCanvas=t.type===Se.WEBGPU}getTexture(t){return this._buildTexturePromise(t.text,t.resolution,t.style)}getManagedTexture(t,e,r,i){if(this._activeTextures[i])return this._increaseReferenceCount(i),this._activeTextures[i].promise;const s=this._buildTexturePromise(t,e,r).then(a=>(this._activeTextures[i].texture=a,a));return this._activeTextures[i]={texture:null,promise:s,usageCount:1},s}async _buildTexturePromise(t,e,r){const i=D.get(xi),s=ma(t,r),a=await ya(s,r,De.defaultTextStyle),o=js(t,r,a,i),h=Math.ceil(Math.ceil(Math.max(1,o.width)+r.padding*2)*e),c=Math.ceil(Math.ceil(Math.max(1,o.height)+r.padding*2)*e),l=i.image,u=2;l.width=(h|0)+u,l.height=(c|0)+u;const f=ba(t,r,e,a,i);await wa(l,f,ga()&&s.length>0);const d=l;let g;this._createCanvas&&(g=Sa(l,e));const p=Ai(g?g.canvas:d,l.width-u,l.height-u,e);return this._createCanvas&&(this._renderer.texture.initSource(p.source),ft.returnCanvasAndContext(g)),D.return(i),p}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}decreaseReferenceCount(t){const e=this._activeTextures[t];e&&(e.usageCount--,e.usageCount===0&&(e.texture?this._cleanUp(e):e.promise.then(r=>{e.texture=r,this._cleanUp(e)}).catch(()=>{j("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[t]=null))}_cleanUp(t){Q.returnTexture(t.texture),t.texture.source.resource=null,t.texture.source.uploadMethodId="unknown"}getReferenceCount(t){return this._activeTextures[t].usageCount}destroy(){this._activeTextures=null}}Ee.extension={type:[B.WebGLSystem,B.WebGPUSystem,B.CanvasSystem],name:"htmlText"};Ee.defaultFontOptions={fontFamily:"Arial",fontStyle:"normal",fontWeight:"normal"};class Fi{constructor(t){this._gpuText=Object.create(null),this._destroyRenderableBound=this.destroyRenderable.bind(this),this._renderer=t,this._renderer.runners.resolutionChange.add(this),this._renderer.renderableGC.addManagedHash(this,"_gpuText")}resolutionChange(){for(const t in this._gpuText){const e=this._gpuText[t];if(!e)continue;const r=e.batchableSprite.renderable;r._autoResolution&&(r._resolution=this._renderer.resolution,r.onViewUpdate())}}validateRenderable(t){const e=this._getGpuText(t),r=t._getKey();return e.currentKey!==r}addRenderable(t,e){const i=this._getGpuText(t).batchableSprite;t._didTextUpdate&&this._updateText(t),this._renderer.renderPipes.batch.addToBatch(i,e)}updateRenderable(t){const r=this._getGpuText(t).batchableSprite;t._didTextUpdate&&this._updateText(t),r._batcher.updateElement(r)}destroyRenderable(t){t.off("destroyed",this._destroyRenderableBound),this._destroyRenderableById(t.uid)}_destroyRenderableById(t){const e=this._gpuText[t];this._renderer.canvasText.decreaseReferenceCount(e.currentKey),D.return(e.batchableSprite),this._gpuText[t]=null}_updateText(t){const e=t._getKey(),r=this._getGpuText(t),i=r.batchableSprite;r.currentKey!==e&&this._updateGpuText(t),t._didTextUpdate=!1,ye(i,t)}_updateGpuText(t){const e=this._getGpuText(t),r=e.batchableSprite;e.texture&&this._renderer.canvasText.decreaseReferenceCount(e.currentKey),e.texture=r.texture=this._renderer.canvasText.getManagedTexture(t),e.currentKey=t._getKey(),r.texture=e.texture}_getGpuText(t){return this._gpuText[t.uid]||this.initGpuText(t)}initGpuText(t){const e={texture:null,currentKey:"--",batchableSprite:D.get(mi)};return e.batchableSprite.renderable=t,e.batchableSprite.transform=t.groupTransform,e.batchableSprite.bounds={minX:0,maxX:1,minY:0,maxY:0},e.batchableSprite.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuText[t.uid]=e,t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,this._updateText(t),t.on("destroyed",this._destroyRenderableBound),e}destroy(){for(const t in this._gpuText)this._destroyRenderableById(t);this._gpuText=null,this._renderer=null}}Fi.extension={type:[B.WebGLPipes,B.WebGPUPipes,B.CanvasPipes],name:"text"};function Fr(n,t,e){for(let r=0,i=4*e*t;rd.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}});$(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return S(),h(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=x=>r.value=x),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-CEOclbpQ.js";import{d as U,g as V,S as k,s as y,h as v,H as $,p as K,A as h,o as S,w as u,i as l,b as t}from"./index-1_q7hlhr.js";import"./three-vrm-animation.module-CtUkMEcn.js";import"./mcp-DcvIwSEe.js";import"./mini_xsschema-f5xAZ6yD.js";import{u as w}from"./providers-BQORs1wj.js";import"./Select.vue_vue_type_style_index_0_lang-BNsd3INm.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Bpj2sU-I.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-4K7QSuAF.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BSRJ1m-6.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-lF6IHoMI.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BbIjqYqC.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-hnmd1RAf.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DPXOxOXU.js";import"./Input.vue_vue_type_script_setup_true_lang-DilkC_NM.js";const a="xai",C=U({__name:"xai",setup(I){const{t:m}=V(),b=k(),d=w(),{providers:o}=y(d),n=v(()=>d.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}});$(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return S(),h(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=x=>r.value=x),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/zod-CxRm5Gac-9x712NkA.js b/assets/zod-CxRm5Gac-CPTlfWG7.js similarity index 70% rename from assets/zod-CxRm5Gac-9x712NkA.js rename to assets/zod-CxRm5Gac-CPTlfWG7.js index abed4f8c94440d5fe4a4bbcf9b389737164b6ea6..36b259215b7e54ac83fc5231222a9d3280eee176 100644 --- a/assets/zod-CxRm5Gac-9x712NkA.js +++ b/assets/zod-CxRm5Gac-CPTlfWG7.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-Ce-wxTN6.js","assets/index-Bo-ykojl.js","assets/index-C3aYAgU8.css","assets/index-0TANYLAi.js"])))=>i.map(i=>d[i]); -import{L as n}from"./index-Bo-ykojl.js";const c=async()=>{let r=e=>{throw new Error('xsschema: Missing dependencies "zod" or "@zod/mini".')},a=e=>{throw new Error('xsschema: Missing dependencies "zod-to-json-schema".')};try{const{z:e}=await n(async()=>{const{z:o}=await import("./mini_xsschema-f5xAZ6yD.js").then(t=>t.m);return{z:o}},[]);r=e.toJSONSchema}catch{}try{const{z:e}=await n(async()=>{const{z:o}=await import("./mcp-Ce-wxTN6.js").then(t=>t.i);return{z:o}},__vite__mapDeps([0,1,2]));"toJSONSchema"in e&&(r=e.toJSONSchema)}catch(e){e instanceof Error&&console.error(e.message)}try{const{zodToJsonSchema:e}=await n(async()=>{const{zodToJsonSchema:o}=await import("./index-0TANYLAi.js");return{zodToJsonSchema:o}},__vite__mapDeps([3,0,1,2]));a=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>"_zod"in e?r(e):a(e)};export{c as getToJsonSchemaFn}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-DcvIwSEe.js","assets/index-1_q7hlhr.js","assets/index-C3aYAgU8.css","assets/index-ClvjpxDE.js"])))=>i.map(i=>d[i]); +import{L as n}from"./index-1_q7hlhr.js";const c=async()=>{let r=e=>{throw new Error('xsschema: Missing dependencies "zod" or "@zod/mini".')},a=e=>{throw new Error('xsschema: Missing dependencies "zod-to-json-schema".')};try{const{z:e}=await n(async()=>{const{z:o}=await import("./mini_xsschema-f5xAZ6yD.js").then(t=>t.m);return{z:o}},[]);r=e.toJSONSchema}catch{}try{const{z:e}=await n(async()=>{const{z:o}=await import("./mcp-DcvIwSEe.js").then(t=>t.i);return{z:o}},__vite__mapDeps([0,1,2]));"toJSONSchema"in e&&(r=e.toJSONSchema)}catch(e){e instanceof Error&&console.error(e.message)}try{const{zodToJsonSchema:e}=await n(async()=>{const{zodToJsonSchema:o}=await import("./index-ClvjpxDE.js");return{zodToJsonSchema:o}},__vite__mapDeps([3,0,1,2]));a=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>"_zod"in e?r(e):a(e)};export{c as getToJsonSchemaFn}; diff --git a/index.html b/index.html index 8292f4ae1878f71f2eb1cf78d0cc5606dc6ff556..d4f7844b279ef508847f2e092b7f5ca55755c9bc 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ src="/remote-assets/page-external-data/js/script.js" > - +